Package com.sleepycat.persist.raw
Class RawStore
java.lang.Object
com.sleepycat.persist.raw.RawStore
Provides access to the raw data in a store for use by general purpose tools.
A
RawStore provides access to stored entities without using
entity classes or key classes. Keys are represented as simple type objects
or, for composite keys, as RawObject instances, and entities are
represented as RawObject instances.
RawStore objects are thread-safe. Multiple threads may safely
call the methods of a shared RawStore object.
When using a RawStore, the current persistent class definitions
are not used. Instead, the previously stored metadata and class definitions
are used. This has several implications:
- An
EntityModelmay not be specified usingStoreConfig.setModel(com.sleepycat.persist.model.EntityModel). In other words, the configured model must be null (the default). - When storing entities, their format will not automatically be evolved to the current class definition, even if the current class definition has changed.
-
Constructor Summary
ConstructorsConstructorDescriptionRawStore(Environment env, String storeName, StoreConfig config) Opens an entity store for raw data access. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes all databases and sequences that were opened by this model.Returns a copy of the entity store configuration.Returns the environment associated with this store.getModel()Returns the last configured and stored entity model for this store.Returns the set of mutations that were configured and stored previously.getPrimaryIndex(String entityClass) Opens the primary index for a given entity class.getSecondaryIndex(String entityClass, String keyName) Opens the secondary index for a given entity class and secondary key name.Returns the name of this store.
-
Constructor Details
-
RawStore
public RawStore(Environment env, String storeName, StoreConfig config) throws StoreNotFoundException, DatabaseException Opens an entity store for raw data access.- Parameters:
env- an open Berkeley DB environment.storeName- the name of the entity store within the given environment.config- the store configuration, or null to use default configuration properties.- Throws:
IllegalArgumentException- if theEnvironmentis read-only and theconfig ReadOnlyproperty is false.StoreNotFoundExceptionDatabaseException
-
-
Method Details
-
getPrimaryIndex
Opens the primary index for a given entity class.- Throws:
DatabaseException- the base class for all BDB exceptions.
-
getSecondaryIndex
public SecondaryIndex<Object,Object, getSecondaryIndexRawObject> (String entityClass, String keyName) throws DatabaseException Opens the secondary index for a given entity class and secondary key name.- Throws:
DatabaseException- the base class for all BDB exceptions.
-
getEnvironment
Returns the environment associated with this store. -
getConfig
Returns a copy of the entity store configuration. -
getStoreName
Returns the name of this store. -
getModel
Returns the last configured and stored entity model for this store. -
getMutations
Returns the set of mutations that were configured and stored previously. -
close
Closes all databases and sequences that were opened by this model. No databases opened via this store may be in use.WARNING: To guard against memory leaks, the application should discard all references to the closed handle. While BDB makes an effort to discard references from closed objects to the allocated memory for an environment, this behavior is not guaranteed. The safe course of action for an application is to discard all references to closed BDB objects.
- Throws:
DatabaseException- the base class for all BDB exceptions.
-