Package org.elasticsearch.persistent
Class PersistentTasksCustomMetaData
java.lang.Object
org.elasticsearch.cluster.AbstractNamedDiffable<MetaData.Custom>
org.elasticsearch.persistent.PersistentTasksCustomMetaData
- All Implemented Interfaces:
ClusterState.FeatureAware,Diffable<MetaData.Custom>,MetaData.Custom,NamedDiffable<MetaData.Custom>,NamedWriteable,VersionedNamedWriteable,Writeable,ToXContent,ToXContentFragment
public final class PersistentTasksCustomMetaData extends AbstractNamedDiffable<MetaData.Custom> implements MetaData.Custom
A cluster state record that contains a list of all running persistent tasks
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPersistentTasksCustomMetaData.Assignmentstatic classPersistentTasksCustomMetaData.Builderstatic classPersistentTasksCustomMetaData.PersistentTask<P extends PersistentTaskParams>A record that represents a single running persistent taskNested classes/interfaces inherited from interface org.elasticsearch.common.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
Fields Modifier and Type Field Description static ConstructingObjectParser<PersistentTasksCustomMetaData.Assignment,java.lang.Void>ASSIGNMENT_PARSERstatic PersistentTasksCustomMetaData.AssignmentINITIAL_ASSIGNMENTstatic java.lang.StringTYPE -
Constructor Summary
Constructors Constructor Description PersistentTasksCustomMetaData(long lastAllocationId, java.util.Map<java.lang.String,PersistentTasksCustomMetaData.PersistentTask<?>> tasks)PersistentTasksCustomMetaData(StreamInput in) -
Method Summary
Methods inherited from class org.elasticsearch.cluster.AbstractNamedDiffable
diff, get, readDiffFromMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.cluster.ClusterState.FeatureAware
getRequiredFeature
-
Field Details
-
TYPE
public static final java.lang.String TYPE- See Also:
- Constant Field Values
-
ASSIGNMENT_PARSER
public static final ConstructingObjectParser<PersistentTasksCustomMetaData.Assignment,java.lang.Void> ASSIGNMENT_PARSER -
INITIAL_ASSIGNMENT
-
-
Constructor Details
-
PersistentTasksCustomMetaData
public PersistentTasksCustomMetaData(long lastAllocationId, java.util.Map<java.lang.String,PersistentTasksCustomMetaData.PersistentTask<?>> tasks) -
PersistentTasksCustomMetaData
- Throws:
java.io.IOException
-
-
Method Details
-
getPersistentTasksCustomMetaData
public static PersistentTasksCustomMetaData getPersistentTasksCustomMetaData(ClusterState clusterState) -
tasks
-
taskMap
-
getTask
-
findTasks
public java.util.Collection<PersistentTasksCustomMetaData.PersistentTask<?>> findTasks(java.lang.String taskName, java.util.function.Predicate<PersistentTasksCustomMetaData.PersistentTask<?>> predicate) -
equals
public boolean equals(java.lang.Object o)- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
getNumberOfTasksOnNode
public long getNumberOfTasksOnNode(java.lang.String nodeId, java.lang.String taskName) -
getMinimalSupportedVersion
Description copied from interface:VersionedNamedWriteableThe minimal version of the recipient this object can be sent to- Specified by:
getMinimalSupportedVersionin interfaceVersionedNamedWriteable
-
context
- Specified by:
contextin interfaceMetaData.Custom
-
fromXContent
-
getTaskWithId
public static <Params extends PersistentTaskParams> PersistentTasksCustomMetaData.PersistentTask<Params> getTaskWithId(ClusterState clusterState, java.lang.String taskId) -
disassociateDeadNodes
Unassign any persistent tasks executing on nodes that are no longer in the cluster. If the task's assigment has a non-null executor node and that node is no longer in the cluster then the assignment is set toLOST_NODE_ASSIGNMENT- Parameters:
clusterState- The clusterstate- Returns:
- If no changes the argument
clusterStateis returned else a copy with the modified tasks
-
getWriteableName
public java.lang.String getWriteableName()Description copied from interface:VersionedNamedWriteableReturns the name of the writeable object- Specified by:
getWriteableNamein interfaceNamedWriteable- Specified by:
getWriteableNamein interfaceVersionedNamedWriteable
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput. -
readDiffFrom
- Throws:
java.io.IOException
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException- Specified by:
toXContentin interfaceToXContent- Throws:
java.io.IOException
-
builder
-
builder
-