Package com.azure.data.cosmos
Class FeedOptions
- java.lang.Object
-
- com.azure.data.cosmos.FeedOptions
-
public final class FeedOptions extends Object
Specifies the options associated with feed methods (enumeration operations) in the Azure Cosmos DB database service.
-
-
Constructor Summary
Constructors Constructor Description FeedOptions()
FeedOptions(FeedOptions options)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
allowEmptyPages()
Gets the option to allow empty result pages in feed response.void
allowEmptyPages(boolean allowEmptyPages)
Sets the option to allow empty result pages in feed response.Boolean
emitVerboseTracesInQuery()
Gets the option to allow queries to emit out verbose traces for investigation.FeedOptions
emitVerboseTracesInQuery(Boolean emitVerboseTracesInQuery)
Sets the option to allow queries to emit out verbose traces for investigation.Boolean
enableCrossPartitionQuery()
Gets the option to allow queries to run across all partitions of the collection.FeedOptions
enableCrossPartitionQuery(Boolean enableCrossPartitionQuery)
Sets the option to allow queries to run across all partitions of the collection.Boolean
enableScanInQuery()
Gets the option to allow scan on the queries which couldn't be served as indexing was opted out on the requested paths.FeedOptions
enableScanInQuery(Boolean enableScanInQuery)
Sets the option to allow scan on the queries which couldn't be served as indexing was opted out on the requested paths.int
maxBufferedItemCount()
Gets the maximum number of items that can be buffered client side during parallel query execution.FeedOptions
maxBufferedItemCount(int maxBufferedItemCount)
Sets the maximum number of items that can be buffered client side during parallel query execution.int
maxDegreeOfParallelism()
Gets the number of concurrent operations run client side during parallel query execution.FeedOptions
maxDegreeOfParallelism(int maxDegreeOfParallelism)
Sets the number of concurrent operations run client side during parallel query execution.Integer
maxItemCount()
Gets the maximum number of items to be returned in the enumeration operation.FeedOptions
maxItemCount(Integer maxItemCount)
Sets the maximum number of items to be returned in the enumeration operation.PartitionKey
partitionKey()
Gets the partition key used to identify the current request's target partition.FeedOptions
partitionKey(PartitionKey partitionkey)
Sets the partition key used to identify the current request's target partition.boolean
populateQueryMetrics()
Gets the option to enable populate query metricsFeedOptions
populateQueryMetrics(boolean populateQueryMetrics)
Sets the option to enable/disable getting metrics relating to query execution on document query requestsMap<String,Object>
properties()
Gets the propertiesFeedOptions
properties(Map<String,Object> properties)
Sets the properties used to identify the request token.String
requestContinuation()
Gets the request continuation token.FeedOptions
requestContinuation(String requestContinuation)
Sets the request continuation token.int
responseContinuationTokenLimitInKb()
Gets the ResponseContinuationTokenLimitInKb request option for document query requests in the Azure Cosmos DB service.FeedOptions
responseContinuationTokenLimitInKb(int limitInKb)
Sets the ResponseContinuationTokenLimitInKb request option for document query requests in the Azure Cosmos DB service.String
sessionToken()
Gets the session token for use with session consistency.FeedOptions
sessionToken(String sessionToken)
Sets the session token for use with session consistency.
-
-
-
Constructor Detail
-
FeedOptions
public FeedOptions()
-
FeedOptions
public FeedOptions(FeedOptions options)
-
-
Method Detail
-
sessionToken
public String sessionToken()
Gets the session token for use with session consistency.- Returns:
- the session token.
-
sessionToken
public FeedOptions sessionToken(String sessionToken)
Sets the session token for use with session consistency.- Parameters:
sessionToken
- the session token.- Returns:
- the FeedOptions.
-
enableScanInQuery
public Boolean enableScanInQuery()
Gets the option to allow scan on the queries which couldn't be served as indexing was opted out on the requested paths.- Returns:
- the option of enable scan in query.
-
enableScanInQuery
public FeedOptions enableScanInQuery(Boolean enableScanInQuery)
Sets the option to allow scan on the queries which couldn't be served as indexing was opted out on the requested paths.- Parameters:
enableScanInQuery
- the option of enable scan in query.- Returns:
- the FeedOptions.
-
emitVerboseTracesInQuery
public Boolean emitVerboseTracesInQuery()
Gets the option to allow queries to emit out verbose traces for investigation.- Returns:
- the emit verbose traces in query.
-
emitVerboseTracesInQuery
public FeedOptions emitVerboseTracesInQuery(Boolean emitVerboseTracesInQuery)
Sets the option to allow queries to emit out verbose traces for investigation.- Parameters:
emitVerboseTracesInQuery
- the emit verbose traces in query.- Returns:
- the FeedOptions.
-
enableCrossPartitionQuery
public Boolean enableCrossPartitionQuery()
Gets the option to allow queries to run across all partitions of the collection.- Returns:
- whether to allow queries to run across all partitions of the collection.
-
enableCrossPartitionQuery
public FeedOptions enableCrossPartitionQuery(Boolean enableCrossPartitionQuery)
Sets the option to allow queries to run across all partitions of the collection.- Parameters:
enableCrossPartitionQuery
- whether to allow queries to run across all partitions of the collection.- Returns:
- the FeedOptions.
-
maxDegreeOfParallelism
public int maxDegreeOfParallelism()
Gets the number of concurrent operations run client side during parallel query execution.- Returns:
- number of concurrent operations run client side during parallel query execution.
-
maxDegreeOfParallelism
public FeedOptions maxDegreeOfParallelism(int maxDegreeOfParallelism)
Sets the number of concurrent operations run client side during parallel query execution.- Parameters:
maxDegreeOfParallelism
- number of concurrent operations.- Returns:
- the FeedOptions.
-
maxBufferedItemCount
public int maxBufferedItemCount()
Gets the maximum number of items that can be buffered client side during parallel query execution.- Returns:
- maximum number of items that can be buffered client side during parallel query execution.
-
maxBufferedItemCount
public FeedOptions maxBufferedItemCount(int maxBufferedItemCount)
Sets the maximum number of items that can be buffered client side during parallel query execution.- Parameters:
maxBufferedItemCount
- maximum number of items.- Returns:
- the FeedOptions.
-
responseContinuationTokenLimitInKb
public FeedOptions responseContinuationTokenLimitInKb(int limitInKb)
Sets the ResponseContinuationTokenLimitInKb request option for document query requests in the Azure Cosmos DB service. ResponseContinuationTokenLimitInKb is used to limit the length of continuation token in the query response. Valid values are >= 1. The continuation token contains both required and optional fields. The required fields are necessary for resuming the execution from where it was stooped. The optional fields may contain serialized index lookup work that was done but not yet utilized. This avoids redoing the work again in subsequent continuations and hence improve the query performance. Setting the maximum continuation size to 1KB, the Azure Cosmos DB service will only serialize required fields. Starting from 2KB, the Azure Cosmos DB service would serialize as much as it could fit till it reaches the maximum specified size.- Parameters:
limitInKb
- continuation token size limit.- Returns:
- the FeedOptions.
-
responseContinuationTokenLimitInKb
public int responseContinuationTokenLimitInKb()
Gets the ResponseContinuationTokenLimitInKb request option for document query requests in the Azure Cosmos DB service. If not already set returns 0. ResponseContinuationTokenLimitInKb is used to limit the length of continuation token in the query response. Valid values are >= 1.- Returns:
- return set ResponseContinuationTokenLimitInKb, or 0 if not set
-
maxItemCount
public Integer maxItemCount()
Gets the maximum number of items to be returned in the enumeration operation.- Returns:
- the max number of items.
-
maxItemCount
public FeedOptions maxItemCount(Integer maxItemCount)
Sets the maximum number of items to be returned in the enumeration operation.- Parameters:
maxItemCount
- the max number of items.- Returns:
- the FeedOptionsBase.
-
requestContinuation
public String requestContinuation()
Gets the request continuation token.- Returns:
- the request continuation.
-
requestContinuation
public FeedOptions requestContinuation(String requestContinuation)
Sets the request continuation token.- Parameters:
requestContinuation
- the request continuation.- Returns:
- the FeedOptionsBase.
-
partitionKey
public PartitionKey partitionKey()
Gets the partition key used to identify the current request's target partition.- Returns:
- the partition key.
-
partitionKey
public FeedOptions partitionKey(PartitionKey partitionkey)
Sets the partition key used to identify the current request's target partition.- Parameters:
partitionkey
- the partition key value.- Returns:
- the FeedOptionsBase.
-
populateQueryMetrics
public boolean populateQueryMetrics()
Gets the option to enable populate query metrics- Returns:
- whether to enable populate query metrics
-
populateQueryMetrics
public FeedOptions populateQueryMetrics(boolean populateQueryMetrics)
Sets the option to enable/disable getting metrics relating to query execution on document query requests- Parameters:
populateQueryMetrics
- whether to enable or disable query metrics- Returns:
- the FeedOptionsBase.
-
properties
public Map<String,Object> properties()
Gets the properties- Returns:
- Map of request options properties
-
properties
public FeedOptions properties(Map<String,Object> properties)
Sets the properties used to identify the request token.- Parameters:
properties
- the properties.- Returns:
- the FeedOptionsBase.
-
allowEmptyPages
public boolean allowEmptyPages()
Gets the option to allow empty result pages in feed response.
-
allowEmptyPages
public void allowEmptyPages(boolean allowEmptyPages)
Sets the option to allow empty result pages in feed response. Defaults to false- Parameters:
allowEmptyPages
- whether to allow empty pages in feed response
-
-