Skip to content
Snippets Groups Projects
Commit 9b2d8fbc authored by Andy Kruth's avatar Andy Kruth
Browse files

[core] added return codes to VERIFY

Changed measurement latency to actual latency time of the verifyRow step
and now recording Status codes for verify operations.

Fixes #479
parent 4e7295c2
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;
if (!cells.isEmpty()) {
Status verifyStatus = Status.OK;
long startTime = System.nanoTime();
if (!cells.isEmpty()) {
for (Map.Entry<String, ByteIterator> entry : cells.entrySet()) {
if (!entry.getValue().toString().equals(
if (!entry.getValue().toString().equals(
buildDeterministicValue(key, entry.getKey()))) {
matchType = DATA_INT_DEVIATE;
break;
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