public final class ChangeFeedProcessorOptions extends Object
ChangeFeedProcessor
.Modifier and Type | Field and Description |
---|---|
static Duration |
DEFAULT_ACQUIRE_INTERVAL |
static Duration |
DEFAULT_EXPIRATION_INTERVAL |
static Duration |
DEFAULT_FEED_POLL_DELAY |
static Duration |
DEFAULT_RENEW_INTERVAL |
Constructor and Description |
---|
ChangeFeedProcessorOptions()
Instantiates a new Change feed processor options.
|
Modifier and Type | Method and Description |
---|---|
Duration |
getFeedPollDelay()
Gets the delay in between polling a partition for new changes on the feed, after all current changes are drained.
|
Duration |
getLeaseAcquireInterval()
Gets the interval to kick off a task to compute if partitions are distributed evenly among known host instances.
|
Duration |
getLeaseExpirationInterval()
Gets the interval for which the lease is taken on a lease representing a partition.
|
String |
getLeasePrefix()
Gets a prefix to be used as part of the lease ID.
|
Duration |
getLeaseRenewInterval()
Gets the renew interval for all leases for partitions currently held by
ChangeFeedProcessor instance. |
int |
getMaxItemCount()
Gets the maximum number of items to be returned in the enumeration operation in the Azure Cosmos DB service.
|
int |
getMaxScaleCount()
Gets the maximum number of partitions (parallel workers) the host can run.
|
int |
getMinScaleCount()
Gets the minimum partition count (parallel workers) for the current host.
|
String |
getStartContinuation()
Gets the start request continuation token to start looking for changes after.
|
Instant |
getStartTime()
Gets the time (exclusive) to start looking for changes after.
|
boolean |
isStartFromBeginning()
Gets a value indicating whether change feed in the Azure Cosmos DB service should start from beginning (true)
or from current (false).
|
ChangeFeedProcessorOptions |
setFeedPollDelay(Duration feedPollDelay)
Sets the delay in between polling a partition for new changes on the feed, after all current changes are drained.
|
ChangeFeedProcessorOptions |
setLeaseAcquireInterval(Duration leaseAcquireInterval)
Sets he interval to kick off a task to compute if partitions are distributed evenly among known host instances.
|
ChangeFeedProcessorOptions |
setLeaseExpirationInterval(Duration leaseExpirationInterval)
Sets the interval for which the lease is taken on a lease representing a partition.
|
ChangeFeedProcessorOptions |
setLeasePrefix(String leasePrefix)
Sets a prefix to be used as part of the lease ID.
|
ChangeFeedProcessorOptions |
setLeaseRenewInterval(Duration leaseRenewInterval)
Sets the renew interval for all leases for partitions currently held by
ChangeFeedProcessor instance. |
ChangeFeedProcessorOptions |
setMaxItemCount(int maxItemCount)
Sets the maximum number of items to be returned in the enumeration operation.
|
ChangeFeedProcessorOptions |
setMaxScaleCount(int maxScaleCount)
Sets the maximum number of partitions (parallel workers) the host can run.
|
ChangeFeedProcessorOptions |
setMinScaleCount(int minScaleCount)
Sets the minimum partition count (parallel workers) for the current host.
|
ChangeFeedProcessorOptions |
setStartContinuation(String startContinuation)
Sets the start request continuation token to start looking for changes after.
|
ChangeFeedProcessorOptions |
setStartFromBeginning(boolean startFromBeginning)
Sets a value indicating whether change feed in the Azure Cosmos DB service should start from beginning.
|
ChangeFeedProcessorOptions |
setStartTime(Instant startTime)
Sets the time (exclusive) to start looking for changes after (UTC time).
|
public static final Duration DEFAULT_RENEW_INTERVAL
public static final Duration DEFAULT_ACQUIRE_INTERVAL
public static final Duration DEFAULT_EXPIRATION_INTERVAL
public static final Duration DEFAULT_FEED_POLL_DELAY
public ChangeFeedProcessorOptions()
public Duration getLeaseRenewInterval()
ChangeFeedProcessor
instance.public ChangeFeedProcessorOptions setLeaseRenewInterval(Duration leaseRenewInterval)
ChangeFeedProcessor
instance.leaseRenewInterval
- the renew interval for all leases for partitions currently held by
ChangeFeedProcessor
instance.public Duration getLeaseAcquireInterval()
public ChangeFeedProcessorOptions setLeaseAcquireInterval(Duration leaseAcquireInterval)
leaseAcquireInterval
- he interval to kick off a task to compute if partitions are distributed evenly
among known host instances.public Duration getLeaseExpirationInterval()
If the lease is not renewed within this interval, it will cause it to expire and ownership of the partition will
move to another ChangeFeedProcessor
instance.
public ChangeFeedProcessorOptions setLeaseExpirationInterval(Duration leaseExpirationInterval)
If the lease is not renewed within this interval, it will cause it to expire and ownership of the partition will
move to another ChangeFeedProcessor
instance.
leaseExpirationInterval
- the interval for which the lease is taken on a lease representing a partition.public Duration getFeedPollDelay()
public ChangeFeedProcessorOptions setFeedPollDelay(Duration feedPollDelay)
feedPollDelay
- the delay in between polling a partition for new changes on the feed, after all current
changes are drained.public String getLeasePrefix()
This can be used to support multiple instances of ChangeFeedProcessor
instances pointing at the same
feed while using the same auxiliary container.
public ChangeFeedProcessorOptions setLeasePrefix(String leasePrefix)
leasePrefix
- a prefix to be used as part of the lease ID.public int getMaxItemCount()
public ChangeFeedProcessorOptions setMaxItemCount(int maxItemCount)
maxItemCount
- the maximum number of items to be returned in the enumeration operation.public String getStartContinuation()
This option can be used when lease store is not initialized and it is ignored if a lease item exists and has continuation token that is not null. If this is specified, both StartTime and StartFromBeginning are ignored.
public ChangeFeedProcessorOptions setStartContinuation(String startContinuation)
This option can be used when lease store is not initialized and it is ignored if a lease item exists and has continuation token that is not null. If this is specified, both StartTime and StartFromBeginning are ignored.
startContinuation
- the start request continuation token to start looking for changes after.public Instant getStartTime()
This option can be used when: (1) Lease items are not initialized; this setting will be ignored if the lease items exists and have a valid continuation token. (2) Start continuation token option is not specified. If this option is specified, "start from beginning" option is ignored.
public ChangeFeedProcessorOptions setStartTime(Instant startTime)
This option can be used when: (1) Lease items are not initialized; this setting will be ignored if the lease items exists and have a valid continuation token. (2) Start continuation token option is not specified. If this option is specified, "start from beginning" option is ignored.
startTime
- the time (exclusive) to start looking for changes after.public boolean isStartFromBeginning()
This option can be used when: (1) Lease items are not initialized; this setting will be ignored if the lease items exists and have a valid continuation token. (2) Start continuation token option is not specified. (3) Start time option is not specified.
public ChangeFeedProcessorOptions setStartFromBeginning(boolean startFromBeginning)
This option can be used when: (1) Lease items are not initialized; this setting will be ignored if the lease items exists and have a valid continuation token. (2) Start continuation token option is not specified. (3) Start time option is not specified.
startFromBeginning
- Indicates to start from beginning if truepublic int getMinScaleCount()
This option can be used to increase the number of partitions (parallel workers) for the host and thus override the default equal distribution of leases between multiple hosts.
public ChangeFeedProcessorOptions setMinScaleCount(int minScaleCount)
This option can be used to increase the number of partitions (parallel workers) for the host and thus override the default equal distribution of leases between multiple hosts.
minScaleCount
- the minimum partition count for the host.public int getMaxScaleCount()
This option can be used to limit the number of partitions (parallel workers) for the host and thus override the default equal distribution of leases between multiple hosts. Default setting is "0", unlimited.
public ChangeFeedProcessorOptions setMaxScaleCount(int maxScaleCount)
This option can be used to limit the number of partitions (parallel workers) for the host and thus override the default equal distribution of leases between multiple hosts. Default setting is "0", unlimited.
maxScaleCount
- the maximum number of partitions (parallel workers) the host can run.Copyright © 2021 Microsoft Corporation. All rights reserved.