@Override
 public void writeTo(StreamOutput out) throws IOException {
   super.writeTo(out);
   out.writeLong(recoveryId);
   shardId.writeTo(out);
   if (out.getVersion().onOrAfter(Version.V_1_5_0)) {
     snapshotFiles.writeTo(out);
   } else {
     out.writeVInt(snapshotFiles.size());
     for (StoreFileMetaData snapshotFile : snapshotFiles) {
       out.writeString(snapshotFile.name());
     }
   }
 }
 @Override
 public void writeTo(StreamOutput out) throws IOException {
   out.writeBoolean(allocated);
   shardId.writeTo(out);
   metadataSnapshot.writeTo(out);
 }