Package org.elasticsearch.persistent
Class PersistentTasksCustomMetadata
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
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.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 ClassesModifier and TypeClassDescriptionstatic class
static class
static class
A record that represents a single running persistent taskNested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic org.elasticsearch.common.xcontent.ConstructingObjectParser<>
static
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
ConstructorsConstructorDescriptionPersistentTasksCustomMetadata(long lastAllocationId, <,PersistentTasksCustomMetadata.PersistentTask<?>> tasks)
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
builder(PersistentTasksCustomMetadata tasks)
context()
static ClusterState
disassociateDeadNodes(ClusterState clusterState)
Unassign any persistent tasks executing on nodes that are no longer in the cluster.boolean
o)
taskName, <PersistentTasksCustomMetadata.PersistentTask<?>> predicate)
fromXContent(org.elasticsearch.common.xcontent.XContentParser parser)
The minimal version of the recipient this object can be sent tolong
nodeId, taskName)
getPersistentTasksCustomMetadata(ClusterState clusterState)
id)
static <Params extends PersistentTaskParams>
PersistentTasksCustomMetadata.PersistentTask<Params>getTaskWithId(ClusterState clusterState, taskId)
Returns the name of the writeable objectint
hashCode()
static NamedDiff<Metadata.Custom>
readDiffFrom(StreamInput in)
taskMap()
tasks()
toString()
org.elasticsearch.common.xcontent.XContentBuilder
toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
void
writeTo(StreamOutput out)
Write this into the StreamOutput.Methods inherited from class org.elasticsearch.cluster.AbstractNamedDiffable
diff, get, readDiffFrom
Methods inherited from class java.lang.
, , , , , , ,
Methods inherited from interface org.elasticsearch.cluster.ClusterState.FeatureAware
getRequiredFeature
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
Field Details
-
TYPE
public static final TYPE- See Also:
- Constant Field Values
-
ASSIGNMENT_PARSER
public static final org.elasticsearch.common.xcontent.ConstructingObjectParser<> ASSIGNMENT_PARSER -
INITIAL_ASSIGNMENT
-
-
Constructor Details
-
PersistentTasksCustomMetadata
public PersistentTasksCustomMetadata(long lastAllocationId, <,PersistentTasksCustomMetadata.PersistentTask<?>> tasks) -
PersistentTasksCustomMetadata
- Throws:
-
-
Method Details
-
getPersistentTasksCustomMetadata
public static PersistentTasksCustomMetadata getPersistentTasksCustomMetadata(ClusterState clusterState) -
tasks
-
taskMap
-
getTask
public id) -
findTasks
public < taskName, <PersistentTasksCustomMetadata.PersistentTask<?>> predicate) -
equals
public boolean equals( o)- Overrides:
in class
-
hashCode
public int hashCode()- Overrides:
in class
-
toString
public toString()- Overrides:
in class
-
getNumberOfTasksOnNode
public long getNumberOfTasksOnNode( nodeId, taskName) -
getMinimalSupportedVersion
Description copied from interface:VersionedNamedWriteable
The minimal version of the recipient this object can be sent to- Specified by:
getMinimalSupportedVersion
in interfaceVersionedNamedWriteable
-
context
- Specified by:
context
in interfaceMetadata.Custom
-
fromXContent
public static PersistentTasksCustomMetadata fromXContent(org.elasticsearch.common.xcontent.XContentParser parser) -
getTaskWithId
public static <Params extends PersistentTaskParams> PersistentTasksCustomMetadata.PersistentTask<Params> getTaskWithId(ClusterState clusterState, 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
clusterState
is returned else a copy with the modified tasks
-
getWriteableName
public getWriteableName()Description copied from interface:VersionedNamedWriteable
Returns the name of the writeable object- Specified by:
getWriteableName
in interfaceNamedWriteable
- Specified by:
getWriteableName
in interfaceVersionedNamedWriteable
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput. -
readDiffFrom
- Throws:
-
toXContent
public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws- Specified by:
toXContent
in interfaceorg.elasticsearch.common.xcontent.ToXContent
- Throws:
-
builder
-
builder
-