Interface Driver<S extends Function,​OT>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void cancel()
      This method is invoked when the driver must aborted in mid processing.
      void cleanup()
      This method is invoked in any case (clean termination and exception) at the end of the tasks operation.
      int getNumberOfDriverComparators()
      Gets the number of comparators required for this driver.
      int getNumberOfInputs()
      Gets the number of inputs that the task has.
      Class<S> getStubType()
      Gets the class of the stub type that is run by this task.
      void prepare()
      This method is called before the user code is opened.
      void run()
      The main operation method of the task.
      void setup​(TaskContext<S,​OT> context)  
    • Method Detail

      • getNumberOfInputs

        int getNumberOfInputs()
        Gets the number of inputs that the task has.
        Returns:
        The number of inputs.
      • getNumberOfDriverComparators

        int getNumberOfDriverComparators()
        Gets the number of comparators required for this driver.
        Returns:
        The number of comparators required for this driver.
      • getStubType

        Class<S> getStubType()
        Gets the class of the stub type that is run by this task. For example, a MapTask should return MapFunction.class.
        Returns:
        The class of the stub type run by the task.
      • prepare

        void prepare()
              throws Exception
        This method is called before the user code is opened. An exception thrown by this method signals failure of the task.
        Throws:
        Exception - Exceptions may be forwarded and signal task failure.
      • run

        void run()
          throws Exception
        The main operation method of the task. It should call the user code with the data subsets until the input is depleted.
        Throws:
        Exception - Any exception thrown by this method signals task failure. Because exceptions in the user code typically signal situations where this instance in unable to proceed, exceptions from the user code should be forwarded.
      • cleanup

        void cleanup()
              throws Exception
        This method is invoked in any case (clean termination and exception) at the end of the tasks operation.
        Throws:
        Exception - Exceptions may be forwarded.
      • cancel

        void cancel()
             throws Exception
        This method is invoked when the driver must aborted in mid processing. It is invoked asynchronously by a different thread.
        Throws:
        Exception - Exceptions may be forwarded.