|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.persist.impl.PersistCatalog
public class PersistCatalog
The catalog of class formats for a store, along with its associated model and mutations.
Field Summary | |
---|---|
static boolean |
expectNoClassChanges
Used by unit tests. |
static boolean |
unevolvedFormatsEncountered
|
Fields inherited from interface com.sleepycat.persist.impl.Catalog |
---|
BETA_VERSION, CURRENT_VERSION |
Constructor Summary | |
---|---|
PersistCatalog(Transaction txn,
Environment env,
String storePrefix,
String dbName,
DatabaseConfig dbConfig,
EntityModel modelParam,
Mutations mutationsParam,
boolean rawAccess,
Store store)
Creates a new catalog, opening the database and reading it from a given catalog database if it already exists. |
Method Summary | |
---|---|
boolean |
close()
Decrements the reference count and closes the catalog DB when it reaches zero. |
Object |
convertRawObject(RawObject o,
IdentityHashMap converted)
|
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. |
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. |
void |
dump()
|
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. |
void |
getEntityFormats(Collection<Format> entityFormats)
|
Format |
getFormat(Class cls)
Get a format for a given class, creating it if it does not exist. |
Format |
getFormat(int formatId)
Returns a format for a given ID, or throws an exception. |
Format |
getFormat(String className)
Returns a format by class name. |
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. |
Format |
getLatestVersion(String className)
|
(package private) Set<String> |
getModelClasses()
Returns a set of all persistent (non-simple type) class names. |
Mutations |
getMutations()
Returns the current merged mutations. |
EntityModel |
getResolvedModel()
Returns the model parameter, default model or stored model. |
(package private) Map<Format,Set<Format>> |
getSubclassMap()
Returns a map from format to a set of its superclass formats. |
boolean |
isRawAccess()
|
void |
openExisting()
Increments the reference count for a catalog that is already open. |
(package private) void |
useExistingFormat(Format oldFormat)
Installs an existing format when no evolution is needed, i.e, when the new and old formats are identical. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static boolean expectNoClassChanges
public static boolean unevolvedFormatsEncountered
Constructor Detail |
---|
public PersistCatalog(Transaction txn, Environment env, String storePrefix, String dbName, DatabaseConfig dbConfig, EntityModel modelParam, Mutations mutationsParam, boolean rawAccess, Store store) throws DatabaseException
DatabaseException
Method Detail |
---|
public void getEntityFormats(Collection<Format> entityFormats)
Map<Format,Set<Format>> getSubclassMap()
public EntityModel getResolvedModel()
public void openExisting()
public boolean close() throws DatabaseException
DatabaseException
public Mutations getMutations()
public Format createFormat(String clsName, Map<String,Format> newFormats)
createFormat
in interface Catalog
createFormat(java.lang.String, java.util.Map)
public Format createFormat(Class type, Map<String,Format> newFormats)
createFormat
in interface Catalog
createFormat(java.lang.String, java.util.Map)
void useExistingFormat(Format oldFormat)
Set<String> getModelClasses()
public int getInitVersion(Format format, boolean forReader)
getInitVersion
in interface Catalog
public Format getFormat(int formatId)
Catalog
getFormat
in interface Catalog
public Format getFormat(Class cls)
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]
getFormat
in interface Catalog
public Format getFormat(String className)
Catalog
Catalog.getFormat(Class)
, the
format will not be created if it is not already known.
getFormat
in interface Catalog
public Format getLatestVersion(String className)
public void flush() throws DatabaseException
DatabaseException
public boolean isRawAccess()
isRawAccess
in interface Catalog
isRawAccess()
public Object convertRawObject(RawObject o, IdentityHashMap converted)
convertRawObject
in interface Catalog
convertRawObject(com.sleepycat.persist.raw.RawObject, java.util.IdentityHashMap)
public void dump()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |