Skip to content

Commit

Permalink
Default to printing out BADKEYs from ConsistencyCheck. Cleaned up deb…
Browse files Browse the repository at this point in the history
…ug/trace messages in ConsistencyFix.java.
  • Loading branch information
jayjwylie committed Mar 20, 2013
1 parent 0c6893c commit 104c927
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/java/voldemort/utils/ConsistencyCheck.java
Expand Up @@ -284,14 +284,14 @@ public ConsistencyCheckStats execute() {
}

// print inconsistent keys
if(verbose) {
System.out.println("TYPE,Store,ParId,Key,ServerSet,VersionTS,VectorClock[,ValueHash]");
for(Map.Entry<ByteArray, Map<Version, Set<PrefixNode>>> entry: keyVersionNodeSetMap.entrySet()) {
ByteArray key = entry.getKey();
Map<Version, Set<PrefixNode>> versionMap = entry.getValue();
System.out.print(keyVersionToString(key, versionMap, storeName, partitionId));
}
// if(verbose) {
System.out.println("TYPE,Store,ParId,Key,ServerSet,VersionTS,VectorClock[,ValueHash]");
for(Map.Entry<ByteArray, Map<Version, Set<PrefixNode>>> entry: keyVersionNodeSetMap.entrySet()) {
ByteArray key = entry.getKey();
Map<Version, Set<PrefixNode>> versionMap = entry.getValue();
System.out.print(keyVersionToString(key, versionMap, storeName, partitionId));
}
// }

ConsistencyCheckStats stats = new ConsistencyCheckStats();
stats.consistentKeys = consistentKeys;
Expand Down
4 changes: 3 additions & 1 deletion src/java/voldemort/utils/ConsistencyFix.java
Expand Up @@ -397,6 +397,8 @@ public void run() {
throw new IOException("KeyNumVal line did not parse into two elements: "
+ keyNumVals);
}
logger.trace("parsed[0]: <" + parsed[0] + ">, parsed[1] <" + parsed[1]
+ ">");
String key = parsed[0];
ByteArray keyByteArray = new ByteArray(ByteUtils.fromHexString(key));
int numVals = Integer.parseInt(parsed[1]);
Expand Down Expand Up @@ -471,7 +473,7 @@ public void run() {
badKeyResult = badKeyQOut.take();
}
} catch(IOException ioe) {
logger.warn("IO exception reading badKeyFile " + badKeyFileOut + " : "
logger.warn("IO exception writing badKeyFile " + badKeyFileOut + " : "
+ ioe.getMessage());
} catch(InterruptedException ie) {
logger.warn("Interrupted exception during writing of badKeyFile " + badKeyFileOut
Expand Down

0 comments on commit 104c927

Please sign in to comment.