aliyun-log-python-sdk 0.9.32__tar.gz → 0.9.34__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. {aliyun_log_python_sdk-0.9.32/aliyun_log_python_sdk.egg-info → aliyun_log_python_sdk-0.9.34}/PKG-INFO +1 -1
  2. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/consumer/__init__.py +1 -1
  3. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/consumer/consumer_client.py +2 -0
  4. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/consumer/fetched_log_group.py +6 -5
  5. aliyun_log_python_sdk-0.9.34/aliyun/log/consumer/preprocessor.py +6 -0
  6. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/consumer/shard_worker.py +20 -13
  7. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/consumer/tasks.py +42 -18
  8. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/machine_group_detail.py +10 -4
  9. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/machinegroup_response.py +10 -5
  10. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/pulllog_response.py +27 -10
  11. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/version.py +1 -1
  12. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34/aliyun_log_python_sdk.egg-info}/PKG-INFO +1 -1
  13. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun_log_python_sdk.egg-info/SOURCES.txt +1 -0
  14. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/setup.py +1 -1
  15. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/LICENSE +0 -0
  16. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/README.md +0 -0
  17. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/__init__.py +0 -0
  18. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/__init__.py +0 -0
  19. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/_proto_py2/__init__.py +0 -0
  20. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/_proto_py2/log_logs_pb2.py +0 -0
  21. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/_proto_py2/log_logs_raw_pb2.py +0 -0
  22. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/acl_config.py +0 -0
  23. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/acl_response.py +0 -0
  24. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/async_sql_pb2.py +0 -0
  25. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/async_sql_response.py +0 -0
  26. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/auth.py +0 -0
  27. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/common_response.py +0 -0
  28. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/compress.py +0 -0
  29. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/consumer/checkpoint_tracker.py +0 -0
  30. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/consumer/config.py +0 -0
  31. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/consumer/exceptions.py +0 -0
  32. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/consumer/heart_beat.py +0 -0
  33. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/consumer/worker.py +0 -0
  34. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/consumer_group_request.py +0 -0
  35. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/consumer_group_response.py +0 -0
  36. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/credentials.py +0 -0
  37. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/cursor_response.py +0 -0
  38. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/cursor_time_response.py +0 -0
  39. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/delete_async_sql_request.py +0 -0
  40. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/deletelogsrequest.py +0 -0
  41. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/deletelogssresponse.py +0 -0
  42. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/es_migration/__init__.py +0 -0
  43. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/es_migration/doc_logitem_converter.py +0 -0
  44. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/es_migration/index_logstore_mappings.py +0 -0
  45. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/es_migration/mapping_index_converter.py +0 -0
  46. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/es_migration/migration_log.py +0 -0
  47. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/es_migration/migration_manager.py +0 -0
  48. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/es_migration/migration_response.py +0 -0
  49. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/es_migration/migration_task.py +0 -0
  50. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/es_migration/util.py +0 -0
  51. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/etl_config_response.py +0 -0
  52. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/etl_core/__init__.py +0 -0
  53. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/etl_core/config_parser.py +0 -0
  54. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/etl_core/etl_util.py +0 -0
  55. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/etl_core/exceptions.py +0 -0
  56. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/etl_core/restrict_config_parser.py +0 -0
  57. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/etl_core/runner.py +0 -0
  58. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/etl_core/settings.py +0 -0
  59. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/etl_core/trans_comp/__init__.py +0 -0
  60. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/etl_core/trans_comp/trans_base.py +0 -0
  61. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/etl_core/trans_comp/trans_csv.py +0 -0
  62. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/etl_core/trans_comp/trans_json.py +0 -0
  63. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/etl_core/trans_comp/trans_kv.py +0 -0
  64. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/etl_core/trans_comp/trans_lookup.py +0 -0
  65. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/etl_core/trans_comp/trans_mv.py +0 -0
  66. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/etl_core/trans_comp/trans_regex.py +0 -0
  67. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/etl_core/trans_comp/trans_set_field.py +0 -0
  68. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/etl_core/transform/__init__.py +0 -0
  69. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/etl_core/transform/condition_list.py +0 -0
  70. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/etl_core/transform/condition_transform.py +0 -0
  71. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/etl_core/transform/condition_util.py +0 -0
  72. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/etl_core/transform/transform_base.py +0 -0
  73. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/etl_core/transform/transform_list.py +0 -0
  74. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/etl_core/transform/transform_meta.py +0 -0
  75. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/export_response.py +0 -0
  76. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/ext/__init__.py +0 -0
  77. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/ext/jupyter_magic.py +0 -0
  78. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/ext/syslogclient.py +0 -0
  79. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/external_store_config.py +0 -0
  80. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/external_store_config_response.py +0 -0
  81. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/get_async_sql_request.py +0 -0
  82. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/getcontextlogsresponse.py +0 -0
  83. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/getdeletelogsstatusrequest.py +0 -0
  84. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/getdeletelogsstatusresponse.py +0 -0
  85. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/gethistogramsrequest.py +0 -0
  86. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/gethistogramsresponse.py +0 -0
  87. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/getlogsrequest.py +0 -0
  88. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/getlogsresponse.py +0 -0
  89. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/histogram.py +0 -0
  90. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/index_config.py +0 -0
  91. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/index_config_response.py +0 -0
  92. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/ingestion_response.py +0 -0
  93. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/job.py +0 -0
  94. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/listdeletelogsstasksrequest.py +0 -0
  95. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/listdeletelogsstasksresponse.py +0 -0
  96. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/listlogstoresrequest.py +0 -0
  97. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/listlogstoresresponse.py +0 -0
  98. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/listtopicsrequest.py +0 -0
  99. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/listtopicsresponse.py +0 -0
  100. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/log_logs_pb2.py +0 -0
  101. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/log_logs_raw_pb2.py +0 -0
  102. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/logclient.py +0 -0
  103. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/logclient_core.py +0 -0
  104. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/logclient_operator.py +0 -0
  105. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/logexception.py +0 -0
  106. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/logger_hanlder.py +0 -0
  107. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/logitem.py +0 -0
  108. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/logrequest.py +0 -0
  109. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/logresponse.py +0 -0
  110. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/logstore_config_response.py +0 -0
  111. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/logtail_config_detail.py +0 -0
  112. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/logtail_config_response.py +0 -0
  113. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/metering_mode_response.py +0 -0
  114. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/odps_sink.py +0 -0
  115. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/oss_sink.py +0 -0
  116. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/pluralize.py +0 -0
  117. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/project_response.py +0 -0
  118. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/proto.py +0 -0
  119. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/putlogsrequest.py +0 -0
  120. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/putlogsresponse.py +0 -0
  121. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/queriedlog.py +0 -0
  122. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/rebuild_index_response.py +0 -0
  123. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/resource_params.py +0 -0
  124. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/resource_response.py +0 -0
  125. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/scheduled_sql.py +0 -0
  126. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/scheduled_sql_response.py +0 -0
  127. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/shard_response.py +0 -0
  128. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/shipper_config.py +0 -0
  129. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/shipper_response.py +0 -0
  130. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/sink.py +0 -0
  131. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/sql_instance_response.py +0 -0
  132. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/store_view.py +0 -0
  133. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/store_view_response.py +0 -0
  134. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/submit_async_sql_request.py +0 -0
  135. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/substore_config_response.py +0 -0
  136. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/tag_response.py +0 -0
  137. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/topostore_params.py +0 -0
  138. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/topostore_response.py +0 -0
  139. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun/log/util.py +0 -0
  140. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun_log_python_sdk.egg-info/dependency_links.txt +0 -0
  141. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun_log_python_sdk.egg-info/requires.txt +0 -0
  142. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/aliyun_log_python_sdk.egg-info/top_level.txt +0 -0
  143. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/setup.cfg +0 -0
  144. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/tests/test_alert.py +0 -0
  145. {aliyun_log_python_sdk-0.9.32 → aliyun_log_python_sdk-0.9.34}/tests/test_util.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aliyun-log-python-sdk
3
- Version: 0.9.32
3
+ Version: 0.9.34
4
4
  Summary: Aliyun log service Python client SDK
5
5
  Home-page: https://github.com/aliyun/aliyun-log-python-sdk
6
6
  Author: Aliyun
@@ -1,4 +1,4 @@
1
1
 
2
- from .tasks import ConsumerProcessorBase, ConsumerProcessorAdaptor
2
+ from .tasks import ConsumerProcessorBase, ConsumerProcessorAdaptor, ConsumerJsonProcessorBase
3
3
  from .config import LogHubConfig, CursorPosition
4
4
  from .worker import ConsumerWorker
@@ -7,6 +7,7 @@ from .exceptions import ClientWorkerException
7
7
  from ..logexception import LogException
8
8
  from ..version import USER_AGENT
9
9
  from ..auth import *
10
+ from ..pulllog_response import PullLogResponse
10
11
 
11
12
 
12
13
  class ConsumerClientLoggerAdapter(logging.LoggerAdapter):
@@ -180,4 +181,5 @@ class ConsumerClient(object):
180
181
  return self.mclient.get_end_cursor(self.mproject, self.mlogstore, shard_id).get_cursor()
181
182
 
182
183
  def pull_logs(self, shard_id, cursor, end_cursor=None, count=1000, query=None, processor=None):
184
+ # type: (int, str, str, int, str, object) -> PullLogResponse
183
185
  return self.mclient.pull_logs(self.mproject, self.mlogstore, shard_id, cursor, count, compress=True, end_cursor=end_cursor, query=query, accept_compress_type=self.accept_compress_type, processor=processor)
@@ -3,18 +3,19 @@
3
3
 
4
4
  class FetchedLogGroup(object):
5
5
 
6
- def __init__(self, shard_id, log_group_list, end_cursor):
6
+ def __init__(self, shard_id, data, end_cursor, log_group_count):
7
7
  self._shard_id = shard_id
8
- self._fetched_log_group_list = log_group_list
8
+ self._data = data
9
9
  self._end_cursor = end_cursor
10
+ self._log_group_count = log_group_count
10
11
 
11
12
  @property
12
13
  def shard_id(self):
13
14
  return self._shard_id
14
15
 
15
16
  @property
16
- def fetched_log_group_list(self):
17
- return self._fetched_log_group_list
17
+ def data(self):
18
+ return self._data
18
19
 
19
20
  @property
20
21
  def end_cursor(self):
@@ -22,4 +23,4 @@ class FetchedLogGroup(object):
22
23
 
23
24
  @property
24
25
  def log_group_size(self):
25
- return len(self._fetched_log_group_list.LogGroups)
26
+ return self._log_group_count
@@ -0,0 +1,6 @@
1
+ def to_log_group_list_pb(pull_log_response):
2
+ return pull_log_response.get_loggroup_list()
3
+
4
+
5
+ def to_flattern_json_list(pull_log_response):
6
+ return pull_log_response.get_flatten_logs_json()
@@ -66,6 +66,7 @@ class ShardConsumerWorker(object):
66
66
  self.save_last_checkpoint = False
67
67
  self.query = query
68
68
  self.consume_processor = consume_processor
69
+ self.preprocessor = self.processor._preprocessor
69
70
  self.logger = ShardConsumerWorkerLoggerAdapter(
70
71
  logging.getLogger(__name__), {"shard_consumer_worker": self})
71
72
 
@@ -98,10 +99,13 @@ class ShardConsumerWorker(object):
98
99
 
99
100
  self.last_success_fetch_time = time.time()
100
101
 
101
- self.last_fetch_log_group = FetchedLogGroup(self.shard_id, task_result.get_fetched_log_group_list(),
102
- task_result.get_cursor())
102
+ self.last_fetch_log_group = FetchedLogGroup(self.shard_id,
103
+ task_result.get_data(),
104
+ task_result.get_cursor(),
105
+ task_result.get_log_group_count())
106
+
103
107
  self.next_fetch_cursor = task_result.get_cursor()
104
- self.last_fetch_count = self.last_fetch_log_group.log_group_size
108
+ self.last_fetch_count = task_result.get_log_group_count()
105
109
  self.last_fetch_size = task_result.get_raw_size()
106
110
  self.rawLogGroupCountBeforeQuery = task_result.get_raw_log_group_count_before_query()
107
111
  self.rawSizeBeforeQuery = task_result.get_raw_size_before_query()
@@ -114,7 +118,6 @@ class ShardConsumerWorker(object):
114
118
  self.checkpoint_tracker.flush_check_point()
115
119
  self.save_last_checkpoint = True
116
120
 
117
-
118
121
  self._sample_log_error(task_result)
119
122
 
120
123
  # no task or task is done, create new task
@@ -136,12 +139,17 @@ class ShardConsumerWorker(object):
136
139
  is_generate_fetch_task = (time.time() - self.last_fetch_time) > 0.05
137
140
  if is_generate_fetch_task:
138
141
  self.last_fetch_time = time.time()
139
- self.fetch_data_future = \
140
- self.executor.submit(consumer_fetch_task,
141
- self.log_client, self.shard_id, self.next_fetch_cursor,
142
- max_fetch_log_group_size=self.max_fetch_log_group_size,
143
- end_cursor=self.fetch_end_cursor, query=self.query,
144
- consume_processor=self.consume_processor)
142
+ self.fetch_data_future = self.executor.submit(
143
+ consumer_fetch_task,
144
+ self.log_client,
145
+ self.preprocessor,
146
+ self.shard_id,
147
+ self.next_fetch_cursor,
148
+ max_fetch_log_group_size=self.max_fetch_log_group_size,
149
+ end_cursor=self.fetch_end_cursor,
150
+ query=self.query,
151
+ consume_processor=self.consume_processor,
152
+ )
145
153
  else:
146
154
  self.fetch_data_future = None
147
155
  else:
@@ -213,13 +221,12 @@ class ShardConsumerWorker(object):
213
221
  self.checkpoint_tracker.set_cursor(self.last_fetch_log_group.end_cursor)
214
222
  self.current_task_exist = True
215
223
 
216
- # must deep copy cause some revision will happen
217
- last_fetch_log_group = copy.deepcopy(self.last_fetch_log_group)
224
+ log_group = self.last_fetch_log_group
218
225
  self.last_fetch_log_group = None
219
226
 
220
227
  if self.last_fetch_count > 0:
221
228
  self.task_future = self.executor.submit(consumer_process_task, self.processor,
222
- last_fetch_log_group.fetched_log_group_list,
229
+ log_group.data,
223
230
  self.checkpoint_tracker)
224
231
 
225
232
  elif self.consumer_status == ConsumerStatus.SHUTTING_DOWN:
@@ -5,6 +5,9 @@ import logging
5
5
 
6
6
  from .config import CursorPosition
7
7
  from ..logexception import LogException
8
+ from ..pulllog_response import PullLogResponse
9
+ from .consumer_client import ConsumerClient
10
+ from .preprocessor import to_log_group_list_pb, to_flattern_json_list
8
11
  import time
9
12
  import six
10
13
  import sys
@@ -17,6 +20,7 @@ class ConsumerProcessorBase(object):
17
20
  self.shard_id = -1
18
21
  self.last_check_time = 0
19
22
  self.checkpoint_timeout = 3
23
+ self._preprocessor = to_log_group_list_pb
20
24
 
21
25
  def save_checkpoint(self, tracker, force=False):
22
26
  current_time = time.time()
@@ -53,6 +57,20 @@ class ConsumerProcessorBase(object):
53
57
  self.save_checkpoint(check_point_tracker, force=True)
54
58
 
55
59
 
60
+ class ConsumerJsonProcessorBase(ConsumerProcessorBase):
61
+
62
+ def __init__(self):
63
+ super(ConsumerJsonProcessorBase, self).__init__()
64
+ self._preprocessor = to_flattern_json_list
65
+
66
+ @abc.abstractmethod
67
+ def process(self, flattern_json_list, check_point_tracker):
68
+ """
69
+ @flattern_json_list a list of dict, each dict is a log, eg: [{"__time__": 1761721979, "key1": "value1", "hello": "world", "__tag__:tagkey1": "tagvalue1" }]
70
+ """
71
+ raise NotImplementedError("not create method process")
72
+
73
+
56
74
  class ConsumerProcessorAdaptor(ConsumerProcessorBase):
57
75
  def __init__(self, func):
58
76
  super(ConsumerProcessorAdaptor, self).__init__()
@@ -112,28 +130,32 @@ class InitTaskResult(TaskResult):
112
130
 
113
131
 
114
132
  class FetchTaskResult(TaskResult):
115
- def __init__(self, fetched_log_group_list, cursor, raw_size , raw_size_before_query, raw_log_group_count_before_query):
133
+ def __init__(self, data, log_group_count, cursor, raw_size , raw_size_before_query, raw_log_group_count_before_query):
116
134
  super(FetchTaskResult, self).__init__(None)
117
- self.fetched_log_group_list = fetched_log_group_list
118
- self.cursor = cursor
119
- self.raw_size = raw_size
120
- self.raw_size_before_query = raw_size_before_query
121
- self.raw_log_group_count_before_query = raw_log_group_count_before_query
135
+ self._data = data
136
+ self._log_group_count = log_group_count
137
+ self._cursor = cursor
138
+ self._raw_size = raw_size
139
+ self._raw_size_before_query = raw_size_before_query
140
+ self._raw_log_group_count_before_query = raw_log_group_count_before_query
122
141
 
123
- def get_fetched_log_group_list(self):
124
- return self.fetched_log_group_list
142
+ def get_data(self):
143
+ return self._data
125
144
 
126
145
  def get_cursor(self):
127
- return self.cursor
146
+ return self._cursor
147
+
148
+ def get_log_group_count(self):
149
+ return self._log_group_count
128
150
 
129
151
  def get_raw_size(self):
130
- return self.raw_size
152
+ return self._raw_size
131
153
 
132
154
  def get_raw_size_before_query(self):
133
- return self.raw_size_before_query
155
+ return self._raw_size_before_query
134
156
 
135
157
  def get_raw_log_group_count_before_query(self):
136
- return self.raw_log_group_count_before_query
158
+ return self._raw_log_group_count_before_query
137
159
 
138
160
 
139
161
  def consumer_process_task(processor, log_groups, check_point_tracker):
@@ -186,16 +208,18 @@ def consumer_initialize_task(processor, consumer_client, shard_id, cursor_positi
186
208
  except Exception as e:
187
209
  return TaskResult(e)
188
210
 
189
-
190
- def consumer_fetch_task(loghub_client_adapter, shard_id, cursor, max_fetch_log_group_size=1000, end_cursor=None, query=None, consume_processor=None):
211
+ def consumer_fetch_task(loghub_client_adapter, preprocessor, shard_id, cursor, max_fetch_log_group_size=1000, end_cursor=None, query=None, consume_processor=None):
212
+ # type: (ConsumerClient, object, int, str, int, str, str, str) -> FetchTaskResult
191
213
  exception = None
192
214
 
193
215
  for retry_times in range(3):
194
216
  try:
217
+ # type: PullLogResponse
195
218
  response = loghub_client_adapter.pull_logs(shard_id, cursor, count=max_fetch_log_group_size, end_cursor=end_cursor, query=query, processor=consume_processor)
196
- fetch_log_group_list = response.get_loggroup_list()
219
+ data = preprocessor(response)
197
220
  next_cursor = response.get_next_cursor()
198
221
  raw_size = response.get_raw_size()
222
+ log_group_count = response.get_loggroup_count()
199
223
  raw_size_before_query = 0
200
224
  raw_log_group_count_before_query = 0
201
225
  if query or consume_processor:
@@ -203,11 +227,11 @@ def consumer_fetch_task(loghub_client_adapter, shard_id, cursor, max_fetch_log_g
203
227
  raw_log_group_count_before_query = max(response.get_raw_log_group_count_before_query(), 0)
204
228
  logger.debug("shard id = %s cursor = %s next cursor = %s size: %s",
205
229
  shard_id, cursor, next_cursor,
206
- response.get_log_count())
230
+ log_group_count)
207
231
  if not next_cursor:
208
- return FetchTaskResult(fetch_log_group_list, cursor, raw_size, raw_size_before_query, raw_log_group_count_before_query)
232
+ return FetchTaskResult(data, log_group_count, cursor, raw_size, raw_size_before_query, raw_log_group_count_before_query)
209
233
  else:
210
- return FetchTaskResult(fetch_log_group_list, next_cursor, raw_size, raw_size_before_query, raw_log_group_count_before_query)
234
+ return FetchTaskResult(data, log_group_count, next_cursor, raw_size, raw_size_before_query, raw_log_group_count_before_query)
211
235
  except LogException as e:
212
236
  exception = e
213
237
  if exception.get_resp_status() == 403:
@@ -71,13 +71,19 @@ class MachineStatus(object):
71
71
  :param heartbeat_time: last updated heartbeat_time
72
72
  """
73
73
 
74
- def __init__(self, ip, machine_unique_id, user_defined_id, heartbeat_time):
74
+ def __init__(self, ip, machine_unique_id, user_defined_id, heartbeat_time, binary=None):
75
75
  self.ip = ip
76
76
  self.machine_unique_id = machine_unique_id
77
77
  self.user_defined_id = user_defined_id
78
78
  self.heartbeat_time = heartbeat_time
79
+ self.binary = binary
79
80
 
80
81
  def log_print(self):
81
- print('MachineStatus: machine_unique_id={}, user_defined_id={}, heartbeat_time={}'.format(self.machine_unique_id,
82
- self.user_defined_id,
83
- self.heartbeat_time))
82
+ print(
83
+ "MachineStatus: machine_unique_id={}, user_defined_id={}, heartbeat_time={}, binary={}".format(
84
+ self.machine_unique_id,
85
+ self.user_defined_id,
86
+ self.heartbeat_time,
87
+ self.binary,
88
+ )
89
+ )
@@ -181,12 +181,17 @@ class ListMachinesResponse(LogResponse):
181
181
 
182
182
  def __init__(self, resp, header):
183
183
  LogResponse.__init__(self, header, resp)
184
- self.count = resp['count']
185
- self.total = resp['total']
184
+ self.count = resp["count"]
185
+ self.total = resp["total"]
186
186
  self.machines = []
187
- for machine_status in resp['machines']:
188
- machine = MachineStatus(machine_status['ip'], machine_status['machine-uniqueid'],
189
- machine_status['userdefined-id'], machine_status['lastHeartbeatTime'])
187
+ for machine_status in resp["machines"]:
188
+ machine = MachineStatus(
189
+ machine_status["ip"],
190
+ machine_status.get("machine-uniqueid", None),
191
+ machine_status["userdefined-id"],
192
+ machine_status["lastHeartbeatTime"],
193
+ machine_status.get("binary", None),
194
+ )
190
195
  self.machines.append(machine)
191
196
 
192
197
  def get_machine_count(self):
@@ -28,18 +28,28 @@ class PullLogResponse(LogResponse):
28
28
  def __init__(self, resp, header):
29
29
  LogResponse.__init__(self, header, resp)
30
30
  self._is_bytes_type = None
31
- self.log_count = int(Util.h_v_t(header, "x-log-count"))
31
+ self._log_group_count = int(Util.h_v_t(header, "x-log-count"))
32
32
  self.raw_size = int(Util.h_v_t(header, 'x-log-bodyrawsize'))
33
33
  self.next_cursor = Util.convert_unicode_to_str(Util.h_v_t(header, "x-log-cursor"))
34
34
  self.raw_log_group_count_before_query = int(Util.h_v_td(self.headers, 'x-log-rawdatacount', '-1'))
35
35
  self.raw_size_before_query = int(Util.h_v_td(self.headers, 'x-log-rawdatasize', '-1'))
36
- self.loggroup_list = LogGroupList()
37
- if resp is not None:
38
- self._parse_loggroup_list(resp)
36
+
37
+ self._loggroup_list = None
38
+ self._raw_uncompressed_body = resp
39
39
  self.loggroup_list_json = None
40
40
  self.flatten_logs_json = None
41
41
  self._body = None
42
42
 
43
+
44
+ @property
45
+ def loggroup_list(self):
46
+ if self._loggroup_list is None :
47
+ log_group_list, is_bytes_type = self._parse_loggroup_list(self._raw_uncompressed_body)
48
+ self._loggroup_list = log_group_list
49
+ self._is_bytes_type = is_bytes_type
50
+ self._raw_uncompressed_body = None
51
+ return self._loggroup_list
52
+
43
53
  def get_body(self):
44
54
  if self._body is None:
45
55
  self._body = {"next_cursor": self.next_cursor,
@@ -58,11 +68,15 @@ class PullLogResponse(LogResponse):
58
68
  def get_next_cursor(self):
59
69
  return self.next_cursor
60
70
 
71
+ @property
72
+ def log_count(self):
73
+ return self.get_log_count()
74
+
61
75
  def get_log_count(self):
62
76
  return len(self.get_flatten_logs_json())
63
77
 
64
78
  def get_loggroup_count(self):
65
- return len(self.loggroup_list.LogGroups)
79
+ return self._log_group_count
66
80
 
67
81
  def get_loggroup_json_list(self):
68
82
  if self.loggroup_list_json is None:
@@ -89,21 +103,24 @@ class PullLogResponse(LogResponse):
89
103
  def log_print(self):
90
104
  print('PullLogResponse')
91
105
  print('next_cursor', self.next_cursor)
92
- print('log_count', self.log_count)
106
+ print('log_group_count', self.get_loggroup_count())
93
107
  print('headers:', self.get_all_headers())
94
108
  print('detail:', self.get_loggroup_json_list())
95
109
 
96
110
  def _parse_loggroup_list(self, data):
111
+ if data is None:
112
+ return LogGroupList(), False
113
+
97
114
  try:
98
- self.loggroup_list.ParseFromString(data)
115
+ p = LogGroupList()
116
+ p.ParseFromString(data)
117
+ return p, False
99
118
  except Exception as ex:
100
119
  ex_second = None
101
120
  try:
102
121
  p = LogGroupListRaw()
103
122
  p.ParseFromString(data)
104
- self.loggroup_list = p
105
- self._is_bytes_type = True
106
- return
123
+ return p, True
107
124
  except Exception as ex2:
108
125
  ex_second = ex2
109
126
 
@@ -1,4 +1,4 @@
1
- __version__ = '0.9.32'
1
+ __version__ = '0.9.34'
2
2
 
3
3
  import sys
4
4
  OS_VERSION = str(sys.platform)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aliyun-log-python-sdk
3
- Version: 0.9.32
3
+ Version: 0.9.34
4
4
  Summary: Aliyun log service Python client SDK
5
5
  Home-page: https://github.com/aliyun/aliyun-log-python-sdk
6
6
  Author: Aliyun
@@ -95,6 +95,7 @@ aliyun/log/consumer/consumer_client.py
95
95
  aliyun/log/consumer/exceptions.py
96
96
  aliyun/log/consumer/fetched_log_group.py
97
97
  aliyun/log/consumer/heart_beat.py
98
+ aliyun/log/consumer/preprocessor.py
98
99
  aliyun/log/consumer/shard_worker.py
99
100
  aliyun/log/consumer/tasks.py
100
101
  aliyun/log/consumer/worker.py
@@ -43,7 +43,7 @@ requirements_py2 = [
43
43
  'jmespath==0.9.5',
44
44
  'enum34==1.1.10',
45
45
  'futures==3.3.0',
46
- 'protobuf>3.4.0,<=3.17.3', # 3.18.0 is the last version support py2, but yanked
46
+ 'protobuf==3.17.3', # 3.18.0 is the last version support py2, but yanked
47
47
  'regex==2021.3.17',
48
48
  'tzlocal==2.0.0',
49
49
  'lz4==2.2.1',