Browse Source

HDFS-11928. Segment overflow in FileDistributionCalculator. Contributed by LiXin Ge.

Arpit Agarwal 8 years ago
parent
commit
835560983e

+ 2 - 2
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/FileDistributionCalculator.java

@@ -160,8 +160,8 @@ final class FileDistributionCalculator {
               + StringUtils.byteDesc(((long) (i == 0 ? 0 : i - 1) * steps))
               + ", "
               + StringUtils.byteDesc((long)
-                  (i == distribution.length - 1 ? maxFileSize : i * steps))
-                  + "]\t" + distribution[i]);
+                  (i == distribution.length - 1 ? maxFileSize :
+                      (long) i * steps)) + "]\t" + distribution[i]);
         } else {
           out.print(((long) i * steps) + "\t" + distribution[i]);
         }