Commit Graph

94 Commits

Author SHA1 Message Date
John Roesler 3637b2c374 MINOR: Require final variables in Streams (#5452)
Reviewers: Bill Bejeck <bill@confluent.io>, Guozhang Wang <guozhang@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2018-08-03 13:19:46 -07:00
Matthias J. Sax b083ed66b9
MINOR: improve JavaDocs for Streams PAPI WordCountExample (#5442)
Reviewers: Guozhang Wang <guozhang@confluent.io>, Bill Bejeck <bill@confluent.io>
2018-08-02 15:16:21 -07:00
Guozhang Wang d3e264e773
MINOR: update web docs and examples of Streams with Java8 syntax (#5249)
Reviewers: John Roesler <john@confluent.io>, Bill Bejeck <bill@confluent.io>, Damian Guy <damian@confluent.io>
2018-06-21 10:02:58 -07:00
Guozhang Wang 6b8e79b137
HOTFIX: move Conusmed to o.a.k.streams.kstream (#5033)
Reviewers: Bill Bejeck <bill@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2018-05-17 11:56:07 -07:00
Guozhang Wang 32e97b1d9d
MINOR: Remove deprecated parameter in ProcessorContext#register (#4911)
Updated the upgrade doc as well since we do not have an overloaded function without the deprecated parameter before. Also renamed the 1.2 release version to 2.0.

Reviewers: Bill Bejeck <bill@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2018-05-07 09:22:26 -07:00
Guozhang Wang af983267be
MINOR: Removed deprecated schedule function (#4908)
While working on this, I also refactored the MockProcessor out of the MockProcessorSupplier to cleanup the unit test paths.

Reviewers: John Roesler <john@confluent.io>, Bill Bejeck <bill@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2018-05-04 08:42:01 -07:00
John Roesler adbf31ab1d KAFKA-6473: Add MockProcessorContext to public test-utils (#4736)
Reviewers: Matthias J. Sax <matthias@confluent.io>, Guozhang Wang <guozhang@confluent.io>, Bill Bejeck <bill@confluent.io>
2018-03-27 14:03:24 -07:00
Vitaly Pushkar b1aa1912f0 KAFKA-4831: Extract WindowedSerde to public APIs (#3307)
Now that we have augmented WindowSerde with non-arg parameters, extract it out as part of the public APIs so that users who want to I/O windowed streams can use it. This is originally introduced by @vitaly-pushkar

This PR grows out to be a much larger one, as I found a few tech debts and bugs while working on it. Here is a summary of the PR:

Public API changes (I will propose a KIP after a first round of reviews):
Add TimeWindowedSerializer, TimeWindowedDeserializer, SessionWindowedSerializer, SessionWindowedDeserializer into o.a.k.streams.kstream. The serializers would implemented an internal WindowedSerializer interface for the serializeBaseKey function used in 3) below.

Add WindowedSerdes into o.a.k.streams.kstream. The reason to now add them into o.a.k.clients's Serdes is that it then needs dependency of streams.

Add "default.windowed.key.serde.inner" and "default.windowed.value.serde.inner" into StreamsConfig, used when "default.key.serde" is specified to use time or session windowed serde. Note this requires the serde class, not the type class.

Consolidated serde format from multiple classes, including SessionKeySerde.java for session, and WindowStoreUtils for time window, into SessionKeySchema and WindowKeySchema.

Bug fix: WindowedStreamPartitioner needs to consider both time window and session window serdes.

Removed RocksDBWindowBytesStore etc optimization since after KIP-182 all the serde know happens on metered store, hence this optimization is not worth.

Bug fix: for time window, the serdes used for store and the serdes used for piping (source and sink node) are different: the former needs to append sequence number but not for the later.

Other minor cleanups: remove unnecessary throws, etc.

Authors: Guozhang Wang <wangguoz@gmail.com>, Vitaly Pushkar <vitaly.pushkar@gmail.com>

Reviewers: Matthias J. Sax <mjsax@apache.org>, Bill Bejeck <bill@confluent.io>, Xi Hu
2018-03-09 11:08:08 -08:00
Matthias J. Sax 713a67fdda MINOR: add suppress warnings annotations in Streams API
- fixes examples with regard to new API
 - fixes `Topology#addGlobalStore` parameters

Author: Matthias J. Sax <matthias@confluent.io>

Reviewers: Ismael Juma <ismael@juma.me.uk>, Guozhang Wang <wangguoz@gmail.com>, Damian Guy <damian.guy@gmail.com>

Closes #4003 from mjsax/minor-deprecated
2017-10-04 14:42:07 -07:00
Damian Guy f2b74aa1c3 KAFKA-5873; add materialized overloads to StreamsBuilder
Add overloads for `table` and `globalTable` that use `Materialized`

Author: Damian Guy <damian.guy@gmail.com>

Reviewers: Bill Bejeck <bill@confluent.io>, Matthias J. Sax <matthias@confluent.io>, Guozhang Wang <wangguoz@gmail.com>

Closes #3837 from dguy/kafka-5873
2017-09-18 15:53:44 +01:00
Richard Yu 90b4b07e6e KAFKA-4468: Correctly calculate the window end timestamp after read from state stores
I have decided to use the following approach to fixing this bug:

1) Since the Window Size in WindowedDeserializer was originally unknown, I have initialized
a field _windowSize_ and created a constructor to allow it to be instantiated

2) The default size for __windowSize__ is _Long.MAX_VALUE_. If that is the case, then the
deserialize method will return an Unlimited Window, or else will return Timed one.

3) Temperature Demo was modified to demonstrate how to use this new constructor, given
that the window size is known.

Author: Richard Yu <richardyu@Richards-Air.attlocal.net>

Reviewers: Matthias J. Sax <matthias@confluent.io>, Bill Bejeck <bill@confluent.io>, Guozhang Wang <wangguoz@gmail.com>

Closes #3745 from ConcurrencyPractitioner/trunk
2017-09-12 16:42:06 -07:00
Damian Guy d0ee6ed36b KAFKA-5832; add Consumed and change StreamBuilder to use it
Added `Consumed` class.
Updated `StreamBuilder#stream`, `StreamBuilder#table`, `StreamBuilder#globalTable`

Author: Damian Guy <damian.guy@gmail.com>

Reviewers: Matthias J. Sax <matthias@confluent.io>, Guozhang Wang <wangguoz@gmail.com>

Closes #3784 from dguy/kip-182-stream-builder
2017-09-08 08:21:48 +01:00
Damian Guy 9cbb9f0939 KAFKA-5650; add StateStoreBuilder interface and implementations
Part of KIP-182

- Add `StateStoreBuilder` interface and `WindowStateStoreBuilder`, `KeyValueStateStoreBuilder`, and `SessionStateStoreBuilder` implementations
- Add `StoreSupplier`, `WindowBytesStoreSupplier`, `KeyValueBytesStoreSupplier`, `SessionBytesStoreSupplier` interfaces and implementations
- Add new methods to `Stores` to create the newly added `StoreSupplier` and `StateStoreBuilder` implementations
- Update `Topology` and `InternalTopology` to use the interfaces

Author: Damian Guy <damian.guy@gmail.com>

Reviewers: Bill Bejeck <bill@confluent.io>, Matthias J. Sax <matthias@confluent.io>, Guozhang Wang <wangguoz@gmail.com>

Closes #3767 from dguy/kafka-5650
2017-09-07 09:39:46 +01:00
Damian Guy b687c06800 KAFKA-5817; Add Serialized class and overloads to KStream#groupBy and KStream#groupByKey
Part of KIP-182
- Add the `Serialized` class
- implement overloads of `KStream#groupByKey` and KStream#groupBy`
- deprecate existing methods that have more than default arguments

Author: Damian Guy <damian.guy@gmail.com>

Reviewers: Bill Bejeck <bill@confluent.io>, Matthias J. Sax <matthias@confluent.io>, Guozhang Wang <wangguoz@gmail.com>

Closes #3772 from dguy/kafka-5817
2017-09-06 10:43:14 +01:00
Guozhang Wang d2774e302f KAFKA-5727: Add Streams quickstart tutorial as an archetype project
0. Minor fixes on the existing examples to merge all on a single input topic; also do not use `common.utils.Exit` as it is for internal usage only.

1. Add the archetype project for the quickstart. Steps to try it out:

  a. `mvn install` on the quickstart directory.
  b. `mvn archetype:generate \
-DarchetypeGroupId=org.apache.kafka \
-DarchetypeArtifactId=streams-quickstart-java \
-DarchetypeVersion=1.0.0-SNAPSHOT \
-DgroupId=streams-quickstart \
-DartifactId=streams-quickstart \
-Dversion=0.1 \
-Dpackage=StreamsQuickstart \
-DinteractiveMode=false` at any directory to create the project.
  c. build the streams jar with version `1.0.0-SNAPSHOT` to local maven repository with `./gradlew installAll`; `cd streams-quickstart; mvn clean package`
  d. create the input / output topics, start the console producer and consumer.
  e. start the program: `mvn exec:java -Dexec.mainClass=StreamsQuickstart.Pipe/LineSplit/WordCount`.
  f. type data on console producer and observe data on console consumer.

Author: Guozhang Wang <wangguoz@gmail.com>

Reviewers: Damian Guy <damian.guy@gmail.com>, Bill Bejeck <bbejeck@gmail.com>, Ewen Cheslack-Postava <me@ewencp.org>, Eno Thereska <eno.thereska@gmail.com>

Closes #3630 from guozhangwang/KMinor-streams-quickstart-tutorial
2017-08-11 12:19:28 -07:00
Paolo Patierno 94a6d6c02d KAFKA-5454: Add a new Kafka Streams example IoT oriented
Added a Kafka Streams example (IoT oriented) using "tumbling" window

Author: Paolo Patierno <ppatierno@live.com>
Author: ppatierno <ppatierno@live.com>

Reviewers: Guozhang Wang <wangguoz@gmail.com>, Michael G. Noll <michael@confluent.io>

Closes #3352 from ppatierno/stream-temperature-example
2017-08-01 11:22:49 -07:00
Matthias J. Sax da2205578b KAFKA-5671: Add StreamsBuilder and Deprecate KStreamBuilder
Author: Matthias J. Sax <matthias@confluent.io>

Reviewers: Damian Guy <damian.guy@gmail.com>, Bill Bejeck <bill@confluent.io>, Guozhang Wang <wangguoz@gmail.com>

Closes #3602 from mjsax/kafka-5671-add-streamsbuilder
2017-07-31 15:28:59 -07:00
Matthias J. Sax 1844bf2b2f KAFKA-5670: (KIP-120) Add Topology and deprecate TopologyBuilder
Author: Matthias J. Sax <matthias@confluent.io>

Reviewers: Damian Guy <damian.guy@gmail.com>, Bill Bejeck <bill@confluent.io>, Guozhang Wang <wangguoz@gmail.com>

Closes #3590 from mjsax/kafka-3856-replace-topology-builder-by-topology
2017-07-28 16:46:34 -07:00
Guozhang Wang 91c207c2c6 MINOR: Make streams quick start more interactive
1. Make the WordCountDemo application to not stop automatically but via "ctrl-C".
2. Update the quickstart html file to let users type input messages one-by-one, and observe added output in an interactive manner.
3. Some minor fixes on the parent documentation page pointing to streams sub-pages, added a new recommended Scala version number.

Author: Guozhang Wang <wangguoz@gmail.com>

Reviewers: Michael G. Noll <michael@confluent.io>, Damian Guy <damian.guy@gmail.com>

Closes #3515 from guozhangwang/KMinor-interactive-quickstart
2017-07-25 11:34:16 -07:00
Michal Borowiecki efb060c57f KAFKA-5233; KIP-138: Change punctuate semantics
Implementation for KIP-138: Change punctuate semantics

Author: Michal Borowiecki <michal.borowiecki@openbet.com>

Reviewers: Matthias J. Sax <matthias@confluent.io>, Bill Bejeck <bbejeck@gmail.com>, Eno Thereska <eno.thereska@gmail.com>, Damian Guy <damian.guy@gmail.com>

Closes #3055 from mihbor/KIP-138
2017-06-28 11:26:02 +01:00
Guozhang Wang 7f4feda959 MINOR: Turn off caching in demos for more understandable outputs
Author: Guozhang Wang <wangguoz@gmail.com>

Reviewers: Matthias J Sax <matthias@confluent.io>, Bill Bejeck <bbejeck@gmail.com>

Closes #3403 from guozhangwang/KMinor-turn-off-caching-in-demo
2017-06-22 08:53:32 +01:00
Jeyhun Karimov 9198467eb2 KAFKA-4144: Allow per stream/table timestamp extractor
Author: Jeyhun Karimov <je.karimov@gmail.com>

Reviewers: Damian Guy, Eno Thereska, Matthias J. Sax, Guozhang Wang

Closes #2466 from jeyhunkarimov/KAFKA-4144
2017-05-12 21:38:49 -07:00
Michael G. Noll 6ba98f6e5a MINOR: Improve topic management instructions for Kafka Streams examples
Author: Michael G. Noll <michael@confluent.io>

Reviewers: Matthias J. Sax <matthias@confluent.io>, Eno Thereska <eno@confluent.io>, Ismael Juma <ismael@juma.me.uk>

Closes #2812 from miguno/trunk-streams-examples-docs
2017-04-06 12:34:19 +01:00
Colin P. Mccabe d345d53e4e KAFKA-4902; Utils#delete should correctly handle I/O errors and symlinks
Author: Colin P. Mccabe <cmccabe@confluent.io>

Reviewers: Jun Rao <junrao@gmail.com>, Apurva Mehta <apurva@confluent.io>, Ismael Juma <ismael@juma.me.uk>

Closes #2691 from cmccabe/KAFKA-4902
2017-03-30 13:38:09 +01:00
Colin P. Mccabe aea5989d98 KAFKA-4944; Fix an "unread field" findbugs warning in streams examples
Author: Colin P. Mccabe <cmccabe@confluent.io>

Reviewers: Michael G. Noll <michael@confluent.io>, Ismael Juma <ismael@juma.me.uk>

Closes #2727 from cmccabe/KAFKA-4944
2017-03-29 16:33:12 +01:00
Damian Guy 2269eed242 KAFKA-4919: Document that stores must not be closed when Processors are closed
Author: Damian Guy <damian.guy@gmail.com>

Reviewers: Michael G. Noll, Eno Thereska, Matthias J. Sax, Elias Levy, Guozhang Wang

Closes #2725 from dguy/minor-processor-java-doc
2017-03-23 09:47:45 -07:00
Matthias J. Sax d0e436c471 MINOR: improve license header check by providing head file instead of (prefix) header regex
Author: Matthias J. Sax <matthias@confluent.io>

Reviewers: Jason Gustafson <jason@confluent.io>, Ewen Cheslack-Postava <ewen@confluent.io>

Closes #2303 from mjsax/licenseHeader
2017-02-28 12:35:04 -08:00
Will Marshall 51e745ef30 MINOR: Fix typo in WordCountProcessorDemo
`bin-kafka-console-producer.sh` should be `bin/kafka-console-producer.sh`.

Author: Will Marshall <wcm214@gmail.com>

Reviewers: Guozhang Wang <wangguoz@gmail.com>

Closes #2410 from wmarshall484/typo-fix
2017-01-25 18:01:37 -08:00
Gwen Shapira 9a7032720f MINOR: Clarify misleading comment in WordCount example
Author: Gwen Shapira <cshapi@gmail.com>

Reviewers: Matthias J. Sax, Guozhang Wang

Closes #2400 from gwenshap/wordcount-comment
2017-01-25 18:00:14 -08:00
Hojjat Jafarpour 4b71c0bdc1 KAFKA-4060: Remove zk client dependency in kafka streams
dguy guozhangwang This is a new PR for KAFKA-4060.

Author: Hojjat Jafarpour <hojjat@Hojjat-Jafarpours-MBP.local>
Author: Hojjat Jafarpour <hojjat@HojjatJpoursMBP.attlocal.net>

Reviewers: Damian Guy, Matthias J. Sax, Isamel Juma, Guozhang Wang

Closes #1884 from hjafarpour/KAFKA-4060-Remove-ZkClient-dependency-in-Kafka-Streams-new
2017-01-11 09:15:26 -08:00
Matthias J. Sax 9bed8fbcfc KAFKA-4393: Improve invalid/negative TS handling
Author: Matthias J. Sax <matthias@confluent.io>

Reviewers: Michael G. Noll, Eno Thereska, Damian Guy, Guozhang Wang

Closes #2117 from mjsax/kafka-4393-improveInvalidTsHandling
2016-12-09 16:17:36 -08:00
Eno Thereska fbc5185543 KAFKA-3870: Expose state store names in DSL
Author: Eno Thereska <eno.thereska@gmail.com>

Reviewers: Damian Guy, Matthias J. Sax, Michael G. Noll, Guozhang Wang

Closes #1526 from enothereska/expose-names-dsl
2016-07-18 12:12:51 -07:00
Damian Guy 7d9d1cb235 KAFKA-3561: Auto create through topic for KStream aggregation and join
guozhangwang enothereska mjsax miguno

If you get a chance can you please take a look at this. I've done the repartitioning in the join, but it results in 2 internal topics for each join. This seems like overkill as sometimes we wouldn't need to repartition at all, others just 1 topic, and then sometimes both, but I'm not sure how we can know that.

I'd also need to implement something similar for leftJoin, but again, i'd like to see if i'm heading down the right path or if anyone has any other bright ideas.

For reference - https://github.com/apache/kafka/pull/1453 - the previous PR

Thanks for taking the time and looking forward to getting some welcome advice :-)

Author: Damian Guy <damian.guy@gmail.com>
Author: Damian Guy <damian@continuum.local>

Reviewers: Guozhang Wang <wangguoz@gmail.com>

Closes #1472 from dguy/KAFKA-3561
2016-06-16 11:56:32 -07:00
Guozhang Wang 177b2d0bea KAFKA-3735: Dispose all RocksObejcts upon completeness
Author: Guozhang Wang <wangguoz@gmail.com>

Reviewers: Roger Hoover, Eno Thereska, Ismael Juma

Closes #1411 from guozhangwang/K3735-dispose-rocksobject
2016-05-20 11:52:36 -07:00
Matthias J. Sax 4ab4e4af81 KAFKA-3598: Improve JavaDoc of public API
Author: Matthias J. Sax <matthias@confluent.io>

Reviewers: Michael G. Noll, Guozhang Wang

Closes #1250 from mjsax/JavaDoc-publicAPI
2016-04-29 08:49:16 -07:00
Michael G. Noll 68433dcfdc KAFKA-3613: Consolidate TumblingWindows and HoppingWindows into TimeWindows
This PR includes the same code as https://github.com/apache/kafka/pull/1261 but is rebased on latest trunk.

Author: Michael G. Noll <michael@confluent.io>

Reviewers: Matthias J. Sax, Guozhang Wang

Closes #1277 from miguno/KAFKA-3613-v2
2016-04-29 07:44:03 -07:00
Rajini Sivaram 9d71489ff0 KAFKA-3548: Use root locale for case transformation of constant strings
For enums and other constant strings, use locale independent case conversions to enable comparisons to work regardless of the default locale.

Author: Rajini Sivaram <rajinisivaram@googlemail.com>

Reviewers: Manikumar Reddy, Ismael Juma, Guozhang Wang, Gwen Shapira

Closes #1220 from rajinisivaram/KAFKA-3548
2016-04-20 18:54:30 -07:00
Guozhang Wang 23b50093f4 KAFKA-3454: add Kafka Streams web docs
Author: Guozhang Wang <wangguoz@gmail.com>

Reviewers: Gwen Shapira

Closes #1127 from guozhangwang/KStreamsDocs
2016-03-25 16:04:58 -07:00
Guozhang Wang 5d0cd7667f KAFKA-3422: Add overloading functions without serdes in Streams DSL
Also include:

1) remove streams specific configs before passing to producer and consumer to avoid warning message;
2) add `ConsumerRecord` timestamp extractor and set as the default extractor.

