Checkpoint Class
- java.
lang. Object - com.
microsoft. azure. eventprocessorhost. Checkpoint
- com.
public class Checkpoint
Checkpoint class is public so that advanced users can implement an ICheckpointManager. Unless you are implementing ICheckpointManager you should not have to deal with objects of this class directly.
A Checkpoint is essentially just a tuple. It has a fixed partition id, set at creation time and immutable thereafter, and associates that with an offset/sequenceNumber pair which indicates a position within the events in that partition.
Constructor Summary
Constructor | Description |
---|---|
Checkpoint(Checkpoint source) |
Create a checkpoint which is a duplicate of the given checkpoint. |
Checkpoint(String partitionId) |
Create a checkpoint with offset/sequenceNumber set to the start of the stream. |
Checkpoint(String partitionId, String offset, long sequenceNumber) |
Create a checkpoint with the given offset and sequenceNumber. It is important that the offset and sequence number refer to the same event in the stream. The safest thing to do is get both values from the system properties of one EventData instance. |
Method Summary
Modifier and Type | Method and Description |
---|---|
String |
getOffset()
Return the offset. |
String |
getPartitionId()
Get the partition id. There is no corresponding setter because the partition id is immutable. |
long |
getSequenceNumber()
Get the sequence number. |
void |
setOffset(String newOffset)
Set the offset. Remember to also set the sequence number! |
void |
setSequenceNumber(long newSequenceNumber)
Set the sequence number. Remember to also set the offset! |
Constructor Details
Checkpoint
public Checkpoint(Checkpoint source)
Create a checkpoint which is a duplicate of the given checkpoint.
Parameters:
Checkpoint
public Checkpoint(String partitionId)
Create a checkpoint with offset/sequenceNumber set to the start of the stream.
Parameters:
Checkpoint
public Checkpoint(String partitionId, String offset, long sequenceNumber)
Create a checkpoint with the given offset and sequenceNumber. It is important that the offset and sequence number refer to the same event in the stream. The safest thing to do is get both values from the system properties of one EventData instance.
Parameters:
Method Details
getOffset
public String getOffset()
Return the offset.
Returns:
getPartitionId
public String getPartitionId()
Get the partition id. There is no corresponding setter because the partition id is immutable.
Returns:
getSequenceNumber
public long getSequenceNumber()
Get the sequence number.
Returns:
setOffset
public void setOffset(String newOffset)
Set the offset. Remember to also set the sequence number!
Parameters:
setSequenceNumber
public void setSequenceNumber(long newSequenceNumber)
Set the sequence number. Remember to also set the offset!
Parameters:
Applies to
Azure SDK for Java