Package com.azure.cosmos.models
Class ChangeFeedProcessorState
- java.lang.Object
-
- com.azure.cosmos.models.ChangeFeedProcessorState
-
public class ChangeFeedProcessorState extends Object
Specifies theChangeFeedProcessor
state for a particular lease/worker.
-
-
Constructor Summary
Constructors Constructor Description ChangeFeedProcessorState()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getContinuationToken()
Gets a marker representing the last item that was processed.int
getEstimatedLag()
Gets an approximation of the difference between the last processed item in the feed container and the latest change recorded.String
getHostName()
Gets the name of the host which operates on the lease item.String
getLeaseToken()
Gets the token of the lease item representing the persistent state of a change feed processor worker.ChangeFeedProcessorState
setContinuationToken(String continuationToken)
Sets a marker representing the last item that was processed.ChangeFeedProcessorState
setEstimatedLag(int estimatedLag)
Sets the estimated lag.ChangeFeedProcessorState
setHostName(String hostName)
Sets the name of the host which operates on the lease item.ChangeFeedProcessorState
setLeaseToken(String leaseToken)
Sets the token of the lease item representing the persistent state of a change feed processor worker.
-
-
-
Method Detail
-
getLeaseToken
public String 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
public ChangeFeedProcessorState setLeaseToken(String leaseToken)
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
public String 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
public ChangeFeedProcessorState setHostName(String hostName)
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
public String getContinuationToken()
Gets a marker representing the last item that was processed.- Returns:
- the marker representing the last item that was processed.
-
setContinuationToken
public ChangeFeedProcessorState setContinuationToken(String continuationToken)
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
public ChangeFeedProcessorState setEstimatedLag(int estimatedLag)
Sets the estimated lag.- Parameters:
estimatedLag
- the estimated lag.- Returns:
- the current ChangeFeedProcessorState instance.
-
-