-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Consolidate RetrieveSegmentsToReplaceAction into RetrieveUsedSegmentsAction #15699
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
Merged
AmatyaAvadhanula
merged 11 commits into
apache:master
from
AmatyaAvadhanula:replace_retrieve_segments_action
Jan 29, 2024
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
37c8a43
Verify action segmentListUsed with retrieveSegmentsToReplace
AmatyaAvadhanula 80fc872
Consolidate RetrieveSegmentsToReplaceAction into RetrieveUsedSegments…
AmatyaAvadhanula 9a048cc
Clean up unneeded config
AmatyaAvadhanula 50a1a5d
Fix compilation
AmatyaAvadhanula 71e2e40
Merge remote-tracking branch 'upstream/master' into replace_retrieve_…
AmatyaAvadhanula d079367
Address feedback
AmatyaAvadhanula 369f0fd
Revert accidental change
AmatyaAvadhanula e78bf51
Address feedback
AmatyaAvadhanula e75c831
Fix concurrent tests
AmatyaAvadhanula 09ab5a0
Try to fix MSQ tests
AmatyaAvadhanula 7da3183
Merge remote-tracking branch 'upstream/master' into replace_retrieve_…
AmatyaAvadhanula File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -69,7 +69,7 @@ | |||||||||||||||
| import org.apache.druid.indexing.common.actions.LockListAction; | ||||||||||||||||
| import org.apache.druid.indexing.common.actions.LockReleaseAction; | ||||||||||||||||
| import org.apache.druid.indexing.common.actions.MarkSegmentsAsUnusedAction; | ||||||||||||||||
| import org.apache.druid.indexing.common.actions.RetrieveSegmentsToReplaceAction; | ||||||||||||||||
| import org.apache.druid.indexing.common.actions.RetrieveUsedSegmentsAction; | ||||||||||||||||
| import org.apache.druid.indexing.common.actions.SegmentAllocateAction; | ||||||||||||||||
| import org.apache.druid.indexing.common.actions.SegmentTransactionalAppendAction; | ||||||||||||||||
| import org.apache.druid.indexing.common.actions.SegmentTransactionalInsertAction; | ||||||||||||||||
|
|
@@ -1233,10 +1233,15 @@ private DataSegmentTimelineView makeDataSegmentTimelineView() | |||||||||||||||
| // any segment created after the lock was acquired for its interval will not be considered. | ||||||||||||||||
| final Collection<DataSegment> publishedUsedSegments; | ||||||||||||||||
| try { | ||||||||||||||||
| publishedUsedSegments = context.taskActionClient().submit(new RetrieveSegmentsToReplaceAction( | ||||||||||||||||
| dataSource, | ||||||||||||||||
| intervals | ||||||||||||||||
| )); | ||||||||||||||||
| // Additional check as the task action does not accept empty intervals | ||||||||||||||||
| if (intervals.isEmpty()) { | ||||||||||||||||
| publishedUsedSegments = Collections.emptySet(); | ||||||||||||||||
| } else { | ||||||||||||||||
| publishedUsedSegments = context.taskActionClient().submit(new RetrieveUsedSegmentsAction( | ||||||||||||||||
| dataSource, | ||||||||||||||||
| intervals | ||||||||||||||||
| )); | ||||||||||||||||
|
Comment on lines
+1240
to
+1243
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style:
Suggested change
|
||||||||||||||||
| } | ||||||||||||||||
| } | ||||||||||||||||
| catch (IOException e) { | ||||||||||||||||
| throw new MSQException(e, UnknownFault.forException(e)); | ||||||||||||||||
|
|
||||||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think this comment is really needed or accurate. The real reason we are not firing a task action if the intervals is empty because we know we would get back an empty result. Why perform an unnecessary round trip?