private String buildReleaseYarnCommand(Resource resource) {
    Preconditions.checkArgument(
        resource.getProperties().containsKey(YARN_APPLICATION_ID_PROPERTY),
        "Cannot find {} from optimizer start up stats",
        YARN_APPLICATION_ID_PROPERTY);
    String applicationId = resource.getProperties().get(YARN_APPLICATION_ID_PROPERTY);
    String options = "-Dyarn.application.id=" + applicationId;

    Preconditions.checkArgument(
        resource.getProperties().containsKey(Resource.PROPERTY_JOB_ID),
        "Cannot find {} from optimizer properties",
        Resource.PROPERTY_JOB_ID);
    String jobId = resource.getProperties().get(Resource.PROPERTY_JOB_ID);
    return String.format(
        "%s/bin/flink cancel -t %s %s %s", flinkHome, target.getValue(), options, jobId);
  }
memory conversion of units method, supporting m and g units
amoro-ams/src/main/java/org/apache/amoro/server/manager/FlinkOptimizerContainer.java