Commit Graph

10 Commits

Author SHA1 Message Date
Ken Huang f7f4e5b5b1
KAFKA-17882 improve the document about "default value" of tagged structure field (#17618)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-04 05:46:20 +08:00
Tim Fox 837684a1b9
MINOR: Correct type in README.md from "boolean" to "bool" (#16706)
The actual type name in the JSON descriptor files is "bool" not "boolean"

Reviewers: Mickael Maison <mickael.maison@gmail.com>, Andrew Schofield <andrew_schofield@live.com>
2024-08-07 17:34:53 +02:00
Satish Duggana d3709dafbe
MINOR: Addressed minor typos in READMEs. (#10905)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2021-06-19 23:58:57 +08:00
dengziming c9832aabae
DOCS: Update protocol doc for missing data type (#10162)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2021-02-26 15:04:25 +08:00
Ismael Juma 411ac7d4c0
MINOR: Remove `toStruct` and `fromStruct` methods from generated protocol classes (#9960)
Update few classes that were still using the removed methods (including
tests that are no longer required).

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2021-01-25 04:41:30 -08:00
Brian Byrne 57cef765f5
KAFKA-9474: Adds 'float64' to the RPC protocol types (#8012)
Reviewers: Jason Gustafson <jason@confluent.io>, Ismael Juma <ismael@juma.me.uk>
2020-01-30 04:54:27 -08:00
Colin P. Mccabe 67fd88050f KAFKA-8984: Improve tagged fields documentation
Author: Colin P. Mccabe <cmccabe@confluent.io>

Reviewers: Vikas Singh <vikas@confluent.io>, Jason Gustafson <jason@confluent.io>

Closes #7477 from cmccabe/KAFKA-8984
2019-11-09 10:37:48 +05:30
Colin P. Mccabe 027cbbaec5 KAFKA-8060: The Kafka protocol generator should allow null defaults
Author: Colin P. Mccabe <cmccabe@confluent.io>

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

Closes #6387 from cmccabe/KAFKA-8060
2019-03-08 09:25:28 +05:30
Tom Bentley 269b65279c KAFKA-5692: Change PreferredReplicaLeaderElectionCommand to use Admin… (#3848)
See also KIP-183.

This implements the following algorithm:

AdminClient sends ElectPreferredLeadersRequest.
KafakApis receives ElectPreferredLeadersRequest and delegates to
ReplicaManager.electPreferredLeaders()
ReplicaManager delegates to KafkaController.electPreferredLeaders()
KafkaController adds a PreferredReplicaLeaderElection to the EventManager,
ReplicaManager.electPreferredLeaders()'s callback uses the
delayedElectPreferredReplicasPurgatory to wait for the results of the
election to appear in the metadata cache. If there are no results
because of errors, or because the preferred leaders are already leading
the partitions then a response is returned immediately.
In the EventManager work thread the preferred leader is elected as follows:

The EventManager runs PreferredReplicaLeaderElection.process()
process() calls KafkaController.onPreferredReplicaElectionWithResults()
KafkaController.onPreferredReplicaElectionWithResults()
calls the PartitionStateMachine.handleStateChangesWithResults() to
perform the election (asynchronously the PSM will send LeaderAndIsrRequest
to the new and old leaders and UpdateMetadataRequest to all brokers)
then invokes the callback.

Reviewers: Colin P. McCabe <cmccabe@apache.org>, Jun Rao <junrao@gmail.com>
2019-01-25 14:06:18 -08:00
Colin Patrick McCabe 71e85f5e84 KAFKA-7609; Add Protocol Generator for Kafka (#5893)
This patch adds a framework to automatically generate the request/response classes for Kafka's protocol. The code will be updated to use the generated classes in follow-up patches. Below is a brief summary of the included components:

**buildSrc/src**
The message generator code is here.  This code is automatically re-run by gradle when one of the schema files changes.  The entire directory is processed at once to minimize the number of times we have to start a new JVM.  We use Jackson to translate the JSON files into Java objects.

**clients/src/main/java/org/apache/kafka/common/protocol/Message.java**
This is the interface implemented by all automatically generated messages.

**clients/src/main/java/org/apache/kafka/common/protocol/MessageUtil.java**
Some utility functions used by the generated message code.

**clients/src/main/java/org/apache/kafka/common/protocol/Readable.java, Writable.java, ByteBufferAccessor.java**
The generated message code uses these classes for writing to a buffer.

**clients/src/main/message/README.md**
This README file explains how the JSON schemas work.

**clients/src/main/message/\*.json**
The JSON files in this directory implement every supported version of every Kafka API.  The unit tests automatically validate that the generated schemas match the hand-written schemas in our code.  Additionally, there are some things like request and response headers that have schemas here.

**clients/src/main/java/org/apache/kafka/common/utils/ImplicitLinkedHashSet.java**
I added an optimization here for empty sets.  This is useful here because I want all messages to start with empty sets by default prior to being loaded with data.  This is similar to the "empty list" optimizations in the `java.util.ArrayList` class.

Reviewers: Stanislav Kozlovski <stanislav_kozlovski@outlook.com>, Ismael Juma <ismael@juma.me.uk>, Bob Barrett <bob.barrett@outlook.com>, Jason Gustafson <jason@confluent.io>
2019-01-11 16:40:21 -08:00