@Override
  public CommandProcessorResponse run(String command) throws CommandProcessorException {
    String[] args = command.split("\\s+");

    if (args.length < 1) {
      throw new CommandProcessorException("Encryption Processor Helper Failed: Command arguments are empty.");
    }

    if (encryptionShim == null) {
      throw new CommandProcessorException(
          "Encryption Processor Helper Failed: Hadoop encryption shim is not initialized.");
    }

    String action = args[0];
    String params[] = Arrays.copyOfRange(args, 1, args.length);

    try {
      if (action.equalsIgnoreCase("create_key")) {
        createEncryptionKey(params);
      } else if (action.equalsIgnoreCase("create_zone")) {
        createEncryptionZone(params);
      } else if (action.equalsIgnoreCase("delete_key")) {
        deleteEncryptionKey(params);
      } else {
        throw new CommandProcessorException("Encryption Processor Helper Failed: Unknown command action: " + action);
      }
    } catch (Exception e) {
      throw new CommandProcessorException("Encryption Processor Helper Failed: " + e.getMessage());
    }

    return new CommandProcessorResponse();
  }
This class processes HADOOP commands used for HDFS encryption. It is meant to be run
only by Hive unit &amp; queries tests.
ql/src/java/org/apache/hadoop/hive/ql/processors/CryptoProcessor.java