public static String genMetadataFileLocation(TableMetadata metadata, String filename) {
    String metadataLocation = metadata.properties().get(TableProperties.WRITE_METADATA_LOCATION);

    if (metadataLocation != null) {
      return String.format("%s/%s", LocationUtil.stripTrailingSlash(metadataLocation), filename);
    } else {
      return String.format("%s/%s/%s", metadata.location(), METADATA_FOLDER_NAME, filename);
    }
  }
generate the metadata file location with given filename

@param metadata - the table metadata
@param filename - filename for table metadata
@return - table metadata file location
amoro-ams/src/main/java/org/apache/amoro/server/utils/InternalTableUtil.java