Exemplo n.º 1
0
        internal async Task EnsureGlobalSecondaryIndexProvisionAsync(
            bool isCircuitBreakerTripped,
            GlobalSecondaryIndexAutoscalingConfigurationSet configuration,
            CancellationToken cancellationToken = default(CancellationToken))
        {
            cancellationToken.ThrowIfCancellationRequested();

            var tableName = configuration.TableName;
            var indexName = configuration.IndexName;

            var provisioned = await throughputClient.GetGlobalSecondaryIndexThroughputLevelAsync(tableName, indexName, cancellationToken).ConfigureAwait(false);
            var metrics = await metricsClient.GetGlobalSecondaryIndexMetricsAsync(tableName, indexName, cancellationToken);
            LogStats(configuration, provisioned, metrics);

            var updated = EnsureProvision(isCircuitBreakerTripped, provisioned, metrics, configuration);
            var provisioner = new GlobalSecondaryIndexProvisioner(tableName, indexName, throughputClient, structuredLogger);
            await provisioner.ProvisionAsync(configuration, provisioned, updated, cancellationToken).ConfigureAwait(false);
        }
 public void SetUp()
 {
     throughputClientMock = new Mock<IDynamoDbTableThroughputClient>();
     indexProvisioner = new GlobalSecondaryIndexProvisioner(tableName, indexName, throughputClientMock.Object, structuredLogger);
 }