Sxnan commented on code in PR #186:
URL: https://github.com/apache/flink-agents/pull/186#discussion_r2378994583
##########
runtime/src/main/java/org/apache/flink/agents/runtime/operator/ActionExecutionOperator.java:
##########
@@ -282,7 +301,11 @@ private void processEvent(Object key, Event event) throws
Exception {
if (EventUtil.isOutputEvent(event)) {
// If the event is an OutputEvent, we send it downstream.
OUT outputData = getOutputFromOutputEvent(event);
- output.collect(reusedStreamRecord.replace(outputData));
+ if (event.hasSourceTimestamp()) {
+ output.collect(reusedStreamRecord.replace(outputData,
event.getSourceTimestamp()));
+ } else {
+ output.collect(reusedStreamRecord.replace(outputData));
Review Comment:
We should also clear the timestamp by `StreamRecord#eraseTimestamp`
##########
runtime/src/main/java/org/apache/flink/agents/runtime/operator/queue/KeySegment.java:
##########
@@ -0,0 +1,59 @@
+/*
+ * 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.runtime.operator.queue;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/** A group of keys with the number of unfinished input records for each
specific key. */
+public class KeySegment {
Review Comment:
We should have unit tests for this class.
##########
runtime/src/main/java/org/apache/flink/agents/runtime/context/RunnerContextImpl.java:
##########
@@ -97,6 +97,16 @@ public List<Event> drainEvents() {
return list;
}
+ public List<Event> drainEvents(Long timestamp) {
Review Comment:
Can we remove the `drainEvents()` method?
Only PythonActionExecutor.java:137 is calling it, and it has access to the
event sourceTimestamp
##########
runtime/src/main/java/org/apache/flink/agents/runtime/operator/queue/SegmentedQueue.java:
##########
@@ -0,0 +1,98 @@
+/*
+ * 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.runtime.operator.queue;
+
+import org.apache.flink.streaming.api.watermark.Watermark;
+
+import java.util.ArrayDeque;
+import java.util.Deque;
+
+public class SegmentedQueue {
Review Comment:
We should have unit tests for this class.
--
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]