private String sizeString(long size) {
      final String[] units = { " bytes", "Kb", "Mb", "Gb", "Tb" };
      long current = 1;
      for (int i = 0; i < units.length && current > 0; ++i) {
        long next = current << 10;
        if ((size & (next - 1)) != 0) return (long)(size / current) + units[i];
        current = next;
      }
      return current > 0 ? ((long)(size / current) + "Pb") : (size + units[0]);
    }
validate value for a ConfVar, return non-null string for fail message
common/src/java/org/apache/hadoop/hive/conf/Validator.java