Search in sources :

Example 1 with AzureBlobDataAccessor

use of com.github.ambry.cloud.azure.AzureBlobDataAccessor in project ambry by linkedin.

the class AzureTokenResetTool method main.

public static void main(String[] args) {
    String commandName = AzureTokenResetTool.class.getSimpleName();
    try {
        VerifiableProperties verifiableProperties = ToolUtils.getVerifiableProperties(args);
        String clusterName = verifiableProperties.getString(ClusterMapConfig.CLUSTERMAP_CLUSTER_NAME);
        CloudConfig cloudConfig = new CloudConfig(verifiableProperties);
        AzureCloudConfig azureCloudConfig = new AzureCloudConfig(verifiableProperties);
        AzureMetrics azureMetrics = new AzureMetrics(new MetricRegistry());
        AzureBlobLayoutStrategy blobLayoutStrategy = new AzureBlobLayoutStrategy(clusterName, azureCloudConfig);
        AzureBlobDataAccessor dataAccessor = new AzureBlobDataAccessor(cloudConfig, azureCloudConfig, blobLayoutStrategy, azureMetrics);
        storageClient = dataAccessor.getStorageClient();
        int tokensDeleted = resetTokens(clusterName);
        logger.info("Deleted tokens for {} partitions", tokensDeleted);
    } catch (Exception ex) {
        ex.printStackTrace();
        logger.error("Command {} failed", commandName, ex);
        System.exit(1);
    }
}
Also used : VerifiableProperties(com.github.ambry.config.VerifiableProperties) MetricRegistry(com.codahale.metrics.MetricRegistry) AzureCloudConfig(com.github.ambry.cloud.azure.AzureCloudConfig) CloudConfig(com.github.ambry.config.CloudConfig) AzureBlobLayoutStrategy(com.github.ambry.cloud.azure.AzureBlobLayoutStrategy) AzureBlobDataAccessor(com.github.ambry.cloud.azure.AzureBlobDataAccessor) AzureCloudConfig(com.github.ambry.cloud.azure.AzureCloudConfig) AzureMetrics(com.github.ambry.cloud.azure.AzureMetrics) BlobStorageException(com.azure.storage.blob.models.BlobStorageException)

Aggregations

BlobStorageException (com.azure.storage.blob.models.BlobStorageException)1 MetricRegistry (com.codahale.metrics.MetricRegistry)1 AzureBlobDataAccessor (com.github.ambry.cloud.azure.AzureBlobDataAccessor)1 AzureBlobLayoutStrategy (com.github.ambry.cloud.azure.AzureBlobLayoutStrategy)1 AzureCloudConfig (com.github.ambry.cloud.azure.AzureCloudConfig)1 AzureMetrics (com.github.ambry.cloud.azure.AzureMetrics)1 CloudConfig (com.github.ambry.config.CloudConfig)1 VerifiableProperties (com.github.ambry.config.VerifiableProperties)1