Skip to content

Commit

Permalink
Refactor util method
Browse files Browse the repository at this point in the history
Signed-off-by: Aman Khare <amkhar@amazon.com>
  • Loading branch information
Aman Khare committed May 9, 2023
1 parent 78db6b0 commit 41c475e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ private void handleValidateJoinRequest(
ClusterState incomingState;
try {
if (in.readBoolean()) {
incomingState = CompressionHelper.deserializeFullClusterState(in, transportService);
incomingState = CompressionHelper.deserializeFullClusterState(in, transportService.getLocalNode());
runJoinValidators(currentStateSupplier, incomingState, joinValidators);
} else {
logger.error("validate new node join request requires full cluster state");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ private PublishWithJoinResponse handleIncomingPublishRequest(BytesTransportReque
ClusterState incomingState;
try {
if (in.readBoolean()) {
incomingState = CompressionHelper.deserializeFullClusterState(in, transportService);
incomingState = CompressionHelper.deserializeFullClusterState(in, transportService.getLocalNode());
fullClusterStateReceivedCount.incrementAndGet();
logger.debug("received full cluster state version [{}] with size [{}]", incomingState.version(), request.bytes().length());
final PublishWithJoinResponse response = acceptState(incomingState);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ public static StreamInput decompressClusterState(BytesTransportRequest request,
return in;
}

public static ClusterState deserializeFullClusterState(StreamInput in, TransportService transportService) throws IOException {
public static ClusterState deserializeFullClusterState(StreamInput in, DiscoveryNode localNode) throws IOException {
final ClusterState incomingState;
try (StreamInput input = in) {
incomingState = ClusterState.readFrom(input, transportService.getLocalNode());
incomingState = ClusterState.readFrom(input, localNode);
} catch (Exception e) {
logger.warn("unexpected error while deserializing an incoming cluster state", e);
throw e;
Expand Down

0 comments on commit 41c475e

Please sign in to comment.