WencongLiu commented on code in PR #23905:
URL: https://github.com/apache/flink/pull/23905#discussion_r1440107496
##########
flink-core/src/main/java/org/apache/flink/api/connector/sink2/InitContext.java:
##########
@@ -57,6 +83,34 @@ public interface InitContext {
/**
* The ID of the current job. Note that Job ID can change in particular
upon manual restart. The
* returned ID should NOT be used for any job management tasks.
+ *
+ * @deprecated This method is deprecated since Flink 1.19. All metadata
about the job should be
+ * provided uniformly by {@link #getJobInfo()}.
+ * @see <a
+ *
href="https://cwiki.apache.org/confluence/display/FLINK/FLIP-382%3A+Unify+the+Provision+of+Diverse+Metadata+for+Context-like+APIs">
+ * FLIP-382: Unify the Provision of Diverse Metadata for Context-like
APIs </a>
*/
JobID getJobId();
+
+ /**
+ * Get the meta information of current job.
+ *
+ * @return the job meta information.
+ */
+ @PublicEvolving
+ @Nullable
+ default JobInfo getJobInfo() {
+ return null;
+ }
+
+ /**
+ * Get the meta information of current task.
+ *
+ * @return the task meta information.
+ */
+ @PublicEvolving
+ @Nullable
+ default TaskInfo getTaskInfo() {
+ return null;
+ }
Review Comment:
I've changed the default methods including `getJobInfo()` and
`getTaskInfo()` to be abstract.
--
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]