private void doDelete() throws Exception {
    int nDeletedTokens = 0;
    List<DelegationTokenIdentifier> allDelegationTokenIDs = getAllDelegationTokenIDs();
    for (DelegationTokenIdentifier tokenId : Iterables.filter(allDelegationTokenIDs, selectForDeletion)) {
      if ((++nDeletedTokens % batchSize) == 0) {
        LOG.info("Deleted " + nDeletedTokens + "/" + allDelegationTokenIDs.size() +
                 " (" + (((long)(100*nDeletedTokens))/allDelegationTokenIDs.size()) + "%). " +
                 "Sleeping for " + sleepTimeMillis + "ms...");
        try {Thread.sleep(sleepTimeMillis); } catch (InterruptedException ignore) {}
      }
      LOG.info("Deleting token: " + tokenId.toString());
      if (!isDryRun) {
        delegationTokenStore.removeToken(tokenId);
      }
    }
  }
Tool to twiddle MetaStore delegation tokens.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/security/DelegationTokenTool.java