You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by gu...@apache.org on 2018/04/18 22:07:13 UTC
[kafka] branch trunk updated: KAFKA-6775: Fix the issue of without
init super class's (#4859)
This is an automated email from the ASF dual-hosted git repository.
guozhang pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/trunk by this push:
new 6b2be26 KAFKA-6775: Fix the issue of without init super class's (#4859)
6b2be26 is described below
commit 6b2be2693c60fd222bf8c80b3c9ee783feb00d40
Author: Jimin Hsieh <ji...@gmail.com>
AuthorDate: Thu Apr 19 06:07:09 2018 +0800
KAFKA-6775: Fix the issue of without init super class's (#4859)
Some anonymous classes of AbstractProcessor didn't initialize their superclass. This will not set up ProcessorContext context at AbstractProcessor.
Reviewers: Matthias J. Sax <mj...@apache.org>, Guozhang Wang <wa...@gmail.com>
---
.../test/java/org/apache/kafka/streams/perf/SimpleBenchmark.java | 7 +------
.../test/java/org/apache/kafka/streams/tests/SmokeTestUtil.java | 7 +------
2 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/streams/src/test/java/org/apache/kafka/streams/perf/SimpleBenchmark.java b/streams/src/test/java/org/apache/kafka/streams/perf/SimpleBenchmark.java
index a9bd26b..9dd97c6 100644
--- a/streams/src/test/java/org/apache/kafka/streams/perf/SimpleBenchmark.java
+++ b/streams/src/test/java/org/apache/kafka/streams/perf/SimpleBenchmark.java
@@ -439,6 +439,7 @@ public class SimpleBenchmark {
@SuppressWarnings("unchecked")
@Override
public void init(final ProcessorContext context) {
+ super.init(context);
store = (KeyValueStore<Integer, byte[]>) context.getStateStore("store");
}
@@ -446,12 +447,6 @@ public class SimpleBenchmark {
public void process(final Integer key, final byte[] value) {
store.put(key, value);
}
-
- @Override
- public void punctuate(final long timestamp) {}
-
- @Override
- public void close() {}
};
}
}, "store");
diff --git a/streams/src/test/java/org/apache/kafka/streams/tests/SmokeTestUtil.java b/streams/src/test/java/org/apache/kafka/streams/tests/SmokeTestUtil.java
index 87ca829..9e62e3f 100644
--- a/streams/src/test/java/org/apache/kafka/streams/tests/SmokeTestUtil.java
+++ b/streams/src/test/java/org/apache/kafka/streams/tests/SmokeTestUtil.java
@@ -47,6 +47,7 @@ public class SmokeTestUtil {
@Override
public void init(final ProcessorContext context) {
+ super.init(context);
System.out.println("initializing processor: topic=" + topic + " taskId=" + context.taskId());
numRecordsProcessed = 0;
}
@@ -59,12 +60,6 @@ public class SmokeTestUtil {
System.out.println("processed " + numRecordsProcessed + " records from topic=" + topic);
}
}
-
- @Override
- public void punctuate(final long timestamp) {}
-
- @Override
- public void close() {}
};
}
};
--
To stop receiving notification emails like this one, please contact
guozhang@apache.org.