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

Add SameIntervalMergeTask for easier usage of MergeTask #3981

Merged
merged 3 commits into from
Mar 6, 2017

Conversation

kaijianding
Copy link
Contributor

We generate several small segments each hour in realtime node, and want to merge all yesterday"s segments to only 1 segment.
MergeTask needs DataSegment list to be provided, which is painful in actual use.

@gianm
Copy link
Contributor

gianm commented Mar 1, 2017

@kaijianding, this generally looks good to me. Could you include a test, ideally one for behavior and one for serde of the task itself?

@kaijianding
Copy link
Contributor Author

ut added, @gianm

Copy link
Contributor

@gianm gianm left a comment

Choose a reason for hiding this comment

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

👍 LGTM, thanks @kaijianding

@JsonSubTypes.Type(name = "convert_segment_sub", value = ConvertSegmentTask.SubTask.class)
@JsonSubTypes.Type(name = "convert_segment_sub", value = ConvertSegmentTask.SubTask.class),
@JsonSubTypes.Type(name = "same_interval_merge", value = SameIntervalMergeTask.class),
@JsonSubTypes.Type(name = "same_interval_merge_sub", value = SameIntervalMergeTask.SubTask.class)
Copy link
Contributor

Choose a reason for hiding this comment

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

why is SubTask needed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After test, I verified it is not need here, I removed it from here and also remove other not needed code.

@gianm
Copy link
Contributor

gianm commented Mar 3, 2017

still 👍 after latest changes. thanks for identifying and removing the unneeded code.

@himanshug
Copy link
Contributor

@kaijianding you removed overriding of isReady(..) as well ... i thought it was good because segment list is automatically figured out so no need to fetch segment list again and match as is done in MergeTaskBase.isReady(..) ?

@kaijianding
Copy link
Contributor Author

SubTask.run() is called directly inside SameIntervalMergeTask.run() after SameIntervalMergeTask.isReady() called.
In this way, I think SubTask is not submitted to task queue, so the isReady is not going to be called, that's why I removed isReady from SubTask. @himanshug

@himanshug himanshug added this to the 0.10.1 milestone Mar 6, 2017
@himanshug
Copy link
Contributor

@kaijianding yeah, its fine then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants