public class Cleaner extends Object implements DaemonRunner, EnvConfigObserver
| Constructor and Description |
|---|
Cleaner(EnvironmentImpl env,
String name) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Release resources and update memory budget.
|
FileProcessor |
createProcessor() |
int |
doClean(boolean cleanMultipleFiles,
boolean forceCleaning)
Cleans selected files and returns the number of files cleaned.
|
void |
enableFileDeletion(boolean enable)
Enables or disabling processing of safe-to-delete files, including
the truncation of the VLSN index.
|
void |
envConfigUpdate(DbConfigManager cm,
EnvironmentMutableConfig ignore)
Process notifications of mutable property changes.
|
void |
freshenLogSizeStats()
Updates the cached set of log size stats, including maxDiskOverage,
freeDiskShortage, diskUsageMessage and diskUsageViolationMessage.
|
String |
getDiskLimitMessage()
Returns a message describing disk space limits and usage, regardless of
whether the limit is violated or not.
|
String |
getDiskLimitViolation()
Uses cached disk usage info to determine whether disk space limits are
currently violated.
|
ExpirationProfile |
getExpirationProfile() |
boolean |
getFetchObsoleteSize(DatabaseImpl db) |
FileProtector |
getFileProtector() |
FileSelector.CheckpointStartCleanerState |
getFilesAtCheckpointStart()
Returns a copy of the cleaned files at the time a checkpoint starts.
|
FileSelector |
getFileSelector() |
int |
getNWakeupRequests() |
UtilizationProfile |
getUtilizationProfile() |
UtilizationTracker |
getUtilizationTracker() |
boolean |
isRMWFixEnabled() |
StatGroup |
loadStats(StatsConfig config)
Load stats.
|
void |
manageDiskUsage()
Updates log size stats and deletes unprotected reserved files in order
to stay within disk limits.
|
boolean |
repairReservedFile(DatabaseImpl dbImpl,
CursorImpl cursorImpl,
byte[] key)
If the LSN at the cursor position refers to an LN in a reserved file,
and the LN may be fetched (is not embedded, etc) then repair the
problem by reactivating the file.
|
void |
requestShutdown() |
void |
runOrPause(boolean run) |
void |
shutdown() |
void |
updateFilesAtCheckpointEnd(FileSelector.CheckpointStartCleanerState info)
When a checkpoint is complete, update the files that were returned at
the beginning of the checkpoint.
|
void |
wakeupActivate()
Wakeup the file processor threads in activate mode, meaning that
FileProcessor.doClean will be called.
|
void |
wakeupAfterWrite(int writeSize)
If the number of bytes written since the last activation exceeds the
cleaner's byte interval, wakeup the file processor threads in activate
mode.
|
public Cleaner(EnvironmentImpl env, String name)
public void envConfigUpdate(DbConfigManager cm, EnvironmentMutableConfig ignore)
envConfigUpdate in interface EnvConfigObserverIllegalArgumentException - via Environment ctor and
setMutableConfig.public FileProtector getFileProtector()
public UtilizationTracker getUtilizationTracker()
public UtilizationProfile getUtilizationProfile()
public ExpirationProfile getExpirationProfile()
public FileSelector getFileSelector()
public boolean getFetchObsoleteSize(DatabaseImpl db)
public boolean isRMWFixEnabled()
public void runOrPause(boolean run)
runOrPause in interface DaemonRunnerpublic void wakeupAfterWrite(int writeSize)
public void wakeupActivate()
FileProcessor.onWakeup()public void requestShutdown()
requestShutdown in interface DaemonRunnerpublic void shutdown()
shutdown in interface DaemonRunnerpublic int getNWakeupRequests()
getNWakeupRequests in interface DaemonRunnerpublic int doClean(boolean cleanMultipleFiles,
boolean forceCleaning)
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.public FileProcessor createProcessor()
public StatGroup loadStats(StatsConfig config)
public void enableFileDeletion(boolean enable)
public void manageDiskUsage()
public void freshenLogSizeStats()
public String getDiskLimitMessage()
getDiskLimitViolation(). Does not
return null.public String getDiskLimitViolation()
public FileSelector.CheckpointStartCleanerState getFilesAtCheckpointStart()
If FileSelector.CheckpointStartCleanerState.isEmpty() returns false, the
checkpoint should flush an extra level, and updateFilesAtCheckpointEnd(com.sleepycat.je.cleaner.FileSelector.CheckpointStartCleanerState) should be called when the checkpoint is
complete.
public void updateFilesAtCheckpointEnd(FileSelector.CheckpointStartCleanerState info)
public boolean repairReservedFile(DatabaseImpl dbImpl, CursorImpl cursorImpl, byte[] key)
To guarantee that an active LN at the cursor position is detected, a read lock on the record at the cursor position should be held when this method is called. If a read lock is not held, a write lock may be held by another thread and a different LSN may be restored to the BIN slot after an abort.
This method may release the record lock for the cursor's current LSN. The lock is always held while determining the active LSN, but released to performing more costly operations. If no costly operations are necessary, the lock is not released.
public void close()
Copyright © 2024. All rights reserved.