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 period drop before rule #6415

Merged
merged 4 commits into from
Oct 24, 2018
Merged

Add period drop before rule #6415

merged 4 commits into from
Oct 24, 2018

Conversation

QiuMM
Copy link
Member

@QiuMM QiuMM commented Oct 4, 2018

Add a new drop rule which has been discussed in #5869.

@drcrallen
Copy link
Contributor

Does the coordinator console need adjusted to account for this rule?

I haven't looked recently, but the coordinator has some hard-coded strings in its console

Copy link
Member

@nishantmonu51 nishantmonu51 left a comment

Choose a reason for hiding this comment

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

LGTM, i do not see any coordinator console changes, do you intend to do that in a separate PR ?

@QiuMM
Copy link
Member Author

QiuMM commented Oct 10, 2018

@nishantmonu51 thanks for your review, I'll add more commits to do that, and it seems I also need to open a PR in druid-console repo to make some corresponding adjustments.

@QiuMM
Copy link
Member Author

QiuMM commented Oct 10, 2018

BTW, why not embed the druid-console repo into druid as a module. It's inconvenient to maintain source code in a separate repo since I have to open two PR in two separate repo.

@QiuMM
Copy link
Member Author

QiuMM commented Oct 12, 2018

Have adjusted the coordinator console and tested it in a test cluster.

@@ -151,6 +155,10 @@ function makeDropByPeriod(rule) {
return "<span class='rule_label'>period</span><input type='text' name='period' " + "value='" + rule.period + "'/>";
}

function makeDropBeforeByPeriod(rule) {
return "<span class='rule_label'>period</span><input type='text' name='period' " + "value='" + rule.period + "'/>";
Copy link
Contributor

Choose a reason for hiding this comment

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

would it make sense to put something more descriptive so it is clear this period is different than the one above it?

Copy link
Member Author

@QiuMM QiuMM Oct 18, 2018

Choose a reason for hiding this comment

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

This period is a property of dropBeforeByPeriod rule which representing ISO-8601 Periods, they are distinguished by the rule's name. Below is the UI:

lark20181018-111919

I think there is no need to change this period to something others.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok. Sounds good.

* `type` - this should always be "dropBeforeByPeriod"
* `period` - A JSON Object representing ISO-8601 Periods

The interval of a segment will be compared against the specified period. The period is from some time in the past to the current time. The rule matches if the interval before the period. If you just want to retain recent data, you can use this rule to drop the old data that before a specified period.
Copy link
Contributor

Choose a reason for hiding this comment

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

Just so I'm clear, this is an alternative to doing a load by period followed by a drop forever?

Is this intended to be used in cases where the default load rule is generally used, but you want to configure the maximum age on a per-datasource basis? If so can that be added to the docs?

Copy link
Contributor

Choose a reason for hiding this comment

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

I get the situation now (from the issue description). Form this description it is not clear what scenarios it is desired to use this rule, can either a link to the issue or more detail on when this is appropriate be added here?

Copy link
Contributor

Choose a reason for hiding this comment

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

If you just want to retain recent data, you can use this rule to drop the old data that before a specified period.

Hmm @drcrallen do you think the quote is not enough to explain the desired use case of this rule? Would you please elaborate more on what details you want? Maybe it's better to add like this rule is effectively dropForever + loadByPeriod (includeFuture = true)?

Copy link
Member Author

@QiuMM QiuMM Oct 18, 2018

Choose a reason for hiding this comment

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

Maybe like below

If you just want to retain recent data, you can use this rule to drop the old data that 
before a specified period and add a loadForever rule to follow it. 
Notes, dropBeforeByPeriod + loadForever is equivalent to loadByPeriod(includeFuture = true) + dropForever

?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good to me.

@jihoonson
Copy link
Contributor

The latest change looks good to me. @drcrallen do you have more comments?

@QiuMM
Copy link
Member Author

QiuMM commented Oct 24, 2018

@jihoonson @drcrallen if there are no more comments, I think it can be merged now. Then I'll update #6414 and finally open a PR in druid-console to support #6414 and #6415.

@jihoonson jihoonson added this to the 0.13.1 milestone Oct 24, 2018
@jihoonson jihoonson merged commit 601183b into apache:master Oct 24, 2018
@jihoonson
Copy link
Contributor

@QiuMM merged. Thanks!

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

Successfully merging this pull request may close these issues.

4 participants