Skip to content
Snippets Groups Projects
Commit 1206bc8a authored by Connor McCoy's avatar Connor McCoy
Browse files

Merge pull request #498 from kruthar/verify-reporting

[core] added return codes to VERIFY
parents d6e37c25 05d00f35
No related branches found
No related tags found
No related merge requests found
......@@ -172,16 +172,6 @@ public class CoreWorkload extends Workload
*/
private boolean dataintegrity;
/**
* Response values for data integrity checks.
* Need to be multiples of 1000 to match bucket offsets of
* measurements/OneMeasurementHistogram.java.
*/
private final int DATA_INT_MATCH = 0;
private final int DATA_INT_DEVIATE = 1000;
private final int DATA_INT_UNEXPECTED_NULL = 2000;
/**
* The name of the property for the proportion of transactions that are reads.
*/
......@@ -594,20 +584,23 @@ public class CoreWorkload extends Workload
* Bucket 2 means null data was returned when some data was expected.
*/
protected void verifyRow(String key, HashMap<String,ByteIterator> cells) {
int matchType = DATA_INT_MATCH;
Status verifyStatus = Status.OK;
long startTime = System.nanoTime();
if (!cells.isEmpty()) {
for (Map.Entry<String, ByteIterator> entry : cells.entrySet()) {
if (!entry.getValue().toString().equals(
buildDeterministicValue(key, entry.getKey()))) {
matchType = DATA_INT_DEVIATE;
verifyStatus = Status.UNEXPECTED_STATE;
break;
}
}
} else {
//This assumes that null data is never valid
matchType = DATA_INT_UNEXPECTED_NULL;
verifyStatus = Status.ERROR;
}
Measurements.getMeasurements().measure("VERIFY", matchType);
long endTime = System.nanoTime();
_measurements.measure("VERIFY", (int) (endTime - startTime) / 1000);
_measurements.reportStatus("VERIFY",verifyStatus);
}
int nextKeynum() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment