public static StreamTruncationRecord complete ( StreamTruncationRecord toComplete ) { Preconditions . checkState ( toComplete . updating ) ; ImmutableSet . Builder < Long > builder = ImmutableSet . builder ( ) ; builder . addAll ( toComplete . deletedSegments ) ; builder . addAll ( toComplete . toDelete ) ; return StreamTruncationRecord . builder ( ) . updating ( false ) . span ( toComplete . span ) . streamCut ( toComplete . streamCut ) . deletedSegments ( builder . build ( ) ) . toDelete ( ImmutableSet . of ( ) ) . sizeTill ( toComplete . sizeTill ) . build ( ) ; }
Method to complete a given ongoing truncation record by setting updating flag to false and merging toDelete in deletedSegments .