lewismc commented on a change in pull request #17: SDAP-72
URL:
https://github.com/apache/incubator-sdap-mudrod/pull/17#discussion_r189106719
##########
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 {
Review comment:
Use a
[try-with-resources](https://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html)
statement such that the client is closed.
----------------------------------------------------------------
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