kafka-python 2.2.12__py2.py3-none-any.whl → 2.2.14__py2.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/admin/client.py +5 -7
- kafka/consumer/fetcher.py +2 -1
- kafka/coordinator/base.py +18 -17
- kafka/sasl/gssapi.py +2 -2
- kafka/version.py +1 -1
- {kafka_python-2.2.12.dist-info → kafka_python-2.2.14.dist-info}/METADATA +2 -2
- {kafka_python-2.2.12.dist-info → kafka_python-2.2.14.dist-info}/RECORD +9 -9
- {kafka_python-2.2.12.dist-info → kafka_python-2.2.14.dist-info}/WHEEL +0 -0
- {kafka_python-2.2.12.dist-info → kafka_python-2.2.14.dist-info}/top_level.txt +0 -0
kafka/admin/client.py
CHANGED
|
@@ -17,6 +17,7 @@ import kafka.errors as Errors
|
|
|
17
17
|
from kafka.errors import (
|
|
18
18
|
IncompatibleBrokerVersion, KafkaConfigurationError, UnknownTopicOrPartitionError,
|
|
19
19
|
UnrecognizedBrokerVersion, IllegalArgumentError)
|
|
20
|
+
from kafka.future import Future
|
|
20
21
|
from kafka.metrics import MetricConfig, Metrics
|
|
21
22
|
from kafka.protocol.admin import (
|
|
22
23
|
CreateTopicsRequest, DeleteTopicsRequest, DescribeConfigsRequest, AlterConfigsRequest, CreatePartitionsRequest,
|
|
@@ -358,14 +359,11 @@ class KafkaAdminClient(object):
|
|
|
358
359
|
|
|
359
360
|
Returns:
|
|
360
361
|
A future object that may be polled for status and results.
|
|
361
|
-
|
|
362
|
-
Raises:
|
|
363
|
-
The exception if the message could not be sent.
|
|
364
362
|
"""
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
363
|
+
try:
|
|
364
|
+
self._client.await_ready(node_id)
|
|
365
|
+
except Errors.KafkaConnectionError as e:
|
|
366
|
+
return Future().failure(e)
|
|
369
367
|
return self._client.send(node_id, request, wakeup)
|
|
370
368
|
|
|
371
369
|
def _send_request_to_controller(self, request):
|
kafka/consumer/fetcher.py
CHANGED
|
@@ -613,7 +613,8 @@ class Fetcher(six.Iterator):
|
|
|
613
613
|
fetchable = self._subscriptions.fetchable_partitions()
|
|
614
614
|
# do not fetch a partition if we have a pending fetch response to process
|
|
615
615
|
# use copy.copy to avoid runtimeerror on mutation from different thread
|
|
616
|
-
|
|
616
|
+
# TODO: switch to deque.copy() with py3
|
|
617
|
+
discard = {fetch.topic_partition for fetch in copy.copy(self._completed_fetches)}
|
|
617
618
|
current = self._next_partition_records
|
|
618
619
|
if current:
|
|
619
620
|
discard.add(current.topic_partition)
|
kafka/coordinator/base.py
CHANGED
|
@@ -857,14 +857,12 @@ class BaseCoordinator(object):
|
|
|
857
857
|
self._heartbeat_thread.disable()
|
|
858
858
|
|
|
859
859
|
def _close_heartbeat_thread(self, timeout_ms=None):
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
pass
|
|
867
|
-
self._heartbeat_thread = None
|
|
860
|
+
if self._heartbeat_thread is not None:
|
|
861
|
+
try:
|
|
862
|
+
self._heartbeat_thread.close(timeout_ms=timeout_ms)
|
|
863
|
+
except ReferenceError:
|
|
864
|
+
pass
|
|
865
|
+
self._heartbeat_thread = None
|
|
868
866
|
|
|
869
867
|
def __del__(self):
|
|
870
868
|
try:
|
|
@@ -1047,17 +1045,20 @@ class HeartbeatThread(threading.Thread):
|
|
|
1047
1045
|
self.enabled = False
|
|
1048
1046
|
|
|
1049
1047
|
def close(self, timeout_ms=None):
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1048
|
+
with self.coordinator._lock:
|
|
1049
|
+
if self.closed:
|
|
1050
|
+
return
|
|
1053
1051
|
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
# from within the heartbeat thread.
|
|
1057
|
-
if threading.current_thread() == self:
|
|
1058
|
-
return
|
|
1052
|
+
heartbeat_log.info('Stopping heartbeat thread')
|
|
1053
|
+
self.closed = True
|
|
1059
1054
|
|
|
1060
|
-
|
|
1055
|
+
# Generally this should not happen - close() is triggered
|
|
1056
|
+
# by the coordinator. But in some cases GC may close the coordinator
|
|
1057
|
+
# from within the heartbeat thread.
|
|
1058
|
+
if threading.current_thread() == self:
|
|
1059
|
+
return
|
|
1060
|
+
|
|
1061
|
+
# Notify coordinator lock to wake thread from sleep/lock.wait
|
|
1061
1062
|
self.coordinator._lock.notify()
|
|
1062
1063
|
|
|
1063
1064
|
if self.is_alive():
|
kafka/sasl/gssapi.py
CHANGED
|
@@ -68,10 +68,10 @@ class SaslMechanismGSSAPI(SaslMechanism):
|
|
|
68
68
|
# simply set QoP to 'auth' only (first octet). We reuse the max message size proposed
|
|
69
69
|
# by the server
|
|
70
70
|
client_flags = self.SASL_QOP_AUTH
|
|
71
|
-
server_flags = msg[0]
|
|
71
|
+
server_flags = struct.Struct('>b').unpack(msg[0:1])[0]
|
|
72
72
|
message_parts = [
|
|
73
73
|
struct.Struct('>b').pack(client_flags & server_flags),
|
|
74
|
-
msg[1:],
|
|
74
|
+
msg[1:], # always agree to max message size from server
|
|
75
75
|
self.auth_id.encode('utf-8'),
|
|
76
76
|
]
|
|
77
77
|
# add authorization identity to the response, and GSS-wrap
|
kafka/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '2.2.
|
|
1
|
+
__version__ = '2.2.14'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kafka-python
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.14
|
|
4
4
|
Summary: Pure Python client for Apache Kafka
|
|
5
5
|
Author-email: Dana Powers <dana.powers@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/dpkp/kafka-python
|
|
@@ -45,7 +45,7 @@ Requires-Dist: pyperf; extra == "benchmarks"
|
|
|
45
45
|
Kafka Python client
|
|
46
46
|
------------------------
|
|
47
47
|
|
|
48
|
-
.. image:: https://img.shields.io/badge/kafka-
|
|
48
|
+
.. image:: https://img.shields.io/badge/kafka-4.0--0.8-brightgreen.svg
|
|
49
49
|
:target: https://kafka-python.readthedocs.io/en/master/compatibility.html
|
|
50
50
|
.. image:: https://img.shields.io/pypi/pyversions/kafka-python.svg
|
|
51
51
|
:target: https://pypi.python.org/pypi/kafka-python
|
|
@@ -8,10 +8,10 @@ kafka/future.py,sha256=ZQStbfUYIPJRrgMfAWxxjrIRVxsw4WCtSR0J0bkyGno,2847
|
|
|
8
8
|
kafka/socks5_wrapper.py,sha256=6woOaCTJXJ5e89_zdyW5BjOpyE4rCbYFH-kd-FeuPuk,9827
|
|
9
9
|
kafka/structs.py,sha256=SJGzmLdV21jZyQ7247k0WFy16UiusgTHK3I-e4qzI-E,3058
|
|
10
10
|
kafka/util.py,sha256=WGqI5yT1yWGgHqSuRF9Fi8ejpiB53SurMy7ABkYxJ2g,4584
|
|
11
|
-
kafka/version.py,sha256=
|
|
11
|
+
kafka/version.py,sha256=PR6uSCwslT9zrWgpYBe2K-rcBonsAlnUCAlbjmvi0Yc,23
|
|
12
12
|
kafka/admin/__init__.py,sha256=S_XxqyyV480_yXhttK79XZqNAmZyXRjspd3SoqYykE8,720
|
|
13
13
|
kafka/admin/acl_resource.py,sha256=ak_dUsSni4SyP0ORbSKenZpwTy0Ykxq3FSt_9XgLR8k,8265
|
|
14
|
-
kafka/admin/client.py,sha256=
|
|
14
|
+
kafka/admin/client.py,sha256=94UpHTsgzvhOoB6_1QLeKxvZKlStKfI96xuWyaY9_Sc,78814
|
|
15
15
|
kafka/admin/config_resource.py,sha256=_JZWN_Q7jbuTtq2kdfHxWyTt_jI1LI-xnVGsf6oYGyY,1039
|
|
16
16
|
kafka/admin/new_partitions.py,sha256=rYSb7S6VL706ZauSmiN5J9GDsep0HYRmkkAZUgT2JIg,757
|
|
17
17
|
kafka/admin/new_topic.py,sha256=fvezLP9JXumqX-nU27Fgo0tj4d85ybcJgKluQImm3-0,1306
|
|
@@ -23,11 +23,11 @@ kafka/benchmarks/record_batch_compose.py,sha256=CnUreNg1lUT0Qx9enmSr-THmBl9PjVMf
|
|
|
23
23
|
kafka/benchmarks/record_batch_read.py,sha256=vlFaWU2YWI379n_2M8qieb_S2uHUWKV0NquEYy5b-Ho,2184
|
|
24
24
|
kafka/benchmarks/varint_speed.py,sha256=s4CuvKgDZL-_zna5E3vM8RgHjhXuW6pcaO1z1WYZ_0Y,12585
|
|
25
25
|
kafka/consumer/__init__.py,sha256=NDdvtyuJgFyQZahqL9i5sYXGP6rOMIXWwHQEaZ1fCcs,122
|
|
26
|
-
kafka/consumer/fetcher.py,sha256=
|
|
26
|
+
kafka/consumer/fetcher.py,sha256=RlQLut54c5nOMl21neTJA2tmdsxIIPIX2Idu5Q-dYKY,69184
|
|
27
27
|
kafka/consumer/group.py,sha256=oieWNHM1NWiOZT8pasOLfFJAbmJEXJ4h7PgUtklxo_Q,58944
|
|
28
28
|
kafka/consumer/subscription_state.py,sha256=bK-YTVbOzhy8OB206QAfXVuo7zPA9YqYXnrRRST369c,24289
|
|
29
29
|
kafka/coordinator/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
30
|
-
kafka/coordinator/base.py,sha256=
|
|
30
|
+
kafka/coordinator/base.py,sha256=hXfwtDkrHXHiNqjshCOa19js_2Y6ibLsdzDvJKGmcKc,54419
|
|
31
31
|
kafka/coordinator/consumer.py,sha256=le4bGbHfrDK4pperYXekPKzuZW576uXL324IOwS4Kmw,46348
|
|
32
32
|
kafka/coordinator/heartbeat.py,sha256=LeJJlwz1oUEOfEMIFT-R7ZOHBQ-b-luVKwmKyWxLfDo,3242
|
|
33
33
|
kafka/coordinator/protocol.py,sha256=wTaIOnUVbj0CKXZ82FktZo-zMRvOCk3hdQAoHJ62e3I,1041
|
|
@@ -107,7 +107,7 @@ kafka/record/memory_records.py,sha256=b7RFxvaQ93drXSk3o3_YB3FQlVoESoBlGj3Z5PD25n
|
|
|
107
107
|
kafka/record/util.py,sha256=LDajBWdYVetmXts_t9Q76CxEx7njgC9LnjMgz9yPEMM,3556
|
|
108
108
|
kafka/sasl/__init__.py,sha256=wUUGIKRe52J6Qekj7hSypg44vWTrkYsEdVafQC7cX5s,1106
|
|
109
109
|
kafka/sasl/abc.py,sha256=R0BZOk3AYEGyehiGbbg-LMRvFAlWZsh0fBiESgUpBYw,657
|
|
110
|
-
kafka/sasl/gssapi.py,sha256=
|
|
110
|
+
kafka/sasl/gssapi.py,sha256=pwLxXqcmJJxkuFQUoEfX5PWgZxr-8TziuRCg9K7fO3E,4705
|
|
111
111
|
kafka/sasl/msk.py,sha256=FCv0uUTQKjvR2gIGyiv-dlwIvkpvEtaHvhqhXtC2q8w,8101
|
|
112
112
|
kafka/sasl/oauth.py,sha256=dh87tVi-dlS5lIzgYsC4m7IXUhlLdejaMb9Ua6oYaB0,3425
|
|
113
113
|
kafka/sasl/plain.py,sha256=PMfoWT856wx6nF_LhpfPKEnD7BRNx5l6rDhAqxBnMWU,1317
|
|
@@ -120,7 +120,7 @@ kafka/vendor/enum34.py,sha256=-u-lxAiJMt6ru4Do7NUDY9OpeWkYJMksb2xengJawFE,31204
|
|
|
120
120
|
kafka/vendor/selectors34.py,sha256=gxejLO4eXf8mRSGXaQiknPig3GdX1rtsZiYOQJVuAy8,20594
|
|
121
121
|
kafka/vendor/six.py,sha256=lLBa9_HrANP5BMZ7twEzg1M3wofwPmXyptuWmHX0brY,34826
|
|
122
122
|
kafka/vendor/socketpair.py,sha256=Fi3PoY1Okkppab720wFk1BhHXyjcw7hi5DwhqrYZH2Y,2737
|
|
123
|
-
kafka_python-2.2.
|
|
124
|
-
kafka_python-2.2.
|
|
125
|
-
kafka_python-2.2.
|
|
126
|
-
kafka_python-2.2.
|
|
123
|
+
kafka_python-2.2.14.dist-info/METADATA,sha256=ShmA7Vjv6JzZqT0ktCUjlSoO_EqgOFIWdpsgj2awOoA,9952
|
|
124
|
+
kafka_python-2.2.14.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
|
|
125
|
+
kafka_python-2.2.14.dist-info/top_level.txt,sha256=IivJz7l5WHdLNDT6RIiVAlhjQzYRwGqBBmKHZ7WjPeM,6
|
|
126
|
+
kafka_python-2.2.14.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|