Module org.elasticsearch.xcore
Class DateHistogramGroupConfig
java.lang.Object
org.elasticsearch.xpack.core.rollup.job.DateHistogramGroupConfig
- All Implemented Interfaces:
Writeable,org.elasticsearch.xcontent.ToXContent,org.elasticsearch.xcontent.ToXContentObject
- Direct Known Subclasses:
DateHistogramGroupConfig.CalendarInterval,DateHistogramGroupConfig.FixedInterval
public abstract class DateHistogramGroupConfig
extends Object
implements Writeable, org.elasticsearch.xcontent.ToXContentObject
The configuration object for the histograms in the rollup config
{
"groups": [
"date_histogram": {
"field" : "foo",
"interval" : "1d",
"delay": "30d",
"time_zone" : "EST"
}
]
}
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCalendarInterval is aDateHistogramGroupConfigthat uses calendar-aware intervals for rolling up data.static classFixedInterval is aDateHistogramGroupConfigthat uses a fixed time interval for rolling up data.Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
org.elasticsearch.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.xcontent.ToXContent.MapParams, org.elasticsearch.xcontent.ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final ZoneIdstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDateHistogramGroupConfig(String field, DateHistogramInterval interval, DateHistogramInterval delay, String timeZone) Create a newDateHistogramGroupConfigusing the given configuration parameters.protected -
Method Summary
Modifier and TypeMethodDescriptionCreate the rounding for this date histogrambooleanstatic DateHistogramGroupConfigfromXContent(org.elasticsearch.xcontent.XContentParser parser) getDelay()Get the time delay for this histogramgetField()Get the date fieldGet the date intervalGet the timezone to applyinthashCode()toString()org.elasticsearch.xcontent.XContentBuildertoXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) voidvalidateMappings(Map<String, Map<String, FieldCapabilities>> fieldCapsResponse, ActionRequestValidationException validationException) voidwriteTo(StreamOutput out) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Field Details
-
INTERVAL
- See Also:
-
FIXED_INTERVAL
- See Also:
-
CALENDAR_INTERVAL
- See Also:
-
TIME_ZONE
- See Also:
-
DELAY
- See Also:
-
DEFAULT_ZONEID_TIMEZONE
-
-
Constructor Details
-
DateHistogramGroupConfig
protected DateHistogramGroupConfig(String field, DateHistogramInterval interval, @Nullable DateHistogramInterval delay, @Nullable String timeZone) Create a newDateHistogramGroupConfigusing the given configuration parameters.The
fieldandintervalare required to compute the date histogram for the rolled up documents. Thedelayis optional and can be set tonull. It defines how long to wait before rolling up new documents. ThetimeZoneis optional and can be set tonull. When configured, the time zone value is resolved using (ZoneId.of(String)and must match a time zone identifier.- Parameters:
field- the name of the date field to use for the date histogram (required)interval- the interval to use for the date histogram (required)delay- the time delay (optional)timeZone- the id of time zone to use to calculate the date histogram (optional). Whennull, the UTC timezone is used.- Since:
- 7.2.0
-
DateHistogramGroupConfig
- Throws:
IOException
-
-
Method Details
-
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
toXContent
public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceorg.elasticsearch.xcontent.ToXContent- Throws:
IOException
-
getField
Get the date field -
getInterval
Get the date interval -
getDelay
Get the time delay for this histogram -
getTimeZone
Get the timezone to apply -
createRounding
Create the rounding for this date histogram -
getIntervalTypeName
-
validateMappings
public void validateMappings(Map<String, Map<String, FieldCapabilities>> fieldCapsResponse, ActionRequestValidationException validationException) -
equals
-
hashCode
public int hashCode() -
toString
-
fromXContent
public static DateHistogramGroupConfig fromXContent(org.elasticsearch.xcontent.XContentParser parser) throws IOException - Throws:
IOException
-