Граф коммитов

4636 Коммитов

Автор SHA1 Сообщение Дата
microsoft-github-policy-service[bot] ac50512d12
Microsoft mandatory file 2022-08-02 16:08:54 +00:00
Soumyajit Sahu aad7e50a1a
Merge pull request #4 from Microsoft/tozhan-test
merge latest changes from Apache/kafka to microsoft/kafka trunk
2018-02-01 17:22:53 -08:00
bartdevylder b0132c31e9 KAFKA-6487: ChangeLoggingKeyValueBytesStore does not propagate delete (#4495)
The ChangeLoggingKeyValueBytesStore used to write null to its underlying store instead of propagating the delete, which has two drawbacks:

* an iterator will see null values
* unbounded memory growth of the underlying in-memory keyvalue store

The fix will just propagate the delete instead of performing put(key, null).

The changes to the tests:

*extra test whether the key is really gone after delete by calling the approximateEntries on the underlying store. This number is exact because we know the underlying store in the test is of type InMemoryKeyValueStore
* extra test to check a delete is logged as <key, null> (the existing test would also succeed if the key is just absent)

While also updating the corresponding tests of the ChangeLoggingKeyValueStore I noticed the class is nowhere used anymore so I removed it from the source code for clarity.

Reviewers: Guozhang Wang <wangguoz@gmail.com>, Bill Bejeck <bill@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2018-02-01 16:14:22 -08:00
Jason Gustafson afdf9a8510 KAFKA-6492; Fix log truncation to empty segment
This patch ensures that truncation to an empty segment forces resizing of the index file in order to prevent premature rolling.

I have added unit tests which verify that appends are permitted following truncation to an empty segment. Without the fix, this test case reproduces the failure in which the rolled segment matches the current active segment.

Author: Jason Gustafson <jason@confluent.io>

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

Closes #4498 from hachikuji/KAFKA-6492
2018-02-01 11:57:52 -08:00
Andy Bryant 86de4a86b8 KAFKA-6378: For KStream-GlobalKTable joins let null KeyValueMapper results indicate no match (#4494)
Reviewers: Damian Guy <damian@confluent.io>, Matthias J. Sax <matthias@confluent.io>, Guozhang Wang <wangguoz@gmail.com>
2018-02-01 10:27:59 -08:00
Dmitry Minkovsky 498cf73f54 MINOR: Fix typo in KTable javadoc
*More detailed description of your change,
if necessary. The PR title and PR message become
the squashed commit message, so use a separate
comment to ping reviewers.*

*Summary of testing strategy (including rationale)
for the feature or bug fix. Unit and/or integration
tests are expected for any behaviour change and
system tests should be considered for larger changes.*

Author: Dmitry Minkovsky <dminkovsky@gmail.com>

Reviewers: Joel Hamill <joel-hamill@users.noreply.github.com>, Matthias J. Sax <mjsax@apache.org>, Guozhang Wang <wangguoz@gmail.com>

Closes #4483 from dminkovsky/fix-javadoc-typo

github comments
2018-02-01 10:17:06 -08:00
Guozhang Wang 4a2aa4bb67
KAFKA-6499: Do not write offset checkpoint file with empty offset map (#4492)
* In Checkpoint.write(), if the offset map passed in is empty, skip the writing of the file which would only contain version number and the empty size. From the reading pov, it is the same as no file existed.
* Add related unit tests.
* Minor fixes on log4j messages.

Reviewers: Bill Bejeck <bill@confluent.io>, Damian Guy <damian@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2018-02-01 10:11:29 -08:00
Jiangjie Qin 7804ea173b KAFKA-6489; Fetcher.retrieveOffsetsByTimes() should batch the metadata fetch.
Currently if users call KafkaConsumer.offsetsForTimes() with a large set of partitions. The consumer will add one topic at a time for the metadata refresh. We should add all the topics to the metadata topics and just do one metadata refresh instead.

Author: Jiangjie Qin <becket.qin@gmail.com>

Reviewers: Jason Gustafson <jason@confluent.io>

Closes #4478 from becketqin/KAFKA-6849
2018-02-01 08:58:29 -08:00
Damian Guy ca01711c0e
Bump trunk versions to 1.2-SNAPSHOT (#4505) 2018-02-01 11:35:43 +00:00
Rajini Sivaram c38a34559f
MINOR: Fix brokerId passed to metrics reporters (#4497)
Remove caching of brokerId in DynamicBrokerConfig constructor and delay initialization until brokerId is set in KafkaConfig.

Reviewers: Jason Gustafson <jason@confluent.io>
2018-01-31 17:59:49 -08:00
Panuwat Anawatmongkhon b8222065e0 KAFKA-6138 Simplify StreamsBuilder#addGlobalStore (#4430)
- implements KIP-233

Author: Panuwat Anawatmongkhon <panuwat.anawatmongkhon@gmail.com>

Reviewers: Bill Bejeck <bill@confluent.io>, Damian Guy <damian@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2018-01-31 13:53:15 -08:00
Vahid Hashemian 1ed6da7cc8 KAFKA-6275: Add DeleteGroups API (KIP-229) (#4479)
Reviewers: Manikumar Reddy O <manikumar.reddy@gmail.com>, Jason Gustafson <jason@confluent.io>
2018-01-31 13:23:12 -08:00
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
Soenke Liebau 530bc59de2 KAFKA-4930: Enforce set of legal characters for connector names (KIP-212)
…to check for empty connector name and illegal characters in connector name. This also fixes  KAFKA-4938 by removing the check for slashes in connector name from ConnectorsResource.

Author: Ewen Cheslack-Postava <me@ewencp.org>
Author: Soenke Liebau <soenke.liebau@opencore.com>

Reviewers: Gwen Shapira <cshapi@gmail.com>, Viktor Somogyi <viktor.somogyi@cloudera.com>, Randall Hauch <rhauch@gmail.com>, Ewen Cheslack-Postava <ewen@confluent.io>

Closes #2755 from soenkeliebau/KAFKA-4930
2018-01-31 08:49:23 -08:00
fredfp 15568fdbe7 KAFKA-6323: punctuate with WALL_CLOCK_TIME triggered immediately (#4301)
This PR avoids unnecessary punctuation calls if punctuations are missed due to large time advances. It also aligns punctuation schedules to the epoch.

Author: Frederic Arno

Reviewers: Michal Borowiecki <michal.borowiecki@openbet.com>, Guozhang Wang <wangguoz@gmail.com>, Damian Guy <damian.guy@gmail.com>, Matthias J. Sax <matthias@confluent.io>
2018-01-30 18:18:55 -08:00
Guozhang Wang 3e4176fdd6 HOTFIX: ignore reset integration tests
ignore reset integraion test
2018-01-30 17:22:36 -08:00
Steven Aerts ae42cc8030 KAFKA-6018: Make KafkaFuture.Future an interface (KIP-218)
Changing KafkaFuture.Future and KafkaFuture.BiConsumer into an interface makes
them a functional interface.  This makes them Java 8 lambda compatible.

Author: Colin P. Mccabe <cmccabe@confluent.io>
Author: Steven Aerts <steven.aerts@gmail.com>

Reviewers: Colin P. Mccabe <cmccabe@confluent.io>, Ismael Juma <ismael@juma.me.uk>, Xavier Léauté <xl+github@xvrl.net>, Tom Bentley <tbentley@redhat.com>, Ewen Cheslack-Postava <ewen@confluent.io>

Closes #4033 from steven-aerts/KAFKA-6018
2018-01-30 15:55:49 -08:00
Bill Bejeck c6635e8d12 KAFKA-4969: Attempt to evenly distribute load of tasks (#4410)
* removed round-robin approach, try to assign tasks to consumers in a more even manner, added unit test.
* better interleaved task approach, updated tests

Reviewers: Guozhang Wang <wangguoz@gmail.com>, Damian Guy <damian.guy@gmail.com>, Matthias J. Sax <mjsax@apache.org>
2018-01-30 15:30:58 -08:00
Jakub Scholz 3431be2aeb KAFKA-4029: SSL support for Connect REST API (KIP-208)
This PR implements the JIRA issue [KAFKA-4029: SSL support for Connect REST API](https://issues.apache.org/jira/browse/KAFKA-4029) / [KIP-208](https://cwiki.apache.org/confluence/display/KAFKA/KIP-208%3A+Add+SSL+support+to+Kafka+Connect+REST+interface).

Summary of the main changes:
- Jetty `HttpClient` is used as HTTP client instead of the one shipped with Java. That allows to keep the SSL configuration for Server and Client be in single place (both use the Jetty `SslContextFactory`). It also has much richer configuration than the JDK client (it is easier to configure things such as supported cipher suites etc.).
- The `RestServer` class has been broker into 3 parts. `RestServer` contains the server it self. `RestClient` contains the HTTP client used for forwarding requests etc. and `SSLUtils` contain some helper classes for configuring SSL. One of the reasons for this was Findbugs complaining about the class complexity.
- A new method `valuesWithPrefixAllOrNothing` has been added to `AbstractConfig` to make it easier to handle the situation that we want to use either only the prefixed SSL options or only the non-prefixed. But not mixed them.

Author: Jakub Scholz <www@scholzj.com>

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

Closes #4429 from scholzj/kip-208
2018-01-30 15:09:40 -08:00
Colin Patrick McCabe ef93998fa7 KAFKA-6418; AdminClient should handle empty or null topic names better (#4470) 2018-01-30 14:47:28 -08:00
Guozhang Wang 2264613c4e
KAFKA-6166: Update javadoc for streams config (#4489)
This PR piggy-back a few different javadoc changes:

* KIP-220: add admin client prefix.
* Clarify on user customized configs.
2018-01-30 14:14:50 -08:00
Rajini Sivaram 70d3b19b11
KAFKA-6243: Enable dynamic updates of broker metrics reporters (#4464)
Dynamic metrics reporter updates described in KIP-226. This includes:
  - Addition and removal of metrics reporters
  - Reconfiguration of custom metrics reporter configs
  - Tests for metrics reporter updates at default cluster-level and as per-broker config for testing

Reviewers: Jason Gustafson <jason@confluent.io>
2018-01-30 12:55:32 -08:00
Sean McCauliff d97e63b260 KAFKA-6345; Keep a separate count of in-flight requests to avoid ConcurrentModificationException.
This keeps a separate count of the number of in flight requests so that sensor threads will not need to deal with ConcurrentModfiicationException.

This would probably still be correct with volatile rather than AtomicInteger, but FindBugs flags the use of volatile as the count is incremented and decremented.

Author: Sean McCauliff <smccauliff@linkedin.com>

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

Closes #4460 from smccauliff/KAFKA-6345
2018-01-30 10:20:08 -08:00
Filipe Agapito cb93d76461 KAFKA-6166: Streams configuration requires consumer. and producer. in order to be read (#4434)
* Implement method to get custom properties
* Add custom properties to getConsumerConfigs and getProducerConfigs
* Add tests

Reviewers: Matthias J. Sax <matthias@confluent.io>, Guozhang Wang <wangguoz@gmail.com>
2018-01-30 10:18:51 -08:00
Rajini Sivaram 710aa678b7
KAFKA-6242: Dynamic resize of various broker thread pools (#4471)
Dynamic resize of broker thread pools as described in KIP-226:
  - num.network.threads
  - num.io.threads
  - num.replica.fetchers
  - num.recovery.threads.per.data.dir
  - background.threads

Reviewers: Jason Gustafson <jason@confluent.io>
2018-01-30 09:29:27 -08:00
Konstantine Karantasis b4165522b3 KAFKA-6148; ClassCastException in connectors that include kafka-clients packages (#4457)
Exclusion for packages that need not be loaded in isolation needs to be extended to all the `org.apache.kafka` packages (that do not belong to transforms and the other whitelisted packages). Most notably, this refers to any classes in `kafka-clients` package. 

Reviewers: Randall Hauch <rhauch@gmail.com>, Jason Gustafson <jason@confluent.io>
2018-01-30 08:45:07 -08:00
Ron Dagostino b7a0c327cc KAFKA-6464: Fix Base64URL encode padding issue under JRE 1.7 (#4455)
The org.apache.kafka.common.utils.Base64 class defers Base64 encoding/decoding to the java.util.Base64 class beginning with JRE 1.8 but leverages javax.xml.bind.DatatypeConverter under JRE 1.7.  The implementation of the encodeToString(bytes[]) method returned under JRE 1.7 by Base64.urlEncoderNoPadding() blindly removed the last two trailing characters of the Base64 encoding under the assumption that they would always be the string "==" but that is incorrect; padding can be "=", "==", or non-existent. This commit fixes that problem.

The commit also adds a Base64.urlDecoder() method that defers to java.util.Base64 under JRE 1.8+ but leverages javax.xml.bind.DatatypeConverter under JRE 1.7.

Finally, there is a unit test to confirm that encode/decode are inverses in both the Base64 and Base64URL cases.
2018-01-30 03:09:06 -08:00
Guozhang Wang fdc14daced
MINOR: Code refacotring in KTable-KTable Join (#4486)
1. Rename KTableKTableJoin to KTableKTableInnerJoin. Also removed abstract from other joins.
2. Merge KTableKTableJoinValueGetter.java into KTableKTableInnerJoin.
3. Use set instead of arrays in the stores function, to avoid duplicate stores to be connected to processors.

Reviewers: Bill Bejeck <bill@confluent.io>, Matthias J. Sax <matthias@confluent.io>
2018-01-29 17:48:53 -08:00
Tanvi Jaywant 05e42e1df1 KAFKA-6451: Simplifying KStreamReduce and KStreamAggregate
[KAFKA-6451](https://issues.apache.org/jira/browse/KAFKA-6451)

Simplified KStreamReduce and KStreamAggregate.
Updated comments in KStreamAggregate.

Author: Tanvi Jaywant <tanvijaywant@Tanvis-Air.home>

Reviewers: Guozhang Wang <wangguoz@gmail.com>, Matthias J. Sax <mjsax@apache.org>

Closes #4477 from tanvijaywant31/KAFKA-6451
2018-01-29 17:28:49 -08:00
Matthias J. Sax a78f66a5ae KAFKA-3625: Add public test utils for Kafka Streams (#4402)
* KAFKA-3625: Add public test utils for Kafka Streams
 - add new artifact test-utils
 - add TopologyTestDriver
 - add MockTime, TestRecord, add TestRecordFactory

Reviewers: Guozhang Wang <wangguoz@gmail.com>, Damian Guy <damian.guy@gmail.com>, Bill Bejeck <bill@confluent.io>
2018-01-29 17:21:48 -08:00
Joel Hamill 6ea53d22e2 MINOR: Fix some streams web doc nits (#4411)
Reviewers: Derrick Or <derrickor@gmail.com>, Guozhang Wang <wangguoz@gmail.com>
2018-01-29 10:09:32 -08:00
Kamil Szymański b5da5f8bec MINOR: Optimize KTable-KTable join value getter supplier (#4458)
Reviewers: Guozhang Wang <wangguoz@gmail.com>, Damian Guy <damian.guy@gmail.com>, Matthias J. Sax <mjsax@apache.org>
2018-01-28 20:17:48 -08:00
RichardYuSTUG 2f267871ea HOTFIX: ambiguity issue calling putAll() in scala compilation against JAVA 9
The cause for compilation error in JDK 9.0 was an ambiguity issue in scalac:
```
both method putAll in class Properties of type (x$1: java.util.Map[_, _])Unit
and  method putAll in class Hashtable of type (x$1: java.util.Map[_ <: Object, _ <: Object])Unit
match argument types (java.util.Properties)
      newProps.putAll(props)
```

Author: RichardYuSTUG <yohan.richard.yu2@gmail.com>

Reviewers: Manikumar Reddy O <manikumar.reddy@gmail.com>, Rajini Sivaram <rajinisivaram@googlemail.com>

Closes #4482 from ConcurrencyPractitioner/trunk
2018-01-28 13:22:24 +00:00
Vahid Hashemian 1e04f5d234 MINOR: Fix Javadoc Issues (#4190)
This PR mainly fixes some broken links and invalid references in the clients Javadoc
2018-01-27 18:08:51 -08:00
Rajini Sivaram 9b3722cea1
KAFKA-6245: Dynamic update of topic config defaults (#4466)
Dynamic update of default topic configs as described in KIP-226.
2018-01-27 12:22:05 -08:00
Colin Patrick McCabe e8b30e4d25 MINOR: MetadataResponse#toStruct should serialize null leaders correctly. (#4449)
In MetadataResponse deserialization, if the partition leader key is set
to -1, the leader is set to null.  The MetadataResponse#toStruct code
should handle this correctly as well.

Also fix a case in KafkaApis where we were not taking into account the
possibility of the leader being null.

RequestResponseTest should test this as well.

Reviewers: Ismael Juma <ismael@juma.me.uk>, Jason Gustafson <jason@confluent.io>
2018-01-26 16:44:49 -08:00
Rajini Sivaram 70cecb6881 KAFKA-6244; Dynamic update of log cleaner configuration (#4465) 2018-01-26 14:38:46 -08:00
Koen De Groote 1fef10d47f MINOR: Replace empty string concattenation with String.valueOf() where possible. (#4369)
This is something I did after my working hours, I would ask people reviewing this do the same, don't take time for this during your work hours.

I try to keep such a PR as limited as possible, for clarity of reading.

==========

Using an empty string concat in order to achieve the String representation of the value you want is bad for 2 reasons, as explained here: (https://stackoverflow.com/questions/1572708/is-conversion-to-string-using-int-value-bad-practice

Readability: it shows what you're trying to do.

Depending on your compiler, it might attempt to create your String by first creating a StringBuffer, appending your value to it and then doing .toString() on that. Which is inefficient.

Also, the Metrics.java file had an empty string being added for the sole reason that the page width forced a string to continue on a new line. Removed that.

Reviewers: Guozhang Wang <wangguoz@gmail.com>
2018-01-26 11:43:48 -08:00
Jakub Scholz 93ab94d7ed MINOR: Add authorizer.class.name to the security section in documentation (#4310) 2018-01-26 11:40:35 -08:00
Antony Stubbs 4a274bc9fd MINOR: JavaDoc improvements for RangeAssignor (#4079) 2018-01-26 11:35:54 -08:00
ekenny a9af5c7963 MINOR: Changed javadoc on KafkaConsumer#endOffsets (#3470) 2018-01-26 11:31:37 -08:00
Elyahou 739256bea9 MINOR: Fix comment on how to consume __consumer_offsets (#3710) 2018-01-26 11:29:46 -08:00
Travis Wellman a693e86181 MINOR: fix command help description on zookeeper host strings URLs (#2940) 2018-01-26 11:17:52 -08:00
Scott d706c87cb2 MINOR: a single doc typo (#2969) 2018-01-26 11:14:57 -08:00
Jeyhun Karimov c8d80073c9 MINOR: update javadocs for serde (#3047)
Reviewers: Matthias J. Sax <mjsax@apache.org>
2018-01-26 10:49:17 -08:00
Mickael Maison 115c305526 MINOR: Fixed a few typos in configs and streams docs (#4452)
Reviewers: Guozhang Wang <wangguoz@gmail.com>
2018-01-26 10:40:32 -08:00
Yu-Jhe decfb834fb Add missing backslash (#4474)
There're missing backslash when running the quick start tutorial.

Reviewers: Guozhang Wang <wangguoz@gmail.com>
2018-01-26 10:14:10 -08:00
Bill Bejeck c615c597aa KAFKA-6205: initialize topology after state stores restoration completed
Initialize topology after state store restoration.
Although IMHO updating some of the existing tests demonstrates the correct order of operations, I'll probably add an integration test, but I wanted to get this PR in for feedback on the approach.

Author: Bill Bejeck <bill@confluent.io>

Reviewers: Guozhang Wang <wangguoz@gmail.com>, Matthias J. Sax <mjsax@apache.org>

Closes #4415 from bbejeck/KAFKA-6205_restore_state_stores_before_initializing_topology

minor log4j edits
2018-01-26 09:34:55 -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
Konstantine Karantasis 993d3c727e KAFKA-6467; Enforce layout of dependencies within a connect plugin to be deterministic (#4459)
Adds alphanumeric ordering of dependencies as they added to a Connect plugin's class loader path. 

This makes the layout of the dependencies consistent across systems and deployments. Dependencies should still, in principle, not include conflicts and ideally order should not matter. 

Reviewers: Randall Hauch <rhauch@gmail.com>, Jason Gustafson <jason@confluent.io>
2018-01-26 08:39:57 -08:00