Module org.elasticsearch.xcore
Class DataDescription
java.lang.Object
org.elasticsearch.xpack.core.ml.job.config.DataDescription
- All Implemented Interfaces:
Writeable,ToXContent,ToXContentObject
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
ToXContent.DelegatingMapParams, ToXContent.MapParams, 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 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 ParseFieldstatic final ObjectParser<DataDescription.Builder, Void> static final ObjectParser<DataDescription.Builder, Void> static final ParseFieldstatic final 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.toXContent(XContentBuilder builder, 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
-
FORMAT_FIELD
-
TIME_FIELD_NAME_FIELD
-
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
-
STRICT_PARSER
-
-
Constructor Details
-
DataDescription
-
DataDescription
- Throws:
IOException
-
-
Method Details
-
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceToXContent- 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()
-