[
https://issues.apache.org/jira/browse/SDAP-72?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16479748#comment-16479748
]
ASF GitHub Bot commented on SDAP-72:
------------------------------------
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]
> Solve bugs in file named ESDriver
> ---------------------------------
>
> Key: SDAP-72
> URL: https://issues.apache.org/jira/browse/SDAP-72
> Project: Apache Science Data Analytics Platform
> Issue Type: Bug
> Components: mudrod
> Reporter: Yun Li
> Priority: Major
> Fix For: 0.1
>
>
> Solve MUDROD bugs found by sonar coverage @[~lewismc]
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)