Class RuntimeUDFContext

  • All Implemented Interfaces:
    RuntimeContext

    @Internal
    public class RuntimeUDFContext
    extends AbstractRuntimeUDFContext
    A standalone implementation of the RuntimeContext, created by runtime UDF operators. Used mostly in CollectionExecutor and can be removed along with the DataSet API.
    • Method Detail

      • hasBroadcastVariable

        public boolean hasBroadcastVariable​(String name)
        Description copied from interface: RuntimeContext
        Tests for the existence of the broadcast variable identified by the given name.
        Parameters:
        name - The name under which the broadcast variable is registered;
        Returns:
        Whether a broadcast variable exists for the given name.
      • getBroadcastVariable

        public <RT> List<RT> getBroadcastVariable​(String name)
        Description copied from interface: RuntimeContext
        Returns the result bound to the broadcast variable identified by the given name.

        IMPORTANT: The broadcast variable data structure is shared between the parallel tasks on one machine. Any access that modifies its internal state needs to be manually synchronized by the caller.

        Parameters:
        name - The name under which the broadcast variable is registered;
        Returns:
        The broadcast variable, materialized as a list of elements.
      • getBroadcastVariableWithInitializer

        public <T,​C> C getBroadcastVariableWithInitializer​(String name,
                                                                 BroadcastVariableInitializer<T,​C> initializer)
        Description copied from interface: RuntimeContext
        Returns the result bound to the broadcast variable identified by the given name. The broadcast variable is returned as a shared data structure that is initialized with the given BroadcastVariableInitializer.

        IMPORTANT: The broadcast variable data structure is shared between the parallel tasks on one machine. Any access that modifies its internal state needs to be manually synchronized by the caller.

        Parameters:
        name - The name under which the broadcast variable is registered;
        initializer - The initializer that creates the shared data structure of the broadcast variable from the sequence of elements.
        Returns:
        The broadcast variable, materialized as a list of elements.
      • getJobId

        public JobID getJobId()
        Description copied from interface: RuntimeContext
        The 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.
      • getExternalResourceInfos

        public Set<ExternalResourceInfo> getExternalResourceInfos​(String resourceName)
        Description copied from interface: RuntimeContext
        Get the specific external resource information by the resourceName.
        Parameters:
        resourceName - of the required external resource
        Returns:
        information set of the external resource identified by the resourceName
      • setBroadcastVariable

        public void setBroadcastVariable​(String name,
                                         List<?> value)
      • clearBroadcastVariable

        public void clearBroadcastVariable​(String name)
      • clearAllBroadcastVariables

        public void clearAllBroadcastVariables()