public static void writeToThin(IndexShardRoutingTable indexShard, StreamOutput out)
        throws IOException {
      out.writeVInt(indexShard.shardId.id());
      out.writeBoolean(indexShard.primaryAllocatedPostApi());

      out.writeVInt(indexShard.shards.size());
      for (ShardRouting entry : indexShard) {
        entry.writeToThin(out);
      }
    }
 public Builder(IndexShardRoutingTable indexShard) {
   this.shardId = indexShard.shardId;
   this.shards = newArrayList(indexShard.shards);
   this.primaryAllocatedPostApi = indexShard.primaryAllocatedPostApi();
 }