Author: Guozhang Wang <wangguoz@gmail.com>

Reviewers: Michael G. Noll, Ewen Cheslack-Postava

Closes #1093 from guozhangwang/KConfigWarn
2016-03-18 12:39:41 -07:00
Guozhang Wang dea0719e99 KAFKA-3336: Unify Serializer and Deserializer into Serialization
Author: Guozhang Wang <wangguoz@gmail.com>

Reviewers: Michael G. Noll, Ismael Juma

Closes #1066 from guozhangwang/K3336
2016-03-17 15:41:59 -07:00
Michael G. Noll 958e10c87c KAFKA-3411: Streams: stop using "job" terminology, rename job.id to application.id
guozhangwang ymatsuda : please review.

Author: Michael G. Noll <michael@confluent.io>

Reviewers: Guozhang Wang <wangguoz@gmail.com>

Closes #1081 from miguno/KAFKA-3411
2016-03-17 10:41:48 -07:00
Ismael Juma fd6efbe0b7 MINOR: Remove unused import in `WordCountJob` to fix checkstyle failure
Author: Ismael Juma <ismael@juma.me.uk>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>

Closes #1077 from ijuma/fix-streams-checkstyle-failure
2016-03-15 13:37:33 -07:00
Yasuhiro Matsuda 355076cd26 MINOR: kstream/ktable counting method with default long serdes
guozhangwang miguno

Author: Yasuhiro Matsuda <yasuhiro@confluent.io>

Reviewers: Michael G. Noll, Guozhang Wang

Closes #1065 from ymatsuda/count_serdes
2016-03-15 12:08:26 -07:00
Guozhang Wang edeb11bc56 MINOR: Move streams-examples source files under src folder
Also remove some unused imports.

Author: Guozhang Wang <wangguoz@gmail.com>

Reviewers: Ismael Juma <ismael@juma.me.uk>, Ewen Cheslack-Postava <ewen@confluent.io>

Closes #992 from guozhangwang/KSExamples
2016-03-01 18:53:58 -08:00