| java.lang.Object com.sleepycat.persist.impl.PersistCatalog
PersistCatalog | public class PersistCatalog implements Catalog(Code) | | The catalog of class formats for a store, along with its associated model
and mutations.
author: Mark Hayes |
Method Summary | |
public boolean | close() Decrements the reference count and closes the catalog DB when it reaches
zero. | public Object | convertRawObject(RawObject o, IdentityHashMap converted) | public Format | createFormat(String clsName, Map<String, Format> newFormats) Convenience method that gets the class for the given class name and
calls createFormat with the class object. | public Format | createFormat(Class type, Map<String, Format> newFormats) If the given class format is not already present in the given map,
creates an uninitialized format, adds it to the map, and also collects
related formats in the map. | public void | dump() | public synchronized void | flush() Used to write the catalog when a format has been changed, for example,
when Store.evolve has updated a Format's EvolveNeeded property. | public void | getEntityFormats(Collection<Format> entityFormats) | public Format | getFormat(int formatId) | public Format | getFormat(Class cls) Get a format for a given class, creating it if it does not exist.
This method is called for top level entity instances by
PersistEntityBinding. | public Format | getFormat(String className) | public int | getInitVersion(Format format, boolean forReader) When a format is intialized, this method is called to get the version
of the serialized object to be initialized. | public Format | getLatestVersion(String className) | Set<String> | getModelClasses() Returns a set of all persistent (non-simple type) class names. | public Mutations | getMutations() Returns the current merged mutations. | public EntityModel | getResolvedModel() Returns the model parameter, default model or stored model. | Map<Format, Set<Format>> | getSubclassMap() Returns a map from format to a set of its superclass formats. | public boolean | isRawAccess() | public void | openExisting() Increments the reference count for a catalog that is already open. | void | useExistingFormat(Format oldFormat) Installs an existing format when no evolution is needed, i.e, when the
new and old formats are identical. |
expectNoClassChanges | public static boolean expectNoClassChanges(Code) | | Used by unit tests.
|
unevolvedFormatsEncountered | public static boolean unevolvedFormatsEncountered(Code) | | |
PersistCatalog | public PersistCatalog(Transaction txn, Environment env, String storePrefix, String dbName, DatabaseConfig dbConfig, EntityModel modelParam, Mutations mutationsParam, boolean rawAccess, Store store) throws DatabaseException(Code) | | Creates a new catalog, opening the database and reading it from a given
catalog database if it already exists. All predefined formats and
formats for the given model are added. For modified classes, old
formats are defined based on the rules for compatible class changes and
the given mutations. If any format is changed or added, and the
database is not read-only, write the initialized catalog to the
database.
|
close | public boolean close() throws DatabaseException(Code) | | Decrements the reference count and closes the catalog DB when it reaches
zero. Returns true if the database was closed or false if the reference
count is still non-zero and the database was left open.
|
createFormat | public Format createFormat(String clsName, Map<String, Format> newFormats)(Code) | | Convenience method that gets the class for the given class name and
calls createFormat with the class object.
|
createFormat | public Format createFormat(Class type, Map<String, Format> newFormats)(Code) | | If the given class format is not already present in the given map,
creates an uninitialized format, adds it to the map, and also collects
related formats in the map.
|
flush | public synchronized void flush() throws DatabaseException(Code) | | Used to write the catalog when a format has been changed, for example,
when Store.evolve has updated a Format's EvolveNeeded property. Uses
auto-commit.
|
getFormat | public Format getFormat(Class cls)(Code) | | Get a format for a given class, creating it if it does not exist.
This method is called for top level entity instances by
PersistEntityBinding. When a new entity subclass format is added we
call Store.openSecondaryIndexes so that previously unknown secondary
databases can be created, before storing the entity. We do this here
while not holding a synchronization mutex, not in addNewFormat, to avoid
deadlocks. openSecondaryIndexes synchronizes on the Store. [#15247]
|
getInitVersion | public int getInitVersion(Format format, boolean forReader)(Code) | | When a format is intialized, this method is called to get the version
of the serialized object to be initialized. See Catalog.
|
getModelClasses | Set<String> getModelClasses()(Code) | | Returns a set of all persistent (non-simple type) class names.
|
getMutations | public Mutations getMutations()(Code) | | Returns the current merged mutations.
|
getResolvedModel | public EntityModel getResolvedModel()(Code) | | Returns the model parameter, default model or stored model.
|
getSubclassMap | Map<Format, Set<Format>> getSubclassMap()(Code) | | Returns a map from format to a set of its superclass formats. The
format for simple types, enums and class Object are not included. Only
complex types have superclass formats as defined by
Format.getSuperFormat.
|
isRawAccess | public boolean isRawAccess()(Code) | | |
openExisting | public void openExisting()(Code) | | Increments the reference count for a catalog that is already open.
|
useExistingFormat | void useExistingFormat(Format oldFormat)(Code) | | Installs an existing format when no evolution is needed, i.e, when the
new and old formats are identical.
|
|
|