Commit Graph

84 Commits

Author SHA1 Message Date
Matthias J. Sax 38b08dfd33
MINOR: revert KIP-770 (#12383)
KIP-770 introduced a performance regression and needs some re-design.

Needed to resolve some conflict while reverting.

This reverts commits 1317f3f77a and 0924fd3f9f.

Reviewers:  Sagar Rao <sagarmeansocean@gmail.com>, Guozhang Wang <guozhang@confluent.io>
2022-07-07 11:19:37 -07:00
CHUN-HAO TANG 6ac7f4ea8f
KAFKA-13821: Update Kafka Streams WordCount demo to new Processor API (#12139)
https://issues.apache.org/jira/browse/KAFKA-13821

Reviewers: Jorge Esteban Quilcate Otoya <quilcate.jorge@gmail.com>, Bill Bejeck <bbejeck@apache.org>
2022-06-28 21:39:32 -04:00
Jorge Esteban Quilcate Otoya fa0324485b
KAFKA-13654: Extend KStream process with new Processor API (#11993)
Updates the KStream process API to cover the use cases
of both process and transform, and deprecate the KStream transform API.

Implements KIP-820

Reviewer: John Roesler <vvcephei@apache.org>
2022-04-19 10:29:28 -05:00
vamossagar12 0924fd3f9f
KAFKA-13152: Replace "buffered.records.per.partition" with "input.buffer.max.bytes" (#11796)
Implements KIP-770

Reviewers: Guozhang Wang <wangguoz@gmail.com>
2022-03-21 17:16:00 -07:00
Rob Leland 06ca4850c5
KAFKA-13666 Don't Only ignore test exceptions for windows OS for certain tests. (#11752)
Tests are swallowing exceptions for supported operating systems, which could hide regressions.

Co-authored-by: Rob Leland <rleland@apache.org>

Reviewer: Bruno Cadonna <cadonna@apache.org>
2022-02-18 14:49:03 +01:00
dengziming b5b590cb67
MINOR: Use bootstrap-server instead of broker-list in doc (#10832)
* MINOR: Use bootstrap-server instead of broker-list in doc

Reviewers: Luke Chen <showuon@gmail.com>
2022-02-14 20:24:20 +08:00
Matthias J. Sax 67cf187603 Revert "KAFKA-13152: Replace "buffered.records.per.partition" with "input.buffer.max.bytes" (#11424)"
This reverts commit 14c6030c6a.
Reason: Implemenation breaks backward compatibility
2022-02-01 14:08:11 -08:00
vamossagar12 14c6030c6a
KAFKA-13152: Replace "buffered.records.per.partition" with "input.buffer.max.bytes" (#11424)
This PR is an implementation of: https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=186878390. The following changes have been made:

* Adding a new config input.buffer.max.bytes applicable at a topology level.
* Adding new config statestore.cache.max.bytes.
* Adding new metric called input-buffer-bytes-total.
* The per partition config buffered.records.per.partition is deprecated.
* The config cache.max.bytes.buffering is deprecated.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>, Guozhang Wang <guozhang@confluent.io>
2022-01-27 21:19:04 -08:00
Luke Chen f9aeebed05
KAFKA-13123: close KeyValueIterator instances in example code and tests (#11105)
Reviewers: Matthias J. Sax <matthias@confluent.io>
2021-07-26 16:23:04 -07:00
John Roesler a08e0cfe65
KAFKA-8410: Update the docs to reference the new PAPI (#10994)
Reviewers: Jim Galasyn <jim.galasyn@confluent.io>, Luke Chen <showuon@gmail.com>, Matthias J. Sax <mjsax@apache.org>
2021-07-13 10:23:50 -05:00
Israel Ekpo b3905d9f71
KAFKA-8613: New APIs for Controlling Grace Period for Windowed Operations (#10926)
Implements KIP-633.

Grace-period is an important parameter and its best to make it the user's responsibility to set it expliclity. Thus, we move off to provide a default and make it a mandatory parameter when creating a window.

Reviewers: A. Sophie Blee-Goldman <sophie@confluent.io>, Luke Chen <showuon@gmail.com>, Matthias J. Sax <matthias@confluent.io>
2021-06-30 17:09:19 -07:00
dengziming 1a16fc139a
KAFKA-10437: Update WordCount examples to use new PAPI (#10701)
Reviewers: Matthias J. Sax <matthias@confluent.io>
2021-06-16 22:24:11 -07:00
Boyang Chen ae8b784537
KAFKA-12499: add transaction timeout verification (#10482)
This PR tries to add the check for transaction timeout for a comparison against commit interval of streams. If transaction timeout is smaller than commit interval, stream should crash and inform user to update their commit interval to be larger or equal to the given transaction timeout, or vise versa.

Reviewers: Matthias J. Sax <matthias@confluent.io>, Guozhang Wang <wangguoz@gmail.com>, A. Sophie Blee-Goldman <sophie@confluent.io>
2021-05-21 15:05:39 -07:00
vamossagar12 b9acc492a5
KAFKA-12313: KIP-725: Streamlining configs for Windowed Deserialisers (#10542)
This PR aims to streamline the configurations for WindowedDeserialisers as described in KIP-725. It deprecates default.windowed.key.serde.inner and default.windowed.value.serde.inner configs in StreamConfig and adds windowed.inner.class.serde. 

Reviewers: Anna Sophie Blee-Goldman<ableegoldman@apache.org>
2021-05-17 10:17:31 -07:00
dengziming e2bffb9086
MINOR: Word count should account for extra whitespaces between words (#10229)
Reviewers: Matthias J. Sax <matthias@confluent.io>
2021-03-01 11:02:28 -08:00
Arjun Satish c8dc74e16d
MINOR: Word count should account for extra whitespaces between words (#10044)
Reviewers: Matthias J. Sax <matthias@confluent.io>
2021-02-04 18:54:08 -08:00
leah f5a2fbac6d
KAFKA-10366 & KAFKA-9649: Implement KIP-659 to allow TimeWindowedDeserializer and TimeWindowedSerde to handle window size (#9253)
See KIP details and discussions here: https://cwiki.apache.org/confluence/display/KAFKA/KIP-659%3A+Improve+TimeWindowedDeserializer+and+TimeWindowedSerde+to+handle+window+size

Deprecates methods that allow users to skip setting a window size when one is needed. Adds a window size streams config to allow the timeWindowedDeserializer to calculate window end time.

Reviewers: Walker Carlson <wcarlson@confluent.io>, John Roesler <vvcephei@apache.org>, Guozhang Wang <wangguoz@gmail.com>
2021-02-01 16:20:35 -08:00
Chia-Ping Tsai bed4c6a33b
KAFKA-12172 Migrate streams:examples module to JUnit 5 (#9857)
This PR includes following changes.
1. replace org.junit.Assert by org.junit.jupiter.api.Assertions
2. replace org.junit by org.junit.jupiter.api
3. replace Before by BeforeEach
4. replace After by AfterEach

Reviewers: Ismael Juma <ismael@confluent.io>
2021-01-13 21:02:13 +08:00
Luke Chen 179ecdf49e
KAFKA-10628: remove all the unnecessary parameters from the tests which are using TopologyTestDriver (#9507)
1. remove unneeded javadoc content.
2. Replace containsKey/setProperty with putIfAbsent
3. refactor the constructor of TopologyTestDriverTest

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2020-11-19 11:23:41 +08:00
John Roesler 58bd0a6ee3
MINOR: TopologyTestDriver should not require dummy parameters (#9477)
TopologyTestDriver comes with a paper cut that it passes through a
config requirement that application.id and bootstrap.servers must be
configured. But these configs are not required in the context of
TopologyTestDriver specifically. This change relaxes the requirement.

Reviewers: Boyang Chen <boyang@apache.org>, Matthias J. Sax <mjsax@apache.org>
2020-10-22 08:19:01 -05:00
John Roesler 659b05f78a
KAFKA-10605: Deprecate old PAPI registration methods (#9448)
Add deprecation annotations to the methods replaced in KIP-478.

Reviewers: Bill Bejeck <bbejeck@apache.org>
2020-10-19 15:29:27 -05:00
John Roesler 2804257fe2
KAFKA-10562: Properly invoke new StateStoreContext init (#9388)
* all wrapping stores should pass StateStoreContext init through to the same
  method on the wrapped store and not translate it to ProcessorContext init
* base-level stores should handle StateStoreContext init so that callers passing
  a non-InternalProcessorContext implementation will be able to initialize the store
* extra tests are added to verify the desired behavior

Reviewers: Guozhang Wang <guozhang@apache.org>
2020-10-07 23:06:53 -05:00
John Roesler 69790a1463
KAFKA-10535: Split ProcessorContext into Processor/StateStore/Record Contexts (#9361)
Migrate different components of the old ProcessorContext interface
into separate interfaces that are more appropriate for their usages.
See KIP-478 for the details.

Reviewers: Guozhang Wang <guozhang@apache.org>, Paul Whalen <pgwhalen@gmail.com>
2020-10-02 18:49:12 -05:00
John Roesler 09d1498e30
KAFKA-10436: Implement KIP-478 Topology changes (#9221)
Convert Topology#addProcessor and #addGlobalStore
Also, convert some of the internals in support of addProcessor

Reviewers: Bill Bejeck <bbejeck@apache.org>
2020-09-09 12:37:21 -05:00
Mickael Maison 8af7b96bfb
KAFKA-10367: Allow running the Streams demo app with a config file (#9131)
Update the 3 WordCount demos to accept a configuration file.

Reviewers: Matthias J. Sax <mjsax@apache.org>
2020-08-22 18:00:00 +02:00
John Roesler 26a217c8e7
MINOR: Streams integration tests should not call exit (#9067)
- replace System.exit with Exit.exit in all relevant classes
- forbid use of System.exit in all relevant classes and add exceptions for others

Co-authored-by: John Roesler <vvcephei@apache.org>
Co-authored-by: Matthias J. Sax <matthias@confluent.io>

Reviewers: Lucas Bradstreet <lucas@confluent.io>, Ismael Juma <ismael@confluent.io>
2020-08-05 13:52:50 -07:00
John Roesler 0e6c8a55b9
KAFKA-10200: Fix testability of PAPI with windowed stores (#8927)
It's currently not possible to unit-test custom processors that use windowed stores,
because the provided windowed store implementations cast the context to
InternalProcessorContext.

This change adds a public API example using windowed stores, and fixes the
casts internally that would make that example fail previously.

Reviewers: A. Sophie Blee-Goldman <sophie@confluent.io>, Bruno Cadonna <bruno@confluent.io>
2020-06-30 11:59:47 -05:00
Paul 075bbcfec4
KAFKA-7523: Add ConnectedStoreProvider to Processor API (#6824)
Implements KIP-401:
 - Add ConnectedStoreProvider interface
 - let Processor/[*]Transformer[*]Suppliers extend ConnectedStoreProvider
 - allows to add and connect state stores to processors/transformers implicitly

Reviewers: Matthias J. Sax <matthias@confluent.io>, John Roesler <john@confluent.io>
2020-05-27 10:57:14 -07:00
John Roesler fd095aaafd
KAFKA-8410: Revert Part 1: processor context bounds (#8414) (#8595)
This reverts commit 29e08fd2c2.
There turned out to be more than expected problems with adding the generic parameters.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2020-05-01 14:26:36 -05:00
John Roesler 29e08fd2c2
KAFKA-8410: Part 1: processor context bounds (#8414)
Add type bounds to the ProcessorContext, which bounds the types that can be forwarded to child nodes.

Reviewers: Matthias J. Sax <matthias@confluent.io>
2020-04-07 13:11:02 -05:00
Matthias J. Sax 21cfd0b453
MINOR: Fix generic types in StreamsBuilder and Topology (#8273)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Guozhang Wang <guozhang@confluent.io>, John Roesler <john@confluent.io>
2020-03-19 14:29:15 -07:00
Jukka Karvanen a5a6938c69 KAFKA-8233: TopologyTestDriver test input and output usability improvements (#7378)
Implements KIP-470

Reviewers: Bill Bejeck <bill@confluent.io>, John Roesler <john@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2019-10-07 01:01:58 -07:00
A. Sophie Blee-Goldman 62fbc92e3d KAFKA-8615: Change to track partition time breaks TimestampExtractor (#7054)
The timestamp extractor takes a previousTimestamp parameter which should be the partition time. This PR adds back in partition time tracking for the extractor, and renames previousTimestamp --> partitionTime

Reviewers: Guozhang Wang <wangguoz@gmail.com>, Bill Bejeck <bbejeck@gmail.com>, Matthias J. Sax <mjsax@apache.org>
2019-07-18 13:54:46 -07:00
Kengo Seki 41e1c13a52 MINOR: Fix a wrong description in PipeDemo's javadoc (#6901)
This PR fixes a wrong input stream name in PipeDemo's javadoc.

Reviewers: Kamal Chandraprakash <kamal.chandraprakash@gmail.com>, Jason Gustafson <jason@confluent.io>
2019-07-04 01:00:26 -07:00
Viktor Somogyi-Vass 776041db11 KAFKA-7804: Update docs for topic-command related KIP-377
This PR adds a upgrade notes and changes examples to use the bootstrap-server.

Author: Viktor Somogyi-Vass <viktorsomogyi@gmail.com>

Reviewers: Srinivas <srinivas96alluri@gmail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>

Closes #6118 from viktorsomogyi/topiccommand-adminclient-doc
2019-02-04 13:46:33 -08:00
Matthias J. Sax 046b0087bd
MINOR: improve Streams checkstyle and code cleanup (#5954)
Reviewers: Guozhang Wang <guozhang@confluent.io>, Nikolay Izhikov <nIzhikov@gmail.com>, Ismael Juma <ismael@confluent.io>, Bill Bejeck <bill@confluent.io>
2018-12-11 01:54:41 -08:00
Guozhang Wang 14d3ead19d
MINOR: Remove deprecated callers (#5911)
Callers of 1) Windows#until, 2) Windows#of, 3) Serialized are replaced when possible with the new APIs.

Reviewers: Matthias J. Sax <mjsax@apache.org>, Bill Bejeck <bill@confluent.io>
2018-11-14 17:29:19 -08:00
Ismael Juma 12f310d50e
KAFKA-7612: Fix javac warnings and enable warnings as errors (#5900)
- Use Xlint:all with 3 exclusions (filed KAFKA-7613 to remove the exclusions)
- Use the same javac options when compiling tests (seems accidental that
we didn't do this before)
- Replaced several deprecated method calls with non-deprecated ones:
  - `KafkaConsumer.poll(long)` and `KafkaConsumer.close(long)`
  - `Class.newInstance` and `new Integer/Long` (deprecated since Java 9)
  - `scala.Console` (deprecated in Scala 2.11)
  - `PartitionData` taking a timestamp (one of them seemingly a bug)
  - `JsonMappingException` single parameter constructor
- Fix unnecessary usage of raw types in several places.
- Add @SuppressWarnings for deprecations, unchecked and switch fallthrough in
several places.
- Scala clean-ups (var -> val, ETA expansion warnings, avoid reflective calls)
- Use lambdas to simplify code in a few places
- Add @SafeVarargs, fix varargs usage and remove unnecessary `Utils.mkList` method

Reviewers: Matthias J. Sax <mjsax@apache.org>, Manikumar Reddy <manikumar.reddy@gmail.com>, Randall Hauch <rhauch@gmail.com>, Bill Bejeck <bill@confluent.io>, Stanislav Kozlovski <stanislav_kozlovski@outlook.com>
2018-11-12 22:18:59 -08:00
Nikolay ca641b3e2e KAFKA-7277: Migrate Streams API to Duration instead of longMs times (#5682)
Reviewers: Johne Roesler <john@confluent.io>, Matthias J. Sax <matthias@confluent.io>, Bill Bejeck <bill@confluent.io>, Guozhang Wang <guozhang@confluent.io>
2018-10-04 13:51:39 -07:00
John Roesler d57fe1b053 MINOR: single Jackson serde for PageViewTypedDemo (#5590)
Previously, we depicted creating a Jackson serde for every pojo class, which becomes a burden in practice. There are many ways to avoid this and just have a single serde, so we've decided to model this design choice instead.

Reviewers: Viktor Somogyi <viktorsomogyi@gmail.com>, Bill Bejeck <bill@confluent.io>, Guozhang Wang <wangguoz@gmail.com>
2018-08-31 13:13:42 -07:00
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