public int compare(Pair<SnapshotFileInfo, Long> a, Pair<SnapshotFileInfo, Long> b) {
        long r = a.getSecond() - b.getSecond();
        return (r < 0) ? -1 : ((r > 0) ? 1 : 0);
      }
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