Search in sources :

Example 1 with KvDynamicColumnsTable

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));
    }
}
Also used : KvDynamicColumnsTable(com.palantir.atlasdb.timelock.benchmarks.schema.generated.KvDynamicColumnsTable)

Example 2 with KvDynamicColumnsTable

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));
    });
}
Also used : KvDynamicColumnsTable(com.palantir.atlasdb.timelock.benchmarks.schema.generated.KvDynamicColumnsTable)

Example 3 with KvDynamicColumnsTable

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;
}
Also used : KvDynamicColumnsTable(com.palantir.atlasdb.timelock.benchmarks.schema.generated.KvDynamicColumnsTable) ColumnRangeSelection(com.palantir.atlasdb.keyvalue.api.ColumnRangeSelection)

Aggregations

KvDynamicColumnsTable (com.palantir.atlasdb.timelock.benchmarks.schema.generated.KvDynamicColumnsTable)3 ColumnRangeSelection (com.palantir.atlasdb.keyvalue.api.ColumnRangeSelection)1