com.sleepycat.je.cleaner
Class FileProcessor
java.lang.Object
com.sleepycat.je.utilint.DaemonThread
com.sleepycat.je.cleaner.FileProcessor
- All Implemented Interfaces:
- DaemonRunner, java.lang.Runnable
class FileProcessor
- extends DaemonThread
Reads all entries in a log file and either determines them to be obsolete or
marks them for migration. LNs are marked for migration by setting the BIN
entry MIGRATE flag. INs are marked for migration by setting the dirty flag.
May be invoked explicitly by calling doClean, or woken up if used as a
daemon thread.
|
Method Summary |
void |
clearEnv()
|
int |
doClean(boolean invokedFromDaemon,
boolean cleanMultipleFiles,
boolean forceCleaning)
Cleans selected files and returns the number of files cleaned. |
protected long |
nDeadlockRetries()
Return the number of retries when a deadlock exception occurs. |
void |
onWakeup()
Activates the cleaner. |
| Methods inherited from class com.sleepycat.je.utilint.DaemonThread |
checkErrorListener, getExceptionListener, getNWakeupRequests, getThread, isPaused, isRunning, isShutdownRequested, requestShutdown, run, runOrPause, setExceptionListener, shutdown, toString, wakeup |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
FileProcessor
FileProcessor(java.lang.String name,
EnvironmentImpl env,
Cleaner cleaner,
UtilizationProfile profile,
FileSelector fileSelector)
clearEnv
public void clearEnv()
nDeadlockRetries
protected long nDeadlockRetries()
throws DatabaseException
- Return the number of retries when a deadlock exception occurs.
- Overrides:
nDeadlockRetries in class DaemonThread
- Throws:
DatabaseException
onWakeup
public void onWakeup()
throws DatabaseException
- Activates the cleaner. Is normally called when je.cleaner.byteInterval
bytes are written to the log.
- Specified by:
onWakeup in class DaemonThread
- Throws:
DatabaseException
doClean
public int doClean(boolean invokedFromDaemon,
boolean cleanMultipleFiles,
boolean forceCleaning)
throws DatabaseException
- Cleans selected files and returns the number of files cleaned. May be
called by the daemon thread or programatically.
- Parameters:
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.
- Returns:
- the number of files cleaned, not including files cleaned
unsuccessfully.
- Throws:
DatabaseException
Copyright (c) 2004,2008 Oracle. All rights reserved.