ACKID - Type of Ids to acknowledgepublic class AcknowledgeOnCheckpoint<ACKID extends Serializable> extends Object implements org.apache.flink.runtime.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.
| 构造器和说明 |
|---|
AcknowledgeOnCheckpoint(Acknowledger<ACKID> acknowledger) |
| 限定符和类型 | 方法和说明 |
|---|---|
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)
throws Exception
notifyCheckpointComplete 在接口中 org.apache.flink.runtime.state.CheckpointListenerExceptionpublic void notifyCheckpointAborted(long checkpointId)
notifyCheckpointAborted 在接口中 org.apache.flink.runtime.state.CheckpointListenerpublic List<AcknowledgeIdsForCheckpoint<ACKID>> snapshotState(long checkpointId, long timestamp) throws Exception
snapshotState 在接口中 org.apache.flink.streaming.api.checkpoint.ListCheckpointed<AcknowledgeIdsForCheckpoint<ACKID extends Serializable>>Exceptionpublic void restoreState(List<AcknowledgeIdsForCheckpoint<ACKID>> state) throws Exception
restoreState 在接口中 org.apache.flink.streaming.api.checkpoint.ListCheckpointed<AcknowledgeIdsForCheckpoint<ACKID extends Serializable>>Exceptionpublic int numberOfOutstandingAcknowledgements()
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.