kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guozh...@apache.org
Subject kafka git commit: KAFKA-3922: add constructor to AbstractStream class
Date Tue, 19 Jul 2016 17:56:17 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 114945cb6 -> b418922a3


KAFKA-3922: add constructor to AbstractStream class

https://issues.apache.org/jira/browse/KAFKA-3922

KAFKA-3922 add copy-constructor to AbstractStream class
This copy-constructor allow to access protected variables from subclasses.

It should be used to extend KStreamImpl and KTableImpl classes by implementing a decorator
pattern.

Author: Florian Hussonnois <florian.hussonnois@gmail.com>

Reviewers: Guozhang Wang <wangguoz@gmail.com>

Closes #1581 from fhussonnois/KAFKA-3922


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

Branch: refs/heads/trunk
Commit: b418922a3b48bef9d890abb471908ab2a8aeba18
Parents: 114945c
Author: Florian Hussonnois <florian.hussonnois@gmail.com>
Authored: Tue Jul 19 10:56:12 2016 -0700
Committer: Guozhang Wang <wangguoz@gmail.com>
Committed: Tue Jul 19 10:56:12 2016 -0700

----------------------------------------------------------------------
 .../apache/kafka/streams/kstream/internals/AbstractStream.java | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/b418922a/streams/src/main/java/org/apache/kafka/streams/kstream/internals/AbstractStream.java
----------------------------------------------------------------------
diff --git a/streams/src/main/java/org/apache/kafka/streams/kstream/internals/AbstractStream.java
b/streams/src/main/java/org/apache/kafka/streams/kstream/internals/AbstractStream.java
index b0c1111..b764a6e 100644
--- a/streams/src/main/java/org/apache/kafka/streams/kstream/internals/AbstractStream.java
+++ b/streams/src/main/java/org/apache/kafka/streams/kstream/internals/AbstractStream.java
@@ -30,6 +30,12 @@ public abstract class AbstractStream<K> {
     protected final String name;
     protected final Set<String> sourceNodes;
 
+    public AbstractStream(AbstractStream<K> stream) {
+        this.topology = stream.topology;
+        this.name = stream.name;
+        this.sourceNodes = stream.sourceNodes;
+    }
+
     public AbstractStream(KStreamBuilder topology, String name, Set<String> sourceNodes)
{
         if (sourceNodes == null || sourceNodes.isEmpty()) {
             throw new IllegalArgumentException("parameter <sourceNodes> must not be
null or empty");


Mime
View raw message