Interface SourceReaderContext
-
@Public public interface SourceReaderContextThe interface that exposes some context from runtime to theSourceReader.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default intcurrentParallelism()Get the current parallelism of this Source.ConfigurationgetConfiguration()Gets the configuration with which Flink was started.intgetIndexOfSubtask()StringgetLocalHostName()Gets the hostname of the machine where this reader is executed.UserCodeClassLoadergetUserCodeClassLoader()Gets theUserCodeClassLoaderto load classes that are not in system's classpath, but are part of the jar file of a user job.org.apache.flink.metrics.groups.SourceReaderMetricGroupmetricGroup()voidsendSourceEventToCoordinator(SourceEvent sourceEvent)Send a source event to the source coordinator.voidsendSplitRequest()Sends a split request to the source'sSplitEnumerator.
-
-
-
Method Detail
-
metricGroup
org.apache.flink.metrics.groups.SourceReaderMetricGroup metricGroup()
- Returns:
- The metric group this source belongs to.
-
getConfiguration
Configuration getConfiguration()
Gets the configuration with which Flink was started.
-
getLocalHostName
String getLocalHostName()
Gets the hostname of the machine where this reader is executed. This can be used to request splits local to the machine, if needed.
-
getIndexOfSubtask
int getIndexOfSubtask()
- Returns:
- The index of this subtask.
-
sendSplitRequest
void sendSplitRequest()
Sends a split request to the source'sSplitEnumerator. This will result in a call to theSplitEnumerator.handleSplitRequest(int, String)method, with this reader's parallel subtask id and the hostname where this reader runs.
-
sendSourceEventToCoordinator
void sendSourceEventToCoordinator(SourceEvent sourceEvent)
Send a source event to the source coordinator.- Parameters:
sourceEvent- the source event to coordinator.
-
getUserCodeClassLoader
UserCodeClassLoader getUserCodeClassLoader()
Gets theUserCodeClassLoaderto load classes that are not in system's classpath, but are part of the jar file of a user job.- See Also:
UserCodeClassLoader
-
currentParallelism
default int currentParallelism()
Get the current parallelism of this Source.- Returns:
- the parallelism of the Source.
-
-