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 8BA26173CD for ; Thu, 10 Sep 2015 21:17:44 +0000 (UTC) Received: (qmail 88638 invoked by uid 500); 10 Sep 2015 21:17:44 -0000 Delivered-To: apmail-hbase-commits-archive@hbase.apache.org Received: (qmail 88597 invoked by uid 500); 10 Sep 2015 21:17:44 -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 88588 invoked by uid 99); 10 Sep 2015 21:17:44 -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; Thu, 10 Sep 2015 21:17:44 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0A29CE1072; Thu, 10 Sep 2015 21:17:44 +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: <80d74af9aa054b39b713f8bf60cb398a@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: hbase git commit: Revert "HBASE-14361 Investigate unused connection objects" Date: Thu, 10 Sep 2015 21:17:44 +0000 (UTC) Repository: hbase Updated Branches: refs/heads/branch-1 6c16d244b -> 66ed39241 Revert "HBASE-14361 Investigate unused connection objects" This reverts commit 6c16d244bbe26716c1b5af9877a74e63ef16a0cc. Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/66ed3924 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/66ed3924 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/66ed3924 Branch: refs/heads/branch-1 Commit: 66ed392412f5f55958b478433f3d431b9aa36907 Parents: 6c16d24 Author: stack Authored: Thu Sep 10 14:17:32 2015 -0700 Committer: stack Committed: Thu Sep 10 14:17:32 2015 -0700 ---------------------------------------------------------------------- .../hbase/replication/regionserver/ReplicationSink.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/66ed3924/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSink.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSink.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSink.java index 11019f6..7d47677 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSink.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSink.java @@ -72,7 +72,7 @@ public class ReplicationSink { private static final Log LOG = LogFactory.getLog(ReplicationSink.class); private final Configuration conf; - private Connection sharedHtableCon; + private final Connection sharedHtableCon; private final MetricsSink metrics; private final AtomicLong totalReplicatedEdits = new AtomicLong(); @@ -88,6 +88,7 @@ public class ReplicationSink { this.conf = HBaseConfiguration.create(conf); decorateConf(); this.metrics = new MetricsSink(); + this.sharedHtableCon = ConnectionFactory.createConnection(this.conf); } /** @@ -212,9 +213,7 @@ public class ReplicationSink { */ public void stopReplicationSinkServices() { try { - if (this.sharedHtableCon != null) { - this.sharedHtableCon.close(); - } + this.sharedHtableCon.close(); } catch (IOException e) { LOG.warn("IOException while closing the connection", e); // ignoring as we are closing. } @@ -233,9 +232,6 @@ public class ReplicationSink { } Table table = null; try { - if (this.sharedHtableCon == null) { - this.sharedHtableCon = ConnectionFactory.createConnection(this.conf); - } table = this.sharedHtableCon.getTable(tableName); for (List rows : allRows) { table.batch(rows);