|
|||||||||
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
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 |
---|
Fields inherited from class com.sleepycat.je.utilint.DaemonThread |
---|
name, nWakeupRequests, workQueue, workQueueLatch |
Constructor Summary | |
---|---|
Cleaner(EnvironmentImpl env,
long waitTime,
String name)
|
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()
|
int |
doClean(boolean invokedFromDaemon,
boolean cleanMultipleFiles,
boolean forceCleaning)
Cleans selected files and returns the number of files cleaned. |
Set[] |
getFilesAtCheckpointStart()
Returns a copy of the cleaned and processed files at the time a checkpoint starts. |
void |
handleNoMigrationLogging(BIN bin)
Add a BIN entry to the pending LN set. |
boolean |
isEvictable(BIN bin,
int index)
Returns whether the given BIN entry may be stripped by the evictor. |
void |
loadStats(StatsConfig config,
EnvironmentStats stat)
Load stats. |
void |
migrateLNs(BIN bin)
This method should be called just before logging a BIN. |
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()
|
void |
updateFilesAtCheckpointEnd(Set[] files)
When a checkpoint is complete, update the files that were returned at the beginning of the checkpoint. |
Methods inherited from class com.sleepycat.je.utilint.DaemonThread |
---|
addToQueueAlreadyLatched, getNWakeupRequests, getQueueSize, getThread, isRunning, 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) throws DatabaseException
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 forceCleaning) throws DatabaseException
invokedFromDaemon
- currently has no effect.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 Set[] 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(Set[] files) throws DatabaseException
DatabaseException
public void handleNoMigrationLogging(BIN bin) throws DatabaseException
DatabaseException
public boolean isEvictable(BIN bin, int index)
public void migrateLNs(BIN bin) 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 handleNoMigrationLogging method must be called.
bin
- is the latched BIN. The latch will not be released by this
method.
DatabaseException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |