public static MemorySize parse(String text, MemoryUnit defaultUnit)
      throws IllegalArgumentException {
    if (!MemoryUnit.hasUnit(text)) {
      return parse(text + defaultUnit.getUnits()[0]);
    }

    return parse(text);
  }
Parses the given string with a default unit.

@param text The string to parse.
@param defaultUnit specify the default unit.
@return The parsed MemorySize.
@throws IllegalArgumentException Thrown, if the expression cannot be parsed.
amoro-common/src/main/java/org/apache/amoro/utils/MemorySize.java