KarmaGYZ commented on a change in pull request #11854:
URL: https://github.com/apache/flink/pull/11854#discussion_r414305550



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/operators/util/DistributedRuntimeUDFContext.java
##########
@@ -41,10 +44,14 @@
 public class DistributedRuntimeUDFContext extends AbstractRuntimeUDFContext {
 
        private final HashMap<String, BroadcastVariableMaterialization<?, ?>> 
broadcastVars = new HashMap<String, BroadcastVariableMaterialization<?, ?>>();
-       
+
+       private final Map<String, Set<? extends ExternalResourceInfo>> 
externalResources;
+
        public DistributedRuntimeUDFContext(TaskInfo taskInfo, ClassLoader 
userCodeClassLoader, ExecutionConfig executionConfig,
-                                                                               
        Map<String, Future<Path>> cpTasks, Map<String, Accumulator<?,?>> 
accumulators, MetricGroup metrics) {
+                                                                               
Map<String, Future<Path>> cpTasks, Map<String, Accumulator<?, ?>> accumulators,
+                                                                               
MetricGroup metrics, Map<String, Set<? extends ExternalResourceInfo>> 
externalResources) {
                super(taskInfo, userCodeClassLoader, executionConfig, 
accumulators, cpTasks, metrics);
+               this.externalResources = externalResources;

Review comment:
       I like the idea to have a builder/factory that takes an `Environment`. 
However, it seems the `RuntimeContext` should not couple with `Environment`. 
`RuntimeContext` is in Function level while `Environment` is TM level. Flink 
does not ensure that the TM always exists when trigger a Function.




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

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


Reply via email to