/// <summary>
        /// Instantiates the queryable dictionary for reactive processing entity storage, backed by Azure table storage.
        /// </summary>
        /// <param name="queryProvider">The query provider to the Auzre table storage.</param>
        /// <param name="underlyingDictionary">The underlying queryable dictionary for the metadata entities.</param>
        public AzureQueryableDictionary(AzureMetadataQueryProvider queryProvider, IQueryableDictionary<Uri, TMetadataInterface> underlyingDictionary)
        {
            if (underlyingDictionary == null)
                throw new ArgumentNullException(nameof(underlyingDictionary));

            _queryProvider = queryProvider ?? throw new ArgumentNullException(nameof(queryProvider));
            Expression = CastExpression(underlyingDictionary.Expression);
        }
        /// <summary>
        /// Creates a new Azure metadata service provider using the cloud table client provided.
        /// </summary>
        /// <param name="tableClient">The cloud table client.</param>
        /// <param name="storageResolver">The table address and partition key resolver.</param>
        public AzureMetadataServiceProvider(ITableClient tableClient, IStorageResolver storageResolver)
        {
            var defaultClientBackoff = TimeSpan.FromMilliseconds(100);
            var maxAttempts          = 3;

            var requestOptions = new TableRequestOptions
            {
                RetryPolicy = new ExponentialRetry(defaultClientBackoff, maxAttempts)
            };

            Provider = new AzureMetadataQueryProvider(tableClient, storageResolver, requestOptions);
        }
Example #3
0
 /// <summary>
 /// Creates a new reactive metadata service proxy using the specified service provider and expression tree normalization services.
 /// </summary>
 /// <param name="serviceProvider">Metadata service provider exposing the underlying query provider for use by IRP facilities.</param>
 /// <param name="expressionServices">Expression tree normalization services.</param>
 private AzureReactiveMetadataProxy(AzureMetadataServiceProvider serviceProvider, ReactiveExpressionServices expressionServices)
     : base(serviceProvider, expressionServices)
 {
     _queryProvider = (AzureMetadataQueryProvider)serviceProvider.Provider;
 }
Example #4
0
 /// <summary>
 /// Creates a new metadata query using the specified provider and expression tree representation.
 /// </summary>
 /// <param name="provider">Metadata query provider used to compose queries and to execute the query against Azure table storage.</param>
 /// <param name="expression">Expression representing the metadata query.</param>
 public MetadataQuery(AzureMetadataQueryProvider provider, Expression expression)
 {
     _provider  = provider;
     Expression = expression;
 }