public void checkQueueAccess(
      String queueName, String userName) throws IOException {
    UserGroupInformation ugi = UserGroupInformation.getCurrentUser();
    try {
      ugi.doAs((PrivilegedExceptionAction<Void>) () -> {
        checkQueueAccessInternal(queueName, userName);
        return null;
      });
    } catch (InterruptedException exception) {
      LOG.error("Cannot check queue access against UGI: " + ugi, exception);
      throw new IOException(exception);
    }
  }
Checks yarn queue access of a given user for a given queue, and throws
HiveException in case the user doesn't have access to the queue.
@param  queueName the yarn queue name
@param  userName the username
@throws IOException when doAs throws an exception, we simply throw it
InterruptedException when doAs throws an exception, we simply throw it
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/YarnQueueHelper.java