Github user aljoscha commented on the pull request:
https://github.com/apache/flink/pull/1483#issuecomment-171926900
Hi,
I would be strongly against exposing the input channel index in any way to
operators/user functions. How the index of a channel maps to an upstream
operator is internal to the network layer and dependent on several things, some
of which are not even deterministic IMHO. Off the top of my head it should
depend on the number of upstream tasks, the parallelism of these upstream tasks
and the order in which the system choses to attach the channels.
I think your goal can be achieved by adding a task-id field in the message
wrapper and setting this when emitting elements. Setting this for every
processed element (if using the Storm combat layer or not) seems quite wasteful
to me.
---
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.
---