コード例 #1
0
 @Override
 public void readFrom(StreamInput in) throws IOException {
   super.readFrom(in);
   if (in.readBoolean()) {
     storeFilesMetaData = StoreFilesMetaData.readStoreFilesMetaData(in);
   }
 }
コード例 #2
0
 @Override
 public void writeTo(StreamOutput out) throws IOException {
   super.writeTo(out);
   if (storeFilesMetaData == null) {
     out.writeBoolean(false);
   } else {
     out.writeBoolean(true);
     storeFilesMetaData.writeTo(out);
   }
 }
コード例 #3
0
 @Override
 public void writeTo(StreamOutput out) throws IOException {
   super.writeTo(out);
   if (status != null) {
     out.writeVInt(status.size());
     for (Map.Entry<SnapshotId, Map<ShardId, SnapshotIndexShardStatus>> entry :
         status.entrySet()) {
       entry.getKey().writeTo(out);
       out.writeVInt(entry.getValue().size());
       for (Map.Entry<ShardId, SnapshotIndexShardStatus> shardEntry :
           entry.getValue().entrySet()) {
         shardEntry.getKey().writeTo(out);
         shardEntry.getValue().writeTo(out);
       }
     }
   } else {
     out.writeVInt(0);
   }
 }
コード例 #4
0
 @Override
 public void readFrom(StreamInput in) throws IOException {
   super.readFrom(in);
   int numberOfSnapshots = in.readVInt();
   Map<SnapshotId, Map<ShardId, SnapshotIndexShardStatus>> snapshotMapBuilder =
       new HashMap<>(numberOfSnapshots);
   for (int i = 0; i < numberOfSnapshots; i++) {
     SnapshotId snapshotId = SnapshotId.readSnapshotId(in);
     int numberOfShards = in.readVInt();
     Map<ShardId, SnapshotIndexShardStatus> shardMapBuilder = new HashMap<>(numberOfShards);
     for (int j = 0; j < numberOfShards; j++) {
       ShardId shardId = ShardId.readShardId(in);
       SnapshotIndexShardStatus status = SnapshotIndexShardStatus.readShardSnapshotStatus(in);
       shardMapBuilder.put(shardId, status);
     }
     snapshotMapBuilder.put(snapshotId, unmodifiableMap(shardMapBuilder));
   }
   status = unmodifiableMap(snapshotMapBuilder);
 }