Interface IDriver

  • All Known Implementing Classes:
    DataDriver, Driver, SchemaDriver

    public interface IDriver
    IDriver encapsulates some methods which are necessary for FragmentInstanceTaskExecutor to run a fragment instance
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void close()
      clear resource used by this fragment instance
      void failed​(java.lang.Throwable t)
      fail current driver
      FragmentInstanceId getInfo()
      the id information about this IDriver.
      ISinkHandle getSinkHandle()  
      boolean isFinished()
      Used to judge whether this IDriver should be scheduled for execution anymore
      com.google.common.util.concurrent.ListenableFuture<?> processFor​(io.airlift.units.Duration duration)
      run the IDriver for {@param duration} time slice, the time of this run is likely not to be equal to {@param duration}, the actual run time should be calculated by the caller
    • Method Detail

      • isFinished

        boolean isFinished()
        Used to judge whether this IDriver should be scheduled for execution anymore
        Returns:
        true if the IDriver is done or terminated due to failure, otherwise false.
      • processFor

        com.google.common.util.concurrent.ListenableFuture<?> processFor​(io.airlift.units.Duration duration)
        run the IDriver for {@param duration} time slice, the time of this run is likely not to be equal to {@param duration}, the actual run time should be calculated by the caller
        Parameters:
        duration - how long should this IDriver run
        Returns:
        the returned ListenableFuture is used to represent status of this processing if isDone() return true, meaning that this IDriver is not blocked and is ready for next processing. Otherwise, meaning that this IDriver is blocked and not ready for next processing.
      • close

        void close()
        clear resource used by this fragment instance
      • failed

        void failed​(java.lang.Throwable t)
        fail current driver
        Parameters:
        t - reason cause this failure
      • getSinkHandle

        ISinkHandle getSinkHandle()
        Returns:
        get SinkHandle of current IDriver