@Override
  public TCancelDelegationTokenResp CancelDelegationToken(TCancelDelegationTokenReq req)
      throws TException {
    TCancelDelegationTokenResp resp = new TCancelDelegationTokenResp();

    if (hiveAuthFactory == null || !hiveAuthFactory.isSASLKerberosUser()) {
      resp.setStatus(unsecureTokenErrorStatus());
    } else {
      try {
        cliService.cancelDelegationToken(new SessionHandle(req.getSessionHandle()),
            hiveAuthFactory, req.getDelegationToken());
        resp.setStatus(OK_STATUS);
      } catch (HiveSQLException e) {
        LOG.error("Failed to cancel delegation token [request: {}]", req, e);
        resp.setStatus(HiveSQLException.toTStatus(e));
      }
    }
    return resp;
  }
Return the number of Hive sessions this context has handled. It is
technically possible that a single connection context could handle an
unbounded number of sequential Hive sessions, though it is currently not
implemented.

@return The number of sessions this thrift context has handled
service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java