You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2015/09/10 23:15:56 UTC
hbase git commit: Revert "HBASE-14361 Investigate unused connection
objects"
Repository: hbase
Updated Branches:
refs/heads/1.0 [created] 1ac591ff7
Revert "HBASE-14361 Investigate unused connection objects"
This reverts commit 73bdaf0783b7ab007d4135446b1717028b73f852.
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/1ac591ff
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/1ac591ff
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/1ac591ff
Branch: refs/heads/1.0
Commit: 1ac591ff752cda202c904f5e0fa971e69420070e
Parents: 73bdaf0
Author: stack <st...@apache.org>
Authored: Thu Sep 10 14:15:36 2015 -0700
Committer: stack <st...@apache.org>
Committed: Thu Sep 10 14:15:36 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/1ac591ff/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);