[Feature][Python] Implement EventListener in python sdk#688
Conversation
… in python_java_utils
…er utilities # Conflicts: # api/src/main/java/org/apache/flink/agents/api/resource/python/PythonResourceAdapter.java # runtime/src/main/java/org/apache/flink/agents/runtime/python/utils/PythonResourceAdapterImpl.java # runtime/src/test/java/org/apache/flink/agents/runtime/ResourceCacheTest.java
- Move event conversion to a public method 'convertJsonToPythonEvent' for listener support - Optimize performance by reusing a static ObjectMapper instance - Clean up redundant ObjectMapper instantiations
- Implement PythonEventListenerWrapper in PythonBridgeManager to bridge events to Python - Add logic to initialize and register Python listeners in ActionExecutionOperator - Optimize Java-to-Python event conversion by performing it once per event notification
fa2cb94 to
680c866
Compare
|
Hi, @twosom. Thanks for supporting EventListener in python sdk. Overall, I think the current design has become somewhat overly complex. In my view, we should have a single I think some of the current complexity stems from supporting That would let us drop The cost is that listeners must live at module top level (which the PR already enforces against Additionally, I believe there is no need to support event listeners in the Additionally, I believe the current testing is insufficient. We have some unit tests, but no end-to-end tests. For this cross-language scenario, we need to add real tests that submit jobs to the remote environment in |
Linked issue: #687
Purpose of change
This PR implements the
EventListenermechanism for both Java and Python runtimes, ensuring API consistency across different language SDKs. It enables developers to monitor and react to events synchronously during the agent's event lifecycle.Tests
ok
API
Documentation
doc-neededdoc-not-neededdoc-included