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

Added pre and post offset to histogram aggregation #6980

Closed
wants to merge 0 commits into from

Conversation

Projects
None yet
3 participants
@colings86
Copy link
Member

colings86 commented Jul 23, 2014

Added preOffset and postOffset parameters to the API for the histogram aggregation which work in the same way as in the date histogram

Closes #6605

@colings86 colings86 added the review label Jul 23, 2014

@jpountz

View changes

src/main/java/org/elasticsearch/common/rounding/Rounding.java Outdated
@@ -127,6 +127,59 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeVLong(interval);
}
}

public static class PrePostIntervalRounding extends TimeZoneRounding {

This comment has been minimized.

Copy link
@jpountz

jpountz Jul 23, 2014

Contributor

This looks very similar to PrePostTimeZoneRounding. Do you think we can reuse it?

This comment has been minimized.

Copy link
@colings86

colings86 Jul 24, 2014

Author Member

So I tried doing that and creating a PrePostRounding which extended Rounding, but TimeZoneRounding.Builder expects everything thats returned to be an instance of TimeZoneRounding so would mean changing FactorTimeZoneRounding to accept a Rounding delegate and change the build() method to return Rounding instead of TimeZoneRounding. Not sure if that makes things too messy?

This comment has been minimized.

Copy link
@jpountz

jpountz Jul 24, 2014

Contributor

TimeZoneRounding.Builder expects everything thats returned to be an instance of TimeZoneRounding

TimeZoneRounding doesn't add anything on top of Rounding so I think it's ok to return/expect Rounding instances here.

@jpountz jpountz removed the review label Jul 24, 2014

@jpountz

This comment has been minimized.

Copy link
Contributor

jpountz commented Jul 24, 2014

LGTM

@jpountz jpountz removed the review label Jul 24, 2014

@colings86

This comment has been minimized.

Copy link
Member Author

colings86 commented Jul 24, 2014

pushed to master and 1.x

@colings86 colings86 closed this Jul 24, 2014

@colings86 colings86 self-assigned this Aug 21, 2014

@colings86 colings86 deleted the colings86:feature/histogramOffsets branch Aug 21, 2014

@clintongormley clintongormley changed the title Aggregations: Added pre and post offset to histogram aggregation Added pre and post offset to histogram aggregation Jun 6, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.