|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.je.dbi.DbTree
public class DbTree
Represents the DatabaseImpl Naming Tree.
Field Summary | |
---|---|
static DatabaseId |
ID_DB_ID
|
static String |
ID_DB_NAME
|
static DatabaseId |
NAME_DB_ID
|
static String |
NAME_DB_NAME
|
static String |
UTILIZATION_DB_NAME
|
Constructor Summary | |
---|---|
DbTree()
Create a dbTree from the log. |
|
DbTree(EnvironmentImpl env)
Create a new dbTree for a new environment. |
Method Summary | |
---|---|
boolean |
countAsObsoleteWhenLogged()
Returns true if this item should be counted as obsoleted when logged. |
DatabaseImpl |
createDb(Locker locker,
String databaseName,
DatabaseConfig dbConfig,
Database databaseHandle)
Create a database. |
DatabaseImpl |
createDb(Locker locker,
String databaseName,
DatabaseConfig dbConfig,
Database databaseHandle,
boolean allowEviction)
Create a database. |
(package private) void |
dbRemove(Locker locker,
String databaseName)
Remove the database by deleting the nameLN. |
(package private) boolean |
dbRename(Locker locker,
String databaseName,
String newName)
Return true if the operation succeeded, false otherwise. |
(package private) void |
deleteMapLN(DatabaseId id)
|
void |
dump()
For debugging. |
void |
dumpLog(StringBuffer sb,
boolean verbose)
Write the object into the string buffer for log dumping. |
(package private) String |
dumpString(int nSpaces)
|
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,
boolean allowEviction,
String dbNameIfAvailable)
Get a database object based on an id only. |
DatabaseImpl |
getDb(Locker nameLocker,
String databaseName,
Database databaseHandle)
Get a database object given a database name. |
DatabaseImpl |
getDb(Locker nameLocker,
String databaseName,
Database databaseHandle,
boolean allowEviction)
Get a database object given a database name. |
String |
getDbName(DatabaseId id)
Return the database name for a given db. |
List |
getDbNames()
|
int |
getHighestLevel()
|
int |
getLastDbId()
Get the latest allocated id, for checkpoint info. |
int |
getLogSize()
|
LogEntryType |
getLogType()
All objects that are reponsible for a generating a type of log entry must implement this. |
long |
getTransactionId()
|
boolean |
isReservedDbName(String name)
Returns true if the name is a reserved JE database name. |
boolean |
logEntryIsTransactional()
|
boolean |
marshallOutsideWriteLatch()
Return true if this item can be marshalled outside the log write latch. |
void |
modifyDbRoot(DatabaseImpl db)
Called by the Tree to propagate a root change. |
void |
postLogWork(long justLoggedLsn)
Do any processing we need to do after logging, while under the logging latch. |
void |
readFromLog(ByteBuffer itemBuffer,
byte entryTypeVersion)
Initialize this object from the data in itemBuf. |
void |
rebuildINListMapDb()
Rebuild the IN list after recovery. |
(package private) void |
setEnvironmentImpl(EnvironmentImpl envImpl)
Set the db environment during recovery, after instantiating the tree from the log. |
void |
setLastDbId(int maxDbId)
Initialize the db id, from recovery. |
String |
toString()
|
(package private) TruncateResult |
truncate(Locker locker,
DatabaseImpl oldDatabase)
Deprecated. This method used by Database.truncate() |
(package private) long |
truncate(Locker locker,
String databaseName)
To truncate, remove the database named by databaseName and create a new database in its place. |
boolean |
verify(VerifyConfig config,
PrintStream out)
|
void |
writeToLog(ByteBuffer logBuffer)
Serialize this object into the buffer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final DatabaseId ID_DB_ID
public static final DatabaseId NAME_DB_ID
public static final String ID_DB_NAME
public static final String NAME_DB_NAME
public static final String UTILIZATION_DB_NAME
Constructor Detail |
---|
public DbTree() throws DatabaseException
DatabaseException
public DbTree(EnvironmentImpl env) throws DatabaseException
DatabaseException
Method Detail |
---|
public int getLastDbId()
public void setLastDbId(int maxDbId)
void setEnvironmentImpl(EnvironmentImpl envImpl) throws DatabaseException
DatabaseException
public DatabaseImpl createDb(Locker locker, String databaseName, DatabaseConfig dbConfig, Database databaseHandle) throws DatabaseException
DatabaseException
public DatabaseImpl createDb(Locker locker, String databaseName, DatabaseConfig dbConfig, Database databaseHandle, boolean allowEviction) throws DatabaseException
locker
- owning lockerdatabaseName
- identifier for databasedbConfig
- allowEviction
- is whether eviction is allowed during cursor
operations.
DatabaseException
public void modifyDbRoot(DatabaseImpl db) throws DatabaseException
db
- the target db
DatabaseException
boolean dbRename(Locker locker, String databaseName, String newName) throws DatabaseException
DatabaseException
void dbRemove(Locker locker, String databaseName) throws DatabaseException
DatabaseException
long truncate(Locker locker, String databaseName) throws DatabaseException
DatabaseException
void deleteMapLN(DatabaseId id) throws DatabaseException
DatabaseException
TruncateResult truncate(Locker locker, DatabaseImpl oldDatabase) throws DatabaseException
DatabaseException
public DatabaseImpl getDb(Locker nameLocker, String databaseName, Database databaseHandle) throws DatabaseException
DatabaseException
public DatabaseImpl getDb(Locker nameLocker, String databaseName, Database databaseHandle, boolean allowEviction) throws DatabaseException
nameLocker
- is used to access the NameLN. As always, a NullTxn
is used to access the MapLN.databaseName
- target databaseallowEviction
- is whether eviction is allowed during cursor
operations.
DatabaseException
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, boolean allowEviction, String dbNameIfAvailable) throws DatabaseException
allowEviction
- is whether eviction is allowed during cursor
operations.
DatabaseException
public void rebuildINListMapDb() throws DatabaseException
DatabaseException
public boolean verify(VerifyConfig config, PrintStream out) throws DatabaseException
DatabaseException
public String getDbName(DatabaseId id) throws DatabaseException
DatabaseException
public List getDbNames() throws DatabaseException
DatabaseException
public boolean isReservedDbName(String name)
public int getHighestLevel() throws DatabaseException
DatabaseException
public LogEntryType getLogType()
LoggableObject
getLogType
in interface LoggableObject
LoggableObject.getLogType()
public boolean marshallOutsideWriteLatch()
LoggableObject
marshallOutsideWriteLatch
in interface LoggableObject
Can be marshalled outside the log write latch.
public boolean countAsObsoleteWhenLogged()
LoggableObject
countAsObsoleteWhenLogged
in interface LoggableObject
LoggableObject.countAsObsoleteWhenLogged()
public int getLogSize()
getLogSize
in interface LogWritable
LogWritable.getLogSize()
public void writeToLog(ByteBuffer logBuffer)
LogWritable
writeToLog
in interface LogWritable
logBuffer
- is the destination bufferLogWritable.writeToLog(java.nio.ByteBuffer)
public void postLogWork(long justLoggedLsn) throws DatabaseException
LoggableObject
postLogWork
in interface LoggableObject
DatabaseException
LoggableObject.postLogWork(long)
public void readFromLog(ByteBuffer itemBuffer, byte entryTypeVersion) throws LogException
LogReadable
readFromLog
in interface LogReadable
LogException
LogReadable.readFromLog(java.nio.ByteBuffer, byte)
public void dumpLog(StringBuffer sb, boolean verbose)
LogReadable
dumpLog
in interface LogReadable
sb
- destination string bufferverbose
- if true, dump the full, verbose versionLogReadable.dumpLog(java.lang.StringBuffer, boolean)
public boolean logEntryIsTransactional()
logEntryIsTransactional
in interface LogReadable
LogReadable#logEntryIsTransactional.
public long getTransactionId()
getTransactionId
in interface LogReadable
LogReadable.getTransactionId()
String dumpString(int nSpaces)
public String toString()
toString
in class Object
public void dump() throws DatabaseException
DatabaseException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |