Skip to content

Deprecate Aggregator#getName()#3387

Closed
navis wants to merge 2 commits intoapache:masterfrom
navis:deprecate-aggregator-getname
Closed

Deprecate Aggregator#getName()#3387
navis wants to merge 2 commits intoapache:masterfrom
navis:deprecate-aggregator-getname

Conversation

@navis
Copy link
Copy Markdown
Contributor

@navis navis commented Aug 23, 2016

It's not necessary but occupies memory (a string reference, about 4~8 byte). This makes substantial difference on batch ingestion time (we are using 1000+ metric).

@navis navis force-pushed the deprecate-aggregator-getname branch from 80c5614 to d382d32 Compare August 23, 2016 01:00
// "aggregate" can throw ParseExceptions if a selector expects something but gets something else.
if (reportParseExceptions) {
throw new ParseException(e, "Encountered parse error for aggregator[%s]", agg.getName());
throw new ParseException(e, "Encountered parse error for aggregator[%s]", k);
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.

is k defined?

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.

yep. String k = aggFactory.getName()

@fjy
Copy link
Copy Markdown
Contributor

fjy commented Aug 23, 2016

@navis how much of a difference does this make to memory usage or batch ingestion time for your metrics in real world use case?

@navis
Copy link
Copy Markdown
Contributor Author

navis commented Aug 23, 2016

@fjy In the worst case, 1 min changed to 10 min (with full GC on every 10 seconds). We can just change max row count for incremental index but this was easier and effective.

@fjy
Copy link
Copy Markdown
Contributor

fjy commented Aug 23, 2016

@navis wow that's a big difference, cool

@nishantmonu51
Copy link
Copy Markdown
Member

will it cause compilation errors for people who have implemented their custom aggregators ?
I wonder if it will be worth marking the method as deprecated in interface instead of removing it, throwing ISE from the impl of standard aggregators indicating this method should not be used and actually removing it in the next major version of druid.
@fjy @gianm @drcrallen Any thoughts ?

@navis
Copy link
Copy Markdown
Contributor Author

navis commented Aug 25, 2016

@nishantmonu51 agree on your thoughts. actually, we are using "null-returning" version rather than removing the method. would I change like that?

@nishantmonu51
Copy link
Copy Markdown
Member

Null returning sounds good

@fjy
Copy link
Copy Markdown
Contributor

fjy commented Aug 29, 2016

@navis @nishantmonu51 marking it as deprecated and throwing an exception in the standard aggs sgtm. I prefer throwing an exception with a clear error message.

@gianm
Copy link
Copy Markdown
Contributor

gianm commented Oct 15, 2016

@navis @fjy @nishantmonu51 reworked & submitted #3572 with a couple changes: (a) deprecated instead of removed the function; (b) deprecated AggregatorFactory.getAggregatorStartValue as well. Gonna close this one since that one addresses the comments so far.

thanks @navis for the original patch!

@gianm gianm closed this Oct 15, 2016
seoeun25 pushed a commit to seoeun25/incubator-druid that referenced this pull request Feb 25, 2022
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