use of org.apache.cassandra.io.util.RandomAccessReader in project eiger by wlloyd.
the class SSTableTest method verifyMany.
private void verifyMany(SSTableReader sstable, Map<ByteBuffer, ByteBuffer> map) throws IOException {
List<ByteBuffer> keys = new ArrayList<ByteBuffer>(map.keySet());
Collections.shuffle(keys);
RandomAccessReader file = sstable.openDataReader(false);
for (ByteBuffer key : keys) {
file.seek(sstable.getPosition(sstable.partitioner.decorateKey(key), SSTableReader.Operator.EQ));
assert key.equals(ByteBufferUtil.readWithShortLength(file));
int size = (int) SSTableReader.readRowSize(file, sstable.descriptor);
byte[] bytes2 = new byte[size];
file.readFully(bytes2);
assert Arrays.equals(bytes2, map.get(key).array());
}
}
Aggregations