コード例 #1
0
 public DocumentServiceLeaseCheckpointerCore(
     DocumentServiceLeaseUpdater leaseUpdater,
     RequestOptionsFactory requestOptionsFactory)
 {
     this.leaseUpdater          = leaseUpdater;
     this.requestOptionsFactory = requestOptionsFactory;
 }
コード例 #2
0
 public DocumentServiceLeaseManagerInMemory(
     DocumentServiceLeaseUpdater leaseUpdater,
     ConcurrentDictionary <string, DocumentServiceLease> container)
 {
     this.leaseUpdater = leaseUpdater;
     this.container    = container;
 }
コード例 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DocumentServiceLeaseStoreManagerCosmos"/> class.
        /// </summary>
        /// <remarks>
        /// Internal only for testing purposes, otherwise would be private.
        /// </remarks>
        internal DocumentServiceLeaseStoreManagerCosmos(
            DocumentServiceLeaseStoreManagerOptions options,
            ContainerInternal monitoredContainer,
            ContainerInternal leaseContainer,
            RequestOptionsFactory requestOptionsFactory,
            DocumentServiceLeaseUpdater leaseUpdater) // For testing purposes only.
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }
            if (options.ContainerNamePrefix == null)
            {
                throw new ArgumentNullException(nameof(options.ContainerNamePrefix));
            }
            if (string.IsNullOrEmpty(options.HostName))
            {
                throw new ArgumentNullException(nameof(options.HostName));
            }
            if (monitoredContainer == null)
            {
                throw new ArgumentNullException(nameof(monitoredContainer));
            }
            if (leaseContainer == null)
            {
                throw new ArgumentNullException(nameof(leaseContainer));
            }
            if (requestOptionsFactory == null)
            {
                throw new ArgumentException(nameof(requestOptionsFactory));
            }
            if (leaseUpdater == null)
            {
                throw new ArgumentException(nameof(leaseUpdater));
            }

            this.leaseStore = new DocumentServiceLeaseStoreCosmos(
                leaseContainer,
                options.ContainerNamePrefix,
                requestOptionsFactory);

            this.leaseManager = new DocumentServiceLeaseManagerCosmos(
                monitoredContainer,
                leaseContainer,
                leaseUpdater,
                options,
                requestOptionsFactory);

            this.leaseCheckpointer = new DocumentServiceLeaseCheckpointerCore(
                leaseUpdater,
                requestOptionsFactory);

            this.leaseContainer = new DocumentServiceLeaseContainerCosmos(
                leaseContainer,
                options);
        }
コード例 #4
0
 public DocumentServiceLeaseManagerCosmos(
     Container leaseContainer,
     DocumentServiceLeaseUpdater leaseUpdater,
     DocumentServiceLeaseStoreManagerOptions options,
     RequestOptionsFactory requestOptionsFactory)
 {
     this.leaseContainer        = leaseContainer;
     this.leaseUpdater          = leaseUpdater;
     this.options               = options;
     this.requestOptionsFactory = requestOptionsFactory;
 }
 public DocumentServiceLeaseManagerCosmos(
     CosmosContainer leaseContainer,
     DocumentServiceLeaseUpdater leaseUpdater,
     DocumentServiceLeaseStoreManagerSettings settings,
     RequestOptionsFactory requestOptionsFactory)
 {
     this.leaseContainer        = leaseContainer;
     this.leaseUpdater          = leaseUpdater;
     this.settings              = settings;
     this.requestOptionsFactory = requestOptionsFactory;
 }
 public DocumentServiceLeaseManagerCosmos(
     ContainerInternal monitoredContainer,
     ContainerInternal leaseContainer,
     DocumentServiceLeaseUpdater leaseUpdater,
     DocumentServiceLeaseStoreManagerOptions options,
     RequestOptionsFactory requestOptionsFactory)
 {
     this.monitoredContainer    = monitoredContainer;
     this.leaseContainer        = leaseContainer;
     this.leaseUpdater          = leaseUpdater;
     this.options               = options;
     this.requestOptionsFactory = requestOptionsFactory;
     this.lazyContainerRid      = new AsyncLazy <TryCatch <string> >(valueFactory: (trace, innerCancellationToken) => this.TryInitializeContainerRIdAsync(innerCancellationToken));
 }
コード例 #7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DocumentServiceLeaseStoreManagerInMemory"/> class.
        /// </summary>
        /// <remarks>
        /// Internal only for testing purposes, otherwise would be private.
        /// </remarks>
        internal DocumentServiceLeaseStoreManagerInMemory(
            DocumentServiceLeaseUpdater leaseUpdater,
            ConcurrentDictionary <string, DocumentServiceLease> container) // For testing purposes only.
        {
            if (leaseUpdater == null)
            {
                throw new ArgumentException(nameof(leaseUpdater));
            }

            this.leaseStore = new DocumentServiceLeaseStoreInMemory();

            this.leaseManager = new DocumentServiceLeaseManagerInMemory(leaseUpdater, container);

            this.leaseCheckpointer = new DocumentServiceLeaseCheckpointerCore(
                leaseUpdater,
                new PartitionedByIdCollectionRequestOptionsFactory());

            this.leaseContainer = new DocumentServiceLeaseContainerInMemory(container);
        }