Github user uce commented on a diff in the pull request:
https://github.com/apache/incubator-flink/pull/85#discussion_r15559264
--- Diff:
flink-runtime/src/main/java/org/apache/flink/runtime/operators/RegularPactTask.java
---
@@ -525,7 +526,9 @@ protected void run() throws Exception {
// modify accumulators.ll;
if (this.stub != null) {
// collect the counters from the stub
- Map<String, Accumulator<?,?>> accumulators =
this.stub.getRuntimeContext().getAllAccumulators();
+
+ // !!! Is this.runtimeUdfContext the right
thing to return here if this.stub.getRuntimeContext() is null? !!!
--- End diff --
Yes, I think so, but it might be redundant.
If I am not mistaken, the control flow of `RegularPactTask` results in
`this.stub.getRuntimeContext() == this.runtimeUdfContext`. So if one is null,
then the other will be null as well and vice versa.
In the `initialize` method, we do the following (among other things):
1. Create the RuntimeContext (line 434)
2. Initialize the stub/function (line 441)
Stub initalization sets the runtime context of the stub in line 699 to the
previously created runtime context with
`FunctionUtils.setFunctionRuntimeContext(stub, this.runtimeUdfContext)`.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---