Review Board 1.7.22


automating log and snapshot cleaning

Review Request #1043 - Created July 7, 2011 and submitted

Patrick Hunt
trunk
ZOOKEEPER-1107
Reviewers
zookeeper
breed, mahadev, phunt
zookeeper
I like to have ZK itself manage the amount of snapshots and logs kept, instead of relying on the PurgeTxnLog utility.
test added, passing hudson qa bot.
./conf/zoo_sample.cfg
Revision 1141901 New Change
[20] 9 lines
[+20]
10
# do not use /tmp for storage, /tmp here is just 
10
# do not use /tmp for storage, /tmp here is just 
11
# example sakes.
11
# example sakes.
12
dataDir=/tmp/zookeeper
12
dataDir=/tmp/zookeeper
13
# the port at which the clients will connect
13
# the port at which the clients will connect
14
clientPort=2181
14
clientPort=2181

    
   
15
##################Clean up Configuration ##########################

    
   
16
# The number of snapshots to keep in zookeeper. default is 3.

    
   
17
# The value cannot be given less than 3.

    
   
18
zookeeper.snapshot.count=3

    
   
19
# The time period for which the purge operation should be repeated [in hrs]. Default is 1 hour.

    
   
20
# To turn off the periodic purging feature, specify zookeeper.purge.time as 0.

    
   
21
zookeeper.purge.time=1
./src/java/main/org/apache/zookeeper/ZooKeeperPurger.java
New File
 
./src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerConfig.java
Revision 1141901 New Change
 
./src/java/test/org/apache/zookeeper/ZooKeeperPurgeTest.java
New File
 
  1. ./conf/zoo_sample.cfg: Loading...
  2. ./src/java/main/org/apache/zookeeper/ZooKeeperPurger.java: Loading...
  3. ./src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerConfig.java: Loading...
  4. ./src/java/test/org/apache/zookeeper/ZooKeeperPurgeTest.java: Loading...