use of io.pravega.segmentstore.storage.chunklayer.SnapshotInfo in project pravega by pravega.
the class StreamSegmentContainer method saveStorageSnapshot.
private CompletableFuture<Void> saveStorageSnapshot(SnapshotInfo checkpoint, Duration timeout) {
TimeoutTimer timer = new TimeoutTimer(timeout);
val attributeUpdates = AttributeUpdateCollection.from(new AttributeUpdate(ATTRIBUTE_SLTS_LATEST_SNAPSHOT_ID, AttributeUpdateType.Replace, checkpoint.getSnapshotId()), new AttributeUpdate(ATTRIBUTE_SLTS_LATEST_SNAPSHOT_EPOCH, AttributeUpdateType.Replace, checkpoint.getEpoch()));
return this.metadataStore.getOrAssignSegmentId(NameUtils.getMetadataSegmentName(this.metadata.getContainerId()), timer.getRemaining(), streamSegmentId -> updateAttributesForSegment(streamSegmentId, attributeUpdates, timer.getRemaining())).thenRun(() -> log.debug("{}: Save SLTS snapshot. {}", this.traceObjectId, checkpoint));
}
Aggregations