[Bugfix]分批从ES查询Topic最近一条指标(#817)

This commit is contained in:
zengqiao
2022-12-07 16:09:54 +08:00
committed by EricZeng
parent d9c59cb3d3
commit f3c4133cd2
5 changed files with 45 additions and 19 deletions

View File

@@ -150,8 +150,7 @@ public class ESOpClient {
}
public <T> List<T> performRequest(String indexName, String queryDsl, Class<T> clzz) {
ESQueryResponse esQueryResponse = doQuery(
new ESQueryRequest().indices(indexName).source(queryDsl).clazz(clzz));
ESQueryResponse esQueryResponse = this.doQuery(new ESQueryRequest().indices(indexName).source(queryDsl).clazz(clzz));
if (esQueryResponse == null) {
return new ArrayList<>();
}
@@ -447,8 +446,13 @@ public class ESOpClient {
return response;
} catch (Exception e) {
LOGGER.error( "method=doQuery||indexName={}||queryDsl={}||errMsg=query error. ",
request.indices(), bytesReferenceConvertDsl(request.source()), e);
LOGGER.error(
"method=doQuery||indexName={}||queryDsl={}||errMsg=query error. ",
request.indices(),
bytesReferenceConvertDsl(request.source()),
e
);
return null;
}
}