talos-python 3.1.0__tar.gz → 3.1.2__tar.gz

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.
Files changed (145) hide show
  1. {talos-python-3.1.0/talos_python.egg-info → talos_python-3.1.2}/PKG-INFO +2 -2
  2. {talos-python-3.1.0 → talos_python-3.1.2}/setup.py +2 -2
  3. talos_python-3.1.2/talos/client/ClientVersion.py +24 -0
  4. {talos-python-3.1.0 → talos_python-3.1.2}/talos/client/TalosClientFactory.py +2 -1
  5. {talos-python-3.1.0 → talos_python-3.1.2}/talos/client/TalosHttpClient.py +11 -11
  6. {talos-python-3.1.0 → talos_python-3.1.2}/talos/consumer/PartitionFetcher.py +1 -1
  7. {talos-python-3.1.0 → talos_python-3.1.2}/talos/consumer/TalosMessageReader.py +2 -2
  8. {talos-python-3.1.0 → talos_python-3.1.2/talos_python.egg-info}/PKG-INFO +1 -1
  9. {talos-python-3.1.0 → talos_python-3.1.2}/talos_python.egg-info/SOURCES.txt +1 -0
  10. {talos-python-3.1.0 → talos_python-3.1.2}/setup.cfg +0 -0
  11. {talos-python-3.1.0 → talos_python-3.1.2}/talos/__init__.py +0 -0
  12. {talos-python-3.1.0 → talos_python-3.1.2}/talos/admin/TalosAdmin.py +0 -0
  13. {talos-python-3.1.0 → talos_python-3.1.2}/talos/admin/__init__.py +0 -0
  14. {talos-python-3.1.0 → talos_python-3.1.2}/talos/client/Constants.py +0 -0
  15. {talos-python-3.1.0 → talos_python-3.1.2}/talos/client/ScheduleInfoCache.py +0 -0
  16. {talos-python-3.1.0 → talos_python-3.1.2}/talos/client/SimpleAbnormalCallback.py +0 -0
  17. {talos-python-3.1.0 → talos_python-3.1.2}/talos/client/TalosClientConfig.py +0 -0
  18. {talos-python-3.1.0 → talos_python-3.1.2}/talos/client/TalosClientConfigkeys.py +0 -0
  19. {talos-python-3.1.0 → talos_python-3.1.2}/talos/client/TalosErrors.py +0 -0
  20. {talos-python-3.1.0 → talos_python-3.1.2}/talos/client/TopicAbnormalCallback.py +0 -0
  21. {talos-python-3.1.0 → talos_python-3.1.2}/talos/client/__init__.py +0 -0
  22. {talos-python-3.1.0 → talos_python-3.1.2}/talos/client/compression/Compression.py +0 -0
  23. {talos-python-3.1.0 → talos_python-3.1.2}/talos/client/compression/Gzip.py +0 -0
  24. {talos-python-3.1.0 → talos_python-3.1.2}/talos/client/compression/Snappy.py +0 -0
  25. {talos-python-3.1.0 → talos_python-3.1.2}/talos/client/compression/__init__.py +0 -0
  26. {talos-python-3.1.0 → talos_python-3.1.2}/talos/client/serialization/MessageSerialization.py +0 -0
  27. {talos-python-3.1.0 → talos_python-3.1.2}/talos/client/serialization/MessageSerializationFactory.py +0 -0
  28. {talos-python-3.1.0 → talos_python-3.1.2}/talos/client/serialization/MessageSerializer.py +0 -0
  29. {talos-python-3.1.0 → talos_python-3.1.2}/talos/client/serialization/MessageSerializerV1.py +0 -0
  30. {talos-python-3.1.0 → talos_python-3.1.2}/talos/client/serialization/MessageSerializerV2.py +0 -0
  31. {talos-python-3.1.0 → talos_python-3.1.2}/talos/client/serialization/MessageSerializerV3.py +0 -0
  32. {talos-python-3.1.0 → talos_python-3.1.2}/talos/client/serialization/MessageVersion.py +0 -0
  33. {talos-python-3.1.0 → talos_python-3.1.2}/talos/client/serialization/__init__.py +0 -0
  34. {talos-python-3.1.0 → talos_python-3.1.2}/talos/consumer/MessageCheckpointer.py +0 -0
  35. {talos-python-3.1.0 → talos_python-3.1.2}/talos/consumer/MessageProcessor.py +0 -0
  36. {talos-python-3.1.0 → talos_python-3.1.2}/talos/consumer/MessageProcessorFactory.py +0 -0
  37. {talos-python-3.1.0 → talos_python-3.1.2}/talos/consumer/MessageReader.py +0 -0
  38. {talos-python-3.1.0 → talos_python-3.1.2}/talos/consumer/MessageReaderFactory.py +0 -0
  39. {talos-python-3.1.0 → talos_python-3.1.2}/talos/consumer/SimpleConsumer.py +0 -0
  40. {talos-python-3.1.0 → talos_python-3.1.2}/talos/consumer/TalosConsumer.py +0 -0
  41. {talos-python-3.1.0 → talos_python-3.1.2}/talos/consumer/TalosConsumerConfigKeys.py +0 -0
  42. {talos-python-3.1.0 → talos_python-3.1.2}/talos/consumer/__init__.py +0 -0
  43. {talos-python-3.1.0 → talos_python-3.1.2}/talos/example/SimpleConsumerDemo.py +0 -0
  44. {talos-python-3.1.0 → talos_python-3.1.2}/talos/example/SimpleProducerDemo.py +0 -0
  45. {talos-python-3.1.0 → talos_python-3.1.2}/talos/example/TalosAdminDemo.py +0 -0
  46. {talos-python-3.1.0 → talos_python-3.1.2}/talos/example/TalosConsumerDemo.py +0 -0
  47. {talos-python-3.1.0 → talos_python-3.1.2}/talos/example/TalosProducerDemo.py +0 -0
  48. {talos-python-3.1.0 → talos_python-3.1.2}/talos/example/__init__.py +0 -0
  49. {talos-python-3.1.0 → talos_python-3.1.2}/talos/producer/BufferedMessageCount.py +0 -0
  50. {talos-python-3.1.0 → talos_python-3.1.2}/talos/producer/PartitionMessageQueue.py +0 -0
  51. {talos-python-3.1.0 → talos_python-3.1.2}/talos/producer/PartitionSender.py +0 -0
  52. {talos-python-3.1.0 → talos_python-3.1.2}/talos/producer/Partitioner.py +0 -0
  53. {talos-python-3.1.0 → talos_python-3.1.2}/talos/producer/ProducerNotActiveException.py +0 -0
  54. {talos-python-3.1.0 → talos_python-3.1.2}/talos/producer/SimplePartitioner.py +0 -0
  55. {talos-python-3.1.0 → talos_python-3.1.2}/talos/producer/SimpleProducer.py +0 -0
  56. {talos-python-3.1.0 → talos_python-3.1.2}/talos/producer/TalosProducer.py +0 -0
  57. {talos-python-3.1.0 → talos_python-3.1.2}/talos/producer/TalosProducerConfig.py +0 -0
  58. {talos-python-3.1.0 → talos_python-3.1.2}/talos/producer/TalosProducerConfigKey.py +0 -0
  59. {talos-python-3.1.0 → talos_python-3.1.2}/talos/producer/UserMessage.py +0 -0
  60. {talos-python-3.1.0 → talos_python-3.1.2}/talos/producer/UserMessageCallback.py +0 -0
  61. {talos-python-3.1.0 → talos_python-3.1.2}/talos/producer/UserMessageResult.py +0 -0
  62. {talos-python-3.1.0 → talos_python-3.1.2}/talos/producer/__init__.py +0 -0
  63. {talos-python-3.1.0 → talos_python-3.1.2}/talos/test/__init__.py +0 -0
  64. {talos-python-3.1.0 → talos_python-3.1.2}/talos/test/admin/__init__.py +0 -0
  65. {talos-python-3.1.0 → talos_python-3.1.2}/talos/test/client/__init__.py +0 -0
  66. {talos-python-3.1.0 → talos_python-3.1.2}/talos/test/client/test_socket.py +0 -0
  67. {talos-python-3.1.0 → talos_python-3.1.2}/talos/test/consumer/__init__.py +0 -0
  68. {talos-python-3.1.0 → talos_python-3.1.2}/talos/test/consumer/test_PartitionFetcher.py +0 -0
  69. {talos-python-3.1.0 → talos_python-3.1.2}/talos/test/consumer/test_SimpleConsumer.py +0 -0
  70. {talos-python-3.1.0 → talos_python-3.1.2}/talos/test/consumer/test_TalosConsumer.py +0 -0
  71. {talos-python-3.1.0 → talos_python-3.1.2}/talos/test/consumer/test_TalosMessageReader.py +0 -0
  72. {talos-python-3.1.0 → talos_python-3.1.2}/talos/test/producer/__init__.py +0 -0
  73. {talos-python-3.1.0 → talos_python-3.1.2}/talos/test/producer/test_PartitionMessageQueue.py +0 -0
  74. {talos-python-3.1.0 → talos_python-3.1.2}/talos/test/producer/test_PartitionSender.py +0 -0
  75. {talos-python-3.1.0 → talos_python-3.1.2}/talos/test/producer/test_TalosProducer.py +0 -0
  76. {talos-python-3.1.0 → talos_python-3.1.2}/talos/test/producer/test_UserMessage.py +0 -0
  77. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/TMultiplexedProcessor.py +0 -0
  78. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/TRecursive.py +0 -0
  79. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/TSCons.py +0 -0
  80. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/TSerialization.py +0 -0
  81. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/TTornado.py +0 -0
  82. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/Thrift.py +0 -0
  83. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/__init__.py +0 -0
  84. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/auth/__init__.py +0 -0
  85. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/auth/constants.py +0 -0
  86. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/auth/ttypes.py +0 -0
  87. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/authorization/__init__.py +0 -0
  88. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/authorization/constants.py +0 -0
  89. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/authorization/ttypes.py +0 -0
  90. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/common/TalosBaseService.py +0 -0
  91. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/common/__init__.py +0 -0
  92. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/common/constants.py +0 -0
  93. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/common/ttypes.py +0 -0
  94. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/compat.py +0 -0
  95. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/consumer/ConsumerService.py +0 -0
  96. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/consumer/__init__.py +0 -0
  97. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/consumer/constants.py +0 -0
  98. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/consumer/ttypes.py +0 -0
  99. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/message/MessageService.py +0 -0
  100. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/message/__init__.py +0 -0
  101. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/message/constants.py +0 -0
  102. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/message/ttypes.py +0 -0
  103. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/metric/MetricService.py +0 -0
  104. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/metric/__init__.py +0 -0
  105. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/metric/constants.py +0 -0
  106. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/metric/ttypes.py +0 -0
  107. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/protocol/TBase.py +0 -0
  108. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/protocol/TBinaryProtocol.py +0 -0
  109. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/protocol/TCompactProtocol.py +0 -0
  110. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/protocol/THeaderProtocol.py +0 -0
  111. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/protocol/TJSONProtocol.py +0 -0
  112. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/protocol/TMultiplexedProtocol.py +0 -0
  113. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/protocol/TProtocol.py +0 -0
  114. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/protocol/TProtocolDecorator.py +0 -0
  115. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/protocol/__init__.py +0 -0
  116. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/quota/QuotaService.py +0 -0
  117. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/quota/__init__.py +0 -0
  118. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/quota/constants.py +0 -0
  119. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/quota/ttypes.py +0 -0
  120. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/server/THttpServer.py +0 -0
  121. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/server/TNonblockingServer.py +0 -0
  122. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/server/TProcessPoolServer.py +0 -0
  123. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/server/TServer.py +0 -0
  124. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/server/__init__.py +0 -0
  125. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/topic/TopicService.py +0 -0
  126. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/topic/__init__.py +0 -0
  127. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/topic/constants.py +0 -0
  128. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/topic/ttypes.py +0 -0
  129. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/transport/THeaderTransport.py +0 -0
  130. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/transport/THttpClient.py +0 -0
  131. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/transport/TSSLSocket.py +0 -0
  132. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/transport/TSocket.py +0 -0
  133. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/transport/TTransport.py +0 -0
  134. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/transport/TTwisted.py +0 -0
  135. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/transport/TZlibTransport.py +0 -0
  136. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/transport/__init__.py +0 -0
  137. {talos-python-3.1.0 → talos_python-3.1.2}/talos/thrift/transport/sslcompat.py +0 -0
  138. {talos-python-3.1.0 → talos_python-3.1.2}/talos/utils/Const.py +0 -0
  139. {talos-python-3.1.0 → talos_python-3.1.2}/talos/utils/FalconWriter.py +0 -0
  140. {talos-python-3.1.0 → talos_python-3.1.2}/talos/utils/Utils.py +0 -0
  141. {talos-python-3.1.0 → talos_python-3.1.2}/talos/utils/__init__.py +0 -0
  142. {talos-python-3.1.0 → talos_python-3.1.2}/talos_python.egg-info/dependency_links.txt +0 -0
  143. {talos-python-3.1.0 → talos_python-3.1.2}/talos_python.egg-info/not-zip-safe +0 -0
  144. {talos-python-3.1.0 → talos_python-3.1.2}/talos_python.egg-info/requires.txt +0 -0
  145. {talos-python-3.1.0 → talos_python-3.1.2}/talos_python.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.2
