Пример #1
0
 public List<MutableShardRouting> shardsWithState(ShardRoutingState... state) {
   List<MutableShardRouting> shards = newArrayList();
   for (RoutingNode routingNode : this) {
     shards.addAll(routingNode.shardsWithState(state));
   }
   return shards;
 }
Пример #2
0
 public int numberOfShardsOfType(ShardRoutingState state) {
   int count = 0;
   for (RoutingNode routingNode : this) {
     count += routingNode.numberOfShardsWithState(state);
   }
   return count;
 }
Пример #3
0
 public String prettyPrint() {
   StringBuilder sb = new StringBuilder("routing_nodes:\n");
   for (RoutingNode routingNode : this) {
     sb.append(routingNode.prettyPrint());
   }
   sb.append("---- unassigned\n");
   for (MutableShardRouting shardEntry : unassigned) {
     sb.append("--------").append(shardEntry.shortSummary()).append('\n');
   }
   return sb.toString();
 }