Type - The type of the messages created by the source.UId - The type of the unique IDs which are consistent across sessions.SessionId - The type of the IDs that are used for acknowledging elements (ids valid during
session).SourceFunction API, which is due to be
removed. Use the new Source API instead.@Deprecated @PublicEvolving public abstract class MultipleIdsMessageAcknowledgingSourceBase<Type,UId,SessionId> extends MessageAcknowledgingSourceBase<Type,UId>
MessageAcknowledgingSourceBase, this source handles two
types of ids:
Session ids are used to acknowledge messages in a session. When a checkpoint is restored, unacknowledged messages are redelivered. Duplicates are detected using the unique message ids which are checkpointed.
SourceFunction.SourceContext<T>| 限定符和类型 | 字段和说明 |
|---|---|
protected List<SessionId> |
sessionIds
已过时。
|
protected Deque<org.apache.flink.api.java.tuple.Tuple2<Long,List<SessionId>>> |
sessionIdsPerSnapshot
已过时。
|
pendingCheckpoints| 限定符 | 构造器和说明 |
|---|---|
protected |
MultipleIdsMessageAcknowledgingSourceBase(Class<UId> idClass)
已过时。
Creates a new MessageAcknowledgingSourceBase for IDs of the given type.
|
protected |
MultipleIdsMessageAcknowledgingSourceBase(org.apache.flink.api.common.typeinfo.TypeInformation<UId> idTypeInfo)
已过时。
Creates a new MessageAcknowledgingSourceBase for IDs of the given type.
|
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
acknowledgeIDs(long checkpointId,
Set<UId> uniqueIds)
已过时。
Acknowledges the session ids.
|
protected abstract void |
acknowledgeSessionIDs(List<SessionId> sessionIds)
已过时。
Acknowledges the session ids.
|
void |
close()
已过时。
|
void |
open(org.apache.flink.configuration.Configuration parameters)
已过时。
This method is deprecated since Flink 1.19. The users are recommended to
implement
open(OpenContext openContext) and override open(Configuration
parameters) with an empty body instead. 1. If you implement open(OpenContext
openContext), the open(OpenContext openContext) will be invoked and the open(Configuration parameters) won't be invoked. 2. If you don't implement open(OpenContext openContext), the open(Configuration parameters) will be
invoked in the default implementation of the open(OpenContext openContext). |
void |
snapshotState(org.apache.flink.runtime.state.FunctionSnapshotContext context)
已过时。
This method is called when a snapshot for a checkpoint is requested.
|
addId, initializeState, notifyCheckpointAborted, notifyCheckpointCompletegetIterationRuntimeContext, getRuntimeContext, setRuntimeContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcancel, runprotected transient Deque<org.apache.flink.api.java.tuple.Tuple2<Long,List<SessionId>>> sessionIdsPerSnapshot
protected MultipleIdsMessageAcknowledgingSourceBase(Class<UId> idClass)
idClass - The class of the message ID type, used to create a serializer for the message
IDs.protected MultipleIdsMessageAcknowledgingSourceBase(org.apache.flink.api.common.typeinfo.TypeInformation<UId> idTypeInfo)
idTypeInfo - The type information of the message ID type, used to create a serializer
for the message IDs.@Deprecated public void open(org.apache.flink.configuration.Configuration parameters) throws Exception
open(OpenContext openContext) and override open(Configuration
parameters) with an empty body instead. 1. If you implement open(OpenContext
openContext), the open(OpenContext openContext) will be invoked and the open(Configuration parameters) won't be invoked. 2. If you don't implement open(OpenContext openContext), the open(Configuration parameters) will be
invoked in the default implementation of the open(OpenContext openContext).MultipleIdsMessageAcknowledgingSourceBase.open 在接口中 org.apache.flink.api.common.functions.RichFunctionopen 在类中 org.apache.flink.api.common.functions.AbstractRichFunctionparameters - The configuration containing the parameters attached to the contract.Exception - if an error happens.public void close()
throws Exception
close 在接口中 org.apache.flink.api.common.functions.RichFunctionclose 在类中 MessageAcknowledgingSourceBase<Type,UId>Exceptionprotected final void acknowledgeIDs(long checkpointId,
Set<UId> uniqueIds)
acknowledgeIDs 在类中 MessageAcknowledgingSourceBase<Type,UId>checkpointId - The id of the current checkout to acknowledge ids for.uniqueIds - The checkpointed unique ids which are ignored here. They only serve as a
means of de-duplicating messages when the acknowledgment after a checkpoint fails.protected abstract void acknowledgeSessionIDs(List<SessionId> sessionIds)
sessionIds - The message ids for this session.public void snapshotState(org.apache.flink.runtime.state.FunctionSnapshotContext context)
throws Exception
CheckpointedFunctionFunctionInitializationContext when the Function was initialized, or offered now by FunctionSnapshotContext itself.snapshotState 在接口中 CheckpointedFunctionsnapshotState 在类中 MessageAcknowledgingSourceBase<Type,UId>context - the context for drawing a snapshot of the operatorException - Thrown, if state could not be created ot restored.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.