Skip to content

Commit

Permalink
Check if logger.isDebugEnaled() to optimize loggin
Browse files Browse the repository at this point in the history
  • Loading branch information
abh1nay committed Feb 19, 2013
1 parent f50c241 commit 0391625
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/java/voldemort/client/protocol/admin/StreamingClient.java
Expand Up @@ -550,7 +550,9 @@ public synchronized void commitToVoldemort() {
@SuppressWarnings({ "unchecked", "rawtypes", "unused" })
private void commitToVoldemort(List<String> storeNamesToCommit) {

logger.debug("Trying to commit to Voldemort");
if(logger.isDebugEnabled()) {
logger.debug("Trying to commit to Voldemort");
}
for(Node node: nodesToStream) {

for(String store: storeNamesToCommit) {
Expand Down Expand Up @@ -587,8 +589,10 @@ private void commitToVoldemort(List<String> storeNamesToCommit) {
throw new VoldemortException("Recovery Callback failed");
}
} else {
logger.debug("Commit successful");
logger.debug("calling checkpoint callback");
if(logger.isDebugEnabled()) {
logger.debug("Commit successful");
logger.debug("calling checkpoint callback");
}
Future future = streamingresults.submit(checkpointCallback);
try {
future.get();
Expand Down

0 comments on commit 0391625

Please sign in to comment.