Class BatchedRerouteService
- java.lang.Object
-
- org.elasticsearch.cluster.routing.BatchedRerouteService
-
- All Implemented Interfaces:
RerouteService
public class BatchedRerouteService extends java.lang.Object implements RerouteService
ABatchedRerouteService
is aRerouteService
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 aNotMasterException
on other nodes.
-
-
Constructor Summary
Constructors Constructor Description BatchedRerouteService(ClusterService clusterService, java.util.function.BiFunction<ClusterState,java.lang.String,ClusterState> reroute)
-
Method Summary
Modifier and Type Method Description void
reroute(java.lang.String reason, ActionListener<java.lang.Void> listener)
Initiates a reroute.
-
-
-
Constructor Detail
-
BatchedRerouteService
public BatchedRerouteService(ClusterService clusterService, java.util.function.BiFunction<ClusterState,java.lang.String,ClusterState> reroute)
- Parameters:
reroute
- Function that computes the updated cluster state after it has been rerouted.
-
-
Method Detail
-
reroute
public final void reroute(java.lang.String reason, ActionListener<java.lang.Void> listener)
Initiates a reroute.- Specified by:
reroute
in interfaceRerouteService
-
-