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 2018/10/22 23:21:55 UTC

[GitHub] ctubbsii commented on a change in pull request #718: Made AccumuloClient Closeable

ctubbsii commented on a change in pull request #718: Made AccumuloClient Closeable
URL: https://github.com/apache/accumulo/pull/718#discussion_r227169146
 
 

 ##########
 File path: core/src/main/java/org/apache/accumulo/core/client/impl/AccumuloClientImpl.java
 ##########
 @@ -59,16 +63,24 @@
   private NamespaceOperations namespaceops = null;
   private InstanceOperations instanceops = null;
   private ReplicationOperations replicationops = null;
+  private final SingletonReservation singletonReservation;
+  private volatile boolean closed = false;
+  private final boolean autoClose;
 
-  public AccumuloClientImpl(final ClientContext context)
-      throws AccumuloSecurityException, AccumuloException {
+  private void ensureOpen() {
+    Preconditions.checkState(!closed, "This client was closed.");
 
 Review comment:
   Since this check is already isolated to its own method, I'm not we benefit much by the depenency on the third party utility. We could just inline the if statement. That way, it's one less place where we depend on Guava.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services