@Override
        public void handle(Signal signal) {
          boolean initialRequest = !interruptRequested;
          interruptRequested = true;

          // Kill the VM on second ctrl+c
          if (!initialRequest) {
            console.printInfo("Exiting the JVM");
            System.exit(127);
          }

          // Interrupt the CLI thread to stop the current statement and return
          // to prompt
          console.printInfo("Interrupting... Be patient, this might take some time.");
          console.printInfo("Press Ctrl+C again to kill JVM");

          // First, kill any running MR jobs
          HadoopJobExecHelper.killRunningJobs();
          TezJobExecHelper.killRunningJobs();
          HiveInterruptUtils.interrupt();
        }
Processes a line of semicolon separated commands

@param line
         The commands to process
@param allowInterrupting
         When true the function will handle SIG_INT (Ctrl+C) by interrupting the processing and
         returning -1
@return 0 if ok
cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java