Example #1
0
 /// <summary>
 /// Initialize the instance of the RetryPolicy class
 /// </summary>
 public RetryPolicy(
     GlobalEndpointManager globalEndpointManager,
     ConnectionPolicy connectionPolicy,
     GlobalPartitionEndpointManager partitionKeyRangeLocationCache)
 {
     this.enableEndpointDiscovery        = connectionPolicy.EnableEndpointDiscovery;
     this.globalEndpointManager          = globalEndpointManager;
     this.retryOptions                   = connectionPolicy.RetryOptions;
     this.partitionKeyRangeLocationCache = partitionKeyRangeLocationCache;
 }
Example #2
0
        public ClientRetryPolicy(
            GlobalEndpointManager globalEndpointManager,
            GlobalPartitionEndpointManager partitionKeyRangeLocationCache,
            bool enableEndpointDiscovery,
            RetryOptions retryOptions)
        {
            this.throttlingRetry = new ResourceThrottleRetryPolicy(
                retryOptions.MaxRetryAttemptsOnThrottledRequests,
                retryOptions.MaxRetryWaitTimeInSeconds);

            this.globalEndpointManager          = globalEndpointManager;
            this.partitionKeyRangeLocationCache = partitionKeyRangeLocationCache;
            this.failoverRetryCount             = 0;
            this.enableEndpointDiscovery        = enableEndpointDiscovery;
            this.sessionTokenRetryCount         = 0;
            this.serviceUnavailableRetryCount   = 0;
            this.canUseMultipleWriteLocations   = false;
        }