codenohup commented on code in PR #80:
URL: https://github.com/apache/flink-agents/pull/80#discussion_r2250498638
##########
plan/src/main/java/org/apache/flink/agents/plan/JavaFunction.java:
##########
@@ -71,7 +71,10 @@ public Class<?>[] getParameterTypes() {
return parameterTypes;
}
- public Method getMethod() {
+ public Method getMethod() throws ClassNotFoundException,
NoSuchMethodException {
+ if (method == null) {
+ this.method = Class.forName(qualName).getMethod(methodName,
parameterTypes);
+ }
Review Comment:
> Why do we need this lazy initialization?
Since we need to store the `ActionTask` in the state, and it indirectly
contains the `method` from the `JavaFunction`, which is not serializable in
Java.
--
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]