예제 #1
0
 public override void Visit(ChangeFeedStartFromContinuationAndFeedRange startFromContinuationAndFeedRange)
 {
     // On REST level, change feed is using IfNoneMatch/ETag instead of continuation
     if (startFromContinuationAndFeedRange.Etag != null)
     {
         this.requestMessage.Headers.IfNoneMatch = startFromContinuationAndFeedRange.Etag;
     }
 }
예제 #2
0
        public override void Visit(ChangeFeedStartFromContinuationAndFeedRange startFromContinuationAndFeedRange)
        {
            // On REST level, change feed is using IfNoneMatch/ETag instead of continuation
            if (startFromContinuationAndFeedRange.Etag != null)
            {
                this.requestMessage.Headers.IfNoneMatch = startFromContinuationAndFeedRange.Etag;
            }

            startFromContinuationAndFeedRange.FeedRange.Accept(FeedRangeRequestMessagePopulatorVisitor.Singleton, this.requestMessage);
        }
        public static ChangeFeedPartitionKeyResultSetIteratorCore Create(
            DocumentServiceLease lease,
            string continuationToken,
            int?maxItemCount,
            ContainerInternal container,
            DateTime?startTime,
            bool startFromBeginning)
        {
            // If the lease represents a full partition (old schema) then use a FeedRangePartitionKeyRange
            // If the lease represents an EPK range (new schema) the use the FeedRange in the lease
            FeedRangeInternal feedRange = lease is DocumentServiceLeaseCoreEpk ? lease.FeedRange : new FeedRangePartitionKeyRange(lease.CurrentLeaseToken);

            ChangeFeedStartFrom startFrom;

            if (continuationToken != null)
            {
                // For continuation based feed range we need to manufactor a new continuation token that has the partition key range id in it.
                startFrom = new ChangeFeedStartFromContinuationAndFeedRange(continuationToken, feedRange);
            }
            else if (startTime.HasValue)
            {
                startFrom = ChangeFeedStartFrom.Time(startTime.Value, feedRange);
            }
            else if (startFromBeginning)
            {
                startFrom = ChangeFeedStartFrom.Beginning(feedRange);
            }
            else
            {
                startFrom = ChangeFeedStartFrom.Now(feedRange);
            }

            ChangeFeedRequestOptions requestOptions = new ChangeFeedRequestOptions()
            {
                PageSizeHint = maxItemCount,
            };

            return(new ChangeFeedPartitionKeyResultSetIteratorCore(
                       container: container,
                       changeFeedStartFrom: startFrom,
                       options: requestOptions));
        }
예제 #4
0
 public override TryCatch <ChangeFeedCrossFeedRangeState> Visit(ChangeFeedStartFromContinuationAndFeedRange startFromContinuationAndFeedRange)
 {
     throw new NotSupportedException();
 }
예제 #5
0
 public abstract Task <TResult> VisitAsync(
     ChangeFeedStartFromContinuationAndFeedRange startFromContinuationAndFeedRange,
     TInput input,
     CancellationToken cancellationToken);
 public override FeedRange Visit(ChangeFeedStartFromContinuationAndFeedRange startFromContinuationAndFeedRange) => startFromContinuationAndFeedRange.FeedRange;
 public override FeedRange Visit(ChangeFeedStartFromContinuationAndFeedRange startFromContinuationAndFeedRange)
 {
     return(startFromContinuationAndFeedRange.FeedRange);
 }