use of com.palantir.atlasdb.protos.generated.StreamPersistence.StreamMetadata.Builder in project atlasdb by palantir.
the class DataStreamStore method touchMetadataWhileStoringForConflicts.
private void touchMetadataWhileStoringForConflicts(Transaction t, Long id, long blockNumber) {
DataStreamMetadataTable metaTable = tables.getDataStreamMetadataTable(t);
DataStreamMetadataTable.DataStreamMetadataRow row = DataStreamMetadataTable.DataStreamMetadataRow.of(id);
StreamMetadata metadata = metaTable.getMetadatas(ImmutableSet.of(row)).values().iterator().next();
Preconditions.checkState(metadata.getStatus() == Status.STORING, "This stream is being cleaned up while storing blocks: %s", id);
Builder builder = StreamMetadata.newBuilder(metadata);
builder.setLength(blockNumber * BLOCK_SIZE_IN_BYTES + 1);
metaTable.putMetadata(row, builder.build());
}
use of com.palantir.atlasdb.protos.generated.StreamPersistence.StreamMetadata.Builder in project atlasdb by palantir.
the class StreamTestMaxMemStreamStore method touchMetadataWhileStoringForConflicts.
private void touchMetadataWhileStoringForConflicts(Transaction t, Long id, long blockNumber) {
StreamTestMaxMemStreamMetadataTable metaTable = tables.getStreamTestMaxMemStreamMetadataTable(t);
StreamTestMaxMemStreamMetadataTable.StreamTestMaxMemStreamMetadataRow row = StreamTestMaxMemStreamMetadataTable.StreamTestMaxMemStreamMetadataRow.of(id);
StreamMetadata metadata = metaTable.getMetadatas(ImmutableSet.of(row)).values().iterator().next();
Preconditions.checkState(metadata.getStatus() == Status.STORING, "This stream is being cleaned up while storing blocks: %s", id);
Builder builder = StreamMetadata.newBuilder(metadata);
builder.setLength(blockNumber * BLOCK_SIZE_IN_BYTES + 1);
metaTable.putMetadata(row, builder.build());
}
use of com.palantir.atlasdb.protos.generated.StreamPersistence.StreamMetadata.Builder in project atlasdb by palantir.
the class StreamTestStreamStore method touchMetadataWhileStoringForConflicts.
private void touchMetadataWhileStoringForConflicts(Transaction t, Long id, long blockNumber) {
StreamTestStreamMetadataTable metaTable = tables.getStreamTestStreamMetadataTable(t);
StreamTestStreamMetadataTable.StreamTestStreamMetadataRow row = StreamTestStreamMetadataTable.StreamTestStreamMetadataRow.of(id);
StreamMetadata metadata = metaTable.getMetadatas(ImmutableSet.of(row)).values().iterator().next();
Preconditions.checkState(metadata.getStatus() == Status.STORING, "This stream is being cleaned up while storing blocks: %s", id);
Builder builder = StreamMetadata.newBuilder(metadata);
builder.setLength(blockNumber * BLOCK_SIZE_IN_BYTES + 1);
metaTable.putMetadata(row, builder.build());
}
Aggregations