Remove unused routing for ClusterState creation utils (#57679)

Remove some unused routing definitions from cluster state creation utils.
This commit is contained in:
Howard 2020-06-05 01:50:05 +08:00 committed by Nhat Nguyen
parent 8afd55ebe6
commit 76ee1aad4b
1 changed files with 0 additions and 10 deletions

View File

@ -99,8 +99,6 @@ public class ClusterStateCreationUtils {
.put(SETTING_CREATION_DATE, System.currentTimeMillis())).primaryTerm(0, primaryTerm)
.build();
RoutingTable.Builder routing = new RoutingTable.Builder();
routing.addAsNew(indexMetadata);
IndexShardRoutingTable.Builder indexShardRoutingBuilder = new IndexShardRoutingTable.Builder(shardId);
String primaryNode = null;
@ -179,9 +177,6 @@ public class ClusterStateCreationUtils {
.put(SETTING_NUMBER_OF_SHARDS, numberOfPrimaries).put(SETTING_NUMBER_OF_REPLICAS, 0)
.put(SETTING_CREATION_DATE, System.currentTimeMillis())).build();
RoutingTable.Builder routing = new RoutingTable.Builder();
routing.addAsNew(indexMetadata);
IndexRoutingTable.Builder indexRoutingTable = IndexRoutingTable.builder(indexMetadata.getIndex());
for (int i = 0; i < numberOfPrimaries; i++) {
ShardId shardId = new ShardId(indexMetadata.getIndex(), i);
@ -225,9 +220,6 @@ public class ClusterStateCreationUtils {
.put(SETTING_NUMBER_OF_SHARDS, numberOfPrimaries).put(SETTING_NUMBER_OF_REPLICAS, 0)
.put(SETTING_CREATION_DATE, System.currentTimeMillis())).build();
RoutingTable.Builder routing = new RoutingTable.Builder();
routing.addAsNew(indexMetadata);
IndexRoutingTable.Builder indexRoutingTable = IndexRoutingTable.builder(indexMetadata.getIndex());
for (int i = 0; i < numberOfPrimaries; i++) {
ShardId shardId = new ShardId(indexMetadata.getIndex(), i);
@ -272,8 +264,6 @@ public class ClusterStateCreationUtils {
state.metadata(Metadata.builder().put(indexMetadata, false).generateClusterUuidIfNeeded());
IndexRoutingTable.Builder indexRoutingTableBuilder = IndexRoutingTable.builder(indexMetadata.getIndex());
for (int i = 0; i < numberOfShards; i++) {
RoutingTable.Builder routing = new RoutingTable.Builder();
routing.addAsNew(indexMetadata);
final ShardId shardId = new ShardId(index, "_na_", i);
IndexShardRoutingTable.Builder indexShardRoutingBuilder = new IndexShardRoutingTable.Builder(shardId);
indexShardRoutingBuilder.addShard(TestShardRouting.newShardRouting(index, i, newNode(0).getId(), null, true,