weiqingy opened a new issue, #847:
URL: https://github.com/apache/flink-agents/issues/847
### Background
Surfaced while scoping #829 (deprecating the Python local execution path).
The Java `AgentsExecutionEnvironment` exposes a no-arg
`getExecutionEnvironment()` whose Javadoc promises "a local execution
environment is returned for testing and development"
(`api/src/main/java/org/apache/flink/agents/api/AgentsExecutionEnvironment.java:78-79,135-142`).
Its implementation (`:89-101`) resolves the local env reflectively:
```java
Class<?> localEnvClass =
Class.forName("org.apache.flink.agents.runtime.env.LocalExecutionEnvironment");
return (AgentsExecutionEnvironment)
localEnvClass.getDeclaredConstructor().newInstance();
```
### The problem
There is no `LocalExecutionEnvironment` class in the tree —
`runtime/src/main/java/org/apache/flink/agents/runtime/env/` ships only
`RemoteExecutionEnvironment.java` (plus the Python-env helpers). So any call to
the no-arg `getExecutionEnvironment()` hits `ClassNotFoundException` and is
rethrown as `RuntimeException("Failed to create LocalExecutionEnvironment")`.
It doesn't break anything today only because no Java code calls it — every
Java test and example passes a real `StreamExecutionEnvironment` and goes
through the remote path. The no-arg overload is effectively dead, and its
Javadoc advertises a capability that doesn't exist.
### Proposed fix
Either of:
- Remove the no-arg `getExecutionEnvironment()` overload (and the `env ==
null` branch + its Javadoc), so the Java API doesn't advertise a local path it
can't provide; or
- Implement a real Java `LocalExecutionEnvironment` if an in-process Java
path is actually wanted.
Given the Java side is de-facto remote-only, removal is the smaller,
lower-risk change. This is independent of the #829 decision about the Python
local path.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]