Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize used segment fetching in Kill tasks #15107

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,14 @@ public TaskStatus runTask(TaskToolbox toolbox) throws Exception
// Fetch the load specs of all segments overlapping with the given interval
final Set<Map<String, Object>> usedSegmentLoadSpecs = toolbox
.getTaskActionClient()
.submit(new RetrieveUsedSegmentsAction(getDataSource(), getInterval(), null, Segments.INCLUDING_OVERSHADOWED))
.submit(new RetrieveUsedSegmentsAction(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Format: would be easier to read if the unused intervals were pre-constructed and the constructor was moved to a new line.

Suggested change
.submit(new RetrieveUsedSegmentsAction(
.submit(
new RetrieveUsedSegmentsAction(getDataSource(), null, unusedIntervals, Segments.INCLUDING_OVERSHADOWED)
)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

getDataSource(),
null,
unusedSegments.stream()
.map(DataSegment::getInterval)
.collect(Collectors.toSet()),
Segments.INCLUDING_OVERSHADOWED)
)
.stream()
.map(DataSegment::getLoadSpec)
.collect(Collectors.toSet());
Expand Down
Loading