2
- Name: talos-python
3
- Version: 3.1.0
2
+ Name: talos_python
3
+ Version: 3.1.2
4
4
  Summary: talos python2 sdk
5
5
  Home-page: UNKNOWN
6
6
  Author: huyumei
@@ -1,8 +1,8 @@
1
1
  from setuptools import find_packages, setup
2
2
 
3
3
  setup(
4
- name='talos-python',
5
- version='3.1.0',
4
+ name='talos_python',
5
+ version='3.1.2',
6
6
  author='huyumei',
7
7
  author_email='huyumei@xiaomi.com',
8
8
  maintainer='fangchengjin',
@@ -0,0 +1,24 @@
1
+ try:
2
+ import pkg_resources
3
+ except ImportError:
4
+ pkg_resources = None
5
+
6
+ _CLIENT_VERSION = None
7
+
8
+ def _init_version():
9
+ global _CLIENT_VERSION
10
+
11
+ if not pkg_resources:
12
+ return
13
+
14
+ default_version = "0.0.0"
15
+
16
+ try:
17
+ _CLIENT_VERSION = pkg_resources.get_distribution("talos-python").version
18
+ except (ImportError, pkg_resources.DistributionNotFound):
19
+ _CLIENT_VERSION = default_version
20
+
21
+ _init_version()
22
+
23
+ def get_client_version():
24
+ return _CLIENT_VERSION
@@ -15,6 +15,7 @@ from talos.client.TalosErrors import InvalidArgumentError
15
15
  from talos.client.Constants import Constants
16
16
  from talos.thrift.protocol.TCompactProtocol import TCompactProtocol
17
17
  from talos.client.TalosHttpClient import TalosHttpClient
18
+ from talos.client import ClientVersion
18
19
  import threading
19
20
  import logging
20
21
  import platform
@@ -410,6 +411,6 @@ class TalosClientFactory:
410
411
  raise InvalidArgumentError("Credential is not set")
411
412
 
412
413
  def create_user_agent_header(self):
413
- return "Python-SDK/" + str(self._version.major) + "." + str(self._version.minor) + "." + str(self._version.revision) + " Python/" + platform.python_version()
414
+ return "Python-SDK/" + ClientVersion.get_client_version() + " Python/" + platform.python_version()
414
415
 
415
416
 
@@ -407,7 +407,7 @@ class TalosHttpClient(TTransportBase):
407
407
  response = self.__http_response
408
408
  if not self.code == 200:
409
409
  isTalosTransportError = True
410
- headers = response.headers._headers
410
+ headers = response.getheaders()
411
411
  for i in headers:
412
412
  if i[0] == 'Content-Type':
413
413
  isTalosTransportError = False
@@ -427,17 +427,17 @@ class TalosHttpClient(TTransportBase):
427
427
  # @ return if clock is adjusted
428
428
  def adjustClock(self, response, httpStatusCode):
429
429
  if httpStatusCode == HttpStatusCode.CLOCK_TOO_SKEWED:
430
- headers = response.heasers(constants.HK_TIMESTAMP)
431
- for key, hv in headers.items():
430
+ hv = response.getheader(constants.HK_TIMESTAMP)
431
+ if hv is not None:
432
432
  serverTime = int(hv)
433
- min = 60 * 60 * 24 * 365 * (2010 - 1970)
434
- max = 60 * 60 * 24 * 365 * (2030 - 1970)
435
- if serverTime > min and serverTime < max:
436
- self.logger.debug("Adjusting client time from {} to {}" +
437
- str(self._clockOffset) + " serverTime: " + str(
438
- serverTime))
439
- self._clockOffset = serverTime
440
- return True
433
+ minTime = 60 * 60 * 24 * 365 * (2010 - 1970)
434
+ maxTime = 60 * 60 * 24 * 365 * (2030 - 1970)
435
+ if minTime < serverTime < maxTime:
436
+ self.logger.debug("Adjusting client time from {} to {}" +
437
+ str(self._clockOffset) + " serverTime: " + str(
438
+ serverTime))
439
+ self._clockOffset = serverTime
440
+ return True
441
441
  return False
442
442
 
443
443
 
@@ -282,7 +282,7 @@ class PartitionFetcher(object):
282
282
  # get the successfully locked partition
283
283
  successPartitionList = lockResponse.successPartitions
284
284
  if len(successPartitionList) > 0:
285
- try
285
+ try:
286
286
  assert successPartitionList[0] == self.partitionId
287
287
  except AssertionError as e:
288
288
  raise e
@@ -144,7 +144,7 @@ class TalosMessageReader(MessageReader, MessageCheckpointer):
144
144
  self.logger.info("start checkpoint: " + str(messageOffset))
145
145
  if self.consumerConfig.is_checkpoint_auto_commit():
146
146
  self.logger.info("You can not checkpoint through MessageCheckpointer when you set " +
147
- "\"galaxy.talos.consumer.checkpoint.message.offset\" as \"true\"")
147
+ "\"galaxy.talos.consumer.checkpoint.auto.commit\" as \"true\"")
148
148
  return False
