@Override
 public void writeTo(StreamOutput out) throws IOException {
   super.writeTo(out);
   fromNode.writeTo(out);
   out.writeVInt(indices.length);
   for (IndexMetaData indexMetaData : indices) {
     indexMetaData.writeTo(out);
   }
 }
 public static void writeTo(DiscoveryNodes nodes, StreamOutput out) throws IOException {
   if (nodes.masterNodeId() == null) {
     out.writeBoolean(false);
   } else {
     out.writeBoolean(true);
     out.writeUTF(nodes.masterNodeId);
   }
   out.writeVInt(nodes.size());
   for (DiscoveryNode node : nodes) {
     node.writeTo(out);
   }
 }
 @Override
 public void writeTo(StreamOutput out) throws IOException {
   node.writeTo(out);
 }
 @Override
 public void writeTo(StreamOutput out) throws IOException {
   node.writeTo(out);
   out.writeBoolean(withClusterState);
 }