Returns the current UGI on the stack
@param opConfig
@return UserGroupInformation
@throws HiveSQLException
767809
private UserGroupInformation getCurrentUGI(HiveConf opConfig) throws HiveSQLException {
    try {
      return Utils.getUGI();
    } catch (Exception e) {
      throw new HiveSQLException("Unable to get current user", e);
    }
  }
753121
@Override
  public void closeOperation(OperationHandle opHandle)
      throws HiveSQLException {
    sessionManager.getOperationManager().getOperation(opHandle)
    .getParentSession().closeOperation(opHandle);
    LOG.debug(opHandle + ": closeOperation");
  }
919309
private void createSubgroups(GroupHierarchyConfig config, String groupId) {
        config.getSubitems().forEach(cfg -> {
            if (cfg instanceof GroupHierarchyConfig) {
                GroupMetadata curGroup = findGroup((GroupHierarchyConfig) cfg, groupId);
                String subGroupId;
                if (curGroup != null) {
                    subGroupId = curGroup.getId();
                } else {
                    subGroupId = create(converter.createGroupConfig((GroupHierarchyConfig) cfg, groupId))
                        .getResult()
                        .as(GroupByIdRef.class)
                        .getId();
                }
                createSubgroups((GroupHierarchyConfig) cfg, subGroupId);
            } else if (cfg instanceof CreateServerConfig) {
                ((CreateServerConfig) cfg).group(Group.refById(groupId));
            } else {
                ((CompositeServerConfig) cfg).getServer().group(Group.refById(groupId));
            }
        });
    }
1195223
@SuppressWarnings("deprecation")
	OperationalConfig buildOperationalConfig() {
		return new OperationalConfigImpl(isAsync(), getProperties(), getSessionTimeout(), getThreadPoolSize(), isTransportModeLoggingOnly(), isDebugLogging(),
				getSslHostsToTrust(), isTrustAllSSLHost());
	}
108986
@Override
	public CProduct getCProductByUuidAndGroupId(String uuid, long groupId)
		throws PortalException {
		return cProductPersistence.findByUUID_G(uuid, groupId);
	}
1296099
public static EventLoopGroup getServerBizEventLoopGroup(ServerTransportConfig config, Executor executor) {
        int bizThreads = config.getBizMaxThreads();
        return config.isUseEpoll() ?
            new EpollEventLoopGroup(config.getBizMaxThreads(), executor) :
            new NioEventLoopGroup(bizThreads, executor);
    }
1357944
@Override
    public List<org.jgroups.conf.ProtocolConfiguration> getProtocolStack() {
        List<org.jgroups.conf.ProtocolConfiguration> stack = new ArrayList<>(this.configuration.getProtocols().size() + 1);
        TransportConfiguration transport = this.configuration.getTransport();
        org.jgroups.conf.ProtocolConfiguration protocol = createProtocol(this.configuration, transport);
        Map<String, String> properties = protocol.getProperties();

        Introspector introspector = new Introspector(protocol);

        SocketBinding binding = transport.getSocketBinding();
        if (binding != null) {
            configureBindAddress(introspector, protocol, binding);
            configureServerSocket(introspector, protocol, "bind_port", binding);
            configureMulticastSocket(introspector, protocol, "mcast_addr", "mcast_port", binding);
        }

        SocketBinding diagnosticsSocketBinding = transport.getDiagnosticsSocketBinding();
        boolean diagnostics = (diagnosticsSocketBinding != null);
        properties.put("enable_diagnostics", String.valueOf(diagnostics));
        if (diagnostics) {
            configureMulticastSocket(introspector, protocol, "diagnostics_addr", "diagnostics_port", diagnosticsSocketBinding);
        }

        stack.add(protocol);

        final Class<? extends TP> transportClass = introspector.getProtocolClass().asSubclass(TP.class);
        PrivilegedExceptionAction<TP> action = transportClass::newInstance;
        try {
            stack.addAll(createProtocols(this.configuration, WildFlySecurityManager.doChecked(action).isMulticastCapable()));
        } catch (PrivilegedActionException e) {
            throw new IllegalStateException(e.getCause());
        }

        return stack;
    }
776692
@Override
  public OperationHandle getCatalogs(SessionHandle sessionHandle) throws HiveSQLException {
    try {
      TGetCatalogsReq req = new TGetCatalogsReq(sessionHandle.toTSessionHandle());
      TGetCatalogsResp resp = cliService.GetCatalogs(req);
      checkStatus(resp.getStatus());
      TProtocolVersion protocol = sessionHandle.getProtocolVersion();
      return new OperationHandle(resp.getOperationHandle(), protocol);
    } catch (HiveSQLException e) {
      throw e;
    } catch (Exception e) {
      throw new HiveSQLException(e);
    }
  }
1277758
public function get_option($config = '') {
        global $DB;
        $cache = cache::make('core', 'repositories');
        if (($entries = $cache->get('ops:'. $this->id)) === false) {
            $entries = $DB->get_records('repository_instance_config', array('instanceid' => $this->id));
            $cache->set('ops:'. $this->id, $entries);
        }

        $ret = array();
        foreach($entries as $entry) {
            $ret[$entry->name] = $entry->value;
        }

        if (!empty($config)) {
            if (isset($ret[$config])) {
                return $ret[$config];
            } else {
                return null;
            }
        } else {
            return $ret;
        }
    }
790536
@Override
  public GetInfoValue getInfo(SessionHandle sessionHandle, GetInfoType getInfoType)
      throws HiveSQLException {
    GetInfoValue infoValue = sessionManager.getSession(sessionHandle)
        .getInfo(getInfoType);
    LOG.debug(sessionHandle + ": getInfo()");
    return infoValue;
  }
234536
public ServerGroup getServerGroup(int id, int profileId) throws Exception {
        PreparedStatement queryStatement = null;
        ResultSet results = null;

        if (id == 0) {
            return new ServerGroup(0, "Default", profileId);
        }

        try (Connection sqlConnection = sqlService.getConnection()) {
            queryStatement = sqlConnection.prepareStatement(
                "SELECT * FROM " + Constants.DB_TABLE_SERVER_GROUPS +
                    " WHERE " + Constants.GENERIC_ID + " = ?"
            );
            queryStatement.setInt(1, id);
            results = queryStatement.executeQuery();
            if (results.next()) {
                ServerGroup curGroup = new ServerGroup(results.getInt(Constants.GENERIC_ID),
                                                       results.getString(Constants.GENERIC_NAME),
                                                       results.getInt(Constants.GENERIC_PROFILE_ID));
                return curGroup;
            }
            logger.info("Did not find the ID: {}", id);
        } catch (SQLException e) {
            throw e;
        } finally {
            try {
                if (results != null) {
                    results.close();
                }
            } catch (Exception e) {
            }
            try {
                if (queryStatement != null) {
                    queryStatement.close();
                }
            } catch (Exception e) {
            }
        }
        return null;
    }
697728
public static String getPrimaryGroupName(String userName, AlluxioConfiguration conf)
      throws IOException {
    List<String> groups = getGroups(userName, conf);
    return (groups != null && groups.size() > 0) ? groups.get(0) : "";
  }
1200193
public synchronized String getDelegationTokenFromMetaStore(String owner)
      throws HiveSQLException, UnsupportedOperationException, LoginException, IOException {
    if (!hiveConf.getBoolVar(HiveConf.ConfVars.METASTORE_USE_THRIFT_SASL) ||
        !hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_SERVER2_ENABLE_DOAS)) {
      throw new UnsupportedOperationException(
          "delegation token is can only be obtained for a secure remote metastore");
    }

    try {
      Hive.closeCurrent();
      return Hive.get(hiveConf).getDelegationToken(owner, owner);
    } catch (HiveException e) {
      if (e.getCause() instanceof UnsupportedOperationException) {
        throw (UnsupportedOperationException)e.getCause();
      } else {
        throw new HiveSQLException("Error connect metastore to setup impersonation", e);
      }
    }
  }
420632
@SuppressWarnings("unchecked")
    @Override
	public <T extends ApiUser> List<T> getUsersInGroup(String groupId) {
	    Collection<User> sfsUsers = getZone().getUsersInGroup(groupId);
	    List<T> anwser = new ArrayList<>();
	    for(User sfsUser : sfsUsers)
	        if(sfsUser.containsProperty(APIKey.USER))
	            anwser.add((T) sfsUser.getProperty(APIKey.USER));
	    return anwser;
	}
227639
@Override
  public UserGroupInformation getProxiedUser(final Props userProp)
      throws HadoopSecurityManagerException {
    final String userToProxy = verifySecureProperty(userProp, JobProperties.USER_TO_PROXY);
    final UserGroupInformation user = getProxiedUser(userToProxy);
    if (user == null) {
      throw new HadoopSecurityManagerException(
          "Proxy as any user in unsecured grid is not supported!");
    }
    return user;
  }
566994
public static EventLoopGroup getServerBossEventLoopGroup(ServerTransportConfig config) {
        String type = config.getProtocolType();
        EventLoopGroup bossGroup = serverBossGroups.get(type);
        if (bossGroup == null) {
            synchronized (NettyHelper.class) {
                bossGroup = serverBossGroups.get(config.getProtocolType());
                if (bossGroup == null) {
                    int bossThreads = config.getBossThreads();
                    bossThreads = bossThreads <= 0 ? Math.max(4, SystemInfo.getCpuCores() / 2) : bossThreads;
                    NamedThreadFactory threadName =
                            new NamedThreadFactory("SEV-BOSS-" + config.getPort(), config.isDaemon());
                    bossGroup = config.isUseEpoll() ?
                        new EpollEventLoopGroup(bossThreads, threadName) :
                        new NioEventLoopGroup(bossThreads, threadName);
                    serverBossGroups.put(type, bossGroup);
                    refCounter.putIfAbsent(bossGroup, new AtomicInteger(0));
                }
            }
        }
        refCounter.get(bossGroup).incrementAndGet();
        return bossGroup;
    }
1333800
public static StatusGroup get(final UUID _uuid)
        throws CacheReloadException
    {
        final Cache<UUID, StatusGroup> cache = InfinispanCache.get().<UUID, StatusGroup>getCache(Status.UUIDCACHE4GRP);
        if (!cache.containsKey(_uuid)) {
            Status.getStatusGroupFromDB(Status.SQL_UUID4GRP, String.valueOf(_uuid));
        }
        return cache.get(_uuid);
    }