| Constructor and Description |
|---|
DatabaseImpl()
Create an empty database object for initialization from the log.
|
DatabaseImpl(java.lang.String dbName,
DatabaseId id,
EnvironmentImpl envImpl,
DatabaseConfig dbConfig)
Create a database object for a new database.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addReferringHandle(Database db)
Add a referring handle
|
void |
checkIsDeleted(java.lang.String operation) |
DatabaseImpl |
cloneDb()
Clone.
|
long |
count()
Count entries in the database including dups, but don't dirty the cache.
|
void |
deleteAndReleaseINs()
Purge a DatabaseImpl and corresponding MapLN in the db mapping tree.
|
void |
dumpLog(java.lang.StringBuffer sb,
boolean verbose)
Write the object into the string buffer for log dumping.
|
java.lang.String |
dumpString(int nSpaces) |
Database |
findPrimaryDatabase()
For this secondary database return the primary that it is associated
with, or null if not associated with any primary.
|
int |
getAdditionalMemorySize()
Returns the memory size that should be added to MAPLN_OVERHEAD.
|
int |
getBinDeltaPercent() |
int |
getBinMaxDeltas() |
java.util.Comparator |
getBtreeComparator() |
boolean |
getBtreeComparatorByClass() |
EnvironmentImpl |
getDbEnvironment() |
java.lang.String |
getDebugName() |
java.util.Comparator |
getDuplicateComparator() |
boolean |
getDuplicateComparatorByClass() |
DatabaseStats |
getEmptyStats() |
long |
getEofNodeId() |
DatabaseId |
getId() |
int |
getLogSize() |
java.lang.String |
getName() |
int |
getNodeMaxDupTreeEntries() |
int |
getNodeMaxEntries() |
boolean |
getSortedDuplicates() |
long |
getTransactionId() |
Tree |
getTree() |
boolean |
hasOpenHandles()
Returns whether one or more handles are open.
|
static java.util.Comparator |
instantiateComparator(java.lang.Class comparator,
java.lang.String comparatorType)
Used both to read from the log and to validate a comparator when set in
DatabaseConfig.
|
static java.util.Comparator |
instantiateComparator(java.util.Comparator comparator,
java.lang.String comparatorType)
Used to validate a comparator when set in DatabaseConfig.
|
boolean |
isDeferredWrite() |
boolean |
isDeleted() |
boolean |
isDeleteFinished() |
boolean |
isInUse()
Returns whether this DB is in use and cannot be evicted.
|
boolean |
isTransactional() |
static byte[] |
objectToBytes(java.lang.Object obj,
java.lang.String comparatorType)
Converts an arbitrary object to a serialized byte array.
|
PreloadStats |
preload(PreloadConfig config)
Preload the cache, using up to maxBytes bytes or maxMillsecs msec.
|
void |
readFromLog(java.nio.ByteBuffer itemBuffer,
byte entryTypeVersion)
Initialize this object from the data in itemBuf.
|
void |
releaseDeletedINs() |
void |
removeReferringHandle(Database db)
Decrement the reference count.
|
boolean |
setBtreeComparator(java.util.Comparator comparator,
boolean byClassName)
Set the btree comparison function for this database.
|
void |
setDebugDatabaseName(java.lang.String debugName) |
void |
setDeferredWrite(boolean deferredWrite) |
boolean |
setDuplicateComparator(java.util.Comparator comparator,
boolean byClassName)
Set the duplicate comparison function for this database.
|
void |
setEnvironmentImpl(EnvironmentImpl envImpl)
Set the db environment during recovery, after instantiating the database
from the log
|
void |
setPendingDeletedHook(TestHook hook) |
void |
setTransactional(boolean transactional)
Sets the transactional property for the first opened handle.
|
void |
startDeleteProcessing() |
DatabaseStats |
stat(StatsConfig config) |
void |
sync(boolean flushLog)
Flush all dirty nodes for this database to disk.
|
boolean |
verify(VerifyConfig config,
DatabaseStats emptyStats) |
void |
writeToLog(java.nio.ByteBuffer logBuffer)
Serialize this object into the buffer.
|
public DatabaseImpl(java.lang.String dbName,
DatabaseId id,
EnvironmentImpl envImpl,
DatabaseConfig dbConfig)
throws DatabaseException
DatabaseExceptionpublic DatabaseImpl()
throws DatabaseException
DatabaseExceptionpublic void setDebugDatabaseName(java.lang.String debugName)
public java.lang.String getDebugName()
public void setPendingDeletedHook(TestHook hook)
public DatabaseImpl cloneDb() throws DatabaseException
DatabaseExceptionpublic Tree getTree()
public DatabaseId getId()
public long getEofNodeId()
public boolean isTransactional()
public void setTransactional(boolean transactional)
public boolean isDeferredWrite()
public void setDeferredWrite(boolean deferredWrite)
public boolean getSortedDuplicates()
public int getNodeMaxEntries()
public int getNodeMaxDupTreeEntries()
public int getAdditionalMemorySize()
public boolean setDuplicateComparator(java.util.Comparator comparator,
boolean byClassName)
throws DatabaseException
duplicateComparator - - The Duplicate Comparison function.DatabaseExceptionpublic boolean setBtreeComparator(java.util.Comparator comparator,
boolean byClassName)
throws DatabaseException
btreeComparator - - The btree Comparison function.DatabaseExceptionpublic java.util.Comparator getBtreeComparator()
public java.util.Comparator getDuplicateComparator()
public boolean getBtreeComparatorByClass()
public boolean getDuplicateComparatorByClass()
public void setEnvironmentImpl(EnvironmentImpl envImpl) throws DatabaseException
DatabaseExceptionpublic EnvironmentImpl getDbEnvironment()
public boolean hasOpenHandles()
public void addReferringHandle(Database db)
public void removeReferringHandle(Database db)
public boolean isInUse()
public void sync(boolean flushLog)
throws DatabaseException
DatabaseExceptionpublic Database findPrimaryDatabase() throws DatabaseException
DatabaseExceptionpublic java.lang.String getName()
throws DatabaseException
DatabaseExceptionpublic boolean isDeleted()
public boolean isDeleteFinished()
public void startDeleteProcessing()
public void deleteAndReleaseINs()
throws DatabaseException
DatabaseExceptionpublic void releaseDeletedINs()
throws DatabaseException
DatabaseExceptionpublic void checkIsDeleted(java.lang.String operation)
throws DatabaseException
DatabaseExceptionpublic DatabaseStats stat(StatsConfig config) throws DatabaseException
DatabaseExceptionpublic boolean verify(VerifyConfig config, DatabaseStats emptyStats) throws DatabaseException
DatabaseExceptionpublic DatabaseStats getEmptyStats()
public PreloadStats preload(PreloadConfig config) throws DatabaseException
DatabaseExceptionpublic long count()
throws DatabaseException
DatabaseExceptionpublic java.lang.String dumpString(int nSpaces)
public int getLogSize()
getLogSize in interface LoggableLoggable.getLogSize()public void writeToLog(java.nio.ByteBuffer logBuffer)
LoggablewriteToLog in interface LoggablelogBuffer - is the destination bufferLoggable.writeToLog(java.nio.ByteBuffer)public void readFromLog(java.nio.ByteBuffer itemBuffer,
byte entryTypeVersion)
throws LogException
LoggablereadFromLog in interface LoggableLogExceptionLoggable.readFromLog(java.nio.ByteBuffer, byte)public void dumpLog(java.lang.StringBuffer sb,
boolean verbose)
LoggabledumpLog in interface Loggablesb - destination string bufferverbose - if true, dump the full, verbose versionLoggable.dumpLog(java.lang.StringBuffer, boolean)public long getTransactionId()
getTransactionId in interface LoggableLoggable.getTransactionId()public static java.util.Comparator instantiateComparator(java.lang.Class comparator,
java.lang.String comparatorType)
throws LogException
LogExceptionpublic static java.util.Comparator instantiateComparator(java.util.Comparator comparator,
java.lang.String comparatorType)
throws DatabaseException
DatabaseExceptionpublic static byte[] objectToBytes(java.lang.Object obj,
java.lang.String comparatorType)
throws LogException
LogExceptionpublic int getBinDeltaPercent()
public int getBinMaxDeltas()