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 ReplicationSink should create Connection instances lazily"
Date Thu, 10 Sep 2015 21:15:09 GMT
Repository: hbase
Updated Branches:
  refs/heads/0.98 d2c6979c4 -> be102f587


Revert "HBASE-14361 ReplicationSink should create Connection instances lazily"

This reverts commit d2c6979c4e31e4b5b5b83d7c378bf26bf937abd9.


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

Branch: refs/heads/0.98
Commit: be102f587b9c24be5cfaeaec0a9b973ee10f3b83
Parents: d2c6979
Author: stack <stack@apache.org>
Authored: Thu Sep 10 14:14:57 2015 -0700
Committer: stack <stack@apache.org>
Committed: Thu Sep 10 14:14:57 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/be102f58/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 f989a4f..cd45461 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 HConnection sharedHtableCon;
+  private final HConnection 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 = HConnectionManager.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 {
     }
     HTableInterface table = null;
     try {
-      if (this.sharedHtableCon == null) {
-        this.sharedHtableCon = HConnectionManager.createConnection(this.conf);
-      }
       table = this.sharedHtableCon.getTable(tableName);
       for (List<Row> rows : allRows) {
         table.batch(rows);


Mime
View raw message