Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions fe/src/main/java/org/apache/doris/external/EsRestClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,22 @@ public String getIndexMetaData(String indexName) {

/**
* execute request for specific path
*
* @param path the path must not leading with '/'
* @return
*/
private String execute(String path) {
selectNextNode();
boolean nextNode;
do {
Request request = new Request.Builder()
.get()
.addHeader("Authorization", basicAuth)
Request.Builder builder = new Request.Builder();
if (!Strings.isEmpty(basicAuth)) {
builder.addHeader("Authorization", basicAuth);
}
Request request = builder.get()
.url(currentNode + "/" + path)
.build();
LOG.trace("es rest client request URL: {}", currentNode + "/" + path);
try {
Response response = networkClient.newCall(request).execute();
if (response.isSuccessful()) {
Expand All @@ -117,7 +121,7 @@ private String execute(String path) {
}
nextNode = selectNextNode();
if (!nextNode) {
LOG.error("try all nodes [{}],no other nodes left", nodes);
LOG.warn("try all nodes [{}],no other nodes left", nodes);
}
} while (nextNode);
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ protected void runOneCycle() {
}
esTable.setEsTableState(esTableState);
} catch (Throwable e) {
LOG.error("errors while load table {} state from es", esTable.getName());
LOG.warn("Exception happens when fetch index [{}] meta data from remote es cluster", esTable.getName(), e);
}
}
}
Expand Down