Skip to content

Commit

Permalink
[CELEBORN-1066] Skip looping streamimg sets in numShuffleSteams of Ch…
Browse files Browse the repository at this point in the history
…unkStreamManager

### What changes were proposed in this pull request?

- Minor improvement in `ChunkStreamManager.numShuffleSteams`, by replacing `.flatMap(Set::stream).count()` to `.mapToLong(Set::size).sum()`

### Why are the changes needed?

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

CI tests.

Closes apache#2013 from bowenliang123/numShuffleSteams.

Authored-by: liangbowen <[email protected]>
Signed-off-by: zky.zhoukeyong <[email protected]>
  • Loading branch information
bowenliang123 authored and waitinfuture committed Oct 22, 2023
1 parent 789dd35 commit ef412d5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,6 @@ public int numStreamStates() {

@VisibleForTesting
public long numShuffleSteams() {
return shuffleStreamIds.values().stream().flatMap(Set::stream).count();
return shuffleStreamIds.values().stream().mapToLong(Set::size).sum();
}
}

0 comments on commit ef412d5

Please sign in to comment.