lewismc commented on a change in pull request #17: SDAP-72
URL:
https://github.com/apache/incubator-sdap-mudrod/pull/17#discussion_r189106849
##########
File path: core/src/main/java/org/apache/sdap/mudrod/driver/ESDriver.java
##########
@@ -473,12 +474,20 @@ protected Client makeClient(Properties props) throws
IOException {
Client client = null;
- // Prefer TransportClient
+ // Prefer to TransportClient
if (hosts != null && port > 1) {
- TransportClient transportClient = new ESTransportClient(settings);
- for (String host : hosts)
- transportClient.addTransportAddress(new
InetSocketTransportAddress(InetAddress.getByName(host), port));
- client = transportClient;
+ TransportClient transportClient = null;
+ try {
+ transportClient = new ESTransportClient(settings);
+ for (String host : hosts){
+ transportClient.addTransportAddress(new
InetSocketTransportAddress(InetAddress.getByName(host), port));
+ }
+ client = transportClient;
+ } catch (Exception e) {
+
+ } finally {
Review comment:
You've added the finally statement, but you have not closed the client. Just
use the try-with-resources statement OK.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services