use of com.palantir.atlasdb.protos.generated.StreamPersistence.StreamMetadata.Builder in project atlasdb by palantir.
the class HotspottyDataStreamStore method touchMetadataWhileStoringForConflicts.
private void touchMetadataWhileStoringForConflicts(Transaction t, Long id, long blockNumber) {
HotspottyDataStreamMetadataTable metaTable = tables.getHotspottyDataStreamMetadataTable(t);
HotspottyDataStreamMetadataTable.HotspottyDataStreamMetadataRow row = HotspottyDataStreamMetadataTable.HotspottyDataStreamMetadataRow.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 TestHashComponentsStreamStore method touchMetadataWhileStoringForConflicts.
private void touchMetadataWhileStoringForConflicts(Transaction t, Long id, long blockNumber) {
TestHashComponentsStreamMetadataTable metaTable = tables.getTestHashComponentsStreamMetadataTable(t);
TestHashComponentsStreamMetadataTable.TestHashComponentsStreamMetadataRow row = TestHashComponentsStreamMetadataTable.TestHashComponentsStreamMetadataRow.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 StreamTestWithHashStreamStore method touchMetadataWhileStoringForConflicts.
private void touchMetadataWhileStoringForConflicts(Transaction t, Long id, long blockNumber) {
StreamTestWithHashStreamMetadataTable metaTable = tables.getStreamTestWithHashStreamMetadataTable(t);
StreamTestWithHashStreamMetadataTable.StreamTestWithHashStreamMetadataRow row = StreamTestWithHashStreamMetadataTable.StreamTestWithHashStreamMetadataRow.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 UserPhotosStreamStore method touchMetadataWhileStoringForConflicts.
private void touchMetadataWhileStoringForConflicts(Transaction t, Long id, long blockNumber) {
UserPhotosStreamMetadataTable metaTable = tables.getUserPhotosStreamMetadataTable(t);
UserPhotosStreamMetadataTable.UserPhotosStreamMetadataRow row = UserPhotosStreamMetadataTable.UserPhotosStreamMetadataRow.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 ValueStreamStore method touchMetadataWhileStoringForConflicts.
private void touchMetadataWhileStoringForConflicts(Transaction t, Long id, long blockNumber) {
ValueStreamMetadataTable metaTable = tables.getValueStreamMetadataTable(t);
ValueStreamMetadataTable.ValueStreamMetadataRow row = ValueStreamMetadataTable.ValueStreamMetadataRow.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: " + id);
Builder builder = StreamMetadata.newBuilder(metadata);
builder.setLength(blockNumber * BLOCK_SIZE_IN_BYTES + 1);
metaTable.putMetadata(row, builder.build());
}
Aggregations