Class OMMultipartUploadUtils

java.lang.Object
org.apache.hadoop.ozone.om.request.util.OMMultipartUploadUtils

public final class OMMultipartUploadUtils extends Object
Utility class related to OM Multipart Upload.
  • Method Details

    • getMultipartUploadId

      public static String getMultipartUploadId()
      Generate a unique Multipart Upload ID.
      Returns:
      multipart upload ID
    • getUploadIdFromDbKey

      public static String getUploadIdFromDbKey(String key)
      Get multipart upload ID from the DB key of multipart upload form openKeyTable/openFileTable. The DB keys of openKeyTable and openFileTable are different: openKeyTable: /{volumeName}/{bucketName}/{keyName}/{uploadId} openFileTable: /{volumeId}/{bucketId}/{parentId}/{fileName}/{uploadId} Despite the difference, both have the uploadId as the suffix of the DB key, we can extract this suffix to get the upload ID from the DB key. Upload ID format: uploadId = UUIDv4 + "-" + UniqueId#next
      Parameters:
      key - DB key
      Returns:
      upload ID if uploadId can be extracted from openDBKey otherwise null
    • getMultipartOpenKey

      public static String getMultipartOpenKey(String volumeName, String bucketName, String keyName, String multipartUploadId, org.apache.hadoop.ozone.om.OMMetadataManager omMetadataManager, org.apache.hadoop.ozone.om.helpers.BucketLayout bucketLayout) throws IOException
      Get the multipart open key based on the bucket layout.
      Throws:
      IOException
    • isMultipartKeySet

      public static boolean isMultipartKeySet(org.apache.hadoop.ozone.om.helpers.OmKeyInfo openKeyInfo)
      Check whether key's isMultipartKey flag is set.
      Parameters:
      openKeyInfo - open key
      Returns:
      true if flag is set, false otherwise.