ChangeFeedProcessorState Class

  • java.lang.Object
    • com.azure.cosmos.models.ChangeFeedProcessorState

public class ChangeFeedProcessorState

Specifies the ChangeFeedProcessor state for a particular lease/worker.

Constructor Summary

Constructor Description
ChangeFeedProcessorState()

Method Summary

Modifier and Type Method and 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.

Methods inherited from java.lang.Object

Constructor Details

ChangeFeedProcessorState

public ChangeFeedProcessorState()

Method Details

getContinuationToken

public String getContinuationToken()

Gets a marker representing the last item that was processed.

Returns:

the marker representing the last item that was processed.

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.

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.

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.

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.

setEstimatedLag

public ChangeFeedProcessorState setEstimatedLag(int estimatedLag)

Sets the estimated lag.

Parameters:

estimatedLag - the estimated lag.

Returns:

the current ChangeFeedProcessorState instance.

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.

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.

Applies to