Search in sources :

Example 1 with SealedSegmentsRecord

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()));
    });
}
Also used : SealedSegmentsRecord(io.pravega.controller.store.stream.tables.SealedSegmentsRecord) HashMap(java.util.HashMap)

Aggregations

SealedSegmentsRecord (io.pravega.controller.store.stream.tables.SealedSegmentsRecord)1 HashMap (java.util.HashMap)1