use of org.apache.cassandra.spark.shaded.fourzero.cassandra.db.rows.Unfiltered in project spark-cassandra-bulkreader by jberragan.
the class SSTableReaderTests method countAndValidateRows.
private static int countAndValidateRows(@NotNull final FourZeroSSTableReader reader) {
final ISSTableScanner scanner = reader.getScanner();
int count = 0;
while (scanner.hasNext()) {
final UnfilteredRowIterator it = scanner.next();
while (it.hasNext()) {
final BufferDecoratedKey key = (BufferDecoratedKey) it.partitionKey();
final int a = key.getKey().asIntBuffer().get();
final Unfiltered unfiltered = it.next();
assertTrue(unfiltered.isRow());
final AbstractRow row = (AbstractRow) unfiltered;
final int b = row.clustering().bufferAt(0).asIntBuffer().get();
for (final ColumnData data : row) {
final Cell cell = (Cell) data;
final int c = cell.buffer().getInt();
assertEquals(c, a + b);
count++;
}
}
}
return count;
}
Aggregations