org.apache.hadoop.hive.ql.exec.Utilities.getAclStringWithHiveModification()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(93)

本文整理了Java中org.apache.hadoop.hive.ql.exec.Utilities.getAclStringWithHiveModification()方法的一些代码示例,展示了Utilities.getAclStringWithHiveModification()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utilities.getAclStringWithHiveModification()方法的具体详情如下:
包路径:org.apache.hadoop.hive.ql.exec.Utilities
类名称:Utilities
方法名:getAclStringWithHiveModification

Utilities.getAclStringWithHiveModification介绍

暂无

代码示例

代码示例来源:origin: apache/hive

private void setupSessionAcls(Configuration tezConf, HiveConf hiveConf) throws
  IOException {
 // TODO: De-link from SessionState. A TezSession can be linked to different Hive Sessions via the pool.
 String user = SessionState.getUserFromAuthenticator();
 UserGroupInformation loginUserUgi = UserGroupInformation.getLoginUser();
 String loginUser =
   loginUserUgi == null ? null : loginUserUgi.getShortUserName();
 boolean addHs2User =
   HiveConf.getBoolVar(hiveConf, ConfVars.HIVETEZHS2USERACCESS);
 String viewStr = Utilities.getAclStringWithHiveModification(tezConf,
     TezConfiguration.TEZ_AM_VIEW_ACLS, addHs2User, user, loginUser);
 String modifyStr = Utilities.getAclStringWithHiveModification(tezConf,
     TezConfiguration.TEZ_AM_MODIFY_ACLS, addHs2User, user, loginUser);
 if (LOG.isDebugEnabled()) {
  // TODO: De-link from SessionState. A TezSession can be linked to different Hive Sessions via the pool.
  LOG.debug(
    "Setting Tez Session access for sessionId={} with viewAclString={}, modifyStr={}",
    SessionState.get().getSessionId(), viewStr, modifyStr);
 }
 tezConf.set(TezConfiguration.TEZ_AM_VIEW_ACLS, viewStr);
 tezConf.set(TezConfiguration.TEZ_AM_MODIFY_ACLS, modifyStr);
}

代码示例来源:origin: apache/drill

private void setupSessionAcls(Configuration tezConf, HiveConf hiveConf) throws
  IOException {
 String user = SessionState.getUserFromAuthenticator();
 UserGroupInformation loginUserUgi = UserGroupInformation.getLoginUser();
 String loginUser =
   loginUserUgi == null ? null : loginUserUgi.getShortUserName();
 boolean addHs2User =
   HiveConf.getBoolVar(hiveConf, ConfVars.HIVETEZHS2USERACCESS);
 String viewStr = Utilities.getAclStringWithHiveModification(tezConf,
     TezConfiguration.TEZ_AM_VIEW_ACLS, addHs2User, user, loginUser);
 String modifyStr = Utilities.getAclStringWithHiveModification(tezConf,
     TezConfiguration.TEZ_AM_MODIFY_ACLS, addHs2User, user, loginUser);
 if (LOG.isDebugEnabled()) {
  LOG.debug(
    "Setting Tez Session access for sessionId={} with viewAclString={}, modifyStr={}",
    SessionState.get().getSessionId(), viewStr, modifyStr);
 }
 tezConf.set(TezConfiguration.TEZ_AM_VIEW_ACLS, viewStr);
 tezConf.set(TezConfiguration.TEZ_AM_MODIFY_ACLS, modifyStr);
}

代码示例来源:origin: apache/hive

private static void setAccessControlsForCurrentUser(DAG dag, String queryId,
                          Configuration conf) throws
  IOException {
 String user = SessionState.getUserFromAuthenticator();
 UserGroupInformation loginUserUgi = UserGroupInformation.getLoginUser();
 String loginUser =
   loginUserUgi == null ? null : loginUserUgi.getShortUserName();
 boolean addHs2User =
   HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVETEZHS2USERACCESS);
 // Temporarily re-using the TEZ AM View ACLs property for individual dag access control.
 // Hive may want to setup it's own parameters if it wants to control per dag access.
 // Setting the tez-property per dag should work for now.
 String viewStr = Utilities.getAclStringWithHiveModification(conf,
     TezConfiguration.TEZ_AM_VIEW_ACLS, addHs2User, user, loginUser);
 String modifyStr = Utilities.getAclStringWithHiveModification(conf,
     TezConfiguration.TEZ_AM_MODIFY_ACLS, addHs2User, user, loginUser);
 if (LOG.isDebugEnabled()) {
  LOG.debug("Setting Tez DAG access for queryId={} with viewAclString={}, modifyStr={}",
    queryId, viewStr, modifyStr);
 }
 // set permissions for current user on DAG
 DAGAccessControls ac = new DAGAccessControls(viewStr, modifyStr);
 dag.setAccessControls(ac);
}

代码示例来源:origin: apache/drill

private static void setAccessControlsForCurrentUser(DAG dag, String queryId,
                          Configuration conf) throws
  IOException {
 String user = SessionState.getUserFromAuthenticator();
 UserGroupInformation loginUserUgi = UserGroupInformation.getLoginUser();
 String loginUser =
   loginUserUgi == null ? null : loginUserUgi.getShortUserName();
 boolean addHs2User =
   HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVETEZHS2USERACCESS);
 // Temporarily re-using the TEZ AM View ACLs property for individual dag access control.
 // Hive may want to setup it's own parameters if it wants to control per dag access.
 // Setting the tez-property per dag should work for now.
 String viewStr = Utilities.getAclStringWithHiveModification(conf,
     TezConfiguration.TEZ_AM_VIEW_ACLS, addHs2User, user, loginUser);
 String modifyStr = Utilities.getAclStringWithHiveModification(conf,
     TezConfiguration.TEZ_AM_MODIFY_ACLS, addHs2User, user, loginUser);
 if (LOG.isDebugEnabled()) {
  LOG.debug("Setting Tez DAG access for queryId={} with viewAclString={}, modifyStr={}",
    queryId, viewStr, modifyStr);
 }
 // set permissions for current user on DAG
 DAGAccessControls ac = new DAGAccessControls(viewStr, modifyStr);
 dag.setAccessControls(ac);
}

代码示例来源:origin: apache/hive

domainReaders = Utilities.getAclStringWithHiveModification(hookContext.getConf(),
  TezConfiguration.TEZ_AM_VIEW_ACLS, addHs2User, requestuser, loginUser);
domainWriters = Utilities.getAclStringWithHiveModification(hookContext.getConf(),
  TezConfiguration.TEZ_AM_MODIFY_ACLS, addHs2User, requestuser, loginUser);
SessionState.get().setATSDomainId(domainId);

代码示例来源:origin: apache/drill

domainReaders = Utilities.getAclStringWithHiveModification(hookContext.getConf(),
  TezConfiguration.TEZ_AM_VIEW_ACLS, addHs2User, requestuser, loginUser);
domainWriters = Utilities.getAclStringWithHiveModification(hookContext.getConf(),
  TezConfiguration.TEZ_AM_MODIFY_ACLS, addHs2User, requestuser, loginUser);
SessionState.get().setATSDomainId(domainId);

相关文章

Utilities类方法