buz 2.15.10rc3__py3-none-any.whl → 2.15.10rc4__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.
- buz/kafka/infrastructure/aiokafka/rebalance/kafka_callback_rebalancer.py +9 -1
- {buz-2.15.10rc3.dist-info → buz-2.15.10rc4.dist-info}/METADATA +1 -1
- {buz-2.15.10rc3.dist-info → buz-2.15.10rc4.dist-info}/RECORD +5 -5
- {buz-2.15.10rc3.dist-info → buz-2.15.10rc4.dist-info}/LICENSE +0 -0
- {buz-2.15.10rc3.dist-info → buz-2.15.10rc4.dist-info}/WHEEL +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
from datetime import datetime
|
|
1
2
|
from logging import Logger
|
|
2
|
-
from typing import Awaitable, Callable
|
|
3
|
+
from typing import Awaitable, Callable, Optional
|
|
3
4
|
|
|
4
5
|
from aiokafka import ConsumerRebalanceListener, TopicPartition
|
|
5
6
|
|
|
@@ -16,11 +17,14 @@ class KafkaCallbackRebalancer(ConsumerRebalanceListener):
|
|
|
16
17
|
self.__on_partition_revoked = on_partitions_revoked
|
|
17
18
|
self.__on_partition_assigned = on_partitions_assigned
|
|
18
19
|
self.__assigned_partitions: set[TopicPartition] = set()
|
|
20
|
+
self.__rebalancing_start_time: Optional[datetime] = None
|
|
19
21
|
|
|
20
22
|
async def on_partitions_revoked(self, revoked: set[TopicPartition]) -> None:
|
|
21
23
|
if len(revoked) == 0:
|
|
22
24
|
return None
|
|
23
25
|
|
|
26
|
+
self.__rebalancing_start_time = datetime.now()
|
|
27
|
+
|
|
24
28
|
self.__logger.info(f"Partitions revoked by the rebalancing process: '{revoked}'")
|
|
25
29
|
|
|
26
30
|
await self.__on_partition_revoked(revoked)
|
|
@@ -40,3 +44,7 @@ class KafkaCallbackRebalancer(ConsumerRebalanceListener):
|
|
|
40
44
|
self.__assigned_partitions.update(new_partitions_assigned)
|
|
41
45
|
|
|
42
46
|
self.__logger.info(f"Partitions after assigning process: '{self.__assigned_partitions}'")
|
|
47
|
+
|
|
48
|
+
if self.__rebalancing_start_time is not None:
|
|
49
|
+
elapsed_time_ms = int((datetime.now() - self.__rebalancing_start_time).total_seconds() * 1000)
|
|
50
|
+
self.__logger.info(f"Rebalancing process ended, elapsed time: {elapsed_time_ms} ms")
|
|
@@ -167,7 +167,7 @@ buz/kafka/infrastructure/aiokafka/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeR
|
|
|
167
167
|
buz/kafka/infrastructure/aiokafka/aiokafka_consumer.py,sha256=3-73e2CJhSjHONsCH_kZB1x5EwhnzLG2cCKGmkU4q0s,10008
|
|
168
168
|
buz/kafka/infrastructure/aiokafka/aiokafka_producer.py,sha256=LteHKIHpT6MKplwmwsPYMsd2GWNJCzus65XDHCIdoN8,3823
|
|
169
169
|
buz/kafka/infrastructure/aiokafka/rebalance/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
170
|
-
buz/kafka/infrastructure/aiokafka/rebalance/kafka_callback_rebalancer.py,sha256
|
|
170
|
+
buz/kafka/infrastructure/aiokafka/rebalance/kafka_callback_rebalancer.py,sha256=-sgv29vbDWbvtcPD4qCYmbeVqu78LwkTXgC1fWCOdyk,2194
|
|
171
171
|
buz/kafka/infrastructure/aiokafka/translators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
172
172
|
buz/kafka/infrastructure/aiokafka/translators/consumer_initial_offset_position_translator.py,sha256=WmxkQfoXeTy9mIJtGGhM0eDKeQxhcJczeVAGCbtonVI,617
|
|
173
173
|
buz/kafka/infrastructure/cdc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -250,7 +250,7 @@ buz/serializer/message_to_json_bytes_serializer.py,sha256=RGZJ64t4t4Pz2FCASZZCv-
|
|
|
250
250
|
buz/wrapper/__init__.py,sha256=GnRdJFcncn-qp0hzDG9dBHLmTJSbHFVjE_yr-MdW_n4,77
|
|
251
251
|
buz/wrapper/async_to_sync.py,sha256=OfK-vrVUhuN-LLLvekLdMbQYtH0ue5lfbvuasj6ovMI,698
|
|
252
252
|
buz/wrapper/event_loop.py,sha256=pfBJ1g-8A2a3YgW8Gf9Fg0kkewoh3-wgTy2KIFDyfHk,266
|
|
253
|
-
buz-2.15.
|
|
254
|
-
buz-2.15.
|
|
255
|
-
buz-2.15.
|
|
256
|
-
buz-2.15.
|
|
253
|
+
buz-2.15.10rc4.dist-info/LICENSE,sha256=Jytu2S-2SPEgsB0y6BF-_LUxIWY7402fl0JSh36TLZE,1062
|
|
254
|
+
buz-2.15.10rc4.dist-info/METADATA,sha256=r-rwEUoCYrmm9DqP5VZHkpFvnv2MW4Xfr5bNFttaE5U,1601
|
|
255
|
+
buz-2.15.10rc4.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
256
|
+
buz-2.15.10rc4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|