149
149
 
150
150
  if messageOffset <= self.lastCommitOffset or messageOffset > self.finishedOffset:
@@ -202,7 +202,7 @@ class TalosMessageReader(MessageReader, MessageCheckpointer):
202
202
  self.logger.info("start checkpoint: " + str(commitOffset))
203
203
  if self.consumerConfig.is_checkpoint_auto_commit():
204
204
  self.logger.info("You can not checkpoint through MessageCheckpointer when you set " +
205
- "\"galaxy.talos.consumer.checkpoint.message.offset\" as \"true\"")
205
+ "\"galaxy.talos.consumer.checkpoint.auto.commit\" as \"true\"")
206
206
  return False
207
207
 
208
208
  if commitOffset <= self.lastCommitOffset or commitOffset > self.finishedOffset:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.2
2
2
  Name: talos-python
3
- Version: 3.1.0
3
+ Version: 3.1.2
4
4
  Summary: talos python2 sdk
5
5
  Home-page: UNKNOWN
6
6
  Author: huyumei
@@ -2,6 +2,7 @@ setup.py
2
2
  talos/__init__.py
3
3
  talos/admin/TalosAdmin.py
4
4
  talos/admin/__init__.py
5
+ talos/client/ClientVersion.py
5
6
  talos/client/Constants.py
6
7
  talos/client/ScheduleInfoCache.py
7
8
  talos/client/SimpleAbnormalCallback.py
File without changes