-
Notifications
You must be signed in to change notification settings - Fork 527
Expand file tree
/
Copy pathQueryPage.cs
More file actions
57 lines (46 loc) · 2.31 KB
/
QueryPage.cs
File metadata and controls
57 lines (46 loc) · 2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// ------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// ------------------------------------------------------------
namespace Microsoft.Azure.Cosmos.Query.Core.Pipeline.Pagination
{
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using Microsoft.Azure.Cosmos.CosmosElements;
using Microsoft.Azure.Cosmos.Pagination;
using Microsoft.Azure.Cosmos.Query.Core.QueryClient;
internal sealed class QueryPage : Page<QueryState>
{
public static readonly ImmutableHashSet<string> BannedHeaders = new HashSet<string>()
{
Microsoft.Azure.Documents.HttpConstants.HttpHeaders.Continuation,
Microsoft.Azure.Documents.HttpConstants.HttpHeaders.ContinuationToken,
}.Concat(BannedHeadersBase).ToImmutableHashSet<string>();
public QueryPage(
IReadOnlyList<CosmosElement> documents,
double requestCharge,
string activityId,
Lazy<CosmosQueryExecutionInfo> cosmosQueryExecutionInfo,
DistributionPlanSpec distributionPlanSpec,
string disallowContinuationTokenMessage,
IReadOnlyDictionary<string, string> additionalHeaders,
QueryState state,
bool? streaming)
: base(requestCharge, activityId, additionalHeaders, state)
{
this.Documents = documents ?? throw new ArgumentNullException(nameof(documents));
this.CosmosQueryExecutionInfo = cosmosQueryExecutionInfo;
this.DistributionPlanSpec = distributionPlanSpec;
this.DisallowContinuationTokenMessage = disallowContinuationTokenMessage;
this.Streaming = streaming;
}
public IReadOnlyList<CosmosElement> Documents { get; }
public Lazy<CosmosQueryExecutionInfo> CosmosQueryExecutionInfo { get; }
public DistributionPlanSpec DistributionPlanSpec { get; }
public string DisallowContinuationTokenMessage { get; }
public bool? Streaming { get; }
public override int ItemCount => this.Documents.Count;
protected override ImmutableHashSet<string> DerivedClassBannedHeaders => QueryPage.BannedHeaders;
}
}