Class 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

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int secondsToCrash
      Stores how many seconds to wait before crashing the database.
      • Fields inherited from class edu.caltech.nanodb.commands.Command

        out
    • 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.
    • Field Detail

      • secondsToCrash

        private int secondsToCrash
        Stores how many seconds to wait before crashing the database. A value of 0 means "crash immediately."
    • Constructor Detail

      • CrashCommand

        public CrashCommand​(int secs)
        Construct a new CRASH command that will wait for the specified number of seconds and then crash the database.
      • CrashCommand

        public CrashCommand()
        Construct a new CRASH command that will crash the database immediately.
    • Method Detail

      • getSecondsToCrash

        public int getSecondsToCrash()
      • doCrash

        private void doCrash()
      • toString

        public java.lang.String toString()
        Prints a simple representation of the crash command.
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representing this crash command