From b32ddde156cc4afa533946c5a33485de53747585 Mon Sep 17 00:00:00 2001 From: Shivansh Arora Date: Thu, 4 Jul 2024 09:32:44 +0530 Subject: [PATCH] remove changes already added in another PR Signed-off-by: Shivansh Arora --- .../main/java/org/opensearch/cluster/metadata/Metadata.java | 5 ----- .../opensearch/gateway/remote/RemoteClusterStateService.java | 2 -- 2 files changed, 7 deletions(-) diff --git a/server/src/main/java/org/opensearch/cluster/metadata/Metadata.java b/server/src/main/java/org/opensearch/cluster/metadata/Metadata.java index b37945c4418b8..e3f63b1c27b83 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/Metadata.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/Metadata.java @@ -1286,11 +1286,6 @@ public Builder templates(Map templates) { return this; } - public Builder removeAllTemplates() { - templates.clear(); - return this; - } - public Builder templates(TemplatesMetadata templatesMetadata) { this.templates.clear(); this.templates.putAll(templatesMetadata.getTemplates()); diff --git a/server/src/main/java/org/opensearch/gateway/remote/RemoteClusterStateService.java b/server/src/main/java/org/opensearch/gateway/remote/RemoteClusterStateService.java index 8c0918a132139..3e63f9114ea16 100644 --- a/server/src/main/java/org/opensearch/gateway/remote/RemoteClusterStateService.java +++ b/server/src/main/java/org/opensearch/gateway/remote/RemoteClusterStateService.java @@ -1234,8 +1234,6 @@ ClusterState readClusterStateInParallel( metadataBuilder.transientSettings((Settings) remoteReadResult.getObj()); break; case TEMPLATES_METADATA: - // we need to remove the older templates, as the templates will be refreshed from remote file - metadataBuilder.removeAllTemplates(); metadataBuilder.templates((TemplatesMetadata) remoteReadResult.getObj()); break; case HASHES_OF_CONSISTENT_SETTINGS: