Search in sources :

Example 1 with CloudRequestAgent

use of com.github.ambry.cloud.CloudRequestAgent in project ambry by linkedin.

the class AzureIntegrationTest method setup.

@Before
public void setup() {
    testProperties = new Properties();
    try (InputStream input = this.getClass().getClassLoader().getResourceAsStream(propFileName)) {
        if (input == null) {
            throw new IllegalStateException("Could not find resource: " + propFileName);
        }
        testProperties.load(input);
    } catch (IOException ex) {
        throw new IllegalStateException("Could not load properties from resource: " + propFileName);
    }
    testProperties.setProperty("clustermap.cluster.name", "Integration-Test");
    testProperties.setProperty("clustermap.datacenter.name", "uswest");
    testProperties.setProperty("clustermap.host.name", "localhost");
    testProperties.setProperty(CloudConfig.CLOUD_DELETED_BLOB_RETENTION_DAYS, String.valueOf(retentionPeriodDays));
    testProperties.setProperty(CloudConfig.CLOUD_COMPACTION_LOOKBACK_DAYS, "7");
    testProperties.setProperty(AzureCloudConfig.AZURE_PURGE_BATCH_SIZE, "10");
    testProperties.setProperty(AzureCloudConfig.AZURE_STORAGE_CLIENT_CLASS, azureStorageClientClass);
    verifiableProperties = new VerifiableProperties(testProperties);
    clusterMap = Mockito.mock(ClusterMap.class);
    azureDest = getAzureDestination(verifiableProperties);
    cloudRequestAgent = new CloudRequestAgent(new CloudConfig(verifiableProperties), new VcrMetrics(new MetricRegistry()));
}
Also used : ClusterMap(com.github.ambry.clustermap.ClusterMap) MockClusterMap(com.github.ambry.clustermap.MockClusterMap) CloudRequestAgent(com.github.ambry.cloud.CloudRequestAgent) VcrMetrics(com.github.ambry.cloud.VcrMetrics) VerifiableProperties(com.github.ambry.config.VerifiableProperties) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) MetricRegistry(com.codahale.metrics.MetricRegistry) CloudConfig(com.github.ambry.config.CloudConfig) IOException(java.io.IOException) Properties(java.util.Properties) VerifiableProperties(com.github.ambry.config.VerifiableProperties) Before(org.junit.Before)

Aggregations

MetricRegistry (com.codahale.metrics.MetricRegistry)1 CloudRequestAgent (com.github.ambry.cloud.CloudRequestAgent)1 VcrMetrics (com.github.ambry.cloud.VcrMetrics)1 ClusterMap (com.github.ambry.clustermap.ClusterMap)1 MockClusterMap (com.github.ambry.clustermap.MockClusterMap)1 CloudConfig (com.github.ambry.config.CloudConfig)1 VerifiableProperties (com.github.ambry.config.VerifiableProperties)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 Properties (java.util.Properties)1 Before (org.junit.Before)1