Skip to content
Permalink
Browse files
Removes try-block around client. Fixes #45 (#50)
  • Loading branch information
Manno15 authored and keith-turner committed May 8, 2019
1 parent 983c371 commit 66f5d1c7bcfa2bdc93e9abb575ad483e95eb5870
Showing 1 changed file with 9 additions and 7 deletions.
@@ -301,13 +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");

// the client can't be closed here, because it is passed to the new ARS object
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");
}
} else {
System.out.println(" Commands : ");

0 comments on commit 66f5d1c

Please sign in to comment.