use of com.palantir.common.persist.Persistable in project atlasdb by palantir.
the class StreamingTable method storeStreamForRow.
private Long storeStreamForRow(byte[] data, String rowName) {
StreamTestTableFactory tableFactory = StreamTestTableFactory.of();
ValueStreamStore streamTestStreamStore = ValueStreamStore.of(getTransactionManager(), tableFactory);
final Long streamId = streamTestStreamStore.storeStream(new ByteArrayInputStream(data)).getLhSide();
getTransactionManager().runTaskThrowOnConflict(txn -> {
KeyValueTable table = tableFactory.getKeyValueTable(txn);
KeyValueTable.KeyValueRow row = KeyValueTable.KeyValueRow.of(rowName);
KeyValueTable.StreamId id = KeyValueTable.StreamId.of(streamId);
Multimap<Persistable, ColumnValue<?>> rows = ImmutableMultimap.of(row, id);
txn.put(table.getTableRef(), ColumnValues.toCellValues(rows));
return null;
});
return streamId;
}
Aggregations