| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
DatabaseImpl.StatsAccumulator |
| Modifier and Type | Field and Description |
|---|---|
static boolean |
forceTreeWalkForTruncateAndRemove
For unit testing, setting this field to true will force a walk of the
tree to count utilization during truncate/remove, rather than using the
per-database info.
|
| 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
|
static java.util.Comparator<byte[]> |
bytesToComparator(byte[] comparatorBytes,
java.lang.String comparatorType)
Converts an arbitrary string of bytes to a comparator.
|
void |
checkIsDeleted(java.lang.String operation) |
void |
clearKeyPrefixing() |
void |
clearUtilizationRepairDone()
Is public for unit testing.
|
DatabaseImpl |
cloneDatabase()
Create a clone of this database that can be used as the new empty
database when truncating this database.
|
long |
count()
Count entries in the database including dups, but don't dirty the cache.
|
void |
countObsoleteDb(BaseUtilizationTracker tracker,
long mapLnLsn)
Counts all active LSNs in a database as obsolete.
|
(package private) void |
decrementUseCount()
Decrements the use count of this DB, allowing it to be evicted if the
use count reaches zero.
|
(package private) static void |
dumpFlags(java.lang.StringBuffer sb,
boolean verbose,
byte flags) |
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.
|
void |
finishDeleteProcessing()
Release the INs for the deleted database, count all log entries for this
database as obsolete, delete the MapLN, and set the state to DELETED.
|
(package private) void |
finishedINListHarvest()
Should be called by the SortedLSNTreeWalker when it is finished with
the INList.
|
int |
getAdditionalTreeMemorySize()
Returns the tree memory size that should be added to MAPLN_OVERHEAD.
|
int |
getBinDeltaPercent() |
int |
getBinMaxDeltas() |
java.util.Comparator<byte[]> |
getBtreeComparator() |
boolean |
getBtreeComparatorByClass() |
EnvironmentImpl |
getDbEnvironment() |
DbFileSummaryMap |
getDbFileSummaries()
For unit testing.
|
DbFileSummary |
getDbFileSummary(java.lang.Long fileNum,
boolean willModify)
Returns the DbFileSummary for the given file, allocates it if
necessary and budgeted memory for any changes.
|
java.lang.String |
getDebugName() |
java.util.Comparator<byte[]> |
getDuplicateComparator() |
boolean |
getDuplicateComparatorByClass() |
DatabaseStats |
getEmptyStats() |
long |
getEofNodeId() |
DatabaseId |
getId() |
boolean |
getKeyPrefixing() |
int |
getLogSize()
This log entry type is configured to perform marshaling (getLogSize and
writeToLog) under the write log mutex.
|
java.lang.String |
getName() |
int |
getNodeMaxDupTreeEntries() |
int |
getNodeMaxEntries() |
(package private) DbOpReplicationContext |
getOperationRepContext(DbOperationType operationType)
Return a ReplicationContext that includes information on how to
logically replicate database operations.
|
(package private) int |
getReferringHandleCount() |
ReplicationContext |
getRepContext()
Return a ReplicationContext that will indicate if this operation
should broadcast data records for this database as part the replication
stream.
|
boolean |
getSortedDuplicates() |
static boolean |
getSortedDuplicates(byte flagVal) |
long |
getTransactionId() |
Tree |
getTree() |
long |
getTreeAdminMemory()
Figure out how much memory is used by the DbFileSummaryMap.
|
boolean |
getUtilizationRepairDone()
Is public for unit testing.
|
void |
handleClosed(boolean doSyncDw)
Called after a handle onto this DB is closed.
|
boolean |
hasOpenHandles()
Returns whether one or more handles are open.
|
(package private) void |
incrementUseCount()
Increments the use count of this DB to prevent it from being
evicted.
|
static java.util.Comparator<byte[]> |
instantiateComparator(java.lang.Class<? extends java.util.Comparator<byte[]>> comparatorClass,
java.lang.String comparatorType)
Used both to read from the log and to validate a comparator when set in
DatabaseConfig.
|
static java.util.Comparator<byte[]> |
instantiateComparator(java.util.Comparator<byte[]> comparator,
java.lang.String comparatorType)
Used to validate a comparator when set in DatabaseConfig.
|
boolean |
isCheckpointNeeded()
Returns whether this database's MapLN must be flushed during a
checkpoint.
|
boolean |
isDeferredWriteMode() |
boolean |
isDeleted() |
boolean |
isDeleteFinished() |
boolean |
isDirtyUtilization()
Returns whether this database has new (unflushed) utilization info.
|
boolean |
isDurableDeferredWrite() |
boolean |
isInUse()
Returns whether this DB is in use and cannot be evicted.
|
(package private) boolean |
isInUseDuringDbRemove()
Checks whether a database is in use during a remove or truncate database
operation.
|
boolean |
isReplicated() |
boolean |
isTemporary() |
static boolean |
isTemporary(byte flagVal) |
boolean |
isTransactional() |
boolean |
logicalEquals(Loggable other) |
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 entryVersion)
Initialize this object from the data in itemBuf.
|
void |
releaseTreeAdminMemory()
Update memory budgets when this databaseImpl is closed and will never be
accessed again or when it is still open when its owning MapLN will be
garbage collected, due to eviction or recovery.
|
boolean |
removeDbFileSummary(java.lang.Long fileNum)
Removes the DbFileSummary for the given file.
|
void |
removeReferringHandle(Database db)
Decrement the reference count.
|
boolean |
setBtreeComparator(java.util.Comparator<byte[]> comparator,
boolean byClassName)
Set the btree comparison function for this database.
|
void |
setDebugDatabaseName(java.lang.String debugName) |
void |
setDeferredWrite(boolean durableDeferredWrite)
Sets the deferred write property for the first opened handle.
|
void |
setDirtyUtilization()
Sets utilization dirty in order to force the MapLN to be flushed later.
|
boolean |
setDuplicateComparator(java.util.Comparator<byte[]> comparator,
boolean byClassName)
Set the duplicate comparison function for this database.
|
void |
setEnvironmentImpl(EnvironmentImpl envImpl)
Set the db environment after reading in the DatabaseImpl from the log.
|
(package private) void |
setId(DatabaseId id) |
void |
setKeyPrefixing() |
void |
setPendingDeletedHook(TestHook hook) |
void |
setSortedDuplicates() |
void |
setTransactional(boolean transactional)
Sets the transactional property for the first opened handle.
|
(package private) void |
setTree(Tree tree) |
void |
startAndFinishDelete()
Perform the entire two-step database deletion.
|
void |
startDeleteProcessing()
The delete cleanup is starting.
|
DatabaseStats |
stat(StatsConfig config) |
void |
sync(boolean flushLog)
Flush all dirty nodes for this database to disk.
|
boolean |
unknownReplicated() |
boolean |
verify(VerifyConfig config,
DatabaseStats emptyStats) |
void |
writeToLog(java.nio.ByteBuffer logBuffer)
Serialize this object into the buffer.
|
public static boolean forceTreeWalkForTruncateAndRemove
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 cloneDatabase()
public Tree getTree()
void setTree(Tree tree)
public DatabaseId getId()
void setId(DatabaseId id)
public long getEofNodeId()
public boolean isTransactional()
public void setTransactional(boolean transactional)
public boolean isTemporary()
public static boolean isTemporary(byte flagVal)
public boolean isDurableDeferredWrite()
public boolean isDeferredWriteMode()
public void setDeferredWrite(boolean durableDeferredWrite)
public boolean getSortedDuplicates()
public static boolean getSortedDuplicates(byte flagVal)
public void setSortedDuplicates()
public boolean getKeyPrefixing()
public void setKeyPrefixing()
public void clearKeyPrefixing()
public boolean isReplicated()
public boolean unknownReplicated()
public boolean getUtilizationRepairDone()
public void clearUtilizationRepairDone()
public int getNodeMaxEntries()
public int getNodeMaxDupTreeEntries()
public int getAdditionalTreeMemorySize()
public boolean setDuplicateComparator(java.util.Comparator<byte[]> comparator,
boolean byClassName)
throws DatabaseException
duplicateComparator - - The Duplicate Comparison function.DatabaseExceptionpublic boolean setBtreeComparator(java.util.Comparator<byte[]> comparator,
boolean byClassName)
throws DatabaseException
btreeComparator - - The btree Comparison function.DatabaseExceptionpublic java.util.Comparator<byte[]> getBtreeComparator()
public java.util.Comparator<byte[]> 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 void handleClosed(boolean doSyncDw)
throws DatabaseException
DatabaseExceptionpublic long getTreeAdminMemory()
public void releaseTreeAdminMemory()
int getReferringHandleCount()
void incrementUseCount()
void decrementUseCount()
public boolean isInUse()
boolean isInUseDuringDbRemove()
public void sync(boolean flushLog)
throws DatabaseException
DatabaseExceptionpublic Database findPrimaryDatabase() throws DatabaseException
DatabaseExceptionpublic java.lang.String getName()
throws DatabaseException
DatabaseExceptionpublic DbFileSummary getDbFileSummary(java.lang.Long fileNum, boolean willModify)
Must be called under the log write latch.
willModify - if true, the caller will modify the utilization info.public boolean removeDbFileSummary(java.lang.Long fileNum)
Must be called under the log write latch.
public DbFileSummaryMap getDbFileSummaries()
public boolean isDirtyUtilization()
public void setDirtyUtilization()
public boolean isCheckpointNeeded()
public boolean isDeleted()
public boolean isDeleteFinished()
public void startDeleteProcessing()
void finishedINListHarvest()
public void startAndFinishDelete()
throws DatabaseException
DatabaseExceptionpublic void finishDeleteProcessing()
throws DatabaseException
DatabaseExceptionpublic void checkIsDeleted(java.lang.String operation)
throws DatabaseException
DatabaseExceptionpublic void countObsoleteDb(BaseUtilizationTracker tracker, long mapLnLsn)
mapLnLsn - is the LSN of the MapLN when called via recovery,
otherwise is NULL_LSN.
Must be called under the log write latch or during recovery.
public 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 entryVersion)
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)static void dumpFlags(java.lang.StringBuffer sb,
boolean verbose,
byte flags)
public long getTransactionId()
getTransactionId in interface LoggableLoggable.getTransactionId()public boolean logicalEquals(Loggable other)
logicalEquals in interface LoggableAlways return false, this item should never be compared.public static java.util.Comparator<byte[]> instantiateComparator(java.lang.Class<? extends java.util.Comparator<byte[]>> comparatorClass,
java.lang.String comparatorType)
throws LogException
LogExceptionpublic static java.util.Comparator<byte[]> instantiateComparator(java.util.Comparator<byte[]> comparator,
java.lang.String comparatorType)
throws DatabaseException
DatabaseExceptionpublic static byte[] objectToBytes(java.lang.Object obj,
java.lang.String comparatorType)
throws LogException
LogExceptionpublic static java.util.Comparator<byte[]> bytesToComparator(byte[] comparatorBytes,
java.lang.String comparatorType)
throws LogException,
java.lang.ClassNotFoundException
LogExceptionjava.lang.ClassNotFoundExceptionpublic int getBinDeltaPercent()
public int getBinMaxDeltas()
public ReplicationContext getRepContext()
DbOpReplicationContext getOperationRepContext(DbOperationType operationType)
Copyright (c) 2004,2008 Oracle. All rights reserved.