Class CosmosContainerDeletionEntry


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

      • CosmosContainerDeletionEntry

        public CosmosContainerDeletionEntry​(short containerId,
                                            short accountId,
                                            long deleteTriggerTimestamp,
                                            boolean isDeleted,
                                            java.util.Collection<java.lang.String> partitionIds)
        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 CosmosContainerDeletionEntry fromContainer​(com.github.ambry.account.Container container,
                                                                 java.util.Collection<java.lang.String> partitionIds)
        Create a CosmosContainerDeletionEntry from specified Container in specified ClusterMap.
        Parameters:
        container - Container from which to create deletion entry.
        partitionIds - Collection of partition ids.
        Returns:
        CosmosContainerDeletionEntry 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.
      • getDeletePendingPartitions

        public java.util.Set<java.lang.String> getDeletePendingPartitions()
        Returns:
        deletePendingPartitions.
      • getVersion

        public short getVersion()
        Returns:
        version.
      • toJson

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