code: public static PoolInfo getPoolInfo(
        Session session) {
      PoolInfo poolInfo = session.getPoolInfo();
  
      // If there is no explicit pool info set, take user name.
      if (poolInfo == null || poolInfo.getPoolName().equals("")) {
        poolInfo = new PoolInfo(DEFAULT_POOL_GROUP, session.getUserId());
      }
  
      if (!PoolInfo.isLegalPoolInfo(poolInfo)) {
        LOG.warn("Illegal pool info :" + poolInfo +
            " from session " + session.getSessionId());
        return DEFAULT_POOL_INFO;
      }
      return poolInfo;
    }
docs: Get the pool name for a given session, using the default pool
  information if the name is illegal.  Redirection should happen prior to
  this.
  
  @param session the session to get the pool name for
  @return the pool info that the session is running in