use of com.linkedin.pinot.core.io.reader.BaseSingleColumnSingleValueReader in project pinot by linkedin.
the class ForwardIndexReaderBenchmark method singleValuedReadBenchMarkV1.
public static void singleValuedReadBenchMarkV1(File file, int numDocs, int columnSizeInBits) throws Exception {
boolean signed = false;
boolean isMmap = false;
PinotDataBuffer heapBuffer = PinotDataBuffer.fromFile(file, ReadMode.heap, FileChannel.MapMode.READ_ONLY, "benchmark");
BaseSingleColumnSingleValueReader reader = new com.linkedin.pinot.core.io.reader.impl.v1.FixedBitSingleValueReader(heapBuffer, numDocs, columnSizeInBits, signed);
// sequential read
long start, end;
DescriptiveStatistics stats = new DescriptiveStatistics();
for (int run = 0; run < MAX_RUNS; run++) {
start = System.currentTimeMillis();
for (int i = 0; i < numDocs; i++) {
int value = reader.getInt(i);
}
end = System.currentTimeMillis();
stats.addValue(end - start);
}
System.out.println(" v1 sequential read stats for " + file.getName());
System.out.println(stats.toString().replaceAll("\n", ", ") + " raw:" + Arrays.toString(stats.getValues()));
reader.close();
heapBuffer.close();
}
Aggregations