[api] Remove dead no-arg getExecutionEnvironment() referencing a non-existent LocalExecutionEnvironment#848
Merged
Conversation
…existent LocalExecutionEnvironment The no-arg getExecutionEnvironment() and the env==null branch of the two-arg overload reflectively loaded org.apache.flink.agents.runtime.env.LocalExecutionEnvironment, a class that does not exist (the runtime env/ package ships only RemoteExecutionEnvironment) and never existed in git history. Both paths could therefore only throw at runtime, while the Javadoc promised a local execution environment for testing. No Java code calls the no-arg form; every example and test passes a real StreamExecutionEnvironment. Remove the no-arg overload and the dead branch, and require a non-null StreamExecutionEnvironment (fail-fast). Java agents always run on a Flink environment.
07915d4 to
20396f8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linked issue: #847
Purpose of change
AgentsExecutionEnvironment.getExecutionEnvironment()(no-arg) and theenv == nullbranch of the two-arg overload reflectively loadedorg.apache.flink.agents.runtime.env.LocalExecutionEnvironment— a class that has never existed in the tree or in git history (theruntimeenv/package ships onlyRemoteExecutionEnvironment). So both paths could only throwRuntimeExceptionat runtime, while the Javadoc promised "a local execution environment for testing and development." It went unnoticed because no Java code calls the no-arg form, but these are public API methods, so a user following the Javadoc would hit an obscure failure.This removes the no-arg overload and the dead
env == nullbranch, and requires a non-nullStreamExecutionEnvironment(fail-fastcheckNotNull) — Java agents always run on a Flink environment.Cross-language parity note: Python's
get_execution_environment(env=None)still returns a working in-process local environment. This change makes Java explicitly remote-only, which only surfaces an asymmetry that already existed (the Java no-arg form threw). Whether Python's local path should change too is being evaluated separately in #829. If maintainers would rather keep Java↔Python parity, the alternative is to keep the no-arg signature and implement a real Java local environment — happy to take that direction instead.Tests
New
AgentsExecutionEnvironmentTestasserts a nullStreamExecutionEnvironmentis rejected on both overloads. The fullapisuite passes (264 tests) and a full-reactormvn test-compilesucceeds, confirming no caller relied on the removed method.API
Yes. Removes the public static no-arg
getExecutionEnvironment()and makes theenvparameter required. Safe because the removed method could only throw and had no callers; the project is pre-1.0 (0.3-SNAPSHOT).Documentation
doc-neededdoc-not-neededdoc-included