You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2019/05/08 18:45:04 UTC

[GitHub] [accumulo-examples] keith-turner commented on a change in pull request #50: Removes try-block around client. Fixes #45

keith-turner commented on a change in pull request #50: Removes try-block around client. Fixes #45
URL: https://github.com/apache/accumulo-examples/pull/50#discussion_r282198744
 
 

 ##########
 File path: src/main/java/org/apache/accumulo/examples/reservations/ARS.java
 ##########
 @@ -301,14 +301,15 @@ public void run() {
       } else if (tokens[0].equals("quit") && tokens.length == 1) {
         break;
       } else if (tokens[0].equals("connect") && tokens.length == 6 && ars == null) {
-        try (AccumuloClient client = Accumulo.newClient().to(tokens[1], tokens[2])
-            .as(tokens[3], tokens[4]).build()) {
-          if (client.tableOperations().exists(tokens[5])) {
-            ars = new ARS(client, tokens[5]);
-            reader.println("  connected");
-          } else
-            reader.println("  No Such Table");
-        }
+        // its good to close clients when possible, but it was not done here for simplicity
 
 Review comment:
   > This comment could be improved to explain why the client needs to be left open here.
   
   @ctubbsii what wording would you suggest?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services