@Deprecated public static class Sink.InitContextWrapper extends Object implements Sink.InitContext
WriterInitContext
to an old InitContext
until
deprecation.INITIAL_CHECKPOINT_ID
Constructor and Description |
---|
InitContextWrapper(WriterInitContext wrapped)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
SerializationSchema.InitializationContext |
asSerializationSchemaInitializationContext()
Deprecated.
Provides a view on this context as a
SerializationSchema.InitializationContext . |
<IN> TypeSerializer<IN> |
createInputSerializer()
Deprecated.
Creates a serializer for the type of sink's input.
|
int |
getAttemptNumber()
Deprecated.
Gets the attempt number of this parallel subtask.
|
JobID |
getJobId()
Deprecated.
The ID of the current job.
|
JobInfo |
getJobInfo()
Deprecated.
Get the meta information of current job.
|
MailboxExecutor |
getMailboxExecutor()
Deprecated.
Returns the mailbox executor that allows to execute
Runnable s inside the task
thread in between record processing. |
int |
getNumberOfParallelSubtasks()
Deprecated.
Get the number of parallel committer tasks.
|
ProcessingTimeService |
getProcessingTimeService()
Deprecated.
Returns a
ProcessingTimeService that can be used to get the current time and
register timers. |
OptionalLong |
getRestoredCheckpointId()
Deprecated.
Returns id of the restored checkpoint, if state was restored from the snapshot of a previous
execution.
|
int |
getSubtaskId()
Deprecated.
Get the id of task where the committer is running.
|
TaskInfo |
getTaskInfo()
Deprecated.
Get the meta information of current task.
|
UserCodeClassLoader |
getUserCodeClassLoader()
Deprecated.
Gets the
UserCodeClassLoader to load classes that are not in system's classpath,
but are part of the jar file of a user job. |
boolean |
isObjectReuseEnabled()
Deprecated.
Returns whether object reuse has been enabled or disabled.
|
<MetaT> Optional<Consumer<MetaT>> |
metadataConsumer()
Deprecated.
Returns a metadata consumer, the
SinkWriter can publish metadata events of type
MetaT to the consumer. |
SinkWriterMetricGroup |
metricGroup()
Deprecated.
|
public InitContextWrapper(WriterInitContext wrapped)
public int getSubtaskId()
InitContext
getSubtaskId
in interface InitContext
public int getNumberOfParallelSubtasks()
InitContext
getNumberOfParallelSubtasks
in interface InitContext
public int getAttemptNumber()
InitContext
getAttemptNumber
in interface InitContext
public OptionalLong getRestoredCheckpointId()
InitContext
getRestoredCheckpointId
in interface InitContext
public JobID getJobId()
InitContext
getJobId
in interface InitContext
public JobInfo getJobInfo()
InitContext
getJobInfo
in interface InitContext
public TaskInfo getTaskInfo()
InitContext
getTaskInfo
in interface InitContext
public UserCodeClassLoader getUserCodeClassLoader()
Sink.InitContext
UserCodeClassLoader
to load classes that are not in system's classpath,
but are part of the jar file of a user job.getUserCodeClassLoader
in interface Sink.InitContext
UserCodeClassLoader
public MailboxExecutor getMailboxExecutor()
Sink.InitContext
Runnable
s 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 Runnable
per
batch to handle the result.
getMailboxExecutor
in interface Sink.InitContext
public ProcessingTimeService getProcessingTimeService()
Sink.InitContext
ProcessingTimeService
that can be used to get the current time and
register timers.getProcessingTimeService
in interface Sink.InitContext
public SinkWriterMetricGroup metricGroup()
metricGroup
in interface Sink.InitContext
public SerializationSchema.InitializationContext asSerializationSchemaInitializationContext()
Sink.InitContext
SerializationSchema.InitializationContext
.asSerializationSchemaInitializationContext
in interface Sink.InitContext
public boolean isObjectReuseEnabled()
Sink.InitContext
isObjectReuseEnabled
in interface Sink.InitContext
public <IN> TypeSerializer<IN> createInputSerializer()
Sink.InitContext
createInputSerializer
in interface Sink.InitContext
@Experimental public <MetaT> Optional<Consumer<MetaT>> metadataConsumer()
Sink.InitContext
SinkWriter
can publish metadata events of type
MetaT
to 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.
metadataConsumer
in interface Sink.InitContext
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.