Commit Graph

112 Commits

Author SHA1 Message Date
Randall Hauch 4c48942f9d KAFKA-5142: Add Connect support for message headers (KIP-145)
**[KIP-145](https://cwiki.apache.org/confluence/display/KAFKA/KIP-145+-+Expose+Record+Headers+in+Kafka+Connect) has been accepted, and this PR implements KIP-145 except without the SMTs.**

Changed the Connect API and runtime to support message headers as described in [KIP-145](https://cwiki.apache.org/confluence/display/KAFKA/KIP-145+-+Expose+Record+Headers+in+Kafka+Connect).

The new `Header` interface defines an immutable representation of a Kafka header (key-value pair) with support for the Connect value types and schemas. This interface provides methods for easily converting between many of the built-in primitive, structured, and logical data types.

The new `Headers` interface defines an ordered collection of headers and is used to track all headers associated with a `ConnectRecord` (and thus `SourceRecord` and `SinkRecord`). This does allow multiple headers with the same key. The `Headers` contains methods for adding, removing, finding, and modifying headers. Convenience methods allow connectors and transforms to easily use and modify the headers for a record.

A new `HeaderConverter` interface is also defined to enable the Connect runtime framework to be able to serialize and deserialize headers between the in-memory representation and Kafka’s byte[] representation. A new `SimpleHeaderConverter` implementation has been added, and this serializes to strings and deserializes by inferring the schemas (`Struct` header values are serialized without the schemas, so they can only be deserialized as `Map` instances without a schema.) The `StringConverter`, `JsonConverter`, and `ByteArrayConverter` have all been extended to also be `HeaderConverter` implementations. Each connector can be configured with a different header converter, although by default the `SimpleHeaderConverter` is used to serialize header values as strings without schemas.

Unit and integration tests are added for `ConnectHeader` and `ConnectHeaders`, the two implementation classes for headers. Additional test methods are added for the methods added to the `Converter` implementations. Finally, the `ConnectRecord` object is already used heavily, so only limited tests need to be added while quite a few of the existing tests already cover the changes.

Author: Randall Hauch <rhauch@gmail.com>

Reviewers: Arjun Satish <arjun@confluent.io>, Ted Yu <yuzhihong@gmail.com>, Magesh Nandakumar <magesh.n.kumar@gmail.com>, Konstantine Karantasis <konstantine@confluent.io>, Ewen Cheslack-Postava <ewen@confluent.io>

Closes #4319 from rhauch/kafka-5142-b
2018-01-31 10:40:24 -08:00
Matthias J. Sax d673c8cf94 MINOR: update upgrade notes with regard to KIP-149 (#4439)
Reviewers: Guozhang Wang <wangguoz@gmail.com>, Damian Guy <damian.guy@gmail.com>
2018-01-26 09:18:22 -08:00
Matthias J. Sax 9ef883e62f MINOR: update docs with regard to improved resilience of Kafka Streams (#4380)
Reviewers: Guozhang Wang <wangguoz@gmail.com>, Joel Hamill, Damian Guy <damian.guy@gmail.com>, Bill Bejeck <bill@confluent.io>
2018-01-22 14:37:19 -08:00
cmolter 5d81639907 KAFKA-5890; records.lag should use tags for topic and partition rather than using metric name.
This is the implementation of KIP-225.
It marks the previous metrics as deprecated in the documentation and adds new metrics using tags.

Testing verifies that both the new and the old metric report the same value.

Author: cmolter <cmolter@apple.com>

Reviewers: Jiangjie (Becket) Qin <becket.qin@gmail.com>

Closes #4362 from lahabana/kafka-5890
2018-01-14 16:18:39 -08:00
Ismael Juma 88c2b6849a KAFKA-6317; Maven artifact for kafka should not depend on log4j
It should only depend on slf4j-api (like kafka-clients). The
release tarball still includes log4j and slf4j-log4j12.

Manually verified that there are no duplicate dependencies
in the release tarball and `./gradlew core:dependencies`
looks good.

Author: Ismael Juma <ismael@juma.me.uk>

Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>

Closes #4297 from ijuma/kafka-6317-kafka-slf4j-api-only
2017-12-19 15:15:27 +00:00
Guozhang Wang 72eec0a04c KAFKA-6334: minor typo fix in web docs 2017-12-11 18:55:13 -08:00
Dong Lin 078fd21365 KAFKA-6174; Add methods in AdminClient Options classes to restore binary compatibility with 0.11
From 0.11 to 1.0, we moved `DescribeClusterOptions timeoutMs(Integer timeoutMs)` from
DescribeClusterOptions to AbstractOptions (similarly for other Options classes). This can
cause code compiled against 0.11.0.x to fail when it is executed with 1.0 kafka-clients jar.
This patch adds back these methods to restore binary compatibility with 0.11.

Author: Dong Lin <lindong28@gmail.com>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #4257 from lindong28/KAFKA-6174
2017-12-06 15:56:56 +02:00
Jason Gustafson 062c5568e1 KAFKA-6238; Fix 1.0.0 upgrade instructions relating to the message format version
The upgrade instructions concerning the message format versions did not account
for upgrades from versions prior to 0.11.0.x.

Author: Jason Gustafson <jason@confluent.io>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #4256 from hachikuji/KAFKA-6328
2017-11-23 14:46:21 +00:00
Guozhang Wang 520b313628 HOTFIX: Add missing template ref in upgrade section 2017-11-03 10:10:35 -07:00
Manikumar Reddy 76a45e0dce MINOR: Update `config/consumer.properties` to have new consumer properties
Author: Manikumar Reddy <manikumar.reddy@gmail.com>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #4055 from omkreddy/update-consumer-props
2017-10-12 14:28:55 +01:00
Manikumar Reddy 10cd98cc89 KAFKA-5547; Return TOPIC_AUTHORIZATION_FAILED error if no describe access for topics
Author: Manikumar Reddy <manikumar.reddy@gmail.com>

Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>, Ismael Juma <ismael@juma.me.uk>, Jason Gustafson <jason@confluent.io>

Closes #3924 from omkreddy/KAFKA-5547-TOPIC-AUTHRO
2017-10-06 12:51:30 -07:00
Rajini Sivaram 9949e1ed1b KAFKA-6004; Allow authentication providers to override error message
Author: Rajini Sivaram <rajinisivaram@googlemail.com>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #4015 from rajinisivaram/KAFKA-6004-auth-exception
2017-10-04 13:44:46 -04:00
Jason Gustafson 5383f9bed0 MINOR: Use SecurityProtocol in AuthenticationContext
Since we removed the unused `TRACE` option from `SecurityProtocol`, it now seems safer to expose it from `AuthenticationContext`. Additionally this patch exposes javadocs under security.auth and relocates the `Login` and `AuthCallbackHandler` to a non-public package.

Author: Jason Gustafson <jason@confluent.io>

Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>, Ismael Juma <ismael@juma.me.uk>

Closes #3863 from hachikuji/use-security-protocol-in-auth-context
2017-10-04 09:20:21 -07:00
Rajini Sivaram c4b8a7eab4 KAFKA-5738; Upgrade note for cumulative count metric (KIP-187)
Author: Rajini Sivaram <rajinisivaram@googlemail.com>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #4014 from rajinisivaram/MINOR-upgrade-KIP-187
2017-10-04 10:53:18 -04:00
Rajini Sivaram a202da742d KAFKA-4764; Upgrade notes for authentication failure handling (KIP-152)
Author: Rajini Sivaram <rajinisivaram@googlemail.com>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #4013 from rajinisivaram/MINOR-upgrade-auth-failure
2017-10-04 10:25:08 -04:00
Dong Lin 716330a5b2 KAFKA-5843; Mx4jLoader.maybeLoad should only be executed if kafka_mx4jenable is set to true
Author: Dong Lin <lindong28@gmail.com>
Author: Ralph Weires

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #3797 from lindong28/KAFKA-5843
2017-10-03 11:27:22 +01:00
Ismael Juma 4f4f995325 KAFKA-5746; Return 0.0 from Metric.value() instead of throwing exception
This is less likely to break custom metric reporters and since the method
is deprecated, people will be warned about this potential issue.

Author: Ismael Juma <ismael@juma.me.uk>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>, Xavier Léauté <xavier@confluent.io>

Closes #3996 from ijuma/avoid-exception-in-measurable-value
2017-10-01 01:29:33 +01:00
Rajini Sivaram 021d8a8e96 KAFKA-5746; Add new metrics to support health checks (KIP-188)
Adds new metrics to support health checks:
1. Error rates for each request type, per-error code
2. Request size and temporary memory size
3. Message conversion rate and time
4. Successful and failed authentication rates
5. ZooKeeper latency and status
6. Client version

Author: Rajini Sivaram <rajinisivaram@googlemail.com>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #3705 from rajinisivaram/KAFKA-5746-new-metrics
2017-09-28 21:58:59 +01:00
Manikumar Reddy 8dfdcfd02c KAFKA-5750; Elevate log messages for denials to INFO in SimpleAclAuthorizer
Author: Manikumar Reddy <manikumar.reddy@gmail.com>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #3698 from omkreddy/KAFKA-5750
2017-09-27 16:39:12 +01:00
Dong Lin 4e43a7231d MINOR: Improve documentation of AdminClient and fix exception thrown
Make documentation consistent across methods and throw
IllegalStateException instead of IllegalArgumentException in
some cases.

Also include a couple of minor fixes in upgrade.html.

Author: Dong Lin <lindong28@gmail.com>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #3781 from lindong28/minor-admin-client-comment
2017-09-26 08:20:26 +01:00
Mickael Maison a0f533266a KAFKA-3356: Remove ConsumerOffsetChecker
Author: Mickael Maison <mickael.maison@gmail.com>

Reviewers: Ismael Juma <ismael@juma.me.uk>, Jason Gustafson <jason@confluent.io>

Closes #3036 from mimaison/KAFKA-3356
2017-09-24 10:08:52 +08:00
Mickael Maison c8c6ab6324 KAFKA-5735; KIP-190: Handle client-ids consistently
Developed with edoardocomar

Author: Mickael Maison <mickael.maison@gmail.com>

Reviewers: Edoardo Comar <ecomar@uk.ibm.com>, Rajini Sivaram <rajinisivaram@googlemail.com>

Closes #3906 from mimaison/KAFKA-5735
2017-09-21 21:16:57 +01:00
Guozhang Wang f5310d645c MINOR: doc changes for KIP-138
1. Core concepts (added the stream time definition), upgrade guide and developer guide.
2. Related Java docs changes.

Author: Guozhang Wang <wangguoz@gmail.com>

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

Closes #3732 from guozhangwang/KMinor-kip138-docs
2017-08-30 09:45:16 -07:00
Guozhang Wang 21fea170d8 MINOR: add upgrade section for 1.0.0
1. Add upgrade section for 1.0.0, including Streams API changes section.
2. Add metrics name changes section.

Author: Guozhang Wang <wangguoz@gmail.com>

Reviewers: Eno Thereska <eno.thereska@gmail.com>, Damian Guy <damian.guy@gmail.com>

Closes #3687 from guozhangwang/KMinor-metrics-upgrade-guide
2017-08-24 09:12:12 -07:00
Jason Gustafson 017a21c604 MINOR: Remove unneeded error handlers in deprecated request objects
These handlers were previously used on the broker to handle uncaught exceptions, but now the broker users the new Java request objects exclusively.

Author: Jason Gustafson <jason@confluent.io>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #3646 from hachikuji/remove-old-request-error-handlers
2017-08-10 11:07:53 -07:00
Ismael Juma 69d3d4aad6 KAFKA-5470; Replace -XX:+DisableExplicitGC with -XX:+ExplicitGCInvokesConcurrent in kafka-run-class
This is important because Bits.reserveMemory calls System.gc() hoping to free native
memory in order to avoid throwing an OutOfMemoryException. This call is currently
a no-op due to -XX:+DisableExplicitGC.

It's worth mentioning that -XX:MaxDirectMemorySize can be used to increase the
amount of native memory available for allocation of direct byte buffers.

Author: Ismael Juma <ismael@juma.me.uk>

Reviewers: Apurva Mehta <apurva@confluent.io>, Manikumar Reddy <manikumar.reddy@gmail.com>, Jason Gustafson <jason@confluent.io>

Closes #3371 from ijuma/kafka-5470-explicit-gc-invokes-concurrent
2017-08-09 23:38:57 +01:00
Ismael Juma 5effe72390 MINOR: Next release will be 1.0.0
Author: Ismael Juma <ismael@juma.me.uk>

Reviewers: Guozhang Wang <wangguoz@gmail.com>

Closes #3580 from ijuma/bump-to-1.0.0-SNAPSHOT
2017-07-26 13:01:41 -07:00
Dong Lin fc93fb4b61 KAFKA-4763; Handle disk failure for JBOD (KIP-112)
Author: Dong Lin <lindong28@gmail.com>

Reviewers: Jiangjie Qin <becket.qin@gmail.com>, Jun Rao <junrao@gmail.com>, Ismael Juma <ismael@juma.me.uk>, Onur Karaman <okaraman@linkedin.com>

Closes #2929 from lindong28/KAFKA-4763
2017-07-22 12:35:32 -07:00
Ismael Juma 91b5fc737b MINOR: Give correct instructions for retaining previous unclear leader election behaviour
Author: Ismael Juma <ismael@juma.me.uk>

Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>

Closes #3561 from ijuma/fix-upgrade-note-for-unclean-leader-election
2017-07-22 10:36:12 +01:00
Vahid Hashemian 5bb53e034e KAFKA-5534; KafkaConsumer `offsetForTimes` result should include partitions with no offset
For topics that support timestamp search, if no offset is found for a partition, the partition should still be included in the result with a `null` offset value. This `KafkaConsumer` method currently excludes such partitions from the result.

Author: Vahid Hashemian <vahidhashemian@us.ibm.com>

Reviewers: Ismael Juma <ismael@juma.me.uk>, Jason Gustafson <jason@confluent.io>

Closes #3460 from vahidhashemian/KAFKA-5534
2017-07-20 17:38:30 -07:00
Gwen Shapira ea8845bbd6 KAFKA-5384: Enable topic deletion by default
https://cwiki.apache.org/confluence/display/KAFKA/KIP-162+-+Enable+topic+deletion+by+default

Author: Gwen Shapira <cshapi@gmail.com>

Reviewers: Ismael Juma

Closes #3241 from gwenshap/KAFKA-5384
2017-07-18 08:57:06 -07:00
Jason Gustafson e6e2631743 MINOR: Detail message/batch size implications for conversion between old and new formats
Author: Jason Gustafson <jason@confluent.io>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #3373 from hachikuji/fetch-size-upgrade-notes
2017-06-21 14:04:19 -07:00
Jason Gustafson 8711e5937f KAFKA-5019; Upgrades notes for idempotent/transactional features and new message format
Author: Jason Gustafson <jason@confluent.io>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #3212 from hachikuji/KAFKA-5019
2017-06-03 06:36:29 +01:00
Ismael Juma 4959444afc KAFKA-5236; Increase the block/buffer size when compressing with Snappy or Gzip
We had originally increased Snappy’s block size as part of KAFKA-3704. However,
we had some issues with excessive memory usage in the producer and we reverted
it in 7c6ee8d5e.

After more investigation, we fixed the underlying reason why memory usage seemed
to grow much more than expected via KAFKA-3747 (included in 0.10.0.1).

In 0.10.2, we changed the broker to use the same classes as the producer and the
broker’s block size for Snappy was changed from 32 KB to 1KB. As reported in
KAFKA-5236, the on disk size is, in some cases, 50% larger when the data is compressed
with 1 KB instead of 32 KB as the block size.

As discussed in KAFKA-3704, it may be worth making this configurable and/or allocate
the compression buffers from the producer pool. However, for 0.11.0.0, I think the
simplest thing to do is to default to 32 KB for Snappy (the default if no block size
is provided).

I also increased the Gzip buffer size. 1 KB is too small and the default is smaller
still (512 bytes). 8 KB (which is the default buffer size for BufferedOutputStream)
seemed like a reasonable default.

Author: Ismael Juma <ismael@juma.me.uk>

Reviewers: Jason Gustafson <jason@confluent.io>

Closes #3205 from ijuma/kafka-5236-snappy-block-size
2017-06-02 21:20:02 +01:00
Guozhang Wang 4c8ec795a0 MINOR: Add upgrade notes for KAFKA-2358
Author: Guozhang Wang <wangguoz@gmail.com>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #3200 from guozhangwang/KMinor-KAFKA-2358-upgrade-notes
2017-06-01 18:24:54 -07:00
Matthias J. Sax 1e350b860a MINOR: update Streams docs for KIP-123
Author: Matthias J. Sax <matthias@confluent.io>

Reviewers: Ismael Juma, Ewen Chesklack-Postava, Bill Bejeck, Guozhang Wang

Closes #3194 from mjsax/minor-update-docs-for-kip-123
2017-06-01 15:27:41 -07:00
Damian Guy adb4ea74ab MINOR: add upgrade not for group.initial.rebalance.delay.ms
Add a new entry in upgrade.html for `group.initial.rebalance.delay.ms`

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

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

Closes #3189 from dguy/relabance-delay
2017-06-01 13:42:12 -07:00
Jiangjie Qin 6b03497915 KAFKA-5344; set message.timestamp.difference.max.ms back to Long.MaxValue
Author: Jiangjie Qin <becket.qin@gmail.com>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #3163 from becketqin/KAFKA-5344
2017-05-30 15:44:34 +01:00
Jason Gustafson cea319a4ad KAFKA-4935; Deprecate client checksum API and compute lazy partial checksum for magic v2
Author: Jason Gustafson <jason@confluent.io>

Reviewers: Apurva Mehta <apurva@confluent.io>, Ismael Juma <ismael@juma.me.uk>

Closes #3123 from hachikuji/KAFKA-4935
2017-05-25 08:21:01 +01:00
Michael André Pearce 1c7fdd2843 KAFKA-4208; Add record headers upgrade doc
Update upgrade.html

Raising this now, as KIP-118 is pulled from release as such submitting this without java 8 changes.

As per remaining review comment from https://github.com/apache/kafka/pull/2772, updating the upgrade notes.

Author: Michael André Pearce <michael.andre.pearce@me.com>
Author: Michael Andre Pearce <Michael.Andre.Pearce@me.com>

Reviewers: Jiangjie Qin <becket.qin@gmail.com>, Ismael Juma <ismael@juma.me.uk>

Closes #2991 from michaelandrepearce/KIP-82
2017-05-21 14:34:19 -07:00
Ismael Juma 59b918ec2b KAFKA-3763; Remove deprecated APIs for 0.11.0.0
This only removes deprecated methods,
fields and constructors in a small number of classes.

Deprecated producer configs is tracked via KAFKA-3353
and the old clients and related (tools, etc.) won't
be removed in 0.11.0.0.

Author: Ismael Juma <ismael@juma.me.uk>

Reviewers: Jason Gustafson <jason@confluent.io>

Closes #2995 from ijuma/kafka-3763-remove-deprecated-0.11
2017-05-08 10:29:31 -07:00
Ismael Juma 3bcadbfb47 KAFKA-3353; Remove deprecated producer configs
These configs have been deprecated since 0.9.0.0:
block.on.buffer.full, metadata.fetch.timeout.ms and timeout.ms

Author: Ismael Juma <ismael@juma.me.uk>

Reviewers: Jason Gustafson <jason@confluent.io>

Closes #2987 from ijuma/kafka-3353-remove-deprecated-producer-configs
2017-05-08 10:00:04 -07:00
Ryan P 8d74920163 KAFKA-3754; Add GC log retention policy to limit size of log
Add a default log retention policy to keep GC logs from growing too large

Author: Ryan P <ryan.n.pridgeon@gmail.com>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #1431 from rnpridgeon/KAFKA-3754
2017-05-03 10:51:32 +01:00
sharad-develop 46da01a4a7 KAFKA-4623; Default unclean.leader.election.enabled to false (KIP-106)
Author: sharad.develop <sharad.develop@gmail.com>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #2625 from sharad-develop/KAFKA-4623
2017-05-02 16:27:28 +01:00
Gwen Shapira 3c93fa321b HOTFIX: HTML formatting error in upgrade docs
Introduced in PR #2824. Already fixed in the
website github.

Author: Gwen Shapira <cshapi@gmail.com>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #2844 from gwenshap/docs-hotfix

(cherry picked from commit 5f728532ac)
Signed-off-by: Ismael Juma <ismael@juma.me.uk>
2017-04-12 11:09:21 +01:00
Eno Thereska a74f035844 MINOR: Added changes in 0.10.2.1
Author: Eno Thereska <eno@confluent.io>

Reviewers: Gwen Shapira

Closes #2824 from enothereska/minor-docs-0.10.2.1

(cherry picked from commit 5a68fa7e4e)
Signed-off-by: Gwen Shapira <cshapi@gmail.com>
2017-04-11 17:08:04 -07:00
Dong Lin 8b05ad406d KAFKA-4586; Add purgeDataBefore() API (KIP-107)
Author: Dong Lin <lindong28@gmail.com>

Reviewers: Jun Rao <junrao@gmail.com>, Ismael Juma <ismael@juma.me.uk>, Jiangjie Qin <becket.qin@gmail.com>

Closes #2476 from lindong28/KAFKA-4586
2017-03-28 09:59:44 -07:00
Jason Gustafson 5bd06f1d54 KAFKA-4816; Message format changes for idempotent/transactional producer (KIP-98)
Author: Jason Gustafson <jason@confluent.io>

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

Closes #2614 from hachikuji/exactly-once-message-format
2017-03-24 19:38:43 +00:00
Guozhang Wang 6a55d41fe3 HOTFIX: add js template to upgrade.html
Author: Guozhang Wang <wangguoz@gmail.com>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #2591 from guozhangwang/KHotfix-explicit-version
2017-02-23 13:21:49 -08:00
Jiangjie Qin 1f2ee5f0a9 KAFKA-4340; Follow-up fixing system test failures and handling non default log.retention.ms
Author: Jiangjie Qin <becket.qin@gmail.com>

Reviewers: Jun Rao <junrao@gmail.com>, Ismael Juma <ismael@juma.me.uk>

Closes #2544 from becketqin/KAFKA-4340_follow_up
2017-02-17 02:40:34 -08:00