Package edu.caltech.nanodb.commands
Class CrashCommand
- java.lang.Object
-
- edu.caltech.nanodb.commands.Command
-
- edu.caltech.nanodb.commands.CrashCommand
-
public class CrashCommand extends Command
This command "crashes" the database by shutting it down immediately without any proper cleanup or flushing of caches.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class edu.caltech.nanodb.commands.Command
Command.Type
-
-
Field Summary
Fields Modifier and Type Field Description private int
secondsToCrash
Stores how many seconds to wait before crashing the database.
-
Constructor Summary
Constructors Constructor Description CrashCommand()
Construct a new CRASH command that will crash the database immediately.CrashCommand(int secs)
Construct a new CRASH command that will wait for the specified number of seconds and then crash the database.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
doCrash()
void
execute(NanoDBServer server)
Actually performs the command.int
getSecondsToCrash()
java.lang.String
toString()
Prints a simple representation of the crash command.-
Methods inherited from class edu.caltech.nanodb.commands.Command
getCommandType
-
-
-
-
Method Detail
-
getSecondsToCrash
public int getSecondsToCrash()
-
execute
public void execute(NanoDBServer server) throws ExecutionException
Description copied from class:Command
Actually performs the command.- Specified by:
execute
in classCommand
- Throws:
ExecutionException
- if an issue occurs during command execution
-
doCrash
private void doCrash()
-
toString
public java.lang.String toString()
Prints a simple representation of the crash command.- Overrides:
toString
in classjava.lang.Object
- Returns:
- a string representing this crash command
-
-