Skip to content

Commit

Permalink
Ser/de changes
Browse files Browse the repository at this point in the history
Signed-off-by: Bukhtawar Khan <bukhtawa@amazon.com>
  • Loading branch information
Bukhtawar committed Oct 11, 2023
1 parent c9688ee commit 55586c5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,11 @@ public NodeStats(StreamInput in) throws IOException {
} else {
searchPipelineStats = null;
}
if (in.getVersion().onOrAfter(Version.V_3_0_0)) {
repositoriesStats = in.readOptionalWriteable(RepositoriesStats::new);
} else {
repositoriesStats = null;
}
}

public NodeStats(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package org.opensearch.repositories;

import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
import org.opensearch.core.common.io.stream.Writeable;
import org.opensearch.core.common.util.CollectionUtils;
Expand All @@ -24,10 +25,14 @@ public class RepositoriesStats implements Writeable, ToXContentObject {

List<RepositoryStatsSnapshot> repositoryStatsSnapshots;

RepositoriesStats(List<RepositoryStatsSnapshot> repositoryStatsSnapshots) {
public RepositoriesStats(List<RepositoryStatsSnapshot> repositoryStatsSnapshots) {
this.repositoryStatsSnapshots = repositoryStatsSnapshots;
}

public RepositoriesStats(StreamInput in) throws IOException {
this.repositoryStatsSnapshots = in.readList(RepositoryStatsSnapshot::new);
}

@Override
public void writeTo(StreamOutput out) throws IOException {
out.writeList(repositoryStatsSnapshots);
Expand Down

0 comments on commit 55586c5

Please sign in to comment.