Skip to content

Commit

Permalink
write shard size only
Browse files Browse the repository at this point in the history
Signed-off-by: Himshikha Gupta <[email protected]>
  • Loading branch information
Himshikha Gupta committed Aug 23, 2024
1 parent 7d0a231 commit 089fc21
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ private static class CompleteDiff<T extends Diffable<T>> implements Diff<T> {
this.part = part;
}

@Override
public String toString() {
return "CompleteDiff{" +
"part=" + part +
'}';
}

/**
* Creates simple diff without changes
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ public void writeToSorted(StreamOutput out) throws IOException {
shards.values().stream().sorted(Comparator.comparing(IndexShardRoutingTable::getShardId)).forEach(indexShard ->
{
try {
IndexShardRoutingTable.Builder.writeToThin(indexShard, out);
IndexShardRoutingTable.Builder.writeSize(indexShard, out);
} catch (IOException e) {
throw new RuntimeException(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,10 @@ public static void writeToThin(IndexShardRoutingTable indexShard, StreamOutput o
}
}

public static void writeSize(IndexShardRoutingTable indexShard, StreamOutput out) throws IOException {
out.writeVInt(indexShard.shardId.id());
out.writeVInt(indexShard.shards.size());
}
}

@Override
Expand Down

0 comments on commit 089fc21

Please sign in to comment.