File tree Expand file tree Collapse file tree
ndbench-cass-plugins/src/main/java/com/netflix/ndbench/plugin/cass Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020import java .util .Map ;
2121
2222import com .google .common .collect .ImmutableMap ;
23+ import com .netflix .astyanax .model .Column ;
2324import org .slf4j .Logger ;
2425import org .slf4j .LoggerFactory ;
2526
@@ -131,7 +132,16 @@ public String readSingle(String key) throws Exception {
131132 {
132133 for (int i = 0 ; i < result .size (); i ++)
133134 {
134- String value = result .getColumnByIndex (i ).getStringValue ();
135+ Column <Integer > column = result .getColumnByIndex (i );
136+
137+ // validate column name
138+ if (column .getName () != i )
139+ {
140+ throw new Exception (String .format ("Column name %d does not match with the expected column name %d" , column .getName (), i ));
141+ }
142+
143+ // validate column value checksum
144+ String value = column .getStringValue ();
135145 if (!CheckSumUtil .isChecksumValid (value ))
136146 {
137147 throw new Exception (String .format ("Value %s is corrupt. Key %s." , value , key ));
You can’t perform that action at this time.
0 commit comments