|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.zookeeper.server.DatadirCleanupManager
public class DatadirCleanupManager
This class manages the cleanup of snapshots and corresponding transaction logs by scheduling the auto purge task with the specified 'autopurge.purgeInterval'. It keeps the most recent 'autopurge.snapRetainCount' number of snapshots and corresponding transaction logs.
| Nested Class Summary | |
|---|---|
static class |
DatadirCleanupManager.PurgeTaskStatus
Status of the dataDir purge task |
| Constructor Summary | |
|---|---|
DatadirCleanupManager(String snapDir,
String dataLogDir,
int snapRetainCount,
int purgeInterval)
Constructor of DatadirCleanupManager. |
|
| Method Summary | |
|---|---|
String |
getDataLogDir()
Returns transaction log directory. |
int |
getPurgeInterval()
Returns purge interval in hours. |
DatadirCleanupManager.PurgeTaskStatus |
getPurgeTaskStatus()
Returns the status of the purge task. |
String |
getSnapDir()
Returns the snapshot directory. |
int |
getSnapRetainCount()
Returns the number of snapshots to be retained after purge. |
void |
shutdown()
Shutdown the purge task. |
void |
start()
Validates the purge configuration and schedules the purge task. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DatadirCleanupManager(String snapDir,
String dataLogDir,
int snapRetainCount,
int purgeInterval)
snapDir - snapshot directorydataLogDir - transaction log directorysnapRetainCount - number of snapshots to be retained after purgepurgeInterval - purge interval in hours| Method Detail |
|---|
public void start()
snapRetainCount number of
snapshots and deletes the remaining for every purgeInterval
hour(s).
purgeInterval of 0 or
negative integer will not schedule the purge task.
PurgeTxnLog.purge(File, File, int)public void shutdown()
public DatadirCleanupManager.PurgeTaskStatus getPurgeTaskStatus()
public String getSnapDir()
public String getDataLogDir()
public int getPurgeInterval()
public int getSnapRetainCount()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||