kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guozh...@apache.org
Subject kafka git commit: HOTFIX: fix NPE in changelogger
Date Wed, 23 Mar 2016 21:25:12 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk d4d5920ed -> 80d78f814


HOTFIX: fix NPE in changelogger

Fix NPE in StoreChangeLogger caused by a record out of window retention period.
guozhangwang

Author: Yasuhiro Matsuda <yasuhiro@confluent.io>

Reviewers: Guozhang Wang <wangguoz@gmail.com>

Closes #1124 from ymatsuda/logger_npe


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

Branch: refs/heads/trunk
Commit: 80d78f81470f109dc6d221f755b039c7332bb93b
Parents: d4d5920
Author: Yasuhiro Matsuda <yasuhiro@confluent.io>
Authored: Wed Mar 23 14:25:08 2016 -0700
Committer: Guozhang Wang <wangguoz@gmail.com>
Committed: Wed Mar 23 14:25:08 2016 -0700

----------------------------------------------------------------------
 .../apache/kafka/streams/state/internals/RocksDBWindowStore.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/80d78f81/streams/src/main/java/org/apache/kafka/streams/state/internals/RocksDBWindowStore.java
----------------------------------------------------------------------
diff --git a/streams/src/main/java/org/apache/kafka/streams/state/internals/RocksDBWindowStore.java
b/streams/src/main/java/org/apache/kafka/streams/state/internals/RocksDBWindowStore.java
index 4c6a229..9851c04 100644
--- a/streams/src/main/java/org/apache/kafka/streams/state/internals/RocksDBWindowStore.java
+++ b/streams/src/main/java/org/apache/kafka/streams/state/internals/RocksDBWindowStore.java
@@ -245,7 +245,7 @@ public class RocksDBWindowStore<K, V> implements WindowStore<K,
V> {
     public void put(K key, V value) {
         byte[] rawKey = putAndReturnInternalKey(key, value, USE_CURRENT_TIMESTAMP);
 
-        if (loggingEnabled) {
+        if (rawKey != null && loggingEnabled) {
             changeLogger.add(rawKey);
             changeLogger.maybeLogChange(this.getter);
         }
@@ -255,7 +255,7 @@ public class RocksDBWindowStore<K, V> implements WindowStore<K,
V> {
     public void put(K key, V value, long timestamp) {
         byte[] rawKey = putAndReturnInternalKey(key, value, timestamp);
 
-        if (loggingEnabled) {
+        if (rawKey != null && loggingEnabled) {
             changeLogger.add(rawKey);
             changeLogger.maybeLogChange(this.getter);
         }


Mime
View raw message