Skip to content

Commit

Permalink
Issue 2644: Remove duplicative logic of fetching offsets for a stream…
Browse files Browse the repository at this point in the history
… head. (pravega#2892)

* Remove duplicate logic of fetching offsets for a Stream Head.

Signed-off-by: Sandeep <[email protected]>
  • Loading branch information
shrids authored and shiveshr committed Sep 6, 2018
1 parent f8d7d1e commit 95fbdd5
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,7 @@ private StreamSegmentsIterator listSegments(final Stream stream, final Optional<
private CompletableFuture<StreamCut> fetchHeadStreamCut(final Stream stream) {
//Fetch segments pointing to the current HEAD of the stream.
return controller.getSegmentsAtTime(new StreamImpl(stream.getScope(), stream.getStreamName()), 0L)
.thenApply( s -> {
//fetch the correct start offset from Segment store.
Map<Segment, Long> pos = s.keySet().stream().map(this::segmentToInfo)
.collect(Collectors.toMap(SegmentInfo::getSegment, SegmentInfo::getStartingOffset));
return new StreamCutImpl(stream, pos);
});
.thenApply( s -> new StreamCutImpl(stream, s));
}

private CompletableFuture<StreamCut> fetchTailStreamCut(final Stream stream) {
Expand Down

0 comments on commit 95fbdd5

Please sign in to comment.