public class DbTree extends java.lang.Object implements Loggable
Modifier and Type | Field and Description |
---|---|
static DatabaseId |
ID_DB_ID |
static DatabaseId |
NAME_DB_ID |
static java.lang.String |
REP_OPERATIONS_NAME |
static java.lang.String |
UTILIZATION_DB_NAME |
Constructor and Description |
---|
DbTree()
Create a dbTree from the log.
|
DbTree(EnvironmentImpl env)
Create a new dbTree for a new environment.
|
Modifier and Type | Method and Description |
---|---|
DatabaseImpl |
createDb(Locker locker,
java.lang.String databaseName,
DatabaseConfig dbConfig,
Database databaseHandle)
Create a database.
|
void |
dump()
For debugging.
|
void |
dumpLog(java.lang.StringBuffer sb,
boolean verbose)
Write the object into the string buffer for log dumping.
|
DatabaseImpl |
getDb(DatabaseId dbId)
Get a database object based on an id only.
|
DatabaseImpl |
getDb(DatabaseId dbId,
long lockTimeout)
Get a database object based on an id only.
|
DatabaseImpl |
getDb(DatabaseId dbId,
long lockTimeout,
java.util.Map dbCache)
Get a database object based on an id only, caching the id-db mapping in
the given map.
|
DatabaseImpl |
getDb(DatabaseId dbId,
long lockTimeout,
java.lang.String dbNameIfAvailable)
Get a database object based on an id only.
|
DatabaseImpl |
getDb(Locker nameLocker,
java.lang.String databaseName,
Database databaseHandle)
Get a database object given a database name.
|
java.lang.String |
getDbName(DatabaseId id)
Return the database name for a given db.
|
java.util.List |
getDbNames() |
java.util.Map |
getDbNamesAndIds() |
int |
getHighestLevel() |
int |
getHighestLevel(DatabaseImpl dbImpl) |
java.util.List |
getInternalDbNames()
Return a list of the names of internally used databases.
|
java.util.List |
getInternalNoLookupDbNames()
Return a list of the names of internally used databases that
don't get looked up through the naming tree.
|
int |
getLastDbId()
Get the latest allocated id, for checkpoint info.
|
int |
getLogSize() |
long |
getTransactionId() |
boolean |
isReservedDbName(java.lang.String name)
Returns true if the name is a reserved JE database name.
|
void |
modifyDbRoot(DatabaseImpl db)
Called by the Tree to propagate a root change.
|
void |
optionalModifyDbRoot(DatabaseImpl db)
Called by the Tree to propagate a root change.
|
void |
readFromLog(java.nio.ByteBuffer itemBuffer,
byte entryTypeVersion)
Initialize this object from the data in itemBuf.
|
void |
rebuildINListMapDb()
Rebuild the IN list after recovery.
|
void |
releaseDb(DatabaseImpl db)
Decrements the use count of the given DB, allowing it to be evicted if
the use count reaches zero.
|
void |
releaseDbs(java.util.Map dbCache)
Calls releaseDb for all DBs in the given map of DatabaseId to
DatabaseImpl.
|
void |
setLastDbId(int maxDbId)
Initialize the db id, from recovery.
|
java.lang.String |
toString() |
boolean |
verify(VerifyConfig config,
java.io.PrintStream out) |
void |
writeToLog(java.nio.ByteBuffer logBuffer)
Serialize this object into the buffer.
|
public static final DatabaseId ID_DB_ID
public static final DatabaseId NAME_DB_ID
public static final java.lang.String UTILIZATION_DB_NAME
public static final java.lang.String REP_OPERATIONS_NAME
public DbTree() throws DatabaseException
DatabaseException
public DbTree(EnvironmentImpl env) throws DatabaseException
DatabaseException
public int getLastDbId()
public void setLastDbId(int maxDbId)
public DatabaseImpl createDb(Locker locker, java.lang.String databaseName, DatabaseConfig dbConfig, Database databaseHandle) throws DatabaseException
locker
- owning lockerdatabaseName
- identifier for databasedbConfig
- DatabaseException
public void optionalModifyDbRoot(DatabaseImpl db) throws DatabaseException
db
- the target dbDatabaseException
public void modifyDbRoot(DatabaseImpl db) throws DatabaseException
db
- the target dbDatabaseException
public DatabaseImpl getDb(Locker nameLocker, java.lang.String databaseName, Database databaseHandle) throws DatabaseException
nameLocker
- is used to access the NameLN. As always, a NullTxn
is used to access the MapLN.databaseName
- target databaseDatabaseException
public DatabaseImpl getDb(DatabaseId dbId) throws DatabaseException
DatabaseException
public DatabaseImpl getDb(DatabaseId dbId, long lockTimeout) throws DatabaseException
DatabaseException
public DatabaseImpl getDb(DatabaseId dbId, long lockTimeout, java.util.Map dbCache) throws DatabaseException
DatabaseException
public DatabaseImpl getDb(DatabaseId dbId, long lockTimeout, java.lang.String dbNameIfAvailable) throws DatabaseException
DatabaseException
public void releaseDb(DatabaseImpl db)
public void releaseDbs(java.util.Map dbCache)
public void rebuildINListMapDb() throws DatabaseException
DatabaseException
public boolean verify(VerifyConfig config, java.io.PrintStream out) throws DatabaseException
DatabaseException
public java.lang.String getDbName(DatabaseId id) throws DatabaseException
DatabaseException
public java.util.Map getDbNamesAndIds() throws DatabaseException
DatabaseException
public java.util.List getDbNames() throws DatabaseException
DatabaseException
public java.util.List getInternalNoLookupDbNames()
public java.util.List getInternalDbNames()
public boolean isReservedDbName(java.lang.String name)
public int getHighestLevel() throws DatabaseException
DatabaseException
public int getHighestLevel(DatabaseImpl dbImpl) throws DatabaseException
DatabaseException
public int getLogSize()
getLogSize
in interface Loggable
Loggable.getLogSize()
public void writeToLog(java.nio.ByteBuffer logBuffer)
Loggable
writeToLog
in interface Loggable
logBuffer
- is the destination bufferLoggable.writeToLog(java.nio.ByteBuffer)
public void readFromLog(java.nio.ByteBuffer itemBuffer, byte entryTypeVersion) throws LogException
Loggable
readFromLog
in interface Loggable
LogException
Loggable.readFromLog(java.nio.ByteBuffer, byte)
public void dumpLog(java.lang.StringBuffer sb, boolean verbose)
Loggable
dumpLog
in interface Loggable
sb
- destination string bufferverbose
- if true, dump the full, verbose versionLoggable.dumpLog(java.lang.StringBuffer, boolean)
public long getTransactionId()
getTransactionId
in interface Loggable
Loggable.getTransactionId()
public java.lang.String toString()
toString
in class java.lang.Object
public void dump() throws DatabaseException
DatabaseException