You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "wenjin272 (via GitHub)" <gi...@apache.org> on 2025/06/13 09:02:51 UTC

[PR] [Feature][plan][java] Introduce Workflow, Event, Action & Callable in… [flink-agents]

wenjin272 opened a new pull request, #23:
URL: https://github.com/apache/flink-agents/pull/23

   
   Linked issue: #13 


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][plan][java] Introduce Workflow, Event, Action & Callable in… [flink-agents]

Posted by "xintongsong (via GitHub)" <gi...@apache.org>.
xintongsong commented on code in PR #23:
URL: https://github.com/apache/flink-agents/pull/23#discussion_r2162803127


##########
plan/src/main/java/org/apache/flink/agents/plan/WorkflowPlan.java:
##########
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.agents.plan;
+
+import org.apache.flink.agents.api.Event;
+
+import java.util.List;
+import java.util.Map;
+
+/** Workflow plan compiled from user defined workflow. */
+public class WorkflowPlan {
+    private final Map<Class<? extends Event>, List<Action>> actions;
+
+    public WorkflowPlan(Map<Class<? extends Event>, List<Action>> actions) {
+        this.actions = actions;
+    }
+
+    public List<Action> getAction(Class<?> type) {

Review Comment:
   ```suggestion
       public List<Action> getAction(Class<? extends Event> type) {
   ```



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][plan][java] Introduce Workflow, Event, Action & Callable in… [flink-agents]

Posted by "xintongsong (via GitHub)" <gi...@apache.org>.
xintongsong commented on code in PR #23:
URL: https://github.com/apache/flink-agents/pull/23#discussion_r2160199491


##########
plan/src/main/java/org/apache/flink/agents/plan/Action.java:
##########
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.agents.plan;
+
+import org.apache.flink.agents.api.Event;
+
+import java.util.List;
+
+/**
+ * Representation of a workflow action with event listening and function execution.
+ *
+ * <p>This class encapsulates a named workflow action that listens for specific event types and
+ * executes an associated function when those events occur.
+ */
+public class Action {
+    private final String name;
+    private final Function exec;
+    private final List<Class<? extends Event>> listenEventTypes;
+
+    public Action(String name, Function exec, List<Class<? extends Event>> listenEventTypes)
+            throws Exception {
+        this.name = name;
+        this.exec = exec;
+        this.listenEventTypes = listenEventTypes;
+        exec.checkSignature(new Class[] {Event.class});

Review Comment:
   @lihaosky
   Let me clarify this a bit. The function of an action should take more arguments than just an `Event`. E.g., a runtime context for emitting new events and accessing resources, and maybe also the state (I said "maybe" because alternatively we can get the state from the context). Those classes will be introduced in follow-up PRs, and the target signature for this check will be updated accordingly.
   
   @wenjin272
   Checking the signature in `Action`, or introducing another layer of abstraction `ActionFunction` and checking there, I'm okay with either ways.



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][plan][java] Introduce Workflow, Event, Action & Callable in… [flink-agents]

Posted by "wenjin272 (via GitHub)" <gi...@apache.org>.
wenjin272 commented on code in PR #23:
URL: https://github.com/apache/flink-agents/pull/23#discussion_r2156163855


##########
plan/src/main/java/org/apache/flink/agents/plan/JavaFunction.java:
##########
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.flink.agents.plan;
+
+import java.lang.reflect.Method;
+import java.util.Arrays;
+
+/** Represent a Java function. */
+public class JavaFunction implements Function {
+    private final String qualName;
+    private final String methodName;
+    private final Class<?>[] parameterTypes;
+    private Method method;
+
+    public JavaFunction(String qualName, String methodName, Class<?>[] parameterTypes) {
+        this.qualName = qualName;
+        this.methodName = methodName;
+        this.parameterTypes = parameterTypes;
+    }
+
+    @Override
+    public Object call(Object... args) throws Exception {
+        if (method == null) {
+            Class<?> clazz = Class.forName(qualName);
+            method = clazz.getMethod(methodName, parameterTypes);

Review Comment:
   I put this in constructor, so that the validation will be applied when create object rather than call this function in runtime.



##########
plan/src/main/java/org/apache/flink/agents/plan/JavaFunction.java:
##########
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.flink.agents.plan;
+
+import java.lang.reflect.Method;
+import java.util.Arrays;
+
+/** Represent a Java function. */
+public class JavaFunction implements Function {
+    private final String qualName;
+    private final String methodName;
+    private final Class<?>[] parameterTypes;
+    private Method method;
+
+    public JavaFunction(String qualName, String methodName, Class<?>[] parameterTypes) {

Review Comment:
   make sense



##########
plan/src/main/java/org/apache/flink/agents/plan/Action.java:
##########
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.agents.plan;
+
+import org.apache.flink.agents.api.Event;
+
+import java.util.List;
+
+/**
+ * Representation of a workflow action with event listening and function execution.
+ *
+ * <p>This class encapsulates a named workflow action that listens for specific event types and
+ * executes an associated function when those events occur.
+ */
+public class Action {
+    private final String name;
+    private final Function exec;
+    private final List<Class<? extends Event>> listenEventTypes;
+
+    public Action(String name, Function exec, List<Class<? extends Event>> listenEventTypes)
+            throws Exception {
+        this.name = name;
+        this.exec = exec;
+        this.listenEventTypes = listenEventTypes;
+        exec.checkSignature(new Class[] {Event.class});

Review Comment:
   I add an implementation of Function named ActionFunction which only used for Action, and move the signature check from Action to ActionFunction. But I'm not sure whether this wrapper  is appropriate, because signature check is a general feature for function. What do you think about this @xintongsong 



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][plan][java] Introduce Workflow, Event, Action & Callable in… [flink-agents]

Posted by "xintongsong (via GitHub)" <gi...@apache.org>.
xintongsong commented on code in PR #23:
URL: https://github.com/apache/flink-agents/pull/23#discussion_r2147615019


##########
api/src/main/java/org/apache/flink/agents/api/Event.java:
##########
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.agents.api;
+
+import org.apache.flink.agents.api.utils.SerializableChecker;
+import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.JsonProcessingException;
+
+import java.io.Serializable;
+import java.security.InvalidParameterException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+/** Base class for all event types in the system. */
+public abstract class Event implements Serializable {
+    private static final long serialVersionUID = 1L;
+    private final UUID id;
+    private final Map<String, Object> attributes;
+
+    public Event() {
+        this.id = UUID.randomUUID();
+        attributes = new HashMap<>();
+    }
+
+    public UUID getId() {
+        return id;
+    }
+
+    public Map<String, Object> getAttributes() {
+        return attributes;
+    }
+
+    public Object getAttr(String name) {
+        return attributes.get(name);
+    }
+
+    public void setAttr(String name, Object value) {
+        attributes.put(name, value);
+        checkSerializable();
+    }
+
+    public void checkSerializable() {
+        try {
+            SerializableChecker.checkSerializable(this);
+        } catch (JsonProcessingException e) {
+            throw new InvalidParameterException(e.getMessage());

Review Comment:
   Why do we need this wrapping?



##########
api/src/main/java/org/apache/flink/agents/api/InputEvent.java:
##########
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.agents.api;
+
+/** Event generated by the framework, carrying an input data that arrives at the workflow. */
+public class InputEvent extends Event {
+    private static final long serialVersionUID = 1L;
+    private final Object input;
+
+    public InputEvent(Object input) {
+        super();
+        this.input = input;
+        super.checkSerializable();

Review Comment:
   It's hard to guarantee that all the sub-classes will call this. I think we can only do this when calling `context.sendEvent`.



##########
api/pom.xml:
##########
@@ -28,4 +28,17 @@ under the License.
     <artifactId>api</artifactId>
     <name>Flink Agents : API</name>
 
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-shaded-jackson</artifactId>
+            <version>2.14.2-16.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.junit.jupiter</groupId>
+            <artifactId>junit-jupiter</artifactId>
+            <version>5.10.1</version>
+            <scope>compile</scope>
+        </dependency>
+    </dependencies>

Review Comment:
   1. `junit` should be a common dependency. Should not add it for each module.
   2. I'm not entirely sure whether jackson should also be a common dependency. But how do you make sure the API and Plan modules depends on the same jackson version?



##########
api/src/main/java/org/apache/flink/agents/api/Event.java:
##########
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.agents.api;
+
+import org.apache.flink.agents.api.utils.SerializableChecker;
+import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.JsonProcessingException;
+
+import java.io.Serializable;
+import java.security.InvalidParameterException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+/** Base class for all event types in the system. */
+public abstract class Event implements Serializable {

Review Comment:
   Why implementing `Serializable`? Does jackson require it?



##########
api/src/main/java/org/apache/flink/agents/api/utils/SerializableChecker.java:
##########
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.agents.api.utils;
+
+import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.JsonProcessingException;
+import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.ObjectMapper;
+
+/** Util class for checking object serializable. */
+public final class SerializableChecker {

Review Comment:
   If we do the check in runtime, we should also move this out of the api module.



##########
api/src/test/java/org/apache/flink/agents/api/TestEvent.java:
##########
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.flink.agents.api;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import java.security.InvalidParameterException;
+
+/** Test Event. */
+public class TestEvent {
+    public static class SerializableClass {
+        private final int a;
+
+        public SerializableClass(int a) {
+            this.a = a;
+        }
+
+        public int getA() {
+            return a;
+        }
+    }
+
+    public static class UnserializableClass {
+        private final int a;
+
+        public UnserializableClass(int a) {
+            this.a = a;
+        }
+    }
+
+    @Test
+    public void testEventInitSerializable() {
+        InputEvent event = new InputEvent(new SerializableClass(1));

Review Comment:
   Unused local variable `event`



##########
plan/src/main/java/org/apache/flink/agents/plan/JavaFunction.java:
##########
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.flink.agents.plan;
+
+import java.lang.reflect.Method;
+import java.util.Arrays;
+
+/** Represent a Java function. */
+public class JavaFunction implements Function {
+    private final String qualName;
+    private final String methodName;
+    private final Class<?>[] parameterTypes;
+
+    public JavaFunction(String qualName, String methodName, Class<?>[] parameterTypes) {
+        this.qualName = qualName;
+        this.methodName = methodName;
+        this.parameterTypes = parameterTypes;
+    }
+
+    @Override
+    public Object call(Object... args) throws Exception {
+        Class<?> clazz = Class.forName(qualName);
+        Method method = clazz.getMethod(methodName, parameterTypes);

Review Comment:
   We should only do this once.



##########
api/src/main/java/org/apache/flink/agents/api/OutputEvent.java:
##########
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.agents.api;
+
+import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.JsonProcessingException;
+
+/**
+ * Event representing a result from workflow. By generating an OutputEvent, actions can emit output
+ * data.
+ */
+public class OutputEvent extends Event {
+    private static final long serialVersionUID = 1L;
+    private final Object output;
+
+    public OutputEvent(Object output) throws JsonProcessingException {

Review Comment:
   Unused exception.



##########
plan/src/main/java/org/apache/flink/agents/plan/Action.java:
##########
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.agents.plan;
+
+import org.apache.flink.agents.api.Event;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * Representation of a workflow action with event listening and function execution.
+ *
+ * <p>This class encapsulates a named workflow action that listens for specific event types and
+ * executes an associated function when those events occur.
+ */
+public class Action implements Serializable {
+    private final String name;
+    private final Function exec;
+    private final List<Class<?>> listenEventTypes;

Review Comment:
   ```suggestion
       private final List<Class<? extends Event>> listenEventTypes;
   ```



##########
api/src/test/java/org/apache/flink/agents/api/TestEvent.java:
##########
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.flink.agents.api;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import java.security.InvalidParameterException;
+
+/** Test Event. */
+public class TestEvent {
+    public static class SerializableClass {
+        private final int a;
+
+        public SerializableClass(int a) {
+            this.a = a;
+        }
+
+        public int getA() {
+            return a;
+        }
+    }
+
+    public static class UnserializableClass {

Review Comment:
   How is this unserializable?



##########
api/src/test/java/org/apache/flink/agents/api/TestEvent.java:
##########
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.flink.agents.api;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import java.security.InvalidParameterException;
+
+/** Test Event. */
+public class TestEvent {
+    public static class SerializableClass {
+        private final int a;
+
+        public SerializableClass(int a) {
+            this.a = a;
+        }
+
+        public int getA() {
+            return a;
+        }

Review Comment:
   unused



##########
plan/src/main/java/org/apache/flink/agents/plan/WorkflowPlan.java:
##########
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.agents.plan;
+
+import java.util.List;
+import java.util.Map;
+
+/** Workflow plan compiled from user defined workflow. */
+public class WorkflowPlan {
+    private final Map<Class<?>, List<Action>> actions;

Review Comment:
   ```suggestion
       private final Map<Class<? extends Event>, List<Action>> actions;
   ```



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][plan][java] Introduce Workflow, Event, Action & Callable in… [flink-agents]

Posted by "xintongsong (via GitHub)" <gi...@apache.org>.
xintongsong merged PR #23:
URL: https://github.com/apache/flink-agents/pull/23


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][plan][java] Introduce Workflow, Event, Action & Callable in… [flink-agents]

Posted by "xintongsong (via GitHub)" <gi...@apache.org>.
xintongsong commented on code in PR #23:
URL: https://github.com/apache/flink-agents/pull/23#discussion_r2160201661


##########
plan/src/main/java/org/apache/flink/agents/plan/JavaFunction.java:
##########
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.flink.agents.plan;
+
+import java.lang.reflect.Method;
+import java.util.Arrays;
+
+/** Represent a Java function. */
+public class JavaFunction implements Function {
+    private final String qualName;
+    private final String methodName;
+    private final Class<?>[] parameterTypes;
+    private final Class<?> clazz;

Review Comment:
   Seems we don't need the `clazz` as a field of the class.



##########
plan/src/main/java/org/apache/flink/agents/plan/JavaFunction.java:
##########
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.flink.agents.plan;
+
+import java.lang.reflect.Method;
+import java.util.Arrays;
+
+/** Represent a Java function. */
+public class JavaFunction implements Function {
+    private final String qualName;
+    private final String methodName;
+    private final Class<?>[] parameterTypes;
+    private final Class<?> clazz;
+    private final Method method;

Review Comment:
   `Method` is non serializable. And we need the Function to be serializable in order to deploy the workflow plan across distributed TMs. This is why the Function only contains qualName, methodName and parameterTypes in the first place.
   
   I'm fine with checking the existence of method early in the constructor. But I think we need a way to tell the serializer that `method` should not be serialized. E.g., in Java Serialization we use the keyword `transient`. Not sure how it's done in Jackson.



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][plan][java] Introduce Workflow, Event, Action & Callable in… [flink-agents]

Posted by "xintongsong (via GitHub)" <gi...@apache.org>.
xintongsong commented on code in PR #23:
URL: https://github.com/apache/flink-agents/pull/23#discussion_r2160200618


##########
plan/src/main/java/org/apache/flink/agents/plan/Action.java:
##########
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.agents.plan;
+
+import org.apache.flink.agents.api.Event;
+
+import java.util.List;
+
+/**
+ * Representation of a workflow action with event listening and function execution.
+ *
+ * <p>This class encapsulates a named workflow action that listens for specific event types and
+ * executes an associated function when those events occur.
+ */
+public class Action {
+    private final String name;
+    private final Function exec;
+    private final List<Class<? extends Event>> listenEventTypes;
+
+    public Action(String name, Function exec, List<Class<? extends Event>> listenEventTypes)
+            throws Exception {
+        this.name = name;
+        this.exec = exec;
+        this.listenEventTypes = listenEventTypes;
+        exec.checkSignature(new Class[] {Event.class});

Review Comment:
   @wenjin272 
   After looking into the current implementation of `ActionFunction`, I tend to think that we should not introduce it.
   
   With the current implementation, we would need to first construct a `JavaFunction` or `PythonFunction`, then wrap it into an `ActionFunction` only for the signature check, and then wrap this `ActionFunction` again into an `Action. Such complexity is unnecessary IMO.
   
   Alternatively, we may introduce `ActionFunction` as an interface rather than a class. That means we would need a `JavaActionFunction` that extends `JavaFunction` and implements the `ActionFunction` interface, and do the same for `PythonActionFunction`. This is also complex.
   
   I think the simplest way is just not to introduce the `ActionFunction` abstraction and do the signature checks directly in `Action`.



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][plan][java] Introduce Workflow, Event, Action & Callable in… [flink-agents]

Posted by "xintongsong (via GitHub)" <gi...@apache.org>.
xintongsong commented on code in PR #23:
URL: https://github.com/apache/flink-agents/pull/23#discussion_r2149478884


##########
plan/src/main/java/org/apache/flink/agents/plan/utils/SerializableChecker.java:
##########
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.agents.plan.utils;
+
+import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.JsonProcessingException;
+import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.ObjectMapper;
+
+/** Util class for checking object serializable. */
+public final class SerializableChecker {

Review Comment:
   I'd suggest to name this `JsonSerializationUtils` or `JsonUtils`. Later we can include more json serialization related util methods.



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][plan][java] Introduce Workflow, Event, Action & Callable in… [flink-agents]

Posted by "wenjin272 (via GitHub)" <gi...@apache.org>.
wenjin272 commented on code in PR #23:
URL: https://github.com/apache/flink-agents/pull/23#discussion_r2149199313


##########
api/src/main/java/org/apache/flink/agents/api/Event.java:
##########
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.agents.api;
+
+import org.apache.flink.agents.api.utils.SerializableChecker;
+import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.JsonProcessingException;
+
+import java.io.Serializable;
+import java.security.InvalidParameterException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+/** Base class for all event types in the system. */
+public abstract class Event implements Serializable {

Review Comment:
   Jackson doesn't require this, I removed it.



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][plan][java] Introduce Workflow, Event, Action & Callable in… [flink-agents]

Posted by "wenjin272 (via GitHub)" <gi...@apache.org>.
wenjin272 commented on code in PR #23:
URL: https://github.com/apache/flink-agents/pull/23#discussion_r2149199583


##########
api/src/main/java/org/apache/flink/agents/api/InputEvent.java:
##########
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.agents.api;
+
+/** Event generated by the framework, carrying an input data that arrives at the workflow. */
+public class InputEvent extends Event {
+    private static final long serialVersionUID = 1L;
+    private final Object input;
+
+    public InputEvent(Object input) {
+        super();
+        this.input = input;
+        super.checkSerializable();

Review Comment:
   make sense



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][plan][java] Introduce Workflow, Event, Action & Callable in… [flink-agents]

Posted by "lihaosky (via GitHub)" <gi...@apache.org>.
lihaosky commented on code in PR #23:
URL: https://github.com/apache/flink-agents/pull/23#discussion_r2155260510


##########
plan/src/main/java/org/apache/flink/agents/plan/JavaFunction.java:
##########
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.flink.agents.plan;
+
+import java.lang.reflect.Method;
+import java.util.Arrays;
+
+/** Represent a Java function. */
+public class JavaFunction implements Function {
+    private final String qualName;
+    private final String methodName;
+    private final Class<?>[] parameterTypes;
+    private Method method;
+
+    public JavaFunction(String qualName, String methodName, Class<?>[] parameterTypes) {
+        this.qualName = qualName;
+        this.methodName = methodName;
+        this.parameterTypes = parameterTypes;
+    }
+
+    @Override
+    public Object call(Object... args) throws Exception {
+        if (method == null) {
+            Class<?> clazz = Class.forName(qualName);
+            method = clazz.getMethod(methodName, parameterTypes);

Review Comment:
   Should we validate the method exists or put this in constructor?



##########
plan/src/main/java/org/apache/flink/agents/plan/Action.java:
##########
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.agents.plan;
+
+import org.apache.flink.agents.api.Event;
+
+import java.util.List;
+
+/**
+ * Representation of a workflow action with event listening and function execution.
+ *
+ * <p>This class encapsulates a named workflow action that listens for specific event types and
+ * executes an associated function when those events occur.
+ */
+public class Action {
+    private final String name;
+    private final Function exec;
+    private final List<Class<? extends Event>> listenEventTypes;
+
+    public Action(String name, Function exec, List<Class<? extends Event>> listenEventTypes)
+            throws Exception {
+        this.name = name;
+        this.exec = exec;
+        this.listenEventTypes = listenEventTypes;
+        exec.checkSignature(new Class[] {Event.class});

Review Comment:
   Looks the function can only take Event as input. Should we just have a `EventFunction` subclass for `Function`?



##########
plan/src/main/java/org/apache/flink/agents/plan/JavaFunction.java:
##########
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.flink.agents.plan;
+
+import java.lang.reflect.Method;
+import java.util.Arrays;
+
+/** Represent a Java function. */
+public class JavaFunction implements Function {
+    private final String qualName;
+    private final String methodName;
+    private final Class<?>[] parameterTypes;
+    private Method method;
+
+    public JavaFunction(String qualName, String methodName, Class<?>[] parameterTypes) {

Review Comment:
   Should there be a constructor taking `Class` directly instead of class name?



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][plan][java] Introduce Workflow, Event, Action & Callable in… [flink-agents]

Posted by "wenjin272 (via GitHub)" <gi...@apache.org>.
wenjin272 commented on code in PR #23:
URL: https://github.com/apache/flink-agents/pull/23#discussion_r2161361313


##########
plan/src/main/java/org/apache/flink/agents/plan/Action.java:
##########
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.agents.plan;
+
+import org.apache.flink.agents.api.Event;
+
+import java.util.List;
+
+/**
+ * Representation of a workflow action with event listening and function execution.
+ *
+ * <p>This class encapsulates a named workflow action that listens for specific event types and
+ * executes an associated function when those events occur.
+ */
+public class Action {
+    private final String name;
+    private final Function exec;
+    private final List<Class<? extends Event>> listenEventTypes;
+
+    public Action(String name, Function exec, List<Class<? extends Event>> listenEventTypes)
+            throws Exception {
+        this.name = name;
+        this.exec = exec;
+        this.listenEventTypes = listenEventTypes;
+        exec.checkSignature(new Class[] {Event.class});

Review Comment:
    I will remove the ActionFunction wrapper



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][plan][java] Introduce Workflow, Event, Action & Callable in… [flink-agents]

Posted by "wenjin272 (via GitHub)" <gi...@apache.org>.
wenjin272 commented on code in PR #23:
URL: https://github.com/apache/flink-agents/pull/23#discussion_r2161362936


##########
plan/src/main/java/org/apache/flink/agents/plan/JavaFunction.java:
##########
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.flink.agents.plan;
+
+import java.lang.reflect.Method;
+import java.util.Arrays;
+
+/** Represent a Java function. */
+public class JavaFunction implements Function {
+    private final String qualName;
+    private final String methodName;
+    private final Class<?>[] parameterTypes;
+    private final Class<?> clazz;
+    private final Method method;

Review Comment:
   I add JsonProperty and JsonIgnore annotations to mark not serialize `method`



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org