Interface Context

  • All Known Implementing Classes:
    ContextImpl

    public interface Context
    Context is the information available at runtime for operators like transform. It contains basic things like config, runtime information like task, the stream that it is operating on, ProcessState, etc.
    • Method Detail

      • getTaskId

        int getTaskId()
        Fetches the task id of the current instance of the operator
        Returns:
        the task id.
      • getConfig

        Map<String,​Object> getConfig()
        Fetches the config of the computation
        Returns:
        config
      • getStreamName

        String getStreamName()
        The stream name that we are operating on
        Returns:
        the stream name that we are operating on
      • getStreamPartition

        int getStreamPartition()
        The partition number that we are operating on
        Returns:
        the partition number
      • registerMetric

        <T> void registerMetric​(String metricName,
                                int collectionInterval,
                                Supplier<T> metricFn)
        Register a metric function. This function will be called by the system every collectionInterval seconds and the resulting value will be collected
      • getState

        State<Serializable,​Serializable> getState()
        The state where components can store any of their local state
        Returns:
        The state interface where users can store their local state