Module org.elasticsearch.xcore
Class JobTaskState
java.lang.Object
org.elasticsearch.xpack.core.ml.job.config.JobTaskState
- All Implemented Interfaces:
NamedWriteable,Writeable,PersistentTaskState,org.elasticsearch.xcontent.ToXContent,org.elasticsearch.xcontent.ToXContentObject,MlTaskState
-
Nested Class Summary
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
FieldsFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionJobTaskState(JobState state, long allocationId, String reason, Instant lastStateChangeTime) -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic JobTaskStatefromXContent(org.elasticsearch.xcontent.XContentParser parser) longThe time of the last state change.getState()inthashCode()booleanisFailed()booleanThe job state stores the allocation ID at the time it was last set.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
-
NAME
- See Also:
-
-
Constructor Details
-
JobTaskState
-
JobTaskState
- Throws:
IOException
-
-
Method Details
-
fromXContent
-
getState
-
getAllocationId
public long getAllocationId() -
getReason
-
getLastStateChangeTime
Description copied from interface:MlTaskStateThe time of the last state change.- Specified by:
getLastStateChangeTimein interfaceMlTaskState
-
isFailed
public boolean isFailed()- Specified by:
isFailedin interfaceMlTaskState- Returns:
- Is the task in the
failedstate?
-
isStatusStale
The job state stores the allocation ID at the time it was last set. This method compares the allocation ID in the state with the allocation ID in the task. If the two are different then the task has been relocated to a different node after the last time the state was set. This in turn means that the state is not necessarily correct. For example, a job that has a state of OPENED but is stale must be considered to be OPENING, because it won't yet have a corresponding autodetect process.- Parameters:
task- The job task to check.- Returns:
- Has the task been relocated to another node and not had its status set since then?
-
getWriteableName
- Specified by:
getWriteableNamein interfaceNamedWriteable
-
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
-
equals
-
hashCode
public int hashCode()
-