Class DataDescription
java.lang.Object
org.elasticsearch.client.ml.job.config.DataDescription
- All Implemented Interfaces:
org.elasticsearch.xcontent.ToXContent
,org.elasticsearch.xcontent.ToXContentObject
Describes the format of the data used in the job and how it should
be interpreted by the ML job.
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
Modifier and TypeClassDescriptionstatic class
static enum
Enum 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.Params
-
Field Summary
Modifier and TypeFieldDescriptionstatic final char
The default field delimiter expected by the native autodetect program.static final char
The default quote character used to escape text in delimited data formatsstatic final String
By default autodetect expects the timestamp in a field with this namestatic final String
Special time format string for epoch times (seconds)static final String
Special time format string for epoch times (milli-seconds)static final org.elasticsearch.xcontent.ObjectParser<DataDescription.Builder,
Void> Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
ConstructorDescriptionDataDescription
(DataDescription.DataFormat dataFormat, String timeFieldName, String timeFormat, Character fieldDelimiter, Character quoteCharacter) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Overridden equality testIf the data is in a delimited format with a header e.g.The format of the data to be processed.The quote character used in delimited formats.The name of the field containing the timestampEither "epoch", "epoch_ms" or a SimpleDateTime format string.int
hashCode()
org.elasticsearch.xcontent.XContentBuilder
toXContent
(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Field Details
-
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:
-
DEFAULT_DELIMITER
public static final char DEFAULT_DELIMITERThe default field delimiter expected by the native autodetect program.- See Also:
-
DEFAULT_QUOTE_CHAR
public static final char DEFAULT_QUOTE_CHARThe default quote character used to escape text in delimited data formats- See Also:
-
PARSER
-
-
Constructor Details
-
DataDescription
public DataDescription(DataDescription.DataFormat dataFormat, String timeFieldName, String timeFormat, Character fieldDelimiter, Character quoteCharacter)
-
-
Method Details
-
toXContent
public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException - Specified by:
toXContent
in interfaceorg.elasticsearch.xcontent.ToXContent
- Throws:
IOException
-
getFormat
The format of the data to be processed. Defaults toDataDescription.DataFormat.XCONTENT
- Returns:
- The data format
-
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 (isnull
or 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
-
getFieldDelimiter
If the data is in a delimited format with a header e.g. csv or tsv this is the delimiter character used. This is only applicable if getFormat() isDataDescription.DataFormat.DELIMITED
. The default value for delimited format is '\t'.- Returns:
- A char
-
getQuoteCharacter
The quote character used in delimited formats. The default value for delimited format is '\"'.- Returns:
- The delimited format quote character
-
equals
Overridden equality test -
hashCode
public int hashCode()
-