flume-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hshreedha...@apache.org
Subject git commit: FLUME-2252. Add null check before closing table in HbaseSink
Date Wed, 12 Mar 2014 06:36:52 GMT
Repository: flume
Updated Branches:
  refs/heads/trunk 47507bc40 -> 63d26c19a


FLUME-2252. Add null check before closing table in HbaseSink

(Gopinathan A via Hari Shreedharan)


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

Branch: refs/heads/trunk
Commit: 63d26c19adf250fdd4d3b98e2b049d2b5cefc698
Parents: 47507bc
Author: Hari Shreedharan <hshreedharan@apache.org>
Authored: Tue Mar 11 23:35:51 2014 -0700
Committer: Hari Shreedharan <hshreedharan@apache.org>
Committed: Tue Mar 11 23:35:51 2014 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/flume/sink/hbase/AsyncHBaseSink.java    | 4 +++-
 .../src/main/java/org/apache/flume/sink/hbase/HBaseSink.java     | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flume/blob/63d26c19/flume-ng-sinks/flume-ng-hbase-sink/src/main/java/org/apache/flume/sink/hbase/AsyncHBaseSink.java
----------------------------------------------------------------------
diff --git a/flume-ng-sinks/flume-ng-hbase-sink/src/main/java/org/apache/flume/sink/hbase/AsyncHBaseSink.java
b/flume-ng-sinks/flume-ng-hbase-sink/src/main/java/org/apache/flume/sink/hbase/AsyncHBaseSink.java
index 5316cd6..2d03271 100644
--- a/flume-ng-sinks/flume-ng-hbase-sink/src/main/java/org/apache/flume/sink/hbase/AsyncHBaseSink.java
+++ b/flume-ng-sinks/flume-ng-hbase-sink/src/main/java/org/apache/flume/sink/hbase/AsyncHBaseSink.java
@@ -460,7 +460,9 @@ public class AsyncHBaseSink extends AbstractSink implements Configurable
{
   @Override
   public void stop(){
     serializer.cleanUp();
-    client.shutdown();
+    if (client != null) {
+      client.shutdown();
+    }
     sinkCounter.incrementConnectionClosedCount();
     sinkCounter.stop();
     sinkCallbackPool.shutdown();

http://git-wip-us.apache.org/repos/asf/flume/blob/63d26c19/flume-ng-sinks/flume-ng-hbase-sink/src/main/java/org/apache/flume/sink/hbase/HBaseSink.java
----------------------------------------------------------------------
diff --git a/flume-ng-sinks/flume-ng-hbase-sink/src/main/java/org/apache/flume/sink/hbase/HBaseSink.java
b/flume-ng-sinks/flume-ng-hbase-sink/src/main/java/org/apache/flume/sink/hbase/HBaseSink.java
index 9996a4e..5de0bd5 100644
--- a/flume-ng-sinks/flume-ng-hbase-sink/src/main/java/org/apache/flume/sink/hbase/HBaseSink.java
+++ b/flume-ng-sinks/flume-ng-hbase-sink/src/main/java/org/apache/flume/sink/hbase/HBaseSink.java
@@ -187,7 +187,9 @@ public class HBaseSink extends AbstractSink implements Configurable {
   @Override
   public void stop(){
     try {
-      table.close();
+      if (table != null) {
+        table.close();
+      }
       table = null;
     } catch (IOException e) {
       throw new FlumeException("Error closing table.", e);


Mime
View raw message