Package com.azure.cosmos.models
Class ChangeFeedProcessorState
java.lang.Object
com.azure.cosmos.models.ChangeFeedProcessorState
Specifies the
ChangeFeedProcessor
state for a particular lease/worker.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets a marker representing the last item that was processed.int
Gets an approximation of the difference between the last processed item in the feed container and the latest change recorded.Gets the name of the host which operates on the lease item.Gets the token of the lease item representing the persistent state of a change feed processor worker.setContinuationToken
(String continuationToken) Sets a marker representing the last item that was processed.setEstimatedLag
(int estimatedLag) Sets the estimated lag.setHostName
(String hostName) Sets the name of the host which operates on the lease item.setLeaseToken
(String leaseToken) Sets the token of the lease item representing the persistent state of a change feed processor worker.
-
Constructor Details
-
ChangeFeedProcessorState
public ChangeFeedProcessorState()
-
-
Method Details
-
getLeaseToken
Gets the token of the lease item representing the persistent state of a change feed processor worker.A lease token is a unique identifier representing a specific scope that a CFP worker will operate on.
- Returns:
- a string token uniquely representing the scope for one worker unit.
-
setLeaseToken
Sets the token of the lease item representing the persistent state of a change feed processor worker.A lease token is a unique identifier representing a specific scope that a CFP worker will operate on.
- Parameters:
leaseToken
- a unique string representing a specific scope that a CFP worker will operate on.- Returns:
- the current ChangeFeedProcessorState instance.
-
getHostName
Gets the name of the host which operates on the lease item.When using multiple CFP instances distributing the work for a given feed container, each host must have a unique name.
- Returns:
- the host name that has ownership of this lease item or null if no host is currently operating on this lease.
-
setHostName
Sets the name of the host which operates on the lease item.When using multiple CFP instances distributing the work for a given feed container, each host must have a unique name.
- Parameters:
hostName
- the host name that has ownership of this lease item.- Returns:
- the current ChangeFeedProcessorState instance.
-
getContinuationToken
Gets a marker representing the last item that was processed.- Returns:
- the marker representing the last item that was processed.
-
setContinuationToken
Sets a marker representing the last item that was processed.- Parameters:
continuationToken
- the marker representing the last item that was processed.- Returns:
- the current ChangeFeedProcessorState instance.
-
getEstimatedLag
public int getEstimatedLag()Gets an approximation of the difference between the last processed item in the feed container and the latest change recorded.- Returns:
- the estimated lag.
-
setEstimatedLag
Sets the estimated lag.- Parameters:
estimatedLag
- the estimated lag.- Returns:
- the current ChangeFeedProcessorState instance.
-