@SuppressWarnings("unchecked")
  public static <T> T convertToMemorySize(Object rawValue) {
    if (rawValue instanceof MemorySize) {
      return (T) rawValue;
    } else {
      return (T) MemorySize.parse(rawValue.toString());
    }
  }
Tries to convert the raw value into the provided type.

@param rawValue rawValue to convert into the provided type clazz
@param clazz clazz specifying the target type
@param <T> type of the result
@return the converted value if rawValue is of type clazz
@throws IllegalArgumentException if the rawValue cannot be converted in the specified target
    type clazz
amoro-common/src/main/java/org/apache/amoro/config/ConfigHelpers.java