rominparekh commented on a change in pull request #117: Sorts bin packing by 
weights in descending order
URL: https://github.com/apache/incubator-iceberg/pull/117#discussion_r266713889
 
 

 ##########
 File path: core/src/main/java/com/netflix/iceberg/util/BinPacking.java
 ##########
 @@ -107,7 +113,22 @@ public boolean hasNext() {
           bins.addLast(bin);
 
           if (bins.size() > lookback) {
-            return ImmutableList.copyOf(bins.removeFirst().items());
+            if (expensiveTaskFirst) {
+              Bin maxBin = null;
+
+              // Iterate through all bins looking for one with maximum weight, 
taking O(n) time.
+              for (Bin currBin : bins) {
 
 Review comment:
   +1 Done. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to