hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject hbase git commit: HBASE-14787 Remove obsolete ConnectionImplementation.refCount (Appy)
Date Tue, 10 Nov 2015 03:08:29 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 086bacd12 -> 32de06f66


HBASE-14787 Remove obsolete ConnectionImplementation.refCount (Appy)


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/32de06f6
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/32de06f6
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/32de06f6

Branch: refs/heads/master
Commit: 32de06f663ce2dcd8b7edd392d47f9c0d66bb481
Parents: 086bacd
Author: stack <stack@apache.org>
Authored: Mon Nov 9 17:08:17 2015 -1000
Committer: stack <stack@apache.org>
Committed: Mon Nov 9 17:08:17 2015 -1000

----------------------------------------------------------------------
 .../hbase/client/ConnectionImplementation.java  | 28 ++------------------
 .../hbase/client/HConnectionTestingUtility.java |  2 --
 2 files changed, 2 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/32de06f6/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java
index f7d4658..62a7998 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java
@@ -170,8 +170,6 @@ class ConnectionImplementation implements ClusterConnection, Closeable
{
   private final MetaCache metaCache;
   private final MetricsConnection metrics;
 
-  private int refCount;
-
   protected User user;
 
   private RpcRetryingCallerFactory rpcCallerFactory;
@@ -2138,22 +2136,6 @@ class ConnectionImplementation implements ClusterConnection, Closeable
{
     return this.registry.getCurrentNrHRS();
   }
 
-  /**
-   * Increment this client's reference count.
-   */
-  void incCount() {
-    ++refCount;
-  }
-
-  /**
-   * Decrement this client's reference count.
-   */
-  void decCount() {
-    if (refCount > 0) {
-      --refCount;
-    }
-  }
-
   @Override
   public void close() {
     if (this.closed) {
@@ -2176,13 +2158,9 @@ class ConnectionImplementation implements ClusterConnection, Closeable
{
   }
 
   /**
-   * Close the connection for good, regardless of what the current value of
-   * {@link #refCount} is. Ideally, {@link #refCount} should be zero at this
-   * point, which would be the case if all of its consumers close the
-   * connection. However, on the off chance that someone is unable to close
+   * Close the connection for good. On the off chance that someone is unable to close
    * the connection, perhaps because it bailed out prematurely, the method
-   * below will ensure that this {@link org.apache.hadoop.hbase.client.HConnection} instance
-   * is cleaned up.
+   * below will ensure that this instance is cleaned up.
    * Caveat: The JVM may take an unknown amount of time to call finalize on an
    * unreachable object, so our hope is that every consumer cleans up after
    * itself, like any good citizen.
@@ -2190,8 +2168,6 @@ class ConnectionImplementation implements ClusterConnection, Closeable
{
   @Override
   protected void finalize() throws Throwable {
     super.finalize();
-    // Pretend as if we are about to release the last remaining reference
-    refCount = 1;
     close();
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/32de06f6/hbase-server/src/test/java/org/apache/hadoop/hbase/client/HConnectionTestingUtility.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/HConnectionTestingUtility.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/HConnectionTestingUtility.java
index 06fdd7f..24c0c32 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/HConnectionTestingUtility.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/HConnectionTestingUtility.java
@@ -117,8 +117,6 @@ public class HConnectionTestingUtility {
     Mockito.when(c.getAsyncProcess()).thenReturn(
       new AsyncProcess(c, conf, null, RpcRetryingCallerFactory.instantiate(conf), false,
           RpcControllerFactory.instantiate(conf)));
-    Mockito.doNothing().when(c).incCount();
-    Mockito.doNothing().when(c).decCount();
     Mockito.when(c.getNewRpcRetryingCallerFactory(conf)).thenReturn(
         RpcRetryingCallerFactory.instantiate(conf,
             RetryingCallerInterceptorFactory.NO_OP_INTERCEPTOR, null));


Mime
View raw message