public static String getAMSThriftAddress(Configurations conf, String serviceName) {
    if (conf.getBoolean(AmoroManagementConf.HA_ENABLE)) {
      return String.format(
          ZOOKEEPER_ADDRESS_FORMAT,
          conf.getString(AmoroManagementConf.HA_ZOOKEEPER_ADDRESS),
          conf.getString(AmoroManagementConf.HA_CLUSTER_NAME));
    } else {
      if (Constants.THRIFT_TABLE_SERVICE_NAME.equals(serviceName)) {
        return String.format(
            THRIFT_ADDRESS_FORMAT,
            conf.getString(AmoroManagementConf.SERVER_EXPOSE_HOST),
            conf.getInteger(AmoroManagementConf.TABLE_SERVICE_THRIFT_BIND_PORT));
      } else if (Constants.THRIFT_OPTIMIZING_SERVICE_NAME.equals(serviceName)) {
        return String.format(
            THRIFT_ADDRESS_FORMAT,
            conf.getString(AmoroManagementConf.SERVER_EXPOSE_HOST),
            conf.getInteger(AmoroManagementConf.OPTIMIZING_SERVICE_THRIFT_BIND_PORT));
      } else {
        throw new IllegalArgumentException(String.format("Unknown service name %s", serviceName));
      }
    }
  }
Convert size to a different unit, ensuring that the converted value is > 1
amoro-ams/src/main/java/org/apache/amoro/server/dashboard/utils/AmsUtil.java