fix es deprecated method (#499)

pull/502/head
maxisvest 2 years ago committed by GitHub
parent 6a029ef74c
commit 7b7df9aa3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -30,7 +30,7 @@ import lombok.extern.slf4j.Slf4j;
import org.elasticsearch.action.admin.indices.alias.Alias; import org.elasticsearch.action.admin.indices.alias.Alias;
import org.elasticsearch.action.admin.indices.create.CreateIndexRequest; import org.elasticsearch.action.admin.indices.create.CreateIndexRequest;
import org.elasticsearch.action.admin.indices.create.CreateIndexResponse; import org.elasticsearch.action.admin.indices.create.CreateIndexResponse;
import org.elasticsearch.action.admin.indices.get.GetIndexRequest; import org.elasticsearch.client.indices.GetIndexRequest;
import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.action.index.IndexResponse; import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.client.RequestOptions; import org.elasticsearch.client.RequestOptions;
@ -100,8 +100,7 @@ public class EsMonitorHandler extends AbstractDynamicThreadPoolMonitor {
// cache check result // cache check result
if (Objects.isNull(isIndexExist)) { if (Objects.isNull(isIndexExist)) {
boolean exists = false; boolean exists = false;
GetIndexRequest request = new GetIndexRequest(); GetIndexRequest request = new GetIndexRequest(index);
request.indices(index);
try { try {
RestHighLevelClient client = EsClientHolder.getClient(); RestHighLevelClient client = EsClientHolder.getClient();
exists = client.indices().exists(request, RequestOptions.DEFAULT); exists = client.indices().exists(request, RequestOptions.DEFAULT);

Loading…
Cancel
Save