ACKID - Type of Ids to acknowledgepublic class AcknowledgeOnCheckpoint<ACKID extends Serializable> extends Object implements org.apache.flink.api.common.state.CheckpointListener, org.apache.flink.streaming.api.checkpoint.ListCheckpointed<AcknowledgeIdsForCheckpoint<ACKID>>
The mechanism for this source assumes that messages are identified by a unique ID. When messages are taken from the message queue, the message must not be dropped immediately from the external system, but must be retained until acknowledged. Messages that are not acknowledged within a certain time interval will be served again (to a different connection, established by the recovered source).
Note that this source can give no guarantees about message order in the case of failures, because messages that were retrieved but not yet acknowledged will be returned later again, after a set of messages that was not retrieved before the failure.
Internally, this class gathers the IDs of elements it emits. Per checkpoint, the IDs are stored and acknowledged when the checkpoint is complete. That way, no message is acknowledged unless it is certain that it has been successfully processed throughout the topology and the updates to any state caused by that message are persistent.
| Constructor and Description |
|---|
AcknowledgeOnCheckpoint(Acknowledger<ACKID> acknowledger) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAcknowledgeId(ACKID id) |
void |
notifyCheckpointAborted(long checkpointId) |
void |
notifyCheckpointComplete(long checkpointId) |
int |
numberOfOutstandingAcknowledgements() |
void |
restoreState(List<AcknowledgeIdsForCheckpoint<ACKID>> state) |
List<AcknowledgeIdsForCheckpoint<ACKID>> |
snapshotState(long checkpointId,
long timestamp) |
public AcknowledgeOnCheckpoint(Acknowledger<ACKID> acknowledger)
public void addAcknowledgeId(ACKID id)
public void notifyCheckpointComplete(long checkpointId)
notifyCheckpointComplete in interface org.apache.flink.api.common.state.CheckpointListenerpublic void notifyCheckpointAborted(long checkpointId)
notifyCheckpointAborted in interface org.apache.flink.api.common.state.CheckpointListenerpublic List<AcknowledgeIdsForCheckpoint<ACKID>> snapshotState(long checkpointId, long timestamp)
snapshotState in interface org.apache.flink.streaming.api.checkpoint.ListCheckpointed<AcknowledgeIdsForCheckpoint<ACKID extends Serializable>>public void restoreState(List<AcknowledgeIdsForCheckpoint<ACKID>> state)
restoreState in interface org.apache.flink.streaming.api.checkpoint.ListCheckpointed<AcknowledgeIdsForCheckpoint<ACKID extends Serializable>>public int numberOfOutstandingAcknowledgements()
Copyright © 2022–2024 The Apache Software Foundation. All rights reserved.