flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "liufangliang (Jira)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-18044) Add the subtask index information to the SourceReaderContext.
Date Fri, 12 Jun 2020 02:42:00 GMT

    [ https://issues.apache.org/jira/browse/FLINK-18044?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17133852#comment-17133852
] 

liufangliang commented on FLINK-18044:
--------------------------------------

Hi [~becket_qin],

can i pack this issue?

my solution is to add a methed named indexOfSubtask to interface SourceReaderContext,as following 
{code:java}
/**
 * @return The index of this subtask
 */
int indexOfSubtask();{code}
And then ,implement this method in the open() method of class SourceOperator,as following
{code:java}
@Override
public int indexOfSubtask(){
   return getRuntimeContext().getIndexOfThisSubtask();

}
{code}
what do you think of it ?

 

 

> Add the subtask index information to the SourceReaderContext.
> -------------------------------------------------------------
>
>                 Key: FLINK-18044
>                 URL: https://issues.apache.org/jira/browse/FLINK-18044
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Connectors / Common
>            Reporter: Jiangjie Qin
>            Priority: Major
>
> It is useful for the `SourceReader` to retrieve its subtask id. For example, Kafka readers
can create a consumer with proper client id.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message