flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tillrohrmann <...@git.apache.org>
Subject [GitHub] flink pull request: [FLINK-2150][gelly] Added library method for a...
Date Wed, 10 Jun 2015 08:36:09 GMT
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message