CompletableFuture < Void > updateSegmentInfo ( SegmentMetadata segmentMetadata , Duration timeout ) { if ( segmentMetadata . isMerged ( ) ) { return Futures . failedFuture ( new StreamSegmentMergedException ( segmentMetadata . getName ( ) ) ) ; } else if ( segmentMetadata . isDeleted ( ) ) { return Futures . failedFuture ( new StreamSegmentNotExistsException ( segmentMetadata . getName ( ) ) ) ; } ArrayView toWrite = SegmentInfo . serialize ( new SegmentInfo ( segmentMetadata . getId ( ) , segmentMetadata . getSnapshot ( ) ) ) ; return updateSegmentInfo ( segmentMetadata . getName ( ) , toWrite , timeout ) ; }
Updates information about a Segment .