flume-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject flume git commit: FLUME-2897: AsyncHBase sink NPE when Channel.getTransaction() fails
Date Tue, 29 Mar 2016 15:12:29 GMT
Repository: flume
Updated Branches:
  refs/heads/flume-1.7 c2562900f -> 9efbe92f6


FLUME-2897: AsyncHBase sink NPE when Channel.getTransaction() fails

(Mike Percy via Jarek Jarcec Cecho)


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

Branch: refs/heads/flume-1.7
Commit: 9efbe92f6f00e626d34847b4f3f40378fdb6a1f3
Parents: c256290
Author: Jarek Jarcec Cecho <jarcec@apache.org>
Authored: Tue Mar 29 08:10:31 2016 -0700
Committer: Jarek Jarcec Cecho <jarcec@apache.org>
Committed: Tue Mar 29 08:12:22 2016 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/flume/sink/hbase/AsyncHBaseSink.java   | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flume/blob/9efbe92f/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 eac00f6..c1ff0c4 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
@@ -204,10 +204,11 @@ public class AsyncHBaseSink extends AbstractSink implements Configurable
{
 
     Status status = Status.READY;
     Channel channel = getChannel();
+    txn = channel.getTransaction();
+    txn.begin();
+
     int i = 0;
     try {
-      txn = channel.getTransaction();
-      txn.begin();
       for (; i < batchSize; i++) {
         Event event = channel.take();
         if (event == null) {


Mime
View raw message