diff --git a/server/src/main/java/org/opensearch/cluster/coordination/JoinTaskExecutor.java b/server/src/main/java/org/opensearch/cluster/coordination/JoinTaskExecutor.java index db8e76e751463..d597b51c32ccd 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/JoinTaskExecutor.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/JoinTaskExecutor.java @@ -192,22 +192,22 @@ public ClusterTasksResult execute(ClusterState currentState, List jo .stream() .filter(DiscoveryNode::isRemoteStatePublicationEnabled) .findFirst(); - RepositoriesMetadata existingrepositoriesMetadata = currentState.getMetadata().custom(RepositoriesMetadata.TYPE); + RepositoriesMetadata existingRepositoriesMetadata = currentState.getMetadata().custom(RepositoriesMetadata.TYPE); Map repositories = new LinkedHashMap<>(); - if (existingrepositoriesMetadata != null) { - existingrepositoriesMetadata.repositories().forEach(r -> repositories.putIfAbsent(r.name(), r)); + if (existingRepositoriesMetadata != null) { + existingRepositoriesMetadata.repositories().forEach(r -> repositories.putIfAbsent(r.name(), r)); } if (remoteDN.isPresent()) { RepositoriesMetadata repositoriesMetadata = remoteStoreNodeService.updateRepositoriesMetadata( remoteDN.get(), - existingrepositoriesMetadata + existingRepositoriesMetadata ); repositoriesMetadata.repositories().forEach(r -> repositories.putIfAbsent(r.name(), r)); } if (remotePublicationDN.isPresent()) { RepositoriesMetadata repositoriesMetadata = remoteStoreNodeService.updateRepositoriesMetadata( remotePublicationDN.get(), - existingrepositoriesMetadata + existingRepositoriesMetadata ); repositoriesMetadata.repositories().forEach(r -> repositories.putIfAbsent(r.name(), r)); } @@ -246,7 +246,7 @@ public ClusterTasksResult execute(ClusterState currentState, List jo logger.info("Updating system repository now for remote store"); RepositoriesMetadata repositoriesMetadata = remoteStoreNodeService.updateRepositoriesMetadata( node, - existingrepositoriesMetadata + existingRepositoriesMetadata ); repositoriesMetadata.repositories().forEach(r -> repositories.putIfAbsent(r.name(), r)); }