public int numberOfShardsOfType(ShardRoutingState state) {
   int count = 0;
   for (RoutingNode routingNode : this) {
     count += routingNode.numberOfShardsWithState(state);
   }
   return count;
 }