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
DatabaseException
public DatabaseImpl() throws DatabaseException
DatabaseException
public void setDebugDatabaseName(java.lang.String debugName)
public java.lang.String getDebugName()
public void setPendingDeletedHook(TestHook hook)
public DatabaseImpl cloneDb() throws DatabaseException
DatabaseException
public 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.DatabaseException
public boolean setBtreeComparator(java.util.Comparator comparator, boolean byClassName) throws DatabaseException
btreeComparator
- - The btree Comparison function.DatabaseException
public java.util.Comparator getBtreeComparator()
public java.util.Comparator getDuplicateComparator()
public boolean getBtreeComparatorByClass()
public boolean getDuplicateComparatorByClass()
public void setEnvironmentImpl(EnvironmentImpl envImpl) throws DatabaseException
DatabaseException
public 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
DatabaseException
public Database findPrimaryDatabase() throws DatabaseException
DatabaseException
public java.lang.String getName() throws DatabaseException
DatabaseException
public boolean isDeleted()
public boolean isDeleteFinished()
public void startDeleteProcessing()
public void deleteAndReleaseINs() throws DatabaseException
DatabaseException
public void releaseDeletedINs() throws DatabaseException
DatabaseException
public void checkIsDeleted(java.lang.String operation) throws DatabaseException
DatabaseException
public DatabaseStats stat(StatsConfig config) throws DatabaseException
DatabaseException
public boolean verify(VerifyConfig config, DatabaseStats emptyStats) throws DatabaseException
DatabaseException
public DatabaseStats getEmptyStats()
public PreloadStats preload(PreloadConfig config) throws DatabaseException
DatabaseException
public long count() throws DatabaseException
DatabaseException
public java.lang.String dumpString(int nSpaces)
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 static java.util.Comparator instantiateComparator(java.lang.Class comparator, java.lang.String comparatorType) throws LogException
LogException
public static java.util.Comparator instantiateComparator(java.util.Comparator comparator, java.lang.String comparatorType) throws DatabaseException
DatabaseException
public static byte[] objectToBytes(java.lang.Object obj, java.lang.String comparatorType) throws LogException
LogException
public int getBinDeltaPercent()
public int getBinMaxDeltas()