Class DataDescription
- java.lang.Object
-
- org.elasticsearch.client.ml.job.config.DataDescription
-
- All Implemented Interfaces:
ToXContent,ToXContentObject
public class DataDescription extends java.lang.Object implements 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 andgetTimeFormat()is the format code for the date string in as described byDateTimeFormatter.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDataDescription.Builderstatic classDataDescription.DataFormatEnum of the acceptable data formats.-
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
-
Field Summary
Fields Modifier and Type Field Description static charDEFAULT_DELIMITERThe default field delimiter expected by the native autodetect program.static charDEFAULT_QUOTE_CHARThe default quote character used to escape text in delimited data formatsstatic java.lang.StringDEFAULT_TIME_FIELDBy default autodetect expects the timestamp in a field with this namestatic java.lang.StringEPOCHSpecial time format string for epoch times (seconds)static java.lang.StringEPOCH_MSSpecial time format string for epoch times (milli-seconds)static ObjectParser<DataDescription.Builder,java.lang.Void>PARSER-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Constructor Description DataDescription(DataDescription.DataFormat dataFormat, java.lang.String timeFieldName, java.lang.String timeFormat, java.lang.Character fieldDelimiter, java.lang.Character quoteCharacter)
-
Method Summary
Modifier and Type Method Description booleanequals(java.lang.Object other)Overridden equality testjava.lang.CharactergetFieldDelimiter()If the data is in a delimited format with a header e.g.DataDescription.DataFormatgetFormat()The format of the data to be processed.java.lang.CharactergetQuoteCharacter()The quote character used in delimited formats.java.lang.StringgetTimeField()The name of the field containing the timestampjava.lang.StringgetTimeFormat()Either "epoch", "epoch_ms" or a SimpleDateTime format string.inthashCode()XContentBuildertoXContent(XContentBuilder builder, 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.common.xcontent.ToXContentObject
isFragment
-
-
-
-
Field Detail
-
EPOCH
public static final java.lang.String EPOCH
Special time format string for epoch times (seconds)- See Also:
- Constant Field Values
-
EPOCH_MS
public static final java.lang.String EPOCH_MS
Special time format string for epoch times (milli-seconds)- See Also:
- Constant Field Values
-
DEFAULT_TIME_FIELD
public static final java.lang.String DEFAULT_TIME_FIELD
By default autodetect expects the timestamp in a field with this name- See Also:
- Constant Field Values
-
DEFAULT_DELIMITER
public static final char DEFAULT_DELIMITER
The default field delimiter expected by the native autodetect program.- See Also:
- Constant Field Values
-
DEFAULT_QUOTE_CHAR
public static final char DEFAULT_QUOTE_CHAR
The default quote character used to escape text in delimited data formats- See Also:
- Constant Field Values
-
PARSER
public static final ObjectParser<DataDescription.Builder,java.lang.Void> PARSER
-
-
Constructor Detail
-
DataDescription
public DataDescription(DataDescription.DataFormat dataFormat, java.lang.String timeFieldName, java.lang.String timeFormat, java.lang.Character fieldDelimiter, java.lang.Character quoteCharacter)
-
-
Method Detail
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
- Specified by:
toXContentin interfaceToXContent- Throws:
java.io.IOException
-
getFormat
public DataDescription.DataFormat getFormat()
The format of the data to be processed. Defaults toDataDescription.DataFormat.XCONTENT- Returns:
- The data format
-
getTimeField
public java.lang.String getTimeField()
The name of the field containing the timestamp- Returns:
- A String if set or
null
-
getTimeFormat
public java.lang.String 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
-
getFieldDelimiter
public java.lang.Character 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 9.- Returns:
- A char
-
getQuoteCharacter
public java.lang.Character getQuoteCharacter()
The quote character used in delimited formats. The default value for delimited format is 34.- Returns:
- The delimited format quote character
-
equals
public boolean equals(java.lang.Object other)
Overridden equality test- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-