This is an automated email from the ASF dual-hosted git repository.
lewismc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-sdap-mudrod.git
The following commit(s) were added to refs/heads/master by this push:
new e2f08f7 SDAP-72 (#17)
e2f08f7 is described below
commit e2f08f7976443cb211f83a4db9197a6be7847b77
Author: quintinali <[email protected]>
AuthorDate: Mon Jun 11 14:29:11 2018 -0400
SDAP-72 (#17)
* fix bugs in ESDriver.java
(1)"InterruptedException" should not be ignored
(2)Use try-with-resources or close this "ESTransportClient" in a
"finally" clause.
* remove useless comments
* return ESTransportClient to close it lately
---
core/src/main/java/org/apache/sdap/mudrod/driver/ESDriver.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/core/src/main/java/org/apache/sdap/mudrod/driver/ESDriver.java
b/core/src/main/java/org/apache/sdap/mudrod/driver/ESDriver.java
index fc51557..666629f 100644
--- a/core/src/main/java/org/apache/sdap/mudrod/driver/ESDriver.java
+++ b/core/src/main/java/org/apache/sdap/mudrod/driver/ESDriver.java
@@ -133,6 +133,7 @@ public class ESDriver implements Serializable {
refreshIndex();
} catch (InterruptedException e) {
LOG.error("Error destroying the Bulk Processor.", e);
+ Thread.currentThread().interrupt();
}
}
@@ -489,12 +490,11 @@ public class ESDriver implements Serializable {
Client client = null;
- // Prefer TransportClient
- if (hosts != null && port > 1) {
+ if (hosts != null && port > 1) {
TransportClient transportClient = new ESTransportClient(settings);
for (String host : hosts)
transportClient.addTransportAddress(new
InetSocketTransportAddress(InetAddress.getByName(host), port));
- client = transportClient;
+ return transportClient;
} else if (clusterName != null) {
node = new Node(settings);
client = node.client();
--
To stop receiving notification emails like this one, please contact
[email protected].