- All Superinterfaces:
- org.apache.hadoop.io.Writable
- All Known Implementing Classes:
- DropDatabaseCommand, DropPartitionCommand, DropTableCommand, ExportCommand, ImportCommand, NoopCommand
public interface Command
extends org.apache.hadoop.io.Writable
Interface that abstracts the notion of one atomic command to execute.
If the command does not execute and raises some exception, then Command
provides a conditional to check if the operation is intended to be
retriable - i.e. whether the command is considered idempotent. If it is,
then the user could attempt to redo the particular command they were
running. If not, then they can check another conditional to check
if their action is undo-able. If undoable, then they can then attempt
to undo the action by asking the command how to undo it. If not, they
can then in turn act upon the exception in whatever manner they see
fit (typically by raising an error).
We also have two more methods that help cleanup of temporary locations
used by this Command. cleanupLocationsPerRetry() provides a list of
directories that are intended to be cleaned up every time this Command
needs to be retried. cleanupLocationsAfterEvent() provides a list of
directories that should be cleaned up after the event for which this
Command is generated is successfully processed.