apache-flink 2.1.0__tar.gz → 2.2.0__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.
- {apache_flink-2.1.0/apache_flink.egg-info → apache_flink-2.2.0}/PKG-INFO +5 -5
- {apache_flink-2.1.0 → apache_flink-2.2.0}/README.md +1 -1
- {apache_flink-2.1.0 → apache_flink-2.2.0/apache_flink.egg-info}/PKG-INFO +5 -5
- {apache_flink-2.1.0 → apache_flink-2.2.0}/apache_flink.egg-info/SOURCES.txt +8 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/apache_flink.egg-info/requires.txt +3 -3
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/bin/config.sh +2 -0
- apache_flink-2.2.0/deps/examples/datastream/asyncio/remote_model_inference.py +150 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/examples/datastream/connectors/kafka_avro_format.py +28 -13
- apache_flink-2.2.0/deps/examples/datastream/connectors/kafka_bytearray_format.py +102 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/examples/datastream/connectors/kafka_csv_format.py +28 -13
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/examples/datastream/connectors/kafka_json_format.py +28 -13
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/datastream/__init__.py +10 -2
- apache_flink-2.2.0/pyflink/datastream/async_data_stream.py +172 -0
- apache_flink-2.2.0/pyflink/datastream/async_retry_predicates.py +29 -0
- apache_flink-2.2.0/pyflink/datastream/async_retry_strategies.py +121 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/datastream/data_stream.py +6 -3
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/datastream/functions.py +130 -2
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/datastream/window.py +2 -1
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/beam/beam_coder_impl_fast.c +2030 -1912
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/beam/beam_operations_fast.c +6203 -7137
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/beam/beam_operations_fast.pyx +23 -6
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/beam/beam_operations_slow.py +21 -5
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/beam/beam_stream_fast.c +2406 -2301
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/coder_impl_fast.c +11947 -15500
- apache_flink-2.2.0/pyflink/fn_execution/datastream/process/async_function/__init__.py +19 -0
- apache_flink-2.2.0/pyflink/fn_execution/datastream/process/async_function/operation.py +428 -0
- apache_flink-2.2.0/pyflink/fn_execution/datastream/process/async_function/queue.py +448 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/stream_fast.c +2326 -2507
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/table/aggregate_fast.c +3703 -4292
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/table/window_aggregate_fast.c +3273 -3934
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/table/catalog.py +22 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/table/expression.py +40 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/table/expressions.py +36 -3
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/table/table_environment.py +13 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/table/udf.py +0 -4
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/version.py +1 -1
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyproject.toml +50 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/setup.py +3 -2
- {apache_flink-2.1.0 → apache_flink-2.2.0}/LICENSE +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/MANIFEST.in +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/apache_flink.egg-info/dependency_links.txt +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/apache_flink.egg-info/not-zip-safe +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/apache_flink.egg-info/top_level.txt +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/bin/bash-java-utils.sh +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/bin/config-parser-utils.sh +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/bin/find-flink-home.sh +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/bin/flink +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/bin/flink-console.sh +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/bin/flink-daemon.sh +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/bin/historyserver.sh +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/bin/jobmanager.sh +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/bin/kubernetes-jobmanager.sh +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/bin/kubernetes-session.sh +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/bin/kubernetes-taskmanager.sh +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/bin/migrate-config-file.sh +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/bin/pyflink-shell.sh +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/bin/pyflink-udf-runner.bat +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/bin/pyflink-udf-runner.sh +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/bin/sql-client.sh +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/bin/sql-gateway.sh +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/bin/standalone-job.sh +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/bin/start-cluster.sh +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/bin/start-zookeeper-quorum.sh +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/bin/stop-cluster.sh +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/bin/stop-zookeeper-quorum.sh +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/bin/taskmanager.sh +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/bin/yarn-session.sh +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/bin/zookeeper.sh +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/conf/config.yaml +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/conf/log4j-cli.properties +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/conf/log4j-console.properties +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/conf/log4j-session.properties +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/conf/log4j.properties +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/conf/logback-console.xml +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/conf/logback-session.xml +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/conf/logback.xml +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/conf/masters +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/conf/workers +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/conf/zoo.cfg +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/examples/datastream/basic_operations.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/examples/datastream/connectors/elasticsearch.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/examples/datastream/connectors/pulsar.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/examples/datastream/event_time_timer.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/examples/datastream/process_json_data.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/examples/datastream/state_access.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/examples/datastream/streaming_word_count.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/examples/datastream/windowing/session_with_dynamic_gap_window.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/examples/datastream/windowing/session_with_gap_window.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/examples/datastream/windowing/sliding_time_window.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/examples/datastream/windowing/tumbling_count_window.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/examples/datastream/windowing/tumbling_time_window.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/examples/datastream/word_count.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/examples/table/basic_operations.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/examples/table/mixing_use_of_datastream_and_table.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/examples/table/multi_sink.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/examples/table/pandas/conversion_from_dataframe.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/examples/table/pandas/pandas_udaf.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/examples/table/process_json_data.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/examples/table/process_json_data_with_udf.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/examples/table/streaming_word_count.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/examples/table/windowing/over_window.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/examples/table/windowing/session_window.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/examples/table/windowing/sliding_window.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/examples/table/windowing/tumble_window.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/examples/table/word_count.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/deps/log/empty.txt +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/README.txt +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/__init__.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/common/__init__.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/common/completable_future.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/common/config_options.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/common/configuration.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/common/constants.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/common/execution_config.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/common/input_dependency_constraint.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/common/io.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/common/job_client.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/common/job_execution_result.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/common/job_id.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/common/job_status.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/common/restart_strategy.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/common/serialization.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/common/serializer.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/common/time.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/common/typeinfo.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/common/types.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/common/utils.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/common/watermark_strategy.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/datastream/checkpoint_config.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/datastream/checkpoint_storage.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/datastream/checkpointing_mode.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/datastream/connectors/__init__.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/datastream/connectors/base.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/datastream/connectors/cassandra.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/datastream/connectors/elasticsearch.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/datastream/connectors/file_system.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/datastream/connectors/hybrid_source.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/datastream/connectors/jdbc.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/datastream/connectors/kafka.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/datastream/connectors/kinesis.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/datastream/connectors/number_seq.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/datastream/connectors/pulsar.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/datastream/connectors/rabbitmq.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/datastream/execution_mode.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/datastream/externalized_checkpoint_retention.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/datastream/formats/__init__.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/datastream/formats/avro.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/datastream/formats/csv.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/datastream/formats/json.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/datastream/formats/orc.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/datastream/formats/parquet.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/datastream/output_tag.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/datastream/slot_sharing_group.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/datastream/state.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/datastream/state_backend.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/datastream/stream_execution_environment.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/datastream/time_domain.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/datastream/timerservice.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/datastream/utils.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/find_flink_home.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/ResettableIO.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/__init__.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/beam/__init__.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/beam/beam_boot.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/beam/beam_coder_impl_fast.pxd +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/beam/beam_coder_impl_fast.pyx +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/beam/beam_coder_impl_slow.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/beam/beam_coders.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/beam/beam_operations.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/beam/beam_operations_fast.pxd +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/beam/beam_sdk_worker_main.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/beam/beam_stream_fast.pxd +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/beam/beam_stream_fast.pyx +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/beam/beam_stream_slow.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/beam/beam_worker_pool_service.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/coder_impl_fast.pxd +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/coder_impl_fast.pyx +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/coder_impl_slow.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/coders.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/datastream/__init__.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/datastream/embedded/__init__.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/datastream/embedded/operations.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/datastream/embedded/process_function.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/datastream/embedded/runtime_context.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/datastream/embedded/side_output_context.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/datastream/embedded/state_impl.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/datastream/embedded/timerservice_impl.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/datastream/operations.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/datastream/process/__init__.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/datastream/process/input_handler.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/datastream/process/operations.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/datastream/process/process_function.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/datastream/process/runtime_context.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/datastream/process/timerservice_impl.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/datastream/timerservice.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/datastream/window/__init__.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/datastream/window/merging_window_set.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/datastream/window/window_operator.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/embedded/__init__.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/embedded/converters.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/embedded/java_utils.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/embedded/operation_utils.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/embedded/operations.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/embedded/state_impl.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/flink_fn_execution_pb2.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/flink_fn_execution_pb2.pyi +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/formats/__init__.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/formats/avro.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/internal_state.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/metrics/__init__.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/metrics/embedded/__init__.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/metrics/embedded/counter_impl.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/metrics/embedded/distribution_impl.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/metrics/embedded/meter_impl.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/metrics/embedded/metric_impl.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/metrics/process/__init__.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/metrics/process/counter_impl.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/metrics/process/distribution_impl.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/metrics/process/meter_impl.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/metrics/process/metric_impl.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/pickle.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/profiler.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/state_impl.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/stream_fast.pxd +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/stream_fast.pyx +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/stream_slow.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/table/__init__.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/table/aggregate_fast.pxd +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/table/aggregate_fast.pyx +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/table/aggregate_slow.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/table/operations.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/table/state_data_view.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/table/window_aggregate_fast.pxd +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/table/window_aggregate_fast.pyx +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/table/window_aggregate_slow.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/table/window_assigner.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/table/window_context.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/table/window_process_function.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/table/window_trigger.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/utils/__init__.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/fn_execution/utils/operation_utils.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/gen_protos.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/java_gateway.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/metrics/__init__.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/metrics/metricbase.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/pyflink_callback_server.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/pyflink_gateway_server.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/serializers.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/shell.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/table/__init__.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/table/changelog_mode.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/table/compiled_plan.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/table/data_view.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/table/descriptors.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/table/environment_settings.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/table/explain_detail.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/table/functions.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/table/model_descriptor.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/table/module.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/table/plan_reference.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/table/resolved_expression.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/table/result_kind.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/table/schema.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/table/serializers.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/table/sql_dialect.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/table/statement_set.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/table/table.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/table/table_config.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/table/table_descriptor.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/table/table_pipeline.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/table/table_result.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/table/table_schema.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/table/types.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/table/utils.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/table/window.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/testing/__init__.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/testing/source_sink_utils.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/testing/test_case_utils.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/util/__init__.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/util/api_stability_decorators.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/util/exceptions.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/pyflink/util/java_utils.py +0 -0
- {apache_flink-2.1.0 → apache_flink-2.2.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: apache-flink
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.2.0
|
|
4
4
|
Summary: Apache Flink Python API
|
|
5
5
|
Home-page: https://flink.apache.org
|
|
6
6
|
Author: Apache Software Foundation
|
|
@@ -25,12 +25,12 @@ Requires-Dist: fastavro!=1.8.0,>=1.1.0
|
|
|
25
25
|
Requires-Dist: requests>=2.26.0
|
|
26
26
|
Requires-Dist: protobuf>=3.19.0
|
|
27
27
|
Requires-Dist: numpy>=1.22.4
|
|
28
|
-
Requires-Dist: pandas
|
|
28
|
+
Requires-Dist: pandas<2.3,>=1.3.0
|
|
29
29
|
Requires-Dist: pyarrow<21.0.0,>=5.0.0
|
|
30
|
-
Requires-Dist: pemja<0.5.
|
|
30
|
+
Requires-Dist: pemja<0.5.6,>=0.5.5; platform_system != "Windows"
|
|
31
31
|
Requires-Dist: httplib2>=0.19.0
|
|
32
32
|
Requires-Dist: ruamel.yaml>=0.18.4
|
|
33
|
-
Requires-Dist: apache-flink-libraries<2.
|
|
33
|
+
Requires-Dist: apache-flink-libraries<2.2.1,>=2.2.0
|
|
34
34
|
Dynamic: author
|
|
35
35
|
Dynamic: author-email
|
|
36
36
|
Dynamic: classifier
|
|
@@ -112,6 +112,6 @@ Then you can activate your environment and run tests, for example:
|
|
|
112
112
|
|
|
113
113
|
```shell
|
|
114
114
|
source pyflink_39/bin/activate
|
|
115
|
-
uv pip install
|
|
115
|
+
uv pip install --group dev
|
|
116
116
|
./dev/lint-python.sh
|
|
117
117
|
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: apache-flink
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.2.0
|
|
4
4
|
Summary: Apache Flink Python API
|
|
5
5
|
Home-page: https://flink.apache.org
|
|
6
6
|
Author: Apache Software Foundation
|
|
@@ -25,12 +25,12 @@ Requires-Dist: fastavro!=1.8.0,>=1.1.0
|
|
|
25
25
|
Requires-Dist: requests>=2.26.0
|
|
26
26
|
Requires-Dist: protobuf>=3.19.0
|
|
27
27
|
Requires-Dist: numpy>=1.22.4
|
|
28
|
-
Requires-Dist: pandas
|
|
28
|
+
Requires-Dist: pandas<2.3,>=1.3.0
|
|
29
29
|
Requires-Dist: pyarrow<21.0.0,>=5.0.0
|
|
30
|
-
Requires-Dist: pemja<0.5.
|
|
30
|
+
Requires-Dist: pemja<0.5.6,>=0.5.5; platform_system != "Windows"
|
|
31
31
|
Requires-Dist: httplib2>=0.19.0
|
|
32
32
|
Requires-Dist: ruamel.yaml>=0.18.4
|
|
33
|
-
Requires-Dist: apache-flink-libraries<2.
|
|
33
|
+
Requires-Dist: apache-flink-libraries<2.2.1,>=2.2.0
|
|
34
34
|
Dynamic: author
|
|
35
35
|
Dynamic: author-email
|
|
36
36
|
Dynamic: classifier
|
|
@@ -112,6 +112,6 @@ Then you can activate your environment and run tests, for example:
|
|
|
112
112
|
|
|
113
113
|
```shell
|
|
114
114
|
source pyflink_39/bin/activate
|
|
115
|
-
uv pip install
|
|
115
|
+
uv pip install --group dev
|
|
116
116
|
./dev/lint-python.sh
|
|
117
117
|
```
|
|
@@ -53,8 +53,10 @@ deps/examples/datastream/process_json_data.py
|
|
|
53
53
|
deps/examples/datastream/state_access.py
|
|
54
54
|
deps/examples/datastream/streaming_word_count.py
|
|
55
55
|
deps/examples/datastream/word_count.py
|
|
56
|
+
deps/examples/datastream/asyncio/remote_model_inference.py
|
|
56
57
|
deps/examples/datastream/connectors/elasticsearch.py
|
|
57
58
|
deps/examples/datastream/connectors/kafka_avro_format.py
|
|
59
|
+
deps/examples/datastream/connectors/kafka_bytearray_format.py
|
|
58
60
|
deps/examples/datastream/connectors/kafka_csv_format.py
|
|
59
61
|
deps/examples/datastream/connectors/kafka_json_format.py
|
|
60
62
|
deps/examples/datastream/connectors/pulsar.py
|
|
@@ -108,6 +110,9 @@ pyflink/common/types.py
|
|
|
108
110
|
pyflink/common/utils.py
|
|
109
111
|
pyflink/common/watermark_strategy.py
|
|
110
112
|
pyflink/datastream/__init__.py
|
|
113
|
+
pyflink/datastream/async_data_stream.py
|
|
114
|
+
pyflink/datastream/async_retry_predicates.py
|
|
115
|
+
pyflink/datastream/async_retry_strategies.py
|
|
111
116
|
pyflink/datastream/checkpoint_config.py
|
|
112
117
|
pyflink/datastream/checkpoint_storage.py
|
|
113
118
|
pyflink/datastream/checkpointing_mode.py
|
|
@@ -193,6 +198,9 @@ pyflink/fn_execution/datastream/process/operations.py
|
|
|
193
198
|
pyflink/fn_execution/datastream/process/process_function.py
|
|
194
199
|
pyflink/fn_execution/datastream/process/runtime_context.py
|
|
195
200
|
pyflink/fn_execution/datastream/process/timerservice_impl.py
|
|
201
|
+
pyflink/fn_execution/datastream/process/async_function/__init__.py
|
|
202
|
+
pyflink/fn_execution/datastream/process/async_function/operation.py
|
|
203
|
+
pyflink/fn_execution/datastream/process/async_function/queue.py
|
|
196
204
|
pyflink/fn_execution/datastream/window/__init__.py
|
|
197
205
|
pyflink/fn_execution/datastream/window/merging_window_set.py
|
|
198
206
|
pyflink/fn_execution/datastream/window/window_operator.py
|
|
@@ -8,11 +8,11 @@ fastavro!=1.8.0,>=1.1.0
|
|
|
8
8
|
requests>=2.26.0
|
|
9
9
|
protobuf>=3.19.0
|
|
10
10
|
numpy>=1.22.4
|
|
11
|
-
pandas
|
|
11
|
+
pandas<2.3,>=1.3.0
|
|
12
12
|
pyarrow<21.0.0,>=5.0.0
|
|
13
13
|
httplib2>=0.19.0
|
|
14
14
|
ruamel.yaml>=0.18.4
|
|
15
|
-
apache-flink-libraries<2.
|
|
15
|
+
apache-flink-libraries<2.2.1,>=2.2.0
|
|
16
16
|
|
|
17
17
|
[:platform_system != "Windows"]
|
|
18
|
-
pemja<0.5.
|
|
18
|
+
pemja<0.5.6,>=0.5.5
|
|
@@ -240,6 +240,8 @@ fi
|
|
|
240
240
|
|
|
241
241
|
if [ -z "${MAX_LOG_FILE_NUMBER}" ]; then
|
|
242
242
|
MAX_LOG_FILE_NUMBER=$(readFromConfig ${KEY_ENV_LOG_MAX} ${DEFAULT_ENV_LOG_MAX} "${YAML_CONF}")
|
|
243
|
+
# Remove leading and ending single quotes (if present) of value
|
|
244
|
+
MAX_LOG_FILE_NUMBER="$( echo "${MAX_LOG_FILE_NUMBER}" | sed -e "s/^'//" -e "s/'$//" )"
|
|
243
245
|
export MAX_LOG_FILE_NUMBER
|
|
244
246
|
fi
|
|
245
247
|
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
################################################################################
|
|
2
|
+
# Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
# or more contributor license agreements. See the NOTICE file
|
|
4
|
+
# distributed with this work for additional information
|
|
5
|
+
# regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
# to you under the Apache License, Version 2.0 (the
|
|
7
|
+
# "License"); you may not use this file except in compliance
|
|
8
|
+
# with the License. You may obtain a copy of the License at
|
|
9
|
+
#
|
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
#
|
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
# See the License for the specific language governing permissions and
|
|
16
|
+
# limitations under the License.
|
|
17
|
+
################################################################################
|
|
18
|
+
import argparse
|
|
19
|
+
import asyncio
|
|
20
|
+
import functools
|
|
21
|
+
import json
|
|
22
|
+
import logging
|
|
23
|
+
import random
|
|
24
|
+
import sys
|
|
25
|
+
from typing import List
|
|
26
|
+
|
|
27
|
+
from pyflink.common import Encoder, Types, Time, Row
|
|
28
|
+
from pyflink.datastream import StreamExecutionEnvironment, AsyncDataStream, AsyncFunction, \
|
|
29
|
+
RuntimeContext, AsyncRetryStrategy, async_retry_predicates, CheckpointingMode
|
|
30
|
+
from pyflink.datastream.connectors.file_system import (FileSink, OutputFileConfig, RollingPolicy)
|
|
31
|
+
from pyflink.table import StreamTableEnvironment, TableDescriptor, Schema, DataTypes
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class AsyncLLMRequest(AsyncFunction[Row, str]):
|
|
35
|
+
|
|
36
|
+
def __init__(self):
|
|
37
|
+
self.retried_keys = {}
|
|
38
|
+
|
|
39
|
+
def open(self, runtime_context: RuntimeContext):
|
|
40
|
+
# create model inference client here
|
|
41
|
+
pass
|
|
42
|
+
|
|
43
|
+
def close(self):
|
|
44
|
+
# close the model inference client here
|
|
45
|
+
pass
|
|
46
|
+
|
|
47
|
+
async def async_invoke(self, value: Row) -> List[str]:
|
|
48
|
+
# issue the asynchronous request
|
|
49
|
+
await asyncio.sleep(random.randint(1, 2))
|
|
50
|
+
|
|
51
|
+
if value.user_id not in self.retried_keys and random.randint(1, 10) % 3 == 0:
|
|
52
|
+
self.retried_keys[value.user_id] = True
|
|
53
|
+
# remote model inference request may time out
|
|
54
|
+
raise TimeoutError
|
|
55
|
+
else:
|
|
56
|
+
if value.user_id in self.retried_keys:
|
|
57
|
+
del self.retried_keys[value.user_id]
|
|
58
|
+
# remote model inference request completes
|
|
59
|
+
# note that the result should be a collection even there is only one result
|
|
60
|
+
analysis_result = "positive"
|
|
61
|
+
result = {
|
|
62
|
+
"user_id": value.user_id,
|
|
63
|
+
"comments": value.comments,
|
|
64
|
+
"analysis_result": analysis_result
|
|
65
|
+
}
|
|
66
|
+
return [json.dumps(result)]
|
|
67
|
+
|
|
68
|
+
def timeout(self, value: Row) -> List[str]:
|
|
69
|
+
# return a default value in case timeout
|
|
70
|
+
result = {
|
|
71
|
+
"user_id": value.user_id,
|
|
72
|
+
"comments": value.comments,
|
|
73
|
+
"analysis_result": None
|
|
74
|
+
}
|
|
75
|
+
return [json.dumps(result)]
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def main(output_path):
|
|
79
|
+
env = StreamExecutionEnvironment.get_execution_environment()
|
|
80
|
+
env.enable_checkpointing(30000, CheckpointingMode.EXACTLY_ONCE)
|
|
81
|
+
t_env = StreamTableEnvironment.create(stream_execution_environment=env)
|
|
82
|
+
|
|
83
|
+
# source: user_id, comments
|
|
84
|
+
t_env.create_temporary_table(
|
|
85
|
+
'source',
|
|
86
|
+
TableDescriptor.for_connector('datagen')
|
|
87
|
+
.schema(Schema.new_builder()
|
|
88
|
+
.column('user_id', DataTypes.INT())
|
|
89
|
+
.column('comments', DataTypes.STRING())
|
|
90
|
+
.build())
|
|
91
|
+
.option('fields.user_id.kind', 'random')
|
|
92
|
+
.option('fields.comments.kind', 'random')
|
|
93
|
+
.option('rows-per-second', '100')
|
|
94
|
+
.build())
|
|
95
|
+
|
|
96
|
+
table = t_env.from_path('source')
|
|
97
|
+
ds = t_env.to_data_stream(table)
|
|
98
|
+
|
|
99
|
+
# create an async retry strategy via utility class or a user defined strategy
|
|
100
|
+
async_retry_strategy = AsyncRetryStrategy.fixed_delay(
|
|
101
|
+
max_attempts=100,
|
|
102
|
+
backoff_time_millis=1000,
|
|
103
|
+
result_predicate=None,
|
|
104
|
+
exception_predicate=functools.partial(async_retry_predicates.exception_type_predicate,
|
|
105
|
+
expected_error_type=TimeoutError))
|
|
106
|
+
|
|
107
|
+
result_stream = AsyncDataStream.unordered_wait_with_retry(
|
|
108
|
+
data_stream=ds,
|
|
109
|
+
async_function=AsyncLLMRequest(),
|
|
110
|
+
timeout=Time.seconds(10),
|
|
111
|
+
async_retry_strategy=async_retry_strategy,
|
|
112
|
+
capacity=1000,
|
|
113
|
+
output_type=Types.STRING())
|
|
114
|
+
|
|
115
|
+
# define the sink
|
|
116
|
+
if output_path is not None:
|
|
117
|
+
result_stream.sink_to(
|
|
118
|
+
sink=FileSink.for_row_format(
|
|
119
|
+
base_path=output_path,
|
|
120
|
+
encoder=Encoder.simple_string_encoder())
|
|
121
|
+
.with_output_file_config(
|
|
122
|
+
OutputFileConfig.builder()
|
|
123
|
+
.with_part_prefix("prefix")
|
|
124
|
+
.with_part_suffix(".ext")
|
|
125
|
+
.build())
|
|
126
|
+
.with_rolling_policy(RollingPolicy.default_rolling_policy())
|
|
127
|
+
.build()
|
|
128
|
+
)
|
|
129
|
+
else:
|
|
130
|
+
print("Printing result to stdout. Use --output to specify output path.")
|
|
131
|
+
result_stream.print()
|
|
132
|
+
|
|
133
|
+
# submit for execution
|
|
134
|
+
env.execute()
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
if __name__ == '__main__':
|
|
138
|
+
logging.basicConfig(stream=sys.stdout, level=logging.INFO, format="%(message)s")
|
|
139
|
+
|
|
140
|
+
parser = argparse.ArgumentParser()
|
|
141
|
+
parser.add_argument(
|
|
142
|
+
'--output',
|
|
143
|
+
dest='output',
|
|
144
|
+
required=False,
|
|
145
|
+
help='Output file to write results to.')
|
|
146
|
+
|
|
147
|
+
argv = sys.argv[1:]
|
|
148
|
+
known_args, _ = parser.parse_known_args(argv)
|
|
149
|
+
|
|
150
|
+
main(known_args.output)
|
{apache_flink-2.1.0 → apache_flink-2.2.0}/deps/examples/datastream/connectors/kafka_avro_format.py
RENAMED
|
@@ -18,9 +18,10 @@
|
|
|
18
18
|
import logging
|
|
19
19
|
import sys
|
|
20
20
|
|
|
21
|
-
from pyflink.common import Types
|
|
21
|
+
from pyflink.common import Types, WatermarkStrategy
|
|
22
22
|
from pyflink.datastream import StreamExecutionEnvironment
|
|
23
|
-
from pyflink.datastream.connectors.kafka import
|
|
23
|
+
from pyflink.datastream.connectors.kafka import (KafkaRecordSerializationSchema, KafkaSink,
|
|
24
|
+
KafkaSource, KafkaOffsetsInitializer)
|
|
24
25
|
from pyflink.datastream.formats.avro import AvroRowSerializationSchema, AvroRowDeserializationSchema
|
|
25
26
|
|
|
26
27
|
|
|
@@ -43,14 +44,20 @@ def write_to_kafka(env):
|
|
|
43
44
|
}"""
|
|
44
45
|
)
|
|
45
46
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
serialization_schema
|
|
49
|
-
|
|
47
|
+
record_serializer = KafkaRecordSerializationSchema.builder() \
|
|
48
|
+
.set_topic('test_avro_topic') \
|
|
49
|
+
.set_value_serialization_schema(serialization_schema) \
|
|
50
|
+
.build()
|
|
51
|
+
kafka_sink = (
|
|
52
|
+
KafkaSink.builder()
|
|
53
|
+
.set_record_serializer(record_serializer)
|
|
54
|
+
.set_bootstrap_servers('localhost:9092')
|
|
55
|
+
.set_property("group.id", "test_group")
|
|
56
|
+
.build()
|
|
50
57
|
)
|
|
51
58
|
|
|
52
59
|
# note that the output type of ds must be RowTypeInfo
|
|
53
|
-
ds.
|
|
60
|
+
ds.sink_to(kafka_sink)
|
|
54
61
|
env.execute()
|
|
55
62
|
|
|
56
63
|
|
|
@@ -67,14 +74,22 @@ def read_from_kafka(env):
|
|
|
67
74
|
}"""
|
|
68
75
|
)
|
|
69
76
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
77
|
+
kafka_source = (
|
|
78
|
+
KafkaSource.builder()
|
|
79
|
+
.set_topics('test_avro_topic')
|
|
80
|
+
.set_value_only_deserializer(deserialization_schema)
|
|
81
|
+
.set_properties({'bootstrap.servers': 'localhost:9092', 'group.id': 'test_group_1'})
|
|
82
|
+
.set_starting_offsets(KafkaOffsetsInitializer.earliest())
|
|
83
|
+
.build()
|
|
74
84
|
)
|
|
75
|
-
kafka_consumer.set_start_from_earliest()
|
|
76
85
|
|
|
77
|
-
env.
|
|
86
|
+
ds = env.from_source(
|
|
87
|
+
kafka_source,
|
|
88
|
+
watermark_strategy=WatermarkStrategy.no_watermarks(),
|
|
89
|
+
source_name="kafka source"
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
ds.print()
|
|
78
93
|
env.execute()
|
|
79
94
|
|
|
80
95
|
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
################################################################################
|
|
2
|
+
# Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
# or more contributor license agreements. See the NOTICE file
|
|
4
|
+
# distributed with this work for additional information
|
|
5
|
+
# regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
# to you under the Apache License, Version 2.0 (the
|
|
7
|
+
# "License"); you may not use this file except in compliance
|
|
8
|
+
# with the License. You may obtain a copy of the License at
|
|
9
|
+
#
|
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
#
|
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
# See the License for the specific language governing permissions and
|
|
16
|
+
# limitations under the License.
|
|
17
|
+
################################################################################
|
|
18
|
+
import json
|
|
19
|
+
import logging
|
|
20
|
+
import sys
|
|
21
|
+
|
|
22
|
+
from pyflink.common import Types, ByteArraySchema, WatermarkStrategy
|
|
23
|
+
from pyflink.datastream import StreamExecutionEnvironment
|
|
24
|
+
from pyflink.datastream.connectors.kafka import KafkaSource, \
|
|
25
|
+
KafkaOffsetsInitializer, KafkaSink, KafkaRecordSerializationSchema
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
# This example works since Flink 2.0 since ByteArraySchema was introduced in Flink 2.0
|
|
29
|
+
|
|
30
|
+
# Make sure that the Kafka cluster is started and the topic 'test_json_topic' is
|
|
31
|
+
# created before executing this job.
|
|
32
|
+
def write_to_kafka(env):
|
|
33
|
+
data = [
|
|
34
|
+
(json.dumps({
|
|
35
|
+
"id": 1,
|
|
36
|
+
"country": "USA"
|
|
37
|
+
}).encode("utf-8"),),
|
|
38
|
+
(json.dumps({
|
|
39
|
+
"id": 2,
|
|
40
|
+
"country": "Canada"
|
|
41
|
+
}).encode("utf-8"),),
|
|
42
|
+
(json.dumps({
|
|
43
|
+
"id": 3,
|
|
44
|
+
"country": "Germany"
|
|
45
|
+
}).encode("utf-8"),)
|
|
46
|
+
]
|
|
47
|
+
type_info = Types.ROW([Types.PRIMITIVE_ARRAY(Types.BYTE())])
|
|
48
|
+
ds = env.from_collection(data, type_info=type_info)
|
|
49
|
+
|
|
50
|
+
# declare the output type as Types.PRIMITIVE_ARRAY(Types.BYTE()),
|
|
51
|
+
# otherwise, Types.PICKLED_BYTE_ARRAY() will be used by default, it will
|
|
52
|
+
# use pickler to serialize the result byte array which is unnecessary
|
|
53
|
+
ds = ds.map(lambda x: x[0], output_type=Types.PRIMITIVE_ARRAY(Types.BYTE()))
|
|
54
|
+
|
|
55
|
+
record_serializer = KafkaRecordSerializationSchema.builder() \
|
|
56
|
+
.set_topic('test_bytearray_topic') \
|
|
57
|
+
.set_value_serialization_schema(ByteArraySchema()) \
|
|
58
|
+
.build()
|
|
59
|
+
kafka_sink = (
|
|
60
|
+
KafkaSink.builder()
|
|
61
|
+
.set_record_serializer(record_serializer)
|
|
62
|
+
.set_bootstrap_servers('localhost:9092')
|
|
63
|
+
.set_property("group.id", "test_group")
|
|
64
|
+
.build()
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
ds.sink_to(kafka_sink)
|
|
68
|
+
env.execute()
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def read_from_kafka(env):
|
|
72
|
+
kafka_source = (
|
|
73
|
+
KafkaSource.builder()
|
|
74
|
+
.set_topics('test_bytearray_topic')
|
|
75
|
+
.set_value_only_deserializer(ByteArraySchema())
|
|
76
|
+
.set_properties({'bootstrap.servers': 'localhost:9092', 'group.id': 'test_group_1'})
|
|
77
|
+
.set_starting_offsets(KafkaOffsetsInitializer.earliest())
|
|
78
|
+
.build()
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
ds = env.from_source(
|
|
82
|
+
kafka_source,
|
|
83
|
+
watermark_strategy=WatermarkStrategy.no_watermarks(),
|
|
84
|
+
source_name="kafka source"
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
# the data read out from the source is byte array, decode it as a string
|
|
88
|
+
ds.map(lambda data: data.decode("utf-8")).print()
|
|
89
|
+
env.execute()
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
if __name__ == '__main__':
|
|
93
|
+
logging.basicConfig(stream=sys.stdout, level=logging.INFO, format="%(message)s")
|
|
94
|
+
|
|
95
|
+
env = StreamExecutionEnvironment.get_execution_environment()
|
|
96
|
+
env.add_jars("file:///path/to/flink-sql-connector-kafka-1.15.0.jar")
|
|
97
|
+
|
|
98
|
+
print("start writing data to kafka")
|
|
99
|
+
write_to_kafka(env)
|
|
100
|
+
|
|
101
|
+
print("start reading data from kafka")
|
|
102
|
+
read_from_kafka(env)
|
{apache_flink-2.1.0 → apache_flink-2.2.0}/deps/examples/datastream/connectors/kafka_csv_format.py
RENAMED
|
@@ -18,9 +18,10 @@
|
|
|
18
18
|
import logging
|
|
19
19
|
import sys
|
|
20
20
|
|
|
21
|
-
from pyflink.common import Types
|
|
21
|
+
from pyflink.common import Types, WatermarkStrategy
|
|
22
22
|
from pyflink.datastream import StreamExecutionEnvironment
|
|
23
|
-
from pyflink.datastream.connectors.kafka import
|
|
23
|
+
from pyflink.datastream.connectors.kafka import (KafkaRecordSerializationSchema, KafkaSink,
|
|
24
|
+
KafkaSource, KafkaOffsetsInitializer)
|
|
24
25
|
from pyflink.datastream.formats.csv import CsvRowSerializationSchema, CsvRowDeserializationSchema
|
|
25
26
|
|
|
26
27
|
|
|
@@ -33,14 +34,20 @@ def write_to_kafka(env):
|
|
|
33
34
|
type_info=type_info)
|
|
34
35
|
|
|
35
36
|
serialization_schema = CsvRowSerializationSchema.Builder(type_info).build()
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
serialization_schema
|
|
39
|
-
|
|
37
|
+
record_serializer = KafkaRecordSerializationSchema.builder() \
|
|
38
|
+
.set_topic('test_csv_topic') \
|
|
39
|
+
.set_value_serialization_schema(serialization_schema) \
|
|
40
|
+
.build()
|
|
41
|
+
kafka_sink = (
|
|
42
|
+
KafkaSink.builder()
|
|
43
|
+
.set_record_serializer(record_serializer)
|
|
44
|
+
.set_bootstrap_servers('localhost:9092')
|
|
45
|
+
.set_property("group.id", "test_group")
|
|
46
|
+
.build()
|
|
40
47
|
)
|
|
41
48
|
|
|
42
49
|
# note that the output type of ds must be RowTypeInfo
|
|
43
|
-
ds.
|
|
50
|
+
ds.sink_to(kafka_sink)
|
|
44
51
|
env.execute()
|
|
45
52
|
|
|
46
53
|
|
|
@@ -48,14 +55,22 @@ def read_from_kafka(env):
|
|
|
48
55
|
type_info = Types.ROW([Types.INT(), Types.STRING()])
|
|
49
56
|
deserialization_schema = CsvRowDeserializationSchema.Builder(type_info).build()
|
|
50
57
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
58
|
+
kafka_source = (
|
|
59
|
+
KafkaSource.builder()
|
|
60
|
+
.set_topics('test_csv_topic')
|
|
61
|
+
.set_value_only_deserializer(deserialization_schema)
|
|
62
|
+
.set_properties({'bootstrap.servers': 'localhost:9092', 'group.id': 'test_group_1'})
|
|
63
|
+
.set_starting_offsets(KafkaOffsetsInitializer.earliest())
|
|
64
|
+
.build()
|
|
55
65
|
)
|
|
56
|
-
kafka_consumer.set_start_from_earliest()
|
|
57
66
|
|
|
58
|
-
env.
|
|
67
|
+
ds = env.from_source(
|
|
68
|
+
kafka_source,
|
|
69
|
+
watermark_strategy=WatermarkStrategy.no_watermarks(),
|
|
70
|
+
source_name="kafka source"
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
ds.print()
|
|
59
74
|
env.execute()
|
|
60
75
|
|
|
61
76
|
|
{apache_flink-2.1.0 → apache_flink-2.2.0}/deps/examples/datastream/connectors/kafka_json_format.py
RENAMED
|
@@ -18,9 +18,10 @@
|
|
|
18
18
|
import logging
|
|
19
19
|
import sys
|
|
20
20
|
|
|
21
|
-
from pyflink.common import Types
|
|
21
|
+
from pyflink.common import Types, WatermarkStrategy
|
|
22
22
|
from pyflink.datastream import StreamExecutionEnvironment
|
|
23
|
-
from pyflink.datastream.connectors.kafka import
|
|
23
|
+
from pyflink.datastream.connectors.kafka import (KafkaRecordSerializationSchema, KafkaSink,
|
|
24
|
+
KafkaSource, KafkaOffsetsInitializer)
|
|
24
25
|
from pyflink.datastream.formats.json import JsonRowSerializationSchema, JsonRowDeserializationSchema
|
|
25
26
|
|
|
26
27
|
|
|
@@ -35,14 +36,20 @@ def write_to_kafka(env):
|
|
|
35
36
|
serialization_schema = JsonRowSerializationSchema.Builder() \
|
|
36
37
|
.with_type_info(type_info) \
|
|
37
38
|
.build()
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
serialization_schema
|
|
41
|
-
|
|
39
|
+
record_serializer = KafkaRecordSerializationSchema.builder() \
|
|
40
|
+
.set_topic('test_json_topic') \
|
|
41
|
+
.set_value_serialization_schema(serialization_schema) \
|
|
42
|
+
.build()
|
|
43
|
+
kafka_sink = (
|
|
44
|
+
KafkaSink.builder()
|
|
45
|
+
.set_record_serializer(record_serializer)
|
|
46
|
+
.set_bootstrap_servers('localhost:9092')
|
|
47
|
+
.set_property("group.id", "test_group")
|
|
48
|
+
.build()
|
|
42
49
|
)
|
|
43
50
|
|
|
44
51
|
# note that the output type of ds must be RowTypeInfo
|
|
45
|
-
ds.
|
|
52
|
+
ds.sink_to(kafka_sink)
|
|
46
53
|
env.execute()
|
|
47
54
|
|
|
48
55
|
|
|
@@ -50,14 +57,22 @@ def read_from_kafka(env):
|
|
|
50
57
|
deserialization_schema = JsonRowDeserializationSchema.Builder() \
|
|
51
58
|
.type_info(Types.ROW([Types.INT(), Types.STRING()])) \
|
|
52
59
|
.build()
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
60
|
+
kafka_source = (
|
|
61
|
+
KafkaSource.builder()
|
|
62
|
+
.set_topics('test_json_topic')
|
|
63
|
+
.set_value_only_deserializer(deserialization_schema)
|
|
64
|
+
.set_properties({'bootstrap.servers': 'localhost:9092', 'group.id': 'test_group_1'})
|
|
65
|
+
.set_starting_offsets(KafkaOffsetsInitializer.earliest())
|
|
66
|
+
.build()
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
ds = env.from_source(
|
|
70
|
+
kafka_source,
|
|
71
|
+
watermark_strategy=WatermarkStrategy.no_watermarks(),
|
|
72
|
+
source_name="kafka source"
|
|
57
73
|
)
|
|
58
|
-
kafka_consumer.set_start_from_earliest()
|
|
59
74
|
|
|
60
|
-
|
|
75
|
+
ds.print()
|
|
61
76
|
env.execute()
|
|
62
77
|
|
|
63
78
|
|
|
@@ -82,6 +82,8 @@ Functions used to transform a :class:`DataStream` into another :class:`DataStrea
|
|
|
82
82
|
- :class:`KeyedBroadcastProcessFunction`:
|
|
83
83
|
A function to be applied to a :class:`BroadcastConnectedStream` that connects
|
|
84
84
|
:class:`BroadcastStream`, i.e. a stream with broadcast state, with a :class:`KeyedStream`.
|
|
85
|
+
- :class:`AsyncFunction`:
|
|
86
|
+
A function to trigger Async I/O operation.
|
|
85
87
|
- :class:`RuntimeContext`:
|
|
86
88
|
Contains information about the context in which functions are executed. Each
|
|
87
89
|
parallel instance of the function will have a context through which it can access static
|
|
@@ -256,6 +258,7 @@ Other important classes:
|
|
|
256
258
|
- :class:`OutputTag`:
|
|
257
259
|
Tag with a name and type for identifying side output of an operator
|
|
258
260
|
"""
|
|
261
|
+
from pyflink.datastream.async_data_stream import AsyncDataStream
|
|
259
262
|
from pyflink.datastream.checkpoint_config import CheckpointConfig
|
|
260
263
|
from pyflink.datastream.externalized_checkpoint_retention import ExternalizedCheckpointRetention
|
|
261
264
|
from pyflink.datastream.checkpointing_mode import CheckpointingMode
|
|
@@ -268,7 +271,8 @@ from pyflink.datastream.functions import (MapFunction, CoMapFunction, FlatMapFun
|
|
|
268
271
|
SinkFunction, CoProcessFunction, KeyedProcessFunction,
|
|
269
272
|
KeyedCoProcessFunction, AggregateFunction, WindowFunction,
|
|
270
273
|
ProcessWindowFunction, BroadcastProcessFunction,
|
|
271
|
-
KeyedBroadcastProcessFunction
|
|
274
|
+
KeyedBroadcastProcessFunction, AsyncFunction,
|
|
275
|
+
AsyncRetryPredicate, AsyncRetryStrategy)
|
|
272
276
|
from pyflink.datastream.slot_sharing_group import SlotSharingGroup, MemorySize
|
|
273
277
|
from pyflink.datastream.state_backend import (StateBackend, CustomStateBackend,
|
|
274
278
|
PredefinedOptions, HashMapStateBackend,
|
|
@@ -292,6 +296,7 @@ __all__ = [
|
|
|
292
296
|
'ConnectedStreams',
|
|
293
297
|
'BroadcastStream',
|
|
294
298
|
'BroadcastConnectedStream',
|
|
299
|
+
'AsyncDataStream',
|
|
295
300
|
'DataStreamSink',
|
|
296
301
|
'MapFunction',
|
|
297
302
|
'CoMapFunction',
|
|
@@ -308,6 +313,7 @@ __all__ = [
|
|
|
308
313
|
'AggregateFunction',
|
|
309
314
|
'BroadcastProcessFunction',
|
|
310
315
|
'KeyedBroadcastProcessFunction',
|
|
316
|
+
'AsyncFunction',
|
|
311
317
|
'RuntimeContext',
|
|
312
318
|
'TimerService',
|
|
313
319
|
'CheckpointingMode',
|
|
@@ -338,5 +344,7 @@ __all__ = [
|
|
|
338
344
|
'SinkFunction',
|
|
339
345
|
'SlotSharingGroup',
|
|
340
346
|
'MemorySize',
|
|
341
|
-
'OutputTag'
|
|
347
|
+
'OutputTag',
|
|
348
|
+
'AsyncRetryPredicate',
|
|
349
|
+
'AsyncRetryStrategy'
|
|
342
350
|
]
|