org.apache.zookeeper.server
Class PurgeTxnLog
java.lang.Object
org.apache.zookeeper.server.PurgeTxnLog
public class PurgeTxnLog
- extends Object
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.
Method Summary |
static void |
main(String[] args)
|
static void |
purge(File dataDir,
File snapDir,
int num)
purges the snapshot and logs keeping the last num snapshots
and the corresponding logs. |
PurgeTxnLog
public PurgeTxnLog()
purge
public static void purge(File dataDir,
File snapDir,
int num)
throws IOException
- purges the snapshot and logs keeping the last num snapshots
and the corresponding logs.
- Parameters:
dataDir
- the dir that has the logssnapDir
- the dir that has the snapshotsnum
- the number of snapshots to keep
- Throws:
IOException
main
public static void main(String[] args)
throws IOException
- Parameters:
args
- PurgeTxnLog dataLogDir
dataLogDir -- txn log directory
-n num (number of snapshots to keep)
- Throws:
IOException
Copyright © 2011 The Apache Software Foundation