hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject hbase git commit: Revert "HBASE-14361 Investigate unused connection objects"
Date Thu, 10 Sep 2015 21:16:34 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.1 57744203b -> d1b808d91


Revert "HBASE-14361 Investigate unused connection objects"

This reverts commit 57744203b4a91525162d97331f23d78250aca2d2.


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

Branch: refs/heads/branch-1.1
Commit: d1b808d9143f47f3644c1e87e7b225fe6097c52d
Parents: 5774420
Author: stack <stack@apache.org>
Authored: Thu Sep 10 14:16:20 2015 -0700
Committer: stack <stack@apache.org>
Committed: Thu Sep 10 14:16:20 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/d1b808d9/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 ededd47..3276418 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
@@ -71,7 +71,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();
 
@@ -87,6 +87,7 @@ public class ReplicationSink {
     this.conf = HBaseConfiguration.create(conf);
     decorateConf();
     this.metrics = new MetricsSink();
+    this.sharedHtableCon = ConnectionFactory.createConnection(this.conf);
   }
 
   /**
@@ -211,9 +212,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.
     }
@@ -232,9 +231,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<Row> rows : allRows) {
         table.batch(rows);


Mime
View raw message