Sxnan commented on code in PR #24541:
URL: https://github.com/apache/flink/pull/24541#discussion_r1608022155


##########
flink-datastream/src/main/java/org/apache/flink/datastream/impl/context/DefaultNonPartitionedContext.java:
##########
@@ -18,23 +18,61 @@
 
 package org.apache.flink.datastream.impl.context;
 
+import org.apache.flink.datastream.api.common.Collector;
 import org.apache.flink.datastream.api.context.JobInfo;
 import org.apache.flink.datastream.api.context.NonPartitionedContext;
 import org.apache.flink.datastream.api.context.TaskInfo;
 import org.apache.flink.datastream.api.function.ApplyPartitionFunction;
 import org.apache.flink.metrics.MetricGroup;
 
+import java.util.Set;
+
 /** The default implementation of {@link NonPartitionedContext}. */
 public class DefaultNonPartitionedContext<OUT> implements 
NonPartitionedContext<OUT> {
     private final DefaultRuntimeContext context;
 
-    public DefaultNonPartitionedContext(DefaultRuntimeContext context) {
+    private final DefaultPartitionedContext partitionedContext;
+
+    private final Collector<OUT> collector;
+
+    private final boolean isKeyed;
+
+    private final Set<Object> keySet;
+
+    public DefaultNonPartitionedContext(
+            DefaultRuntimeContext context,
+            DefaultPartitionedContext partitionedContext,
+            Collector<OUT> collector,
+            boolean isKeyed,
+            Set<Object> keySet) {
         this.context = context;
+        this.partitionedContext = partitionedContext;
+        this.collector = collector;
+        this.isKeyed = isKeyed;
+        this.keySet = keySet;
     }
 
     @Override
-    public void applyToAllPartitions(ApplyPartitionFunction<OUT> 
applyPartitionFunction) {
-        // TODO implements this method.
+    public void applyToAllPartitions(ApplyPartitionFunction<OUT> 
applyPartitionFunction)
+            throws Exception {
+        if (isKeyed) {
+            for (Object key : keySet) {

Review Comment:
   If that is the case, how about we add a TODO and throw an exception in this 
case?



-- 
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]

Reply via email to