public class DelayedAllocationService extends AbstractLifecycleComponent implements ClusterStateListener
DelayedAllocationService
listens to cluster state changes and checks
if there are unassigned shards with delayed allocation (unassigned shards that have
the delay marker). These are shards that have become unassigned due to a node leaving
and which were assigned the delay marker based on the index delay setting
UnassignedInfo.INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING
(see AllocationService.deassociateDeadNodes(RoutingAllocation)
).
This class is responsible for choosing the next (closest) delay expiration of a
delayed shard to schedule a reroute to remove the delay marker.
The actual removal of the delay marker happens in
AllocationService.removeDelayMarkers(RoutingAllocation)
, triggering yet
another cluster change event.lifecycle
deprecationLogger, logger, settings
Constructor and Description |
---|
DelayedAllocationService(Settings settings,
ThreadPool threadPool,
ClusterService clusterService,
AllocationService allocationService) |
Modifier and Type | Method and Description |
---|---|
protected void |
assertClusterStateThread() |
void |
clusterChanged(ClusterChangedEvent event)
Called when cluster state changes.
|
protected long |
currentNanoTime()
override this to control time based decisions during delayed allocation
|
protected void |
doClose() |
protected void |
doStart() |
protected void |
doStop() |
addLifecycleListener, close, lifecycleState, removeLifecycleListener, start, stop
logDeprecatedSetting, logRemovedSetting, nodeName
@Inject public DelayedAllocationService(Settings settings, ThreadPool threadPool, ClusterService clusterService, AllocationService allocationService)
protected void doStart()
doStart
in class AbstractLifecycleComponent
protected void doStop()
doStop
in class AbstractLifecycleComponent
protected void doClose()
doClose
in class AbstractLifecycleComponent
protected long currentNanoTime()
public void clusterChanged(ClusterChangedEvent event)
ClusterStateListener
clusterChanged
in interface ClusterStateListener
protected void assertClusterStateThread()