types-kafka-python 2.3.0.20260523__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- kafka-stubs/METADATA.toml +2 -0
- kafka-stubs/__init__.pyi +13 -0
- kafka-stubs/admin/__init__.pyi +30 -0
- kafka-stubs/admin/acl_resource.pyi +91 -0
- kafka-stubs/admin/client.pyi +114 -0
- kafka-stubs/admin/config_resource.pyi +12 -0
- kafka-stubs/admin/new_partitions.pyi +6 -0
- kafka-stubs/admin/new_topic.pyi +16 -0
- kafka-stubs/cli/__init__.pyi +0 -0
- kafka-stubs/cli/admin/__init__.pyi +3 -0
- kafka-stubs/cli/admin/cluster/__init__.pyi +3 -0
- kafka-stubs/cli/admin/cluster/describe.pyi +3 -0
- kafka-stubs/cli/admin/configs/__init__.pyi +3 -0
- kafka-stubs/cli/admin/configs/describe.pyi +5 -0
- kafka-stubs/cli/admin/consumer_groups/__init__.pyi +3 -0
- kafka-stubs/cli/admin/consumer_groups/delete.pyi +3 -0
- kafka-stubs/cli/admin/consumer_groups/describe.pyi +3 -0
- kafka-stubs/cli/admin/consumer_groups/list.pyi +3 -0
- kafka-stubs/cli/admin/consumer_groups/list_offsets.pyi +3 -0
- kafka-stubs/cli/admin/log_dirs/__init__.pyi +3 -0
- kafka-stubs/cli/admin/log_dirs/describe.pyi +3 -0
- kafka-stubs/cli/admin/topics/__init__.pyi +3 -0
- kafka-stubs/cli/admin/topics/create.pyi +5 -0
- kafka-stubs/cli/admin/topics/delete.pyi +3 -0
- kafka-stubs/cli/admin/topics/describe.pyi +3 -0
- kafka-stubs/cli/admin/topics/list.pyi +3 -0
- kafka-stubs/cli/consumer/__init__.pyi +3 -0
- kafka-stubs/cli/producer/__init__.pyi +3 -0
- kafka-stubs/client_async.pyi +56 -0
- kafka-stubs/cluster.pyi +36 -0
- kafka-stubs/codec.pyi +25 -0
- kafka-stubs/conn.pyi +70 -0
- kafka-stubs/consumer/__init__.pyi +3 -0
- kafka-stubs/consumer/fetcher.pyi +150 -0
- kafka-stubs/consumer/group.pyi +143 -0
- kafka-stubs/consumer/subscription_state.pyi +112 -0
- kafka-stubs/coordinator/__init__.pyi +0 -0
- kafka-stubs/coordinator/assignors/__init__.pyi +0 -0
- kafka-stubs/coordinator/assignors/abstract.pyi +15 -0
- kafka-stubs/coordinator/assignors/range.pyi +15 -0
- kafka-stubs/coordinator/assignors/roundrobin.pyi +15 -0
- kafka-stubs/coordinator/assignors/sticky/__init__.pyi +0 -0
- kafka-stubs/coordinator/assignors/sticky/partition_movements.pyi +18 -0
- kafka-stubs/coordinator/assignors/sticky/sorted_set.pyi +13 -0
- kafka-stubs/coordinator/assignors/sticky/sticky_assignor.pyi +59 -0
- kafka-stubs/coordinator/base.pyi +86 -0
- kafka-stubs/coordinator/consumer.pyi +31 -0
- kafka-stubs/coordinator/heartbeat.pyi +22 -0
- kafka-stubs/coordinator/protocol.pyi +17 -0
- kafka-stubs/coordinator/subscription.pyi +13 -0
- kafka-stubs/errors.pyi +822 -0
- kafka-stubs/future.pyi +19 -0
- kafka-stubs/metrics/__init__.pyi +10 -0
- kafka-stubs/metrics/compound_stat.pyi +13 -0
- kafka-stubs/metrics/dict_reporter.pyi +15 -0
- kafka-stubs/metrics/kafka_metric.pyi +13 -0
- kafka-stubs/metrics/measurable.pyi +9 -0
- kafka-stubs/metrics/measurable_stat.pyi +6 -0
- kafka-stubs/metrics/metric_config.pyi +13 -0
- kafka-stubs/metrics/metric_name.pyi +13 -0
- kafka-stubs/metrics/metrics.pyi +24 -0
- kafka-stubs/metrics/metrics_reporter.pyi +13 -0
- kafka-stubs/metrics/quota.pyi +13 -0
- kafka-stubs/metrics/stat.pyi +5 -0
- kafka-stubs/metrics/stats/__init__.pyi +12 -0
- kafka-stubs/metrics/stats/avg.pyi +6 -0
- kafka-stubs/metrics/stats/count.pyi +6 -0
- kafka-stubs/metrics/stats/histogram.pyi +21 -0
- kafka-stubs/metrics/stats/max_stat.pyi +6 -0
- kafka-stubs/metrics/stats/min_stat.pyi +6 -0
- kafka-stubs/metrics/stats/percentile.pyi +6 -0
- kafka-stubs/metrics/stats/percentiles.pyi +21 -0
- kafka-stubs/metrics/stats/rate.pyi +28 -0
- kafka-stubs/metrics/stats/sampled_stat.pyi +26 -0
- kafka-stubs/metrics/stats/sensor.pyi +10 -0
- kafka-stubs/metrics/stats/total.pyi +6 -0
- kafka-stubs/partitioner/__init__.pyi +3 -0
- kafka-stubs/partitioner/default.pyi +5 -0
- kafka-stubs/producer/__init__.pyi +3 -0
- kafka-stubs/producer/future.pyi +37 -0
- kafka-stubs/producer/kafka.pyi +110 -0
- kafka-stubs/producer/producer_batch.pyi +42 -0
- kafka-stubs/producer/record_accumulator.pyi +45 -0
- kafka-stubs/producer/sender.pyi +47 -0
- kafka-stubs/producer/transaction_manager.pyi +187 -0
- kafka-stubs/protocol/__init__.pyi +3 -0
- kafka-stubs/protocol/abstract.pyi +9 -0
- kafka-stubs/protocol/add_offsets_to_txn.pyi +39 -0
- kafka-stubs/protocol/add_partitions_to_txn.pyi +39 -0
- kafka-stubs/protocol/admin.pyi +506 -0
- kafka-stubs/protocol/api.pyi +37 -0
- kafka-stubs/protocol/api_versions.pyi +70 -0
- kafka-stubs/protocol/broker_api_versions.pyi +3 -0
- kafka-stubs/protocol/commit.pyi +166 -0
- kafka-stubs/protocol/end_txn.pyi +39 -0
- kafka-stubs/protocol/fetch.pyi +143 -0
- kafka-stubs/protocol/find_coordinator.pyi +39 -0
- kafka-stubs/protocol/frame.pyi +6 -0
- kafka-stubs/protocol/group.pyi +229 -0
- kafka-stubs/protocol/init_producer_id.pyi +28 -0
- kafka-stubs/protocol/list_offsets.pyi +85 -0
- kafka-stubs/protocol/message.pyi +43 -0
- kafka-stubs/protocol/metadata.pyi +123 -0
- kafka-stubs/protocol/offset_for_leader_epoch.pyi +61 -0
- kafka-stubs/protocol/parser.pyi +11 -0
- kafka-stubs/protocol/produce.pyi +103 -0
- kafka-stubs/protocol/sasl_authenticate.pyi +28 -0
- kafka-stubs/protocol/sasl_handshake.pyi +28 -0
- kafka-stubs/protocol/struct.pyi +14 -0
- kafka-stubs/protocol/txn_offset_commit.pyi +39 -0
- kafka-stubs/protocol/types.pyi +115 -0
- kafka-stubs/py.typed +0 -0
- kafka-stubs/record/__init__.pyi +3 -0
- kafka-stubs/record/_crc32c.pyi +8 -0
- kafka-stubs/record/abc.pyi +60 -0
- kafka-stubs/record/default_records.pyi +155 -0
- kafka-stubs/record/legacy_records.pyi +86 -0
- kafka-stubs/record/memory_records.pyi +44 -0
- kafka-stubs/record/util.pyi +5 -0
- kafka-stubs/sasl/__init__.pyi +6 -0
- kafka-stubs/sasl/abc.pyi +14 -0
- kafka-stubs/sasl/gssapi.pyi +16 -0
- kafka-stubs/sasl/msk.pyi +33 -0
- kafka-stubs/sasl/oauth.pyi +23 -0
- kafka-stubs/sasl/plain.pyi +15 -0
- kafka-stubs/sasl/scram.pyi +40 -0
- kafka-stubs/sasl/sspi.pyi +17 -0
- kafka-stubs/serializer/__init__.pyi +1 -0
- kafka-stubs/serializer/abstract.pyi +15 -0
- kafka-stubs/socks5_wrapper.pyi +25 -0
- kafka-stubs/structs.pyi +53 -0
- kafka-stubs/util.pyi +38 -0
- kafka-stubs/version.pyi +1 -0
- types_kafka_python-2.3.0.20260523.dist-info/METADATA +38 -0
- types_kafka_python-2.3.0.20260523.dist-info/RECORD +138 -0
- types_kafka_python-2.3.0.20260523.dist-info/WHEEL +5 -0
- types_kafka_python-2.3.0.20260523.dist-info/licenses/LICENSE +237 -0
- types_kafka_python-2.3.0.20260523.dist-info/top_level.txt +1 -0
kafka-stubs/__init__.pyi
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
|
|
3
|
+
from kafka.admin import KafkaAdminClient as KafkaAdminClient
|
|
4
|
+
from kafka.client_async import KafkaClient as KafkaClient
|
|
5
|
+
from kafka.conn import BrokerConnection as BrokerConnection
|
|
6
|
+
from kafka.consumer import KafkaConsumer as KafkaConsumer
|
|
7
|
+
from kafka.consumer.subscription_state import ConsumerRebalanceListener as ConsumerRebalanceListener
|
|
8
|
+
from kafka.producer import KafkaProducer as KafkaProducer
|
|
9
|
+
|
|
10
|
+
__all__ = ["BrokerConnection", "ConsumerRebalanceListener", "KafkaAdminClient", "KafkaClient", "KafkaConsumer", "KafkaProducer"]
|
|
11
|
+
|
|
12
|
+
class NullHandler(logging.Handler):
|
|
13
|
+
def emit(self, record) -> None: ...
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
from kafka.admin.acl_resource import (
|
|
2
|
+
ACL as ACL,
|
|
3
|
+
ACLFilter as ACLFilter,
|
|
4
|
+
ACLOperation as ACLOperation,
|
|
5
|
+
ACLPermissionType as ACLPermissionType,
|
|
6
|
+
ACLResourcePatternType as ACLResourcePatternType,
|
|
7
|
+
ResourcePattern as ResourcePattern,
|
|
8
|
+
ResourcePatternFilter as ResourcePatternFilter,
|
|
9
|
+
ResourceType as ResourceType,
|
|
10
|
+
)
|
|
11
|
+
from kafka.admin.client import KafkaAdminClient as KafkaAdminClient
|
|
12
|
+
from kafka.admin.config_resource import ConfigResource as ConfigResource, ConfigResourceType as ConfigResourceType
|
|
13
|
+
from kafka.admin.new_partitions import NewPartitions as NewPartitions
|
|
14
|
+
from kafka.admin.new_topic import NewTopic as NewTopic
|
|
15
|
+
|
|
16
|
+
__all__ = [
|
|
17
|
+
"ConfigResource",
|
|
18
|
+
"ConfigResourceType",
|
|
19
|
+
"KafkaAdminClient",
|
|
20
|
+
"NewTopic",
|
|
21
|
+
"NewPartitions",
|
|
22
|
+
"ACL",
|
|
23
|
+
"ACLFilter",
|
|
24
|
+
"ResourcePattern",
|
|
25
|
+
"ResourcePatternFilter",
|
|
26
|
+
"ACLOperation",
|
|
27
|
+
"ResourceType",
|
|
28
|
+
"ACLPermissionType",
|
|
29
|
+
"ACLResourcePatternType",
|
|
30
|
+
]
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
from enum import IntEnum
|
|
2
|
+
|
|
3
|
+
class ResourceType(IntEnum):
|
|
4
|
+
UNKNOWN = 0
|
|
5
|
+
ANY = 1
|
|
6
|
+
CLUSTER = 4
|
|
7
|
+
DELEGATION_TOKEN = 6
|
|
8
|
+
GROUP = 3
|
|
9
|
+
TOPIC = 2
|
|
10
|
+
TRANSACTIONAL_ID = 5
|
|
11
|
+
|
|
12
|
+
class ACLOperation(IntEnum):
|
|
13
|
+
UNKNOWN = 0
|
|
14
|
+
ANY = 1
|
|
15
|
+
ALL = 2
|
|
16
|
+
READ = 3
|
|
17
|
+
WRITE = 4
|
|
18
|
+
CREATE = 5
|
|
19
|
+
DELETE = 6
|
|
20
|
+
ALTER = 7
|
|
21
|
+
DESCRIBE = 8
|
|
22
|
+
CLUSTER_ACTION = 9
|
|
23
|
+
DESCRIBE_CONFIGS = 10
|
|
24
|
+
ALTER_CONFIGS = 11
|
|
25
|
+
IDEMPOTENT_WRITE = 12
|
|
26
|
+
CREATE_TOKENS = 13
|
|
27
|
+
DESCRIBE_TOKENS = 13
|
|
28
|
+
|
|
29
|
+
class ACLPermissionType(IntEnum):
|
|
30
|
+
UNKNOWN = 0
|
|
31
|
+
ANY = 1
|
|
32
|
+
DENY = 2
|
|
33
|
+
ALLOW = 3
|
|
34
|
+
|
|
35
|
+
class ACLResourcePatternType(IntEnum):
|
|
36
|
+
UNKNOWN = 0
|
|
37
|
+
ANY = 1
|
|
38
|
+
MATCH = 2
|
|
39
|
+
LITERAL = 3
|
|
40
|
+
PREFIXED = 4
|
|
41
|
+
|
|
42
|
+
class ACLFilter:
|
|
43
|
+
principal: str | None
|
|
44
|
+
host: str | None
|
|
45
|
+
operation: ACLOperation
|
|
46
|
+
permission_type: ACLPermissionType
|
|
47
|
+
resource_pattern: ResourcePatternFilter
|
|
48
|
+
def __init__(
|
|
49
|
+
self,
|
|
50
|
+
principal: str | None,
|
|
51
|
+
host: str | None,
|
|
52
|
+
operation: ACLOperation,
|
|
53
|
+
permission_type: ACLPermissionType,
|
|
54
|
+
resource_pattern: ResourcePatternFilter,
|
|
55
|
+
) -> None: ...
|
|
56
|
+
def validate(self) -> None: ...
|
|
57
|
+
def __eq__(self, other): ...
|
|
58
|
+
def __hash__(self): ...
|
|
59
|
+
|
|
60
|
+
class ACL(ACLFilter):
|
|
61
|
+
resource_pattern: ResourcePattern
|
|
62
|
+
def __init__(
|
|
63
|
+
self,
|
|
64
|
+
principal: str,
|
|
65
|
+
host: str,
|
|
66
|
+
operation: ACLOperation,
|
|
67
|
+
permission_type: ACLPermissionType,
|
|
68
|
+
resource_pattern: ResourcePattern,
|
|
69
|
+
) -> None: ...
|
|
70
|
+
def validate(self) -> None: ...
|
|
71
|
+
|
|
72
|
+
class ResourcePatternFilter:
|
|
73
|
+
resource_type: ResourceType
|
|
74
|
+
resource_name: str | None
|
|
75
|
+
pattern_type: ACLResourcePatternType
|
|
76
|
+
def __init__(self, resource_type: ResourceType, resource_name: str | None, pattern_type: ACLResourcePatternType) -> None: ...
|
|
77
|
+
def validate(self) -> None: ...
|
|
78
|
+
def __eq__(self, other): ...
|
|
79
|
+
def __hash__(self): ...
|
|
80
|
+
|
|
81
|
+
class ResourcePattern(ResourcePatternFilter):
|
|
82
|
+
resource_name: str
|
|
83
|
+
def __init__(
|
|
84
|
+
self,
|
|
85
|
+
resource_type: ResourceType,
|
|
86
|
+
resource_name: str,
|
|
87
|
+
pattern_type: ACLResourcePatternType = ACLResourcePatternType.LITERAL,
|
|
88
|
+
) -> None: ...
|
|
89
|
+
def validate(self) -> None: ...
|
|
90
|
+
|
|
91
|
+
def valid_acl_operations(int_vals) -> set[ACLOperation]: ...
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import selectors
|
|
2
|
+
import ssl
|
|
3
|
+
from _typeshed import Incomplete
|
|
4
|
+
from collections.abc import Callable, Iterable, Mapping, Sequence
|
|
5
|
+
from typing import Literal, TypeAlias, TypedDict, type_check_only
|
|
6
|
+
from typing_extensions import Unpack
|
|
7
|
+
|
|
8
|
+
from kafka.admin.acl_resource import ACL, ACLFilter
|
|
9
|
+
from kafka.admin.config_resource import ConfigResource
|
|
10
|
+
from kafka.admin.new_partitions import NewPartitions
|
|
11
|
+
from kafka.admin.new_topic import NewTopic
|
|
12
|
+
from kafka.errors import KafkaError
|
|
13
|
+
from kafka.protocol.admin import ElectionType
|
|
14
|
+
from kafka.structs import GroupInformation, OffsetAndMetadata, TopicPartition
|
|
15
|
+
|
|
16
|
+
_ApiVersion: TypeAlias = tuple[int, ...]
|
|
17
|
+
_BootstrapServers: TypeAlias = str | Sequence[str]
|
|
18
|
+
_KafkaClientFactory: TypeAlias = Callable[..., object]
|
|
19
|
+
_SaslMechanism: TypeAlias = Literal["PLAIN", "GSSAPI", "OAUTHBEARER", "SCRAM-SHA-256", "SCRAM-SHA-512"]
|
|
20
|
+
_SecurityProtocol: TypeAlias = Literal["PLAINTEXT", "SSL", "SASL_PLAINTEXT", "SASL_SSL"]
|
|
21
|
+
_SocketOption: TypeAlias = tuple[int, int, int]
|
|
22
|
+
|
|
23
|
+
@type_check_only
|
|
24
|
+
class _KafkaAdminClientConfig(TypedDict, total=False):
|
|
25
|
+
bootstrap_servers: _BootstrapServers
|
|
26
|
+
client_id: str
|
|
27
|
+
request_timeout_ms: int
|
|
28
|
+
connections_max_idle_ms: int
|
|
29
|
+
reconnect_backoff_ms: int
|
|
30
|
+
reconnect_backoff_max_ms: int
|
|
31
|
+
max_in_flight_requests_per_connection: int
|
|
32
|
+
receive_buffer_bytes: int | None
|
|
33
|
+
send_buffer_bytes: int | None
|
|
34
|
+
socket_options: Sequence[_SocketOption]
|
|
35
|
+
sock_chunk_bytes: int
|
|
36
|
+
sock_chunk_buffer_count: int
|
|
37
|
+
retry_backoff_ms: int
|
|
38
|
+
metadata_max_age_ms: int
|
|
39
|
+
security_protocol: _SecurityProtocol
|
|
40
|
+
ssl_context: ssl.SSLContext | None
|
|
41
|
+
ssl_check_hostname: bool
|
|
42
|
+
ssl_cafile: str | None
|
|
43
|
+
ssl_certfile: str | None
|
|
44
|
+
ssl_keyfile: str | None
|
|
45
|
+
ssl_password: str | None
|
|
46
|
+
ssl_crlfile: str | None
|
|
47
|
+
api_version: _ApiVersion | None
|
|
48
|
+
api_version_auto_timeout_ms: int
|
|
49
|
+
selector: type[selectors.BaseSelector]
|
|
50
|
+
sasl_mechanism: _SaslMechanism | None
|
|
51
|
+
sasl_plain_username: str | None
|
|
52
|
+
sasl_plain_password: str | None
|
|
53
|
+
sasl_kerberos_name: object | None
|
|
54
|
+
sasl_kerberos_service_name: str
|
|
55
|
+
sasl_kerberos_domain_name: str | None
|
|
56
|
+
sasl_oauth_token_provider: object | None
|
|
57
|
+
socks5_proxy: str | None
|
|
58
|
+
metric_reporters: Sequence[type[object]]
|
|
59
|
+
metrics_num_samples: int
|
|
60
|
+
metrics_sample_window_ms: int
|
|
61
|
+
kafka_client: _KafkaClientFactory
|
|
62
|
+
|
|
63
|
+
@type_check_only
|
|
64
|
+
class _CreateAclsResult(TypedDict):
|
|
65
|
+
succeeded: list[ACL]
|
|
66
|
+
failed: list[tuple[ACL, KafkaError]]
|
|
67
|
+
|
|
68
|
+
log: Incomplete
|
|
69
|
+
|
|
70
|
+
class KafkaAdminClient:
|
|
71
|
+
DEFAULT_CONFIG: Incomplete
|
|
72
|
+
config: Incomplete
|
|
73
|
+
def __init__(self, **configs: Unpack[_KafkaAdminClientConfig]) -> None: ...
|
|
74
|
+
def close(self) -> None: ...
|
|
75
|
+
def send_request(self, request, node_id=None): ...
|
|
76
|
+
def send_requests(self, requests_and_node_ids, response_fn=...): ...
|
|
77
|
+
def create_topics(self, new_topics: Sequence[NewTopic], timeout_ms: int | None = None, validate_only: bool = False): ...
|
|
78
|
+
def delete_topics(self, topics: Sequence[str], timeout_ms: int | None = None): ...
|
|
79
|
+
def list_topics(self) -> list[str]: ...
|
|
80
|
+
def describe_topics(self, topics: Sequence[str] | None = None) -> list[dict[str, Incomplete]]: ...
|
|
81
|
+
def describe_cluster(self) -> dict[str, Incomplete]: ...
|
|
82
|
+
def describe_acls(self, acl_filter: ACLFilter) -> tuple[list[ACL], KafkaError]: ...
|
|
83
|
+
def create_acls(self, acls: Sequence[ACL]) -> _CreateAclsResult: ...
|
|
84
|
+
def delete_acls(
|
|
85
|
+
self, acl_filters: Sequence[ACLFilter]
|
|
86
|
+
) -> list[tuple[ACLFilter, list[tuple[ACL, KafkaError]], KafkaError]]: ...
|
|
87
|
+
def describe_configs(self, config_resources: Sequence[ConfigResource], include_synonyms: bool = False): ...
|
|
88
|
+
def alter_configs(self, config_resources: Sequence[ConfigResource]): ...
|
|
89
|
+
def create_partitions(
|
|
90
|
+
self, topic_partitions: Mapping[str, NewPartitions], timeout_ms: int | None = None, validate_only: bool = False
|
|
91
|
+
): ...
|
|
92
|
+
def delete_records(
|
|
93
|
+
self,
|
|
94
|
+
records_to_delete: Mapping[TopicPartition, int],
|
|
95
|
+
timeout_ms: float | None = None,
|
|
96
|
+
partition_leader_id: int | None = None,
|
|
97
|
+
) -> dict[TopicPartition, Incomplete]: ...
|
|
98
|
+
def describe_consumer_groups(
|
|
99
|
+
self, group_ids: Sequence[str], group_coordinator_id: int | None = None, include_authorized_operations: bool = False
|
|
100
|
+
) -> list[GroupInformation]: ...
|
|
101
|
+
def list_consumer_groups(self, broker_ids: Sequence[int] | None = None) -> list[tuple[str, str]]: ...
|
|
102
|
+
def list_consumer_group_offsets(
|
|
103
|
+
self, group_id: str, group_coordinator_id: int | None = None, partitions: Iterable[TopicPartition] | None = None
|
|
104
|
+
) -> dict[TopicPartition, OffsetAndMetadata]: ...
|
|
105
|
+
def delete_consumer_groups(
|
|
106
|
+
self, group_ids: Sequence[str], group_coordinator_id: int | None = None
|
|
107
|
+
) -> list[tuple[str, KafkaError]]: ...
|
|
108
|
+
def perform_leader_election(
|
|
109
|
+
self,
|
|
110
|
+
election_type: int | ElectionType,
|
|
111
|
+
topic_partitions: Mapping[str, Sequence[int]] | None = None,
|
|
112
|
+
timeout_ms: int | None = None,
|
|
113
|
+
): ...
|
|
114
|
+
def describe_log_dirs(self): ...
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from enum import IntEnum
|
|
3
|
+
|
|
4
|
+
class ConfigResourceType(IntEnum):
|
|
5
|
+
BROKER = 4
|
|
6
|
+
TOPIC = 2
|
|
7
|
+
|
|
8
|
+
class ConfigResource:
|
|
9
|
+
resource_type: ConfigResourceType
|
|
10
|
+
name: str
|
|
11
|
+
configs: Mapping[str, str] | None
|
|
12
|
+
def __init__(self, resource_type: ConfigResourceType, name: str, configs: Mapping[str, str] | None = None) -> None: ...
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from collections.abc import Mapping, Sequence
|
|
2
|
+
|
|
3
|
+
class NewTopic:
|
|
4
|
+
name: str
|
|
5
|
+
num_partitions: int
|
|
6
|
+
replication_factor: int
|
|
7
|
+
replica_assignments: Mapping[int, Sequence[int]] | None
|
|
8
|
+
topic_configs: Mapping[str, str] | None
|
|
9
|
+
def __init__(
|
|
10
|
+
self,
|
|
11
|
+
name: str,
|
|
12
|
+
num_partitions: int = -1,
|
|
13
|
+
replication_factor: int = -1,
|
|
14
|
+
replica_assignments: Mapping[int, Sequence[int]] | None = None,
|
|
15
|
+
topic_configs: Mapping[str, str] | None = None,
|
|
16
|
+
) -> None: ...
|
|
File without changes
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
from _typeshed import Incomplete
|
|
2
|
+
from collections import OrderedDict as OrderedDict
|
|
3
|
+
|
|
4
|
+
log: Incomplete
|
|
5
|
+
socketpair: Incomplete
|
|
6
|
+
|
|
7
|
+
class KafkaClient:
|
|
8
|
+
DEFAULT_CONFIG: Incomplete
|
|
9
|
+
config: Incomplete
|
|
10
|
+
cluster: Incomplete
|
|
11
|
+
def __init__(self, **configs) -> None: ...
|
|
12
|
+
def maybe_connect(self, node_id, wakeup: bool = True): ...
|
|
13
|
+
def connection_failed(self, node_id): ...
|
|
14
|
+
def ready(self, node_id, metadata_priority: bool = True): ...
|
|
15
|
+
def connected(self, node_id): ...
|
|
16
|
+
def close(self, node_id=None) -> None: ...
|
|
17
|
+
def __del__(self) -> None: ...
|
|
18
|
+
def is_disconnected(self, node_id): ...
|
|
19
|
+
def connection_delay(self, node_id): ...
|
|
20
|
+
def throttle_delay(self, node_id): ...
|
|
21
|
+
def is_ready(self, node_id, metadata_priority: bool = True): ...
|
|
22
|
+
def send(self, node_id, request, wakeup: bool = True, request_timeout_ms=None): ...
|
|
23
|
+
def poll(self, timeout_ms=None, future=None): ...
|
|
24
|
+
def in_flight_request_count(self, node_id=None): ...
|
|
25
|
+
def least_loaded_node(self): ...
|
|
26
|
+
def least_loaded_node_refresh_ms(self): ...
|
|
27
|
+
def set_topics(self, topics): ...
|
|
28
|
+
def add_topic(self, topic): ...
|
|
29
|
+
def get_api_versions(self): ...
|
|
30
|
+
def check_version(self, node_id=None, timeout=None, **kwargs): ...
|
|
31
|
+
def api_version(self, operation, max_version=None): ...
|
|
32
|
+
def wakeup(self) -> None: ...
|
|
33
|
+
def bootstrap_connected(self): ...
|
|
34
|
+
def await_ready(self, node_id, timeout_ms: int = 30000): ...
|
|
35
|
+
def send_and_receive(self, node_id, request): ...
|
|
36
|
+
|
|
37
|
+
class IdleConnectionManager:
|
|
38
|
+
connections_max_idle: Incomplete
|
|
39
|
+
next_idle_close_check_time: Incomplete
|
|
40
|
+
lru_connections: Incomplete
|
|
41
|
+
def __init__(self, connections_max_idle_ms) -> None: ...
|
|
42
|
+
def update(self, conn_id) -> None: ...
|
|
43
|
+
def remove(self, conn_id) -> None: ...
|
|
44
|
+
def is_expired(self, conn_id): ...
|
|
45
|
+
def next_check_ms(self): ...
|
|
46
|
+
def update_next_idle_close_check_time(self, ts) -> None: ...
|
|
47
|
+
def poll_expired_connection(self): ...
|
|
48
|
+
|
|
49
|
+
class KafkaClientMetrics:
|
|
50
|
+
metrics: Incomplete
|
|
51
|
+
metric_group_name: Incomplete
|
|
52
|
+
connection_closed: Incomplete
|
|
53
|
+
connection_created: Incomplete
|
|
54
|
+
select_time: Incomplete
|
|
55
|
+
io_time: Incomplete
|
|
56
|
+
def __init__(self, metrics, metric_group_prefix, conns) -> None: ...
|
kafka-stubs/cluster.pyi
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from _typeshed import Incomplete
|
|
2
|
+
|
|
3
|
+
log: Incomplete
|
|
4
|
+
|
|
5
|
+
class ClusterMetadata:
|
|
6
|
+
DEFAULT_CONFIG: Incomplete
|
|
7
|
+
need_all_topic_metadata: bool
|
|
8
|
+
unauthorized_topics: Incomplete
|
|
9
|
+
internal_topics: Incomplete
|
|
10
|
+
controller: Incomplete
|
|
11
|
+
cluster_id: Incomplete
|
|
12
|
+
config: Incomplete
|
|
13
|
+
def __init__(self, **configs) -> None: ...
|
|
14
|
+
def is_bootstrap(self, node_id): ...
|
|
15
|
+
def brokers(self): ...
|
|
16
|
+
def broker_metadata(self, broker_id): ...
|
|
17
|
+
def partitions_for_topic(self, topic): ...
|
|
18
|
+
def available_partitions_for_topic(self, topic): ...
|
|
19
|
+
def leader_for_partition(self, partition): ...
|
|
20
|
+
def leader_epoch_for_partition(self, partition): ...
|
|
21
|
+
def partitions_for_broker(self, broker_id): ...
|
|
22
|
+
def coordinator_for_group(self, group): ...
|
|
23
|
+
def ttl(self): ...
|
|
24
|
+
def refresh_backoff(self): ...
|
|
25
|
+
def request_update(self): ...
|
|
26
|
+
@property
|
|
27
|
+
def need_update(self): ...
|
|
28
|
+
def topics(self, exclude_internal_topics: bool = True): ...
|
|
29
|
+
def failed_update(self, exception) -> None: ...
|
|
30
|
+
def update_metadata(self, metadata): ...
|
|
31
|
+
def add_listener(self, listener) -> None: ...
|
|
32
|
+
def remove_listener(self, listener) -> None: ...
|
|
33
|
+
def add_coordinator(self, response, coord_type, coord_key): ...
|
|
34
|
+
def with_partitions(self, partitions_to_add): ...
|
|
35
|
+
|
|
36
|
+
def collect_hosts(hosts, randomize: bool = True): ...
|
kafka-stubs/codec.pyi
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
from _typeshed import Incomplete
|
|
2
|
+
|
|
3
|
+
ZSTD_MAX_OUTPUT_SIZE: Incomplete
|
|
4
|
+
PYPY: Incomplete
|
|
5
|
+
|
|
6
|
+
def has_gzip(): ...
|
|
7
|
+
def has_snappy(): ...
|
|
8
|
+
def has_zstd(): ...
|
|
9
|
+
def has_lz4(): ...
|
|
10
|
+
def gzip_encode(payload, compresslevel=None): ...
|
|
11
|
+
def gzip_decode(payload): ...
|
|
12
|
+
def snappy_encode(payload, xerial_compatible: bool = True, xerial_blocksize=32768): ...
|
|
13
|
+
def snappy_decode(payload): ...
|
|
14
|
+
|
|
15
|
+
lz4_encode: Incomplete
|
|
16
|
+
|
|
17
|
+
def lz4f_decode(payload): ...
|
|
18
|
+
|
|
19
|
+
lz4_decode: Incomplete
|
|
20
|
+
lz4_decode = lz4f_decode
|
|
21
|
+
|
|
22
|
+
def lz4_encode_old_kafka(payload): ...
|
|
23
|
+
def lz4_decode_old_kafka(payload): ...
|
|
24
|
+
def zstd_encode(payload): ...
|
|
25
|
+
def zstd_decode(payload): ...
|
kafka-stubs/conn.pyi
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import ssl
|
|
2
|
+
from _typeshed import Incomplete
|
|
3
|
+
|
|
4
|
+
log: Incomplete
|
|
5
|
+
DEFAULT_KAFKA_PORT: int
|
|
6
|
+
ssl_available: bool
|
|
7
|
+
SSLEOFError = ssl.SSLEOFError
|
|
8
|
+
SSLWantReadError = ssl.SSLWantReadError
|
|
9
|
+
SSLWantWriteError = ssl.SSLWantWriteError
|
|
10
|
+
SSLZeroReturnError = ssl.SSLZeroReturnError
|
|
11
|
+
|
|
12
|
+
AFI_NAMES: Incomplete
|
|
13
|
+
|
|
14
|
+
class ConnectionStates:
|
|
15
|
+
DISCONNECTED: str
|
|
16
|
+
CONNECTING: str
|
|
17
|
+
HANDSHAKE: str
|
|
18
|
+
CONNECTED: str
|
|
19
|
+
AUTHENTICATING: str
|
|
20
|
+
API_VERSIONS_SEND: str
|
|
21
|
+
API_VERSIONS_RECV: str
|
|
22
|
+
|
|
23
|
+
class BrokerConnection:
|
|
24
|
+
DEFAULT_CONFIG: Incomplete
|
|
25
|
+
SECURITY_PROTOCOLS: Incomplete
|
|
26
|
+
VERSION_CHECKS: Incomplete
|
|
27
|
+
host: Incomplete
|
|
28
|
+
port: Incomplete
|
|
29
|
+
afi: Incomplete
|
|
30
|
+
config: Incomplete
|
|
31
|
+
node_id: Incomplete
|
|
32
|
+
in_flight_requests: Incomplete
|
|
33
|
+
state: Incomplete
|
|
34
|
+
last_attempt: int
|
|
35
|
+
def __init__(self, host, port, afi, **configs) -> None: ...
|
|
36
|
+
def connect_blocking(self, timeout=...): ...
|
|
37
|
+
def connect(self): ...
|
|
38
|
+
def blacked_out(self): ...
|
|
39
|
+
def throttled(self): ...
|
|
40
|
+
def throttle_delay(self): ...
|
|
41
|
+
def connection_delay(self): ...
|
|
42
|
+
def connected(self): ...
|
|
43
|
+
def connecting(self): ...
|
|
44
|
+
def initializing(self): ...
|
|
45
|
+
def disconnected(self): ...
|
|
46
|
+
def connect_failed(self): ...
|
|
47
|
+
def __del__(self) -> None: ...
|
|
48
|
+
def close(self, error=None) -> None: ...
|
|
49
|
+
def send(self, request, blocking: bool = True, request_timeout_ms=None): ...
|
|
50
|
+
def send_pending_requests(self): ...
|
|
51
|
+
def send_pending_requests_v2(self): ...
|
|
52
|
+
def can_send_more(self): ...
|
|
53
|
+
def recv(self): ...
|
|
54
|
+
def requests_timed_out(self): ...
|
|
55
|
+
def timed_out_ifrs(self): ...
|
|
56
|
+
def next_ifr_request_timeout_ms(self): ...
|
|
57
|
+
def get_api_versions(self): ...
|
|
58
|
+
def check_version(self, timeout: int = 2, **kwargs): ...
|
|
59
|
+
|
|
60
|
+
class BrokerConnectionMetrics:
|
|
61
|
+
metrics: Incomplete
|
|
62
|
+
bytes_sent: Incomplete
|
|
63
|
+
bytes_received: Incomplete
|
|
64
|
+
request_time: Incomplete
|
|
65
|
+
throttle_time: Incomplete
|
|
66
|
+
def __init__(self, metrics, metric_group_prefix, node_id) -> None: ...
|
|
67
|
+
|
|
68
|
+
def get_ip_port_afi(host_and_port_str): ...
|
|
69
|
+
def is_inet_4_or_6(gai): ...
|
|
70
|
+
def dns_lookup(host, port, afi=...): ...
|