@Override
      public boolean nextKeyValue() {
        if (index >= 0) {
          procSize += files.get(index).getSecond();
        }
        return (++index < files.size());
      }
Given a list of file paths and sizes, create around ngroups in as balanced a way as possible.
The groups created will have similar amounts of bytes.
<p>
The algorithm used is pretty straightforward; the file list is sorted by size, and then each
group fetch the bigger file available, iterating through groups alternating the direction.
hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java