Github user tillrohrmann commented on the pull request: https://github.com/apache/flink/pull/801#issuecomment-110653949 If I'm not mistaken then something like ``` int log2(long value){ if(value & 0xffffffff00000000 > 0) { 64 - Integer.numberOfLeadingZeros((int)(value >> 32)) } else { 32 - Integer.numberOfLeadingZeros((int)value) } } ``` should do the trick. For the generalization I think something like `dataSet.zipWithID()` with ``` class DataSet<T> { public DataSet<Tuple2<Long, T>> zipWithID() {} } ``` would be nice. But we should discuss it on the mailing list whether we want this to be part of the API or not. For the beginning, it could be added to some kind of utils class.
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---