Skip to content

Commit

Permalink
NIO + BDB stats - Code review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vinothchandar committed Jan 2, 2013
1 parent dd29d0e commit 5aa3716
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Expand Up @@ -54,7 +54,8 @@ public ByteBufferBackedInputStream(ByteBuffer buffer) {
public ByteBufferBackedInputStream(ByteBuffer buffer, MutableLong sizeTracker) {
this.buffer = buffer;
this.sizeTracker = sizeTracker;
this.sizeTracker.add(buffer.capacity());
if(buffer != null)
this.sizeTracker.add(buffer.capacity());
}

public ByteBuffer getBuffer() {
Expand Down
Expand Up @@ -65,7 +65,8 @@ public ByteBufferBackedOutputStream(ByteBuffer buffer, MutableLong sizeTracker)
this.buffer = buffer;
wasExpanded = false;
this.sizeTracker = sizeTracker;
this.sizeTracker.add(buffer.capacity());
if(buffer != null)
this.sizeTracker.add(buffer.capacity());
}

public ByteBuffer getBuffer() {
Expand Down
5 changes: 2 additions & 3 deletions src/java/voldemort/store/bdb/stats/BdbEnvironmentStats.java
Expand Up @@ -6,7 +6,6 @@
import voldemort.VoldemortException;
import voldemort.annotations.Experimental;
import voldemort.annotations.jmx.JmxGetter;
import voldemort.annotations.jmx.JmxOperation;
import voldemort.utils.CachedCallable;

import com.sleepycat.je.Database;
Expand Down Expand Up @@ -351,12 +350,12 @@ public long getNumEnvironmentFailureExceptions() {
return numEnvironmentFailureExceptions.longValue();
}

@JmxOperation(description = "Obtain the number of k-v entries in the store")
@JmxGetter(name = "getEntryCount", description = "Obtain the number of k-v entries in the store")
public long getEntryCount() throws Exception {
return entryCount.call();
}

@JmxOperation(description = "Obtain statistics about the BTree Index for a store")
@JmxGetter(name = "getBtreeStats", description = "Obtain statistics about the BTree Index for a store")
public String getBtreeStats() throws Exception {
return btreeStats.call().toString();
}
Expand Down

0 comments on commit 5aa3716

Please sign in to comment.