Package com.github.ambry.cloud.azure
Class AzureContainerCompactor
- java.lang.Object
-
- com.github.ambry.cloud.azure.AzureContainerCompactor
-
- All Implemented Interfaces:
CloudContainerCompactor
public class AzureContainerCompactor extends java.lang.Object implements CloudContainerCompactor
Class that compacts containers in the Azure cloud by purging blobs of deprecated containers from ABS and Cosmos.
-
-
Constructor Summary
Constructors Constructor Description AzureContainerCompactor(AzureBlobDataAccessor azureBlobDataAccessor, CosmosDataAccessor cosmosDataAccessor, com.github.ambry.config.CloudConfig cloudConfig, AzureCloudConfig azureCloudConfig, VcrMetrics vcrMetrics, AzureMetrics azureMetrics)
Constructor forAzureContainerCompactor
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
compactAssignedDeprecatedContainers(java.util.Collection<? extends com.github.ambry.clustermap.PartitionId> assignedPartitions)
Compact blobs of the deprecated container from cloud.void
deprecateContainers(java.util.Collection<com.github.ambry.account.Container> deprecatedContainers, java.util.Collection<java.lang.String> partitionIds)
Update newly deprecated containers fromdeprecatedContainers
to CosmosDb since last checkpoint.long
getLatestContainerDeletionTimestamp()
void
shutdown()
Shut down the compactor waiting for in progress operations to complete.
-
-
-
Constructor Detail
-
AzureContainerCompactor
public AzureContainerCompactor(AzureBlobDataAccessor azureBlobDataAccessor, CosmosDataAccessor cosmosDataAccessor, com.github.ambry.config.CloudConfig cloudConfig, AzureCloudConfig azureCloudConfig, VcrMetrics vcrMetrics, AzureMetrics azureMetrics) throws CloudStorageException
Constructor forAzureContainerCompactor
.- Parameters:
azureBlobDataAccessor
-AzureBlobDataAccessor
object to access Azure Blob Store.cosmosDataAccessor
-CosmosDataAccessor
object to access CosmosDb.cloudConfig
-CloudConfig
object.vcrMetrics
-VcrMetrics
object.azureMetrics
-AzureMetrics
object.- Throws:
CloudStorageException
- if case of any error.
-
-
Method Detail
-
deprecateContainers
public void deprecateContainers(java.util.Collection<com.github.ambry.account.Container> deprecatedContainers, java.util.Collection<java.lang.String> partitionIds) throws CloudStorageException
Update newly deprecated containers fromdeprecatedContainers
to CosmosDb since last checkpoint. This method is one of the two entry points inAzureContainerCompactor
along withcompactAssignedDeprecatedContainers(Collection)
.- Parameters:
deprecatedContainers
-Collection
of deprecatedContainer
s.partitionIds
- list of partition ids from where the containers have to be removed.- Throws:
CloudStorageException
- in case of any error.
-
compactAssignedDeprecatedContainers
public void compactAssignedDeprecatedContainers(java.util.Collection<? extends com.github.ambry.clustermap.PartitionId> assignedPartitions)
Compact blobs of the deprecated container from cloud. This method is one of the two entry points in theAzureContainerCompactor
class along withdeprecateContainers(Collection, Collection)
. Note that this method is not thread safe as it is expected to run in a single thread.- Specified by:
compactAssignedDeprecatedContainers
in interfaceCloudContainerCompactor
- Parameters:
assignedPartitions
- theCollection
ofPartitionId
s assigned to this node.
-
getLatestContainerDeletionTimestamp
public long getLatestContainerDeletionTimestamp()
- Returns:
- the latest container deletion timestamp.
-
shutdown
public void shutdown()
Shut down the compactor waiting for in progress operations to complete.- Specified by:
shutdown
in interfaceCloudContainerCompactor
-
-