Class Sink.InitContextWrapper
- java.lang.Object
-
- org.apache.flink.api.connector.sink2.Sink.InitContextWrapper
-
- All Implemented Interfaces:
InitContext,Sink.InitContext
@Deprecated public static class Sink.InitContextWrapper extends Object implements Sink.InitContext
Deprecated.Internal, do not use it.Class for wrapping a newWriterInitContextto an oldSink.InitContextuntil deprecation.
-
-
Field Summary
-
Fields inherited from interface org.apache.flink.api.connector.sink2.InitContext
INITIAL_CHECKPOINT_ID
-
-
Constructor Summary
Constructors Constructor Description InitContextWrapper(WriterInitContext wrapped)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description SerializationSchema.InitializationContextasSerializationSchemaInitializationContext()Deprecated.Provides a view on this context as aSerializationSchema.InitializationContext.<IN> TypeSerializer<IN>createInputSerializer()Deprecated.Creates a serializer for the type of sink's input.intgetAttemptNumber()Deprecated.Gets the attempt number of this parallel subtask.JobIDgetJobId()Deprecated.The ID of the current job.JobInfogetJobInfo()Deprecated.Get the meta information of current job.MailboxExecutorgetMailboxExecutor()Deprecated.Returns the mailbox executor that allows to executeRunnables inside the task thread in between record processing.intgetNumberOfParallelSubtasks()Deprecated.Get the number of parallel committer tasks.ProcessingTimeServicegetProcessingTimeService()Deprecated.Returns aProcessingTimeServicethat can be used to get the current time and register timers.OptionalLonggetRestoredCheckpointId()Deprecated.Returns id of the restored checkpoint, if state was restored from the snapshot of a previous execution.intgetSubtaskId()Deprecated.Get the id of task where the committer is running.TaskInfogetTaskInfo()Deprecated.Get the meta information of current task.UserCodeClassLoadergetUserCodeClassLoader()Deprecated.Gets theUserCodeClassLoaderto load classes that are not in system's classpath, but are part of the jar file of a user job.booleanisObjectReuseEnabled()Deprecated.Returns whether object reuse has been enabled or disabled.<MetaT> Optional<java.util.function.Consumer<MetaT>>metadataConsumer()Deprecated.Returns a metadata consumer, theSinkWritercan publish metadata events of typeSink.InitContextto the consumer.org.apache.flink.metrics.groups.SinkWriterMetricGroupmetricGroup()Deprecated.
-
-
-
Constructor Detail
-
InitContextWrapper
public InitContextWrapper(WriterInitContext wrapped)
Deprecated.
-
-
Method Detail
-
getSubtaskId
public int getSubtaskId()
Deprecated.Description copied from interface:InitContextGet the id of task where the committer is running.- Specified by:
getSubtaskIdin interfaceInitContext- See Also:
- FLIP-382: Unify the Provision of Diverse Metadata for Context-like APIs
-
getNumberOfParallelSubtasks
public int getNumberOfParallelSubtasks()
Deprecated.Description copied from interface:InitContextGet the number of parallel committer tasks.- Specified by:
getNumberOfParallelSubtasksin interfaceInitContext- See Also:
- FLIP-382: Unify the Provision of Diverse Metadata for Context-like APIs
-
getAttemptNumber
public int getAttemptNumber()
Deprecated.Description copied from interface:InitContextGets the attempt number of this parallel subtask. First attempt is numbered 0.- Specified by:
getAttemptNumberin interfaceInitContext- Returns:
- Attempt number of the subtask.
- See Also:
- FLIP-382: Unify the Provision of Diverse Metadata for Context-like APIs
-
getRestoredCheckpointId
public OptionalLong getRestoredCheckpointId()
Deprecated.Description copied from interface:InitContextReturns id of the restored checkpoint, if state was restored from the snapshot of a previous execution.- Specified by:
getRestoredCheckpointIdin interfaceInitContext
-
getJobId
public JobID getJobId()
Deprecated.Description copied from interface:InitContextThe ID of the current job. Note that Job ID can change in particular upon manual restart. The returned ID should NOT be used for any job management tasks.- Specified by:
getJobIdin interfaceInitContext- See Also:
- FLIP-382: Unify the Provision of Diverse Metadata for Context-like APIs
-
getJobInfo
public JobInfo getJobInfo()
Deprecated.Description copied from interface:InitContextGet the meta information of current job.- Specified by:
getJobInfoin interfaceInitContext- Returns:
- the job meta information.
-
getTaskInfo
public TaskInfo getTaskInfo()
Deprecated.Description copied from interface:InitContextGet the meta information of current task.- Specified by:
getTaskInfoin interfaceInitContext- Returns:
- the task meta information.
-
getUserCodeClassLoader
public UserCodeClassLoader getUserCodeClassLoader()
Deprecated.Description copied from interface:Sink.InitContextGets theUserCodeClassLoaderto load classes that are not in system's classpath, but are part of the jar file of a user job.- Specified by:
getUserCodeClassLoaderin interfaceSink.InitContext- See Also:
UserCodeClassLoader
-
getMailboxExecutor
public MailboxExecutor getMailboxExecutor()
Deprecated.Description copied from interface:Sink.InitContextReturns the mailbox executor that allows to executeRunnables inside the task thread in between record processing.Note that this method should not be used per-record for performance reasons in the same way as records should not be sent to the external system individually. Rather, implementers are expected to batch records and only enqueue a single
Runnableper batch to handle the result.- Specified by:
getMailboxExecutorin interfaceSink.InitContext
-
getProcessingTimeService
public ProcessingTimeService getProcessingTimeService()
Deprecated.Description copied from interface:Sink.InitContextReturns aProcessingTimeServicethat can be used to get the current time and register timers.- Specified by:
getProcessingTimeServicein interfaceSink.InitContext
-
metricGroup
public org.apache.flink.metrics.groups.SinkWriterMetricGroup metricGroup()
Deprecated.- Specified by:
metricGroupin interfaceSink.InitContext- Returns:
- The metric group this writer belongs to.
-
asSerializationSchemaInitializationContext
public SerializationSchema.InitializationContext asSerializationSchemaInitializationContext()
Deprecated.Description copied from interface:Sink.InitContextProvides a view on this context as aSerializationSchema.InitializationContext.- Specified by:
asSerializationSchemaInitializationContextin interfaceSink.InitContext
-
isObjectReuseEnabled
public boolean isObjectReuseEnabled()
Deprecated.Description copied from interface:Sink.InitContextReturns whether object reuse has been enabled or disabled.- Specified by:
isObjectReuseEnabledin interfaceSink.InitContext
-
createInputSerializer
public <IN> TypeSerializer<IN> createInputSerializer()
Deprecated.Description copied from interface:Sink.InitContextCreates a serializer for the type of sink's input.- Specified by:
createInputSerializerin interfaceSink.InitContext
-
metadataConsumer
@Experimental public <MetaT> Optional<java.util.function.Consumer<MetaT>> metadataConsumer()
Deprecated.Description copied from interface:Sink.InitContextReturns a metadata consumer, theSinkWritercan publish metadata events of typeSink.InitContextto the consumer.It is recommended to use a separate thread pool to publish the metadata because enqueuing a lot of these messages in the mailbox may lead to a performance decrease. thread, and the
Consumer.accept(T)method is executed very fast.- Specified by:
metadataConsumerin interfaceSink.InitContext
-
-