Skip to content

Commit

Permalink
[AMORO-2688] Fix flink runtime info NullPointException (apache#2689)
Browse files Browse the repository at this point in the history
* [AMORO-2688] Fix flink runtime info nullPointException

* add subtask_index runtime info

---------

Co-authored-by: huyuanfeng <[email protected]>
  • Loading branch information
huyuanfeng2018 and huyuanfeng authored Apr 8, 2024
1 parent 561cab5 commit 5faffab
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,13 @@ public void open() throws Exception {
getRuntimeContext().getTaskManagerRuntimeInfo().getConfiguration().getString(HA_CLUSTER_ID);
executor = (FlinkOptimizerExecutor) allExecutors[subTaskIndex];
// set optimizer flink runtime info, including application_id, tm_id, host
executor.addRuntimeContext("application_id", applicationId);
executor.addRuntimeContext("tm_id", taskManagerId);
if (applicationId != null) {
executor.addRuntimeContext("application_id", applicationId);
}
if (taskManagerId != null) {
executor.addRuntimeContext("tm_id", taskManagerId);
}
executor.addRuntimeContext("subtask_index", String.valueOf(subTaskIndex));
// add label optimize_group;
getMetricGroup().getAllVariables().put("<optimizer_group>", optimizeGroupName);
executor.initOperatorMetric(getMetricGroup());
Expand Down

0 comments on commit 5faffab

Please sign in to comment.