Package org.elasticsearch.cluster
Interface ClusterStateTaskConfig
- All Known Implementing Classes:
AckedClusterStateUpdateTask
,ClusterStateTaskConfig.Basic
,ClusterStateUpdateTask
,MigrationResultsUpdateTask
,SystemIndexMetadataUpgradeService.SystemIndexMetadataUpdateTask
public interface ClusterStateTaskConfig
Cluster state update task configuration for timeout and priority
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ClusterStateTaskConfig
Build a cluster state update task configuration with the specifiedPriority
and no timeout.static ClusterStateTaskConfig
Build a cluster state update task configuration with the specifiedPriority
and timeout.priority()
ThePriority
for this cluster state update task configuration.org.elasticsearch.core.TimeValue
timeout()
The timeout for this cluster state update task configuration.
-
Method Details
-
timeout
@Nullable org.elasticsearch.core.TimeValue timeout()The timeout for this cluster state update task configuration. If the cluster state update task isn't processed within this timeout, the associatedClusterStateTaskListener.onFailure(Exception)
is invoked. Tasks arising from client requests should have a timeout which clients can adjust via the?master_timeout
query parameter, and typically defaults to30s
. In contrast, internal tasks can reasonably have an infinite timeout, especially if a timeout would simply trigger a retry.- Returns:
- the timeout, or null if one is not set
-
priority
Priority priority()ThePriority
for this cluster state update task configuration. Avoid priorites other thanPriority.NORMAL
where possible. A stream of higher-priority tasks can starve lower-priority ones from running. Higher-priority tasks should definitely share aClusterStateTaskExecutor
instance so that they are executed in batches.- Returns:
- the priority
-
build
Build a cluster state update task configuration with the specifiedPriority
and no timeout.- Parameters:
priority
- the priority for the associated cluster state update task- Returns:
- the resulting cluster state update task configuration
-
build
Build a cluster state update task configuration with the specifiedPriority
and timeout.- Parameters:
priority
- the priority for the associated cluster state update tasktimeout
- the timeout for the associated cluster state update task- Returns:
- the result cluster state update task configuration
-