Package io.digdag.spi

Interface CommandExecutor


  • public interface CommandExecutor
    • Method Detail

      • run

        CommandStatus run​(CommandContext context,
                          CommandRequest request)
                   throws java.io.IOException
        Starts a command and returns its state. Caller must check isFinished of the returned CommandStatus. If it's true, the command is done. CommandStatus.getStatusCode() is ready to call. Otherwise, caller must call poll method repeatedly with toJson of the returned CommandStatus until CommandStatus is returned with isFinished == true.
        Parameters:
        context -
        request -
        Returns:
        Throws:
        java.io.IOException
      • poll

        CommandStatus poll​(CommandContext context,
                           com.fasterxml.jackson.databind.node.ObjectNode previousStatusJson)
                    throws java.io.IOException
        Polls the command status by non-blocking and return CommandStatus.
        Parameters:
        context -
        previousStatusJson -
        Returns:
        Throws:
        java.io.IOException
      • cleanup

        default void cleanup​(CommandContext context,
                             io.digdag.client.config.Config state)
                      throws java.io.IOException
        Runs a cleanup script when an attempt gets CANCEL_REQUESTED.
        Parameters:
        context -
        state -
        Throws:
        java.io.IOException