|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.je.utilint.DaemonThread
com.sleepycat.je.cleaner.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 |
Fields inherited from class com.sleepycat.je.utilint.DaemonThread |
name, nWakeupRequests, workQueue, workQueueLatch |
Constructor Summary | |
Cleaner(EnvironmentImpl env,
long waitTime,
String name,
UtilizationProfile profile)
|
Method Summary | |
void |
addToQueue(Object o)
Cleaner doesn't have a work queue so just throw an exception if it's ever called. |
void |
clearEnv()
|
void |
deleteCleanedFiles(Set cleanedFiles)
Delete files that were previously returned by getCleanedFiles, after performing a checkpoint with no deltas and that flushed to the root. |
int |
doClean(boolean invokedFromDaemon,
boolean cleanMultipleFiles,
boolean forceAggressive)
Cleans selected files and returns the number of files cleaned. |
Set |
getCleanedFiles(boolean getAll)
Called when starting a checkpoint to get the files to be deleted when the checkpoint is complete. |
boolean |
isNearDiskBudget(boolean calcIfNecessary)
Returns whether we are near to using the disk budget. |
void |
loadStats(StatsConfig config,
EnvironmentStats stat)
Load stats. |
protected int |
nDeadlockRetries()
Return the number of retries when a deadlock exception occurs. |
void |
onWakeup()
Called whenever the daemon thread wakes up from a sleep. |
String |
toString()
|
Methods inherited from class com.sleepycat.je.utilint.DaemonThread |
addToQueueAlreadyLatched, getNWakeupRequests, getQueueSize, getThread, isShutdownRequested, requestShutdown, run, runOrPause, shutdown, wakeup |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Cleaner(EnvironmentImpl env, long waitTime, String name, UtilizationProfile profile) throws DatabaseException
Method Detail |
public String toString()
toString
in class DaemonThread
public void addToQueue(Object o) throws DatabaseException
addToQueue
in class DaemonThread
DatabaseException
public void loadStats(StatsConfig config, EnvironmentStats stat) throws DatabaseException
DatabaseException
public void clearEnv()
protected int nDeadlockRetries() throws DatabaseException
nDeadlockRetries
in class DaemonThread
DatabaseException
public void onWakeup() throws DatabaseException
onWakeup
in class DaemonThread
DatabaseException
public int doClean(boolean invokedFromDaemon, boolean cleanMultipleFiles, boolean forceAggressive) throws DatabaseException
invokedFromDaemon
- currently has no effect.cleanMultipleFiles
- is true to clean until we're under * budget,forceAggressive
- is true to clean as if we were under budget even
when we're not.
DatabaseException
public Set getCleanedFiles(boolean getAll)
If non-null is returned, the checkpoint should not allow deltas, the checkpoint should flush to the root, and deleteCleanedFiles() should be called when the checkpoint is complete. The caller must call deleteCleanedFiles() or the files will have to be cleaned again later.
The checkpoint can't have deltas because the checkpointer is essentially rewriting INs for the cleaner. We flush all the way to the root to make sure there are no references left to the old file.
getAll
- is true to get all files even if the number of cleaned
files is below the threshold. Even if getAll is true, null will be
returned if zero files have been cleaned.public void deleteCleanedFiles(Set cleanedFiles) throws DatabaseException
DatabaseException
public boolean isNearDiskBudget(boolean calcIfNecessary) throws DatabaseException
calcIfNecessary
- is true if this method should calculate the total
log size by reading the utilization database if the size is not already
available. It will only calculate it the first time it is called and if
the cleaner has not yet been invoked.
DatabaseException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |