Class ContainerDeletionEntry


  • public class ContainerDeletionEntry
    extends java.lang.Object
    Class representing container deletion status in cloud.
    • Constructor Detail

      • ContainerDeletionEntry

        public ContainerDeletionEntry​(short containerId,
                                      short accountId,
                                      long deleteTriggerTimestamp,
                                      boolean isDeleted,
                                      java.util.Collection<java.lang.String> partitionIds)
        Constructor for ContainerDeletionEntry.
        Parameters:
        containerId - container id.
        accountId - account id of the container.
        deleteTriggerTimestamp - timestamp at which delete was triggered.
        isDeleted - true if all container blobs are deleted in cloud. false otherwise.
        partitionIds - Collection of all the cloud partition ids from which container is yet to be deleted.
    • Method Detail

      • fromContainer

        public static ContainerDeletionEntry fromContainer​(com.github.ambry.account.Container container,
                                                           java.util.Collection<java.lang.String> partitionIds)
        Create a ContainerDeletionEntry from specified Container in specified ClusterMap.
        Parameters:
        container - Container from which to create deletion entry.
        partitionIds - Collection of partition ids.
        Returns:
        ContainerDeletionEntry object.
      • markDeleted

        public void markDeleted()
        Mark the container as deleted in cloud.
      • removePartition

        public void removePartition​(java.lang.String partitionId)
        Remove a delete pending partition.
        Parameters:
        partitionId - partition to remove.
      • isDeleted

        public boolean isDeleted()
        Returns:
        deletion status of the container.
      • getContainerId

        public short getContainerId()
        Returns:
        containerId of the container.
      • getAccountId

        public short getAccountId()
        Returns:
        accountId of the container.
      • getDeleteTriggerTimestamp

        public long getDeleteTriggerTimestamp()
        Returns:
        delete trigger timestamp when the container deletion was triggered by customer.
      • toJson

        public org.json.JSONObject toJson()
        Serialize Container object to save to Cosmos.
        Returns:
        serialized JSONObject.