未验证 提交 d305efcb 编写于 作者: wu-sheng's avatar wu-sheng 提交者: GitHub

In no-init mode, should only check the index existence. (#4929)

上级 164124fc
......@@ -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());
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册