Arranges files into buckets. Callers must interact with this class in the following order:
- Invoke {@link #reset(String)}.
- Invoke {@link #add(FileStatus)} zero or more times.
- Invoke {@link #createBuckets()}.
- Go to 1 or throw away instance.
The bucketing algorithm is:
- Calculate the number of buckets as floor(total bytes / block size). Add one if there is a remainder.
- Sort the files in order of descending size.
- Add each file to the bucket that has the least size.
- Remove any buckets containing one file only