Search in sources :

Example 21 with CloudConfig

use of com.github.ambry.config.CloudConfig 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

CloudConfig (com.github.ambry.config.CloudConfig)21 VerifiableProperties (com.github.ambry.config.VerifiableProperties)17 MetricRegistry (com.codahale.metrics.MetricRegistry)12 Properties (java.util.Properties)11 ClusterMapConfig (com.github.ambry.config.ClusterMapConfig)8 Test (org.junit.Test)6 MockClusterMap (com.github.ambry.clustermap.MockClusterMap)5 IOException (java.io.IOException)5 ArrayList (java.util.ArrayList)5 DataNodeId (com.github.ambry.clustermap.DataNodeId)4 ReplicationConfig (com.github.ambry.config.ReplicationConfig)4 StoreConfig (com.github.ambry.config.StoreConfig)4 RequestHandlerPool (com.github.ambry.protocol.RequestHandlerPool)4 AccountService (com.github.ambry.account.AccountService)3 VcrMetrics (com.github.ambry.cloud.VcrMetrics)3 ClusterMap (com.github.ambry.clustermap.ClusterMap)3 PartitionId (com.github.ambry.clustermap.PartitionId)3 ReplicaId (com.github.ambry.clustermap.ReplicaId)3 Port (com.github.ambry.network.Port)3 InputStream (java.io.InputStream)3