use of com.palantir.atlasdb.keyvalue.cassandra.thrift.MutationMap in project atlasdb by palantir.
the class CassandraKeyValueServiceImpl method insertRangeTombstones.
private void insertRangeTombstones(CassandraClient client, Map<Cell, Long> maxTimestampExclusiveByCell, TableReference tableRef) throws TException {
MutationMap mutationMap = new MutationMap();
maxTimestampExclusiveByCell.forEach((cell, maxTimestampExclusive) -> {
Mutation mutation = Mutations.rangeTombstoneForColumn(cell.getColumnName(), maxTimestampExclusive);
mutationMap.addMutationForCell(cell, tableRef, mutation);
});
wrappingQueryRunner.batchMutate("deleteAllTimestamps", client, ImmutableSet.of(tableRef), mutationMap, deleteConsistency);
}
use of com.palantir.atlasdb.keyvalue.cassandra.thrift.MutationMap in project atlasdb by palantir.
the class CassandraKeyValueServiceImpl method convertToMutations.
private MutationMap convertToMutations(List<TableCellAndValue> batch, long timestamp) {
MutationMap mutationMap = new MutationMap();
for (TableCellAndValue tableCellAndValue : batch) {
Cell cell = tableCellAndValue.cell;
Column col = CassandraKeyValueServices.createColumn(cell, Value.create(tableCellAndValue.value, timestamp));
ColumnOrSuperColumn colOrSup = new ColumnOrSuperColumn();
colOrSup.setColumn(col);
Mutation mutation = new Mutation();
mutation.setColumn_or_supercolumn(colOrSup);
mutationMap.addMutationForCell(cell, tableCellAndValue.tableRef, mutation);
}
return mutationMap;
}
Aggregations