Return-Path: X-Original-To: apmail-hbase-commits-archive@www.apache.org Delivered-To: apmail-hbase-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9CD2418071 for ; Tue, 10 Nov 2015 03:08:29 +0000 (UTC) Received: (qmail 85577 invoked by uid 500); 10 Nov 2015 03:08:29 -0000 Delivered-To: apmail-hbase-commits-archive@hbase.apache.org Received: (qmail 85517 invoked by uid 500); 10 Nov 2015 03:08:29 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 85508 invoked by uid 99); 10 Nov 2015 03:08:29 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Nov 2015 03:08:29 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 2C3A9E07E9; Tue, 10 Nov 2015 03:08:29 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: stack@apache.org To: commits@hbase.apache.org Message-Id: <860001153157436287b9de2d2084803c@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: hbase git commit: HBASE-14787 Remove obsolete ConnectionImplementation.refCount (Appy) Date: Tue, 10 Nov 2015 03:08:29 +0000 (UTC) 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 Authored: Mon Nov 9 17:08:17 2015 -1000 Committer: stack 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));