-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Kafka protocol support through 1.0 (#84)
* Add new response classes, excluding fetch, produce, and transaction support * Simplify schema test for response classes * Clean up some inheritance for existing requests * Add the ability to have requests that are not exposed in the CLI tool * Add additional error codes * Rename v1 of the GroupCoordinator response to FindCoordinator * Remove support for controller-only requests from the CLI * Additional changes for renaming FindCoordinator * Add new requests through 1.0 * Add tests for new requests
- Loading branch information
1 parent
79639e5
commit 55993ff
Showing
133 changed files
with
3,344 additions
and
609 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
from kafka.tools.protocol.requests import BaseRequest | ||
from kafka.tools.protocol.responses.alter_configs_v0 import AlterConfigsV0Response | ||
|
||
|
||
class AlterConfigsV0Request(BaseRequest): | ||
api_key = 33 | ||
api_version = 0 | ||
response = AlterConfigsV0Response | ||
|
||
cmd = "AlterConfigs" | ||
help_string = '' | ||
|
||
schema = [ | ||
{'name': 'resources', | ||
'type': 'array', | ||
'item_type': [ | ||
{'name': 'resource_type', 'type': 'int8'}, | ||
{'name': 'resource_name', 'type': 'string'}, | ||
{'name': 'config_entries', | ||
'type': 'array', | ||
'item_type': [ | ||
{'name': 'config_name', 'type': 'string'}, | ||
{'name': 'config_value', 'type': 'string'}, | ||
]}, | ||
]}, | ||
{'name': 'validate_only', 'type': 'boolean'} | ||
] |
42 changes: 42 additions & 0 deletions
42
kafka/tools/protocol/requests/alter_replica_log_dirs_v0.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
from kafka.tools.protocol.requests import BaseRequest | ||
from kafka.tools.protocol.responses.alter_replica_log_dirs_v0 import AlterReplicaLogDirsV0Response | ||
|
||
|
||
class AlterReplicaLogDirsV0Request(BaseRequest): | ||
api_key = 34 | ||
api_version = 0 | ||
response = AlterReplicaLogDirsV0Response | ||
|
||
cmd = "AlterReplicaLogDirs" | ||
help_string = '' | ||
|
||
schema = [ | ||
{'name': 'log_dirs', | ||
'type': 'array', | ||
'item_type': [ | ||
{'name': 'log_dir', 'type': 'string'}, | ||
{'name': 'topics', | ||
'type': 'array', | ||
'item_type': [ | ||
{'name': 'topic', 'type': 'string'}, | ||
{'name': 'partitions', 'type': 'array', 'item_type': 'int32'} | ||
]}, | ||
]}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
from kafka.tools.protocol.requests.api_versions_v0 import ApiVersionsV0Request | ||
from kafka.tools.protocol.responses.api_versions_v1 import ApiVersionsV1Response | ||
|
||
|
||
class ApiVersionsV1Request(ApiVersionsV0Request): | ||
api_version = 1 | ||
response = ApiVersionsV1Response |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
|
||
from kafka.tools.protocol.requests import BaseRequest | ||
from kafka.tools.protocol.responses.controlled_shutdown_v0 import ControlledShutdownV0Response | ||
|
||
|
||
class ControlledShutdownV0Request(BaseRequest): | ||
api_key = 7 | ||
api_version = 0 | ||
cmd = "ControlledShutdown" | ||
response = ControlledShutdownV0Response | ||
|
||
help_string = '' | ||
|
||
schema = [ | ||
{'name': 'broker_id', 'type': 'int32'} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
from kafka.tools.protocol.requests import BaseRequest | ||
from kafka.tools.protocol.responses.create_acls_v0 import CreateAclsV0Response | ||
|
||
|
||
class CreateAclsV0Request(BaseRequest): | ||
api_key = 30 | ||
api_version = 0 | ||
response = CreateAclsV0Response | ||
|
||
cmd = "CreateAcls" | ||
help_string = '' | ||
|
||
schema = [ | ||
{'name': 'creations', | ||
'type': 'array', | ||
'item_type': [ | ||
{'name': 'resource_type', 'type': 'int8'}, | ||
{'name': 'resource_name', 'type': 'string'}, | ||
{'name': 'principal', 'type': 'string'}, | ||
{'name': 'host', 'type': 'string'}, | ||
{'name': 'operation', 'type': 'int8'}, | ||
{'name': 'permission_type', 'type': 'int8'}, | ||
]}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
from kafka.tools.protocol.requests import BaseRequest | ||
from kafka.tools.protocol.responses.create_partitions_v0 import CreatePartitionsV0Response | ||
|
||
|
||
class CreatePartitionsV0Request(BaseRequest): | ||
api_key = 37 | ||
api_version = 0 | ||
response = CreatePartitionsV0Response | ||
|
||
cmd = "CreatePartitions" | ||
help_string = '' | ||
|
||
schema = [ | ||
{'name': 'topic_partitions', | ||
'type': 'array', | ||
'item_type': [ | ||
{'name': 'topic', 'type': 'string'}, | ||
{'name': 'count', 'type': 'int32'}, | ||
{'name': 'replicas', | ||
'type': 'array', | ||
'item_type': [ | ||
{'name': 'broker_id', 'type': 'array', 'item_type': 'int32'}, | ||
]}, | ||
]}, | ||
{'name': 'timeout', 'type': 'int32'}, | ||
{'name': 'validate_only', 'type': 'boolean'}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.