Exemplo n.º 1
0
        public RemainingWorkEstimator(
            ILeaseContainer leaseContainer,
            IChangeFeedDocumentClient feedDocumentClient,
            string collectionSelfLink,
            int degreeOfParallelism)
        {
            if (leaseContainer == null)
            {
                throw new ArgumentNullException(nameof(leaseContainer));
            }
            if (string.IsNullOrEmpty(collectionSelfLink))
            {
                throw new ArgumentNullException(nameof(collectionSelfLink));
            }
            if (feedDocumentClient == null)
            {
                throw new ArgumentNullException(nameof(feedDocumentClient));
            }
            if (degreeOfParallelism < 1)
            {
                throw new ArgumentException("Degree of parallelism is out of range", nameof(degreeOfParallelism));
            }

            this.leaseContainer      = leaseContainer;
            this.collectionSelfLink  = collectionSelfLink;
            this.feedDocumentClient  = feedDocumentClient;
            this.degreeOfParallelism = degreeOfParallelism;
        }
Exemplo n.º 2
0
        public PartitionLoadBalancer(
            IPartitionController partitionController,
            ILeaseContainer leaseContainer,
            IParitionLoadBalancingStrategy partitionLoadBalancingStrategy,
            TimeSpan leaseAcquireInterval)
        {
            if (partitionController == null)
            {
                throw new ArgumentNullException(nameof(partitionController));
            }
            if (leaseContainer == null)
            {
                throw new ArgumentNullException(nameof(leaseContainer));
            }
            if (partitionLoadBalancingStrategy == null)
            {
                throw new ArgumentNullException(nameof(partitionLoadBalancingStrategy));
            }

            this.partitionController            = partitionController;
            this.leaseContainer                 = leaseContainer;
            this.partitionLoadBalancingStrategy = partitionLoadBalancingStrategy;
            this.leaseAcquireInterval           = leaseAcquireInterval;
            this.cancellationTokenSource        = new CancellationTokenSource();
        }
Exemplo n.º 3
0
 public PartitionController(
     ILeaseContainer leaseContainer,
     ILeaseManager leaseManager,
     IPartitionSupervisorFactory partitionSupervisorFactory,
     IPartitionSynchronizer synchronizer)
 {
     this.leaseContainer             = leaseContainer;
     this.leaseManager               = leaseManager;
     this.partitionSupervisorFactory = partitionSupervisorFactory;
     this.synchronizer               = synchronizer;
 }
Exemplo n.º 4
0
 public PartitionSynchronizer(
     IChangeFeedDocumentClient documentClient,
     string collectionSelfLink,
     ILeaseContainer leaseContainer,
     ILeaseManager leaseManager,
     int degreeOfParallelism,
     int maxBatchSize)
 {
     this.documentClient      = documentClient;
     this.collectionSelfLink  = collectionSelfLink;
     this.leaseContainer      = leaseContainer;
     this.leaseManager        = leaseManager;
     this.degreeOfParallelism = degreeOfParallelism;
     this.maxBatchSize        = maxBatchSize;
 }