Interface SourceReaderContext


  • @Public
    public interface SourceReaderContext
    The interface that exposes some context from runtime to the SourceReader.
    • 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.
      • sendSourceEventToCoordinator

        void sendSourceEventToCoordinator​(SourceEvent sourceEvent)
        Send a source event to the source coordinator.
        Parameters:
        sourceEvent - the source event to coordinator.
      • currentParallelism

        default int currentParallelism()
        Get the current parallelism of this Source.
        Returns:
        the parallelism of the Source.