Skip to content

Add support for a configurable default segment history period for segmentMetadata queries#1726

Closed
jon-wei wants to merge 1 commit intoapache:masterfrom
jon-wei:segmentmeta
Closed

Add support for a configurable default segment history period for segmentMetadata queries#1726
jon-wei wants to merge 1 commit intoapache:masterfrom
jon-wei:segmentmeta

Conversation

@jon-wei
Copy link
Copy Markdown
Contributor

@jon-wei jon-wei commented Sep 12, 2015

Allows segmentMetadata queries to use a default interval if none is specified.

The default interval spans a configurable time period before the end time of the most recent segment.

The length of this time period can be set using ISO8601 format in the broker configuration via:
druid.query.segmentMetadata.defaultSegmentHistoryPeriod

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You could read this in directly as a Period and skip the parsing later

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

maybe the default should be 1 week to be consistent with the ClientInfoResource

@jon-wei jon-wei force-pushed the segmentmeta branch 3 times, most recently from 76020bb to 402956c Compare September 12, 2015 03:48
Copy link
Copy Markdown
Member

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 make this a generic configuration also used by the broker as default interval for returning dimensions and metrics?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I believe the broker currently also hardcodes one week as well, so it would be nice to make it a common config for both to be consistent, since those two are kind of related.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That sounds reasonable, I can change the GET /datasource/* handling to use the common configuration.

Do you think druid.query.segmentMetadata.defaultSegmentHistoryPeriod is a good path/name for the shared config?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

maybe we can shorten the name a bit? maybe druid.query.segmentMetadata.defaultHistory ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@xvrl name changed to druid.query.segmentMetadata.defaultHistory

@jon-wei jon-wei force-pushed the segmentmeta branch 2 times, most recently from 010867d to d908777 Compare September 14, 2015 23:38
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

needs JsonProperty annotation

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please include a serde test too.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this will confuse guice- can the broker start up with this change?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ok, it can start up, but it will use DateTime.now forever and ever once it does start up. It would be better to make getCurrentTime() protected and override it in the tests.

…mentMetadata queries and GET /datasources/<datasourceName> lookups
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.

5 participants