for (String arg : commandLine.getArgs()) {
Path path = new Path(arg);
CachableBlockFile.Reader _rdr = new CachableBlockFile.Reader(fs, path, conf, null, null);
Reader iter = new RFile.Reader(_rdr);
iter.printInfo();
if (doHistogram || dump) {
iter.seek(new Range((Key) null, (Key) null), new ArrayList<ByteSequence>(), false);
while (iter.hasTop()) {
Key key = iter.getTopKey();
Value value = iter.getTopValue();
if (dump)
System.out.println(key + " -> " + value);
if (doHistogram) {
long size = key.getSize() + value.getSize();
int bucket = (int) Math.log10(size);
countBuckets[bucket]++;
sizeBuckets[bucket] += size;
totalSize += size;
}
iter.next();
}
}
iter.close();
if (doHistogram) {
System.out.println("Up to size count %-age");
for (int i = 1; i < countBuckets.length; i++) {
System.out.println(String.format("%11.0f : %10d %6.2f%%", Math.pow(10, i), countBuckets[i], sizeBuckets[i] * 100. / totalSize));
}