Class GlobalRoutingTableTestHelper
java.lang.Object
org.elasticsearch.cluster.routing.GlobalRoutingTableTestHelper
-
Method Summary
Modifier and TypeMethodDescriptionstatic GlobalRoutingTablebuildRoutingTable(Metadata metadata, BiConsumer<RoutingTable.Builder, IndexMetadata> indexConsumer) Construct a newGlobalRoutingTablebased on all the projects and indices inmetadata.static GlobalRoutingTableroutingTable(ProjectId projectId, IndexRoutingTable... indexRouting) static GlobalRoutingTableroutingTable(ProjectId projectId, RoutingTable projectRouting) static GlobalRoutingTableroutingTable(ProjectId projectId, RoutingTable.Builder projectRouting) static GlobalRoutingTableupdateRoutingTable(ClusterState clusterState, BiConsumer<RoutingTable.Builder, IndexMetadata> newIndicesConsumer) Update the existingGlobalRoutingTablestatic GlobalRoutingTableupdateRoutingTable(ClusterState clusterState, BiConsumer<RoutingTable.Builder, IndexMetadata> newIndicesConsumer, BiConsumer<RoutingTable.Builder, IndexMetadata> updateIndicesConsumer) Update the existingGlobalRoutingTable
-
Method Details
-
buildRoutingTable
public static GlobalRoutingTable buildRoutingTable(Metadata metadata, BiConsumer<RoutingTable.Builder, IndexMetadata> indexConsumer) Construct a newGlobalRoutingTablebased on all the projects and indices inmetadata. Each index is passed to theindexConsumeralong with a builder for that project's routing table -
updateRoutingTable
public static GlobalRoutingTable updateRoutingTable(ClusterState clusterState, BiConsumer<RoutingTable.Builder, IndexMetadata> newIndicesConsumer) Update the existingGlobalRoutingTable- Parameters:
newIndicesConsumer- Called for indices that do not exist in the routing table
-
updateRoutingTable
public static GlobalRoutingTable updateRoutingTable(ClusterState clusterState, BiConsumer<RoutingTable.Builder, IndexMetadata> newIndicesConsumer, BiConsumer<RoutingTable.Builder, IndexMetadata> updateIndicesConsumer) Update the existingGlobalRoutingTable- Parameters:
newIndicesConsumer- Called for indices that do not exist in the routing tableupdateIndicesConsumer- Called for indices that already exist in the routing table
-
routingTable
public static GlobalRoutingTable routingTable(ProjectId projectId, RoutingTable.Builder projectRouting) -
routingTable
-
routingTable
public static GlobalRoutingTable routingTable(ProjectId projectId, IndexRoutingTable... indexRouting)
-