Module org.elasticsearch.xcore
Class DataDescription
java.lang.Object
org.elasticsearch.xpack.core.ml.job.config.DataDescription
- All Implemented Interfaces:
Writeable,org.elasticsearch.xcontent.ToXContent,org.elasticsearch.xcontent.ToXContentObject
public class DataDescription
extends Object
implements org.elasticsearch.xcontent.ToXContentObject, Writeable
Describes the format of the data used in the job and how it should
be interpreted by autodetect.
Data must either be in JSON or SMILE format (and only JSON is publicly documented).
The DataDescription.DataFormat enum is always set to XCONTENT. getTimeField()
is the name of the field containing the timestamp and getTimeFormat()
is the format code for the date string in as described by
DateTimeFormatter.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enumEnum of the acceptable data formats.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 org.elasticsearch.xcontent.ParseFieldstatic final StringBy default autodetect expects the timestamp in a field with this namestatic final StringSpecial time format string for epoch times (seconds)static final StringSpecial time format string for epoch times (milli-seconds)static final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ObjectParser<DataDescription.Builder, Void> static final org.elasticsearch.xcontent.ObjectParser<DataDescription.Builder, Void> static final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanOverridden equality testThe name of the field containing the timestampEither "epoch", "epoch_ms" or a SimpleDateTime format string.inthashCode()booleanReturn true if the time format is "epoch_ms"booleanReturn true if the time is in a format that needs transforming.org.elasticsearch.xcontent.XContentBuildertoXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) voidwriteTo(StreamOutput out) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Field Details
-
DATA_DESCRIPTION_FIELD
public static final org.elasticsearch.xcontent.ParseField DATA_DESCRIPTION_FIELD -
FORMAT_FIELD
public static final org.elasticsearch.xcontent.ParseField FORMAT_FIELD -
TIME_FIELD_NAME_FIELD
public static final org.elasticsearch.xcontent.ParseField TIME_FIELD_NAME_FIELD -
TIME_FORMAT_FIELD
public static final org.elasticsearch.xcontent.ParseField TIME_FORMAT_FIELD -
EPOCH
Special time format string for epoch times (seconds)- See Also:
-
EPOCH_MS
Special time format string for epoch times (milli-seconds)- See Also:
-
DEFAULT_TIME_FIELD
By default autodetect expects the timestamp in a field with this name- See Also:
-
LENIENT_PARSER
public static final org.elasticsearch.xcontent.ObjectParser<DataDescription.Builder,Void> LENIENT_PARSER -
STRICT_PARSER
public static final org.elasticsearch.xcontent.ObjectParser<DataDescription.Builder,Void> STRICT_PARSER
-
-
Constructor Details
-
DataDescription
-
DataDescription
- 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
-
getTimeField
The name of the field containing the timestamp- Returns:
- A String if set or
null
-
getTimeFormat
Either "epoch", "epoch_ms" or a SimpleDateTime format string. If not set (isnullor an empty string) or set to "epoch_ms" (the default) then the date is assumed to be in milliseconds from the epoch.- Returns:
- A String if set or
null
-
isTransformTime
public boolean isTransformTime()Return true if the time is in a format that needs transforming. Anytime format this isn't "epoch" ornullneeds transforming.- Returns:
- True if the time field needs to be transformed.
-
isEpochMs
public boolean isEpochMs()Return true if the time format is "epoch_ms"- Returns:
- True if the date is in milli-seconds since the epoch.
-
equals
Overridden equality test -
hashCode
public int hashCode()
-