Package io.digdag.spi
Interface CommandExecutor
-
public interface CommandExecutor
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidcleanup(CommandContext context, io.digdag.client.config.Config state)Runs a cleanup script when an attempt gets CANCEL_REQUESTED.CommandStatuspoll(CommandContext context, com.fasterxml.jackson.databind.node.ObjectNode previousStatusJson)Polls the command status by non-blocking and return CommandStatus.CommandStatusrun(CommandContext context, CommandRequest request)Starts a command and returns its state.
-
-
-
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
-
-