public int run(String[] args) throws Exception {
    try {
      readArgs(args);
      init();

      switch (opType) {
        case LIST:
          doList(); break;
        case DELETE:
          doDelete(); break;
      }

      return 0;
    }
    catch (Exception exception) {
      LOG.error("Unexpected exception: ", exception);
      return -1;
    }
  }
Tool to twiddle MetaStore delegation tokens.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/security/DelegationTokenTool.java