Skip to content

Commit

Permalink
Added hook to checkpoint all BDB envs
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinoth Chandar committed May 3, 2013
1 parent be4dbc0 commit c5a143f
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/java/voldemort/store/bdb/BdbStorageConfiguration.java
Expand Up @@ -39,6 +39,7 @@

import com.google.common.collect.Maps;
import com.sleepycat.je.CacheMode;
import com.sleepycat.je.CheckpointConfig;
import com.sleepycat.je.Database;
import com.sleepycat.je.DatabaseConfig;
import com.sleepycat.je.DatabaseException;
Expand Down Expand Up @@ -304,7 +305,7 @@ public String getEnvStatsAsString(String storeName, boolean fast) throws Excepti
/**
* Forceful cleanup the logs
*/
@JmxOperation(description = "Forceful start the cleaner threads")
@JmxOperation(description = "Forceful invoke the log cleaning")
public void cleanLogs() {
synchronized(lock) {
try {
Expand All @@ -317,6 +318,24 @@ public void cleanLogs() {
}
}

/**
* Forceful checkpointing
*/
@JmxOperation(description = "Forcefully checkpoint all the environments")
public void checkPointAllEnvironments() {
synchronized(lock) {
try {
for(Environment environment: environments.values()) {
CheckpointConfig checkPointConfig = new CheckpointConfig();
checkPointConfig.setForce(true);
environment.checkpoint(checkPointConfig);
}
} catch(DatabaseException e) {
throw new VoldemortException(e);
}
}
}

public void close() {
synchronized(lock) {
try {
Expand Down

0 comments on commit c5a143f

Please sign in to comment.