[ 
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)

Reply via email to