Module org.elasticsearch.server
Class BatchedRerouteService
java.lang.Object
org.elasticsearch.cluster.routing.BatchedRerouteService
- All Implemented Interfaces:
RerouteService
A
BatchedRerouteService is a RerouteService that batches together reroute requests to avoid unnecessary extra reroutes.
This component only does meaningful work on the elected master node. Reroute requests will fail with a NotMasterException on
other nodes.-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionBatchedRerouteService(ClusterService clusterService, BatchedRerouteService.RerouteAction reroute) -
Method Summary
Modifier and TypeMethodDescriptionfinal voidreroute(String reason, Priority priority, ActionListener<Void> listener) Initiates a reroute.
-
Constructor Details
-
BatchedRerouteService
public BatchedRerouteService(ClusterService clusterService, BatchedRerouteService.RerouteAction reroute) - Parameters:
reroute- Function that computes the updated cluster state after it has been rerouted.
-
-
Method Details
-
reroute
Initiates a reroute.- Specified by:
reroutein interfaceRerouteService- Parameters:
priority- the (minimum) priority at which to run this reroute. If there is already a pending reroute at a higher priority then this reroute is batched with the pending one; if there is already a pending reroute at a lower priority then the priority of the pending batch is raised to the given priority.
-