You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2020/06/18 09:34:46 UTC

[skywalking] 01/02: In no-init mode, should only check the index existence. (#4929)

This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch 8.0.1
in repository https://gitbox.apache.org/repos/asf/skywalking.git

commit 86ad68daa59ad181742aeba74a1564db1330e99e
Author: 吴晟 Wu Sheng <wu...@foxmail.com>
AuthorDate: Tue Jun 16 08:06:02 2020 +0800

    In no-init mode, should only check the index existence. (#4929)
---
 .../storage/plugin/elasticsearch/base/StorageEsInstaller.java | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/StorageEsInstaller.java b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/StorageEsInstaller.java
index 2a13160..143d095 100644
--- a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/StorageEsInstaller.java
+++ b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/StorageEsInstaller.java
@@ -53,11 +53,12 @@ public class StorageEsInstaller extends ModelInstaller {
     protected boolean isExists(Model model) throws StorageException {
         ElasticSearchClient esClient = (ElasticSearchClient) client;
         try {
-            String timeSeriesIndexName =
-                model.isTimeSeries() ?
-                    TimeSeriesUtils.latestWriteIndexName(model) :
-                    model.getName();
-            return esClient.isExistsTemplate(model.getName()) && esClient.isExistsIndex(timeSeriesIndexName);
+            if (model.isTimeSeries()) {
+                return esClient.isExistsTemplate(model.getName()) && esClient.isExistsIndex(
+                    TimeSeriesUtils.latestWriteIndexName(model));
+            } else {
+                return esClient.isExistsIndex(model.getName());
+            }
         } catch (IOException e) {
             throw new StorageException(e.getMessage());
         }