Package com.github.ambry.cloud.azure
Class CosmosContainerDeletionEntry
- java.lang.Object
-
- com.github.ambry.cloud.azure.CosmosContainerDeletionEntry
-
public class CosmosContainerDeletionEntry extends java.lang.Object
Class representing container deletion status in cloud.
-
-
Constructor Summary
Constructors Constructor Description CosmosContainerDeletionEntry(short containerId, short accountId, long deleteTriggerTimestamp, boolean isDeleted, java.util.Collection<java.lang.String> partitionIds)
Constructor forCosmosContainerDeletionEntry
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CosmosContainerDeletionEntry
fromContainer(com.github.ambry.account.Container container, java.util.Collection<java.lang.String> partitionIds)
static CosmosContainerDeletionEntry
fromJson(org.json.JSONObject jsonObject)
CreateCosmosContainerDeletionEntry
from specified json.short
getAccountId()
short
getContainerId()
java.util.Set<java.lang.String>
getDeletePendingPartitions()
long
getDeleteTriggerTimestamp()
java.lang.String
getId()
short
getVersion()
boolean
isDeleted()
void
markDeleted()
Mark the container as deleted in cloud.void
removePartition(java.lang.String partitionId)
Remove a delete pending partition.org.json.JSONObject
toJson()
SerializeContainer
object to save to Cosmos.
-
-
-
Constructor Detail
-
CosmosContainerDeletionEntry
public CosmosContainerDeletionEntry(short containerId, short accountId, long deleteTriggerTimestamp, boolean isDeleted, java.util.Collection<java.lang.String> partitionIds)
Constructor forCosmosContainerDeletionEntry
.- 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)
- Parameters:
container
-Container
from which to create deletion entry.partitionIds
-Collection
of partition ids.- Returns:
CosmosContainerDeletionEntry
object.
-
fromJson
public static CosmosContainerDeletionEntry fromJson(org.json.JSONObject jsonObject)
CreateCosmosContainerDeletionEntry
from specified json.- Parameters:
jsonObject
-JSONObject
representing the serializedCosmosContainerDeletionEntry
.- Returns:
- deserialized
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.
-
getId
public java.lang.String getId()
- Returns:
- unique id for the
CosmosContainerDeletionEntry
entry in cosmos db.
-
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()
SerializeContainer
object to save to Cosmos.- Returns:
- serialized
JSONObject
.
-
-