public ListenableFuture < SegmentsAndMetadata > publishAll ( final TransactionalSegmentPublisher publisher ) { final Map < String , SegmentsForSequence > snapshot ; synchronized ( segments ) { snapshot = ImmutableMap . copyOf ( segments ) ; } return publishInBackground ( new SegmentsAndMetadata ( snapshot . values ( ) . stream ( ) . flatMap ( SegmentsForSequence :: allSegmentStateStream ) . map ( segmentWithState -> Preconditions . checkNotNull ( segmentWithState . getDataSegment ( ) , "dataSegment for segmentId[%s]" , segmentWithState . getSegmentIdentifier ( ) ) ) . collect ( Collectors . toList ( ) ) , null ) , publisher ) ; }
Publish all segments .