Package org.apache.zookeeper.server
Class PurgeTxnLog
java.lang.Object
org.apache.zookeeper.server.PurgeTxnLog
this class is used to clean up the
snapshot and data log dir's. This is usually
run as a cronjob on the zookeeper server machine.
Invocation of this class will clean up the datalogdir
files and snapdir files keeping the last "-n" snapshot files
and the corresponding logs.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
PurgeTxnLog
public PurgeTxnLog()
-
-
Method Details
-
purge
Purges the snapshot and logs keeping the last num snapshots and the corresponding logs. If logs are rolling or a new snapshot is created during this process, these newest N snapshots or any data logs will be excluded from current purging cycle.- Parameters:
dataDir
- the dir that has the logssnapDir
- the dir that has the snapshotsnum
- the number of snapshots to keep- Throws:
IOException
-
main
- Parameters:
args
- dataLogDir [snapDir] -n count dataLogDir -- path to the txn log directory snapDir -- path to the snapshot directory count -- the number of old snaps/logs you want to keep, value should be greater than or equal to 3- Throws:
IOException
-