|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.je.cleaner.Cleaner
public class Cleaner
The Cleaner is responsible for effectively garbage collecting the JE log. It looks through log files and locates log records (IN's and LN's of all flavors) that are superceded by later versions. Those that are "current" are propagated to a newer log file so that older log files can be deleted.
Field Summary | |
---|---|
(package private) static java.lang.String |
CLEAN_IN
|
(package private) static java.lang.String |
CLEAN_LN
|
(package private) static java.lang.String |
CLEAN_MIGRATE_LN
|
(package private) static java.lang.String |
CLEAN_PENDING_LN
|
(package private) long |
cleanerBytesInterval
|
(package private) boolean |
clusterAll
|
(package private) boolean |
clusterResident
|
(package private) java.util.logging.Level |
detailedTraceLevel
|
(package private) static boolean |
DO_CRITICAL_EVICTION
Whether the cleaner should participate in critical eviction. |
(package private) boolean |
expunge
|
(package private) long |
lockTimeout
|
(package private) int |
lookAheadCacheSize
|
(package private) java.util.Set |
lowUtilizationFiles
All files that are below the minUtilization threshold. |
(package private) int |
maxBatchFiles
|
(package private) java.util.Set |
mustBeCleanedFiles
All files that are to-be-cleaning or being-cleaned. |
(package private) int |
nBacklogFiles
|
(package private) int |
nCleanerDeletions
|
(package private) int |
nCleanerRuns
|
(package private) int |
nClusterLNsProcessed
|
(package private) int |
nDeadlockRetries
|
(package private) int |
nEntriesRead
|
(package private) int |
nINsCleaned
|
(package private) int |
nINsDead
|
(package private) int |
nINsMigrated
|
(package private) int |
nINsObsolete
|
(package private) int |
nLNQueueHits
|
(package private) int |
nLNsCleaned
|
(package private) int |
nLNsDead
|
(package private) int |
nLNsLocked
|
(package private) int |
nLNsMarked
|
(package private) int |
nLNsMigrated
|
(package private) int |
nLNsObsolete
|
(package private) int |
nMarkedLNsProcessed
|
(package private) int |
nPendingLNsLocked
|
(package private) int |
nPendingLNsProcessed
|
(package private) long |
nRepeatIteratorReads
|
(package private) int |
nToBeCleanedLNsProcessed
|
(package private) static boolean |
PROACTIVE_MIGRATION
Whether to fetch LNs for files in the to-be-cleaned set during lazy migration. |
(package private) int |
readBufferSize
|
(package private) boolean |
trackDetail
|
(package private) static boolean |
UPDATE_GENERATION
Whether to update the IN generation count during searches. |
Constructor Summary | |
---|---|
Cleaner(EnvironmentImpl env,
java.lang.String name)
|
Method Summary | |
---|---|
(package private) void |
addPendingDB(DatabaseImpl db)
Adds the DB ID to the pending DB set if it is being deleted but deletion is not yet complete. |
void |
clearDeleteProhibited()
|
(package private) void |
deleteSafeToDeleteFiles()
Deletes all files that are safe-to-delete, if there are no read/only processes and concurrent backups. |
int |
doClean(boolean cleanMultipleFiles,
boolean forceCleaning)
Cleans selected files and returns the number of files cleaned. |
void |
envConfigUpdate(DbConfigManager cm)
Process notifications of mutable property changes. |
FileSelector.CheckpointStartCleanerState |
getFilesAtCheckpointStart()
Returns a copy of the cleaned and processed files at the time a checkpoint starts. |
int |
getNWakeupRequests()
|
UtilizationProfile |
getUtilizationProfile()
|
UtilizationTracker |
getUtilizationTracker()
|
boolean |
isEvictable(BIN bin,
int index)
Returns whether the given BIN entry may be stripped by the evictor. |
void |
lazyMigrateDupCountLN(DIN din,
ChildReference dclRef,
boolean proactiveMigration)
This method should be called just before logging a root DIN. |
void |
lazyMigrateLNs(BIN bin,
boolean proactiveMigration)
This method should be called just before logging a BIN. |
void |
loadStats(StatsConfig config,
EnvironmentStats stat)
Load stats. |
(package private) void |
processPending()
If any LNs are pending, process them. |
void |
requestShutdown()
|
void |
runOrPause(boolean run)
|
void |
setDeleteProhibited()
|
void |
shutdown()
|
(package private) void |
trace(java.util.logging.Level level,
java.lang.String action,
Node node,
long logLsn,
boolean completed,
boolean obsolete,
boolean dirtiedMigrated)
Send trace messages to the java.util.logger. |
void |
updateFilesAtCheckpointEnd(FileSelector.CheckpointStartCleanerState info)
When a checkpoint is complete, update the files that were returned at the beginning of the checkpoint. |
void |
updateReadOnlyFileCollections()
Update the lowUtilizationFiles and mustBeCleanedFiles fields with new read-only collections, and update the backlog file count. |
void |
wakeup()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final java.lang.String CLEAN_IN
static final java.lang.String CLEAN_LN
static final java.lang.String CLEAN_MIGRATE_LN
static final java.lang.String CLEAN_PENDING_LN
static final boolean PROACTIVE_MIGRATION
static final boolean UPDATE_GENERATION
static final boolean DO_CRITICAL_EVICTION
int nBacklogFiles
int nCleanerRuns
int nCleanerDeletions
int nINsObsolete
int nINsCleaned
int nINsDead
int nINsMigrated
int nLNsObsolete
int nLNsCleaned
int nLNsDead
int nLNsLocked
int nLNsMigrated
int nLNsMarked
int nLNQueueHits
int nPendingLNsProcessed
int nMarkedLNsProcessed
int nToBeCleanedLNsProcessed
int nClusterLNsProcessed
int nPendingLNsLocked
int nEntriesRead
long nRepeatIteratorReads
long lockTimeout
int readBufferSize
int lookAheadCacheSize
int nDeadlockRetries
boolean expunge
boolean clusterResident
boolean clusterAll
int maxBatchFiles
java.util.logging.Level detailedTraceLevel
long cleanerBytesInterval
boolean trackDetail
java.util.Set mustBeCleanedFiles
java.util.Set lowUtilizationFiles
Constructor Detail |
---|
public Cleaner(EnvironmentImpl env, java.lang.String name) throws DatabaseException
DatabaseException
Method Detail |
---|
public void envConfigUpdate(DbConfigManager cm) throws DatabaseException
envConfigUpdate
in interface EnvConfigObserver
DatabaseException
public UtilizationTracker getUtilizationTracker()
public UtilizationProfile getUtilizationProfile()
public void runOrPause(boolean run)
runOrPause
in interface DaemonRunner
public void wakeup()
public void requestShutdown()
requestShutdown
in interface DaemonRunner
public void shutdown()
shutdown
in interface DaemonRunner
public int getNWakeupRequests()
getNWakeupRequests
in interface DaemonRunner
public int doClean(boolean cleanMultipleFiles, boolean forceCleaning) throws DatabaseException
cleanMultipleFiles
- is true to clean until we're under budget,
or false to clean at most one file.forceCleaning
- is true to clean even if we're not under the
utilization threshold.
DatabaseException
public void loadStats(StatsConfig config, EnvironmentStats stat) throws DatabaseException
DatabaseException
void deleteSafeToDeleteFiles() throws DatabaseException
DatabaseException
public void setDeleteProhibited()
public void clearDeleteProhibited()
public FileSelector.CheckpointStartCleanerState getFilesAtCheckpointStart() throws DatabaseException
If non-null is returned, the checkpoint should flush an extra level, and addCheckpointedFiles() should be called when the checkpoint is complete.
DatabaseException
public void updateFilesAtCheckpointEnd(FileSelector.CheckpointStartCleanerState info) throws DatabaseException
DatabaseException
public void updateReadOnlyFileCollections()
void processPending() throws DatabaseException
DatabaseException
public boolean isEvictable(BIN bin, int index)
public void lazyMigrateLNs(BIN bin, boolean proactiveMigration) throws DatabaseException
On return this method guarantees that no MIGRATE flag will be set on any child entry. If this method is *not* called before logging a BIN, then the addPendingLNs method must be called.
bin
- is the latched BIN. The latch will not be released by this
method.proactiveMigration
- perform proactive migration if needed; this is
false during a split, to reduce the delay in the user operation.
DatabaseException
public void lazyMigrateDupCountLN(DIN din, ChildReference dclRef, boolean proactiveMigration) throws DatabaseException
On return this method guarantees that the MIGRATE flag will not be set on the child entry. If this method is *not* called before logging a root DIN, then the addPendingDupCountLN method must be called.
din
- is the latched DIN. The latch will not be released by this
method.dclRef
- is the reference to the DupCountLN.proactiveMigration
- perform proactive migration if needed; this is
false during a split, to reduce the delay in the user operation.
DatabaseException
void addPendingDB(DatabaseImpl db)
void trace(java.util.logging.Level level, java.lang.String action, Node node, long logLsn, boolean completed, boolean obsolete, boolean dirtiedMigrated)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |