Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added server-put tracking to progress bar.

  • Loading branch information...
commit 9d3fb7eaf2d60f8ed64392ad5649cd52706d16db 1 parent 104c927
Jay Wylie jayjwylie authored
3  src/java/log4j.properties
View
@@ -19,3 +19,6 @@ log4j.logger.voldemort.utils=INFO
log4j.logger.voldemort.client.rebalance=INFO
log4j.logger.voldemort.server=INFO
log4j.logger.krati=WARN
+
+# log4j.logger.voldemort.utils.ConsistencyFix=TRACE
+# log4j.logger.voldemort.utils.ConsistencyFixWorker=DEBUG
35 src/java/voldemort/utils/ConsistencyFix.java
View
@@ -491,14 +491,16 @@ public void run() {
public class Stats {
final long progressBar;
- long count;
+ long fixCount;
+ long putCount;
long failures;
long lastTimeMs;
final long startTimeMs;
Stats(long progressBar) {
this.progressBar = progressBar;
- this.count = 0;
+ this.fixCount = 0;
+ this.putCount = 0;
this.failures = 0;
this.lastTimeMs = System.currentTimeMillis();
this.startTimeMs = lastTimeMs;
@@ -511,16 +513,27 @@ private synchronized String getPrettyQPS(long count, long ms) {
return df.format(qps);
}
- public synchronized void incrementCount() {
- count++;
- if(count % progressBar == 0) {
+ public synchronized void incrementFixCount() {
+ fixCount++;
+ if(fixCount % progressBar == 0) {
long nowTimeMs = System.currentTimeMillis();
- logger.info("Bad keys attempted to be processed count = " + count + " ("
- + getPrettyQPS(progressBar, lastTimeMs - nowTimeMs) + " keys/second)");
+ StringBuilder sb = new StringBuilder();
+ sb.append("\nConsistencyFix Progress Bar\n");
+ sb.append("\tBad keys processed : " + fixCount
+ + " (during this progress bar period)\n");
+ sb.append("\tBad key processing rate : "
+ + getPrettyQPS(progressBar, nowTimeMs - lastTimeMs)
+ + " bad keys/second)\n");
+ sb.append("\tServer-puts issued : " + putCount + " (since fixer started)\n");
+ logger.info(sb.toString());
lastTimeMs = nowTimeMs;
}
}
+ public synchronized void incrementPutCount() {
+ putCount++;
+ }
+
public synchronized void incrementFailures() {
failures++;
if(failures % progressBar == 0) {
@@ -533,12 +546,14 @@ public synchronized String summary() {
summary.append("\n\n");
summary.append("Consistency Fix Summary\n");
summary.append("-----------------------\n");
- summary.append("Total keys processed: " + count + "\n");
+ summary.append("Total bad keys processed: " + fixCount + "\n");
+ summary.append("Total server-puts issued: " + putCount + "\n");
summary.append("Total keys processed that were not corrected: " + failures + "\n");
- long nowTimeMs = System.currentTimeMillis();
+ long nowTimeMs = System.currentTimeMillis();
summary.append("Keys per second processed: "
- + getPrettyQPS(count, nowTimeMs - startTimeMs) + "\n");
+ + getPrettyQPS(fixCount, nowTimeMs - startTimeMs) + "\n");
+
return summary.toString();
}
}
3  src/java/voldemort/utils/ConsistencyFixWorker.java
View
@@ -88,7 +88,7 @@ public void run() {
logger.trace("About to process key " + keyInHexFormat + " (" + myName() + ")");
Status status = doConsistencyFix(keyInHexFormat);
logger.trace("Finished processing key " + keyInHexFormat + " (" + myName() + ")");
- consistencyFix.getStats().incrementCount();
+ consistencyFix.getStats().incrementFixCount();
if(status != Status.SUCCESS) {
try {
@@ -340,6 +340,7 @@ public Status doRepairPut(final List<NodeValue<ByteArray, byte[]>> toReadRepair)
consistencyFix.maybePutThrottle(nodeKeyValue.getNodeId());
consistencyFix.getAdminClient().storeOps.putNodeKeyValue(consistencyFix.getStoreName(),
nodeKeyValue);
+ consistencyFix.getStats().incrementPutCount();
} catch(ObsoleteVersionException ove) {
// TODO: Add OVE catches to some statistics?
// NOOP. Treat OVE as success.
Please sign in to comment.
Something went wrong with that request. Please try again.