Github user tillrohrmann commented on the pull request:
https://github.com/apache/flink/pull/1075#issuecomment-136619441
@s1ck, it's important to note that `1` will be subtracted from
`getRuntimeContext().getNumberOfParallelSubtasks()` and not `getBitSize()`. The
reason is that we have `0` based indices for the subtasks. Thus, we only have
to calculate the maximum needed bits for the highest index we can encounter.
And this is `getRuntimeContext().getNumberOfParallelSubtasks() - 1`. Thus if
`getNumberOfParallelSubtasks == 7`, then we would calculate `getBitSize(6) ==
3`.
---
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.
---