From b42912f89d5a5bcfafde356446cde7a148ea6f47 Mon Sep 17 00:00:00 2001 From: Shourya Dutta Biswas <114977491+shourya035@users.noreply.github.com> Date: Thu, 6 Jul 2023 18:55:58 +0530 Subject: [PATCH] Excluding stats publishing on non-remote store indices Signed-off-by: Shourya Dutta Biswas <114977491+shourya035@users.noreply.github.com> --- .../main/java/org/opensearch/index/shard/IndexShard.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/main/java/org/opensearch/index/shard/IndexShard.java b/server/src/main/java/org/opensearch/index/shard/IndexShard.java index 1b590f7f01468..721e2f49e8ee3 100644 --- a/server/src/main/java/org/opensearch/index/shard/IndexShard.java +++ b/server/src/main/java/org/opensearch/index/shard/IndexShard.java @@ -4816,7 +4816,7 @@ private boolean localDirectoryContains(Directory localDirectory, String file, lo } private void beforeSegmentDownload(RemoteRefreshSegmentTracker downloadStatsTracker, long incomingFileSize) { - if (!isRemoteStoreEnabled()) { + if (!indexSettings.isRemoteStoreEnabled()) { return; } downloadStatsTracker.incrementTotalDownloadsStarted(); @@ -4828,7 +4828,7 @@ private void afterSegmentDownloadCompleted( long downloadedFileSize, long startTimeInNs ) { - if (!isRemoteStoreEnabled()) { + if (!indexSettings.isRemoteStoreEnabled()) { return; } long currentTimeInNs = System.nanoTime(); @@ -4842,7 +4842,7 @@ private void afterSegmentDownloadCompleted( } private void afterSegmentDownloadFailed(RemoteRefreshSegmentTracker downloadStatsTracker, long failedFileSize) { - if (!isRemoteStoreEnabled()) { + if (!indexSettings.isRemoteStoreEnabled()) { return; } downloadStatsTracker.incrementTotalDownloadsFailed();