use of io.pravega.controller.store.stream.tables.SealedSegmentsRecord in project pravega by pravega.
the class PersistentStreamBase method addSealedSegmentsToRecord.
private CompletableFuture<Void> addSealedSegmentsToRecord(Map<Integer, Long> sealedSegments) {
return getSealedSegmentsRecord().thenCompose(data -> {
SealedSegmentsRecord sealedSegmentsRecord = SerializationUtils.deserialize(data.getData());
Map<Integer, Long> map = new HashMap<>();
map.putAll(sealedSegments);
map.putAll(sealedSegmentsRecord.getSealedSegmentsSizeMap());
return updateSealedSegmentsRecord(new Data<>(SerializationUtils.serialize(new SealedSegmentsRecord(map)), data.getVersion()));
});
}
Aggregations