org.apache.zookeeper.server
Class PurgeTxnLog
java.lang.Object
org.apache.zookeeper.server.PurgeTxnLog
public class PurgeTxnLog
- extends java.lang.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(java.lang.String[] args)
|
static void |
purge(java.io.File dataDir,
java.io.File snapDir,
int num)
purges the snapshot and logs keeping the last num snapshots
and the corresponding logs. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PurgeTxnLog
public PurgeTxnLog()
purge
public static void purge(java.io.File dataDir,
java.io.File snapDir,
int num)
throws java.io.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:
java.io.IOException
main
public static void main(java.lang.String[] args)
throws java.io.IOException
- Parameters:
args
- PurgeTxnLog dataLogDir
dataLogDir -- txn log directory
-n num (number of snapshots to keep)
- Throws:
java.io.IOException
Copyright © 2010 The Apache Software Foundation