use of com.palantir.atlasdb.timelock.benchmarks.schema.generated.KvDynamicColumnsTable in project atlasdb by palantir.
the class TransactionWriteDynamicColumnsBenchmark method writeValues.
@Override
protected void writeValues(Transaction txn, List<byte[]> values) {
String bucket = UUID.randomUUID().toString();
KvDynamicColumnsTable table = tableFactory.getKvDynamicColumnsTable(txn);
long id = 1;
for (byte[] value : values) {
table.put(KvDynamicColumnsRow.of(bucket), KvDynamicColumnsColumnValue.of(KvDynamicColumnsColumn.of(id++), value));
}
}
use of com.palantir.atlasdb.timelock.benchmarks.schema.generated.KvDynamicColumnsTable in project atlasdb by palantir.
the class RangeScanDynamicColumnsBenchmark method writeValues.
@Override
protected void writeValues(Transaction txn, Map<Long, byte[]> valuesByKey) {
KvDynamicColumnsTable table = BenchmarksTableFactory.of().getKvDynamicColumnsTable(txn);
valuesByKey.forEach((key, value) -> {
table.put(KvDynamicColumnsRow.of(bucket), KvDynamicColumnsColumnValue.of(KvDynamicColumnsColumn.of(key), value));
});
}
use of com.palantir.atlasdb.timelock.benchmarks.schema.generated.KvDynamicColumnsTable in project atlasdb by palantir.
the class RangeScanDynamicColumnsBenchmark method getRange.
@Override
protected List<byte[]> getRange(Transaction txn, long startInclusive, long endExclusive) {
KvDynamicColumnsTable table = BenchmarksTableFactory.of().getKvDynamicColumnsTable(txn);
List<byte[]> data = Lists.newArrayList();
table.getRowsColumnRange(ImmutableSet.of(KvDynamicColumnsRow.of(bucket)), new ColumnRangeSelection(KvDynamicColumnsColumn.of(startInclusive).persistToBytes(), KvDynamicColumnsColumn.of(endExclusive).persistToBytes()), batchSize).forEachRemaining(entry -> data.add(entry.getValue().getValue()));
return data;
}
Aggregations