In no-init mode, should only check the index existence. (#4929)
This commit is contained in:
parent
164124fc22
commit
d305efcb52
|
|
@ -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());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue