本文整理了Java中org.apache.hadoop.hive.shims.Utils.getTokenStrForm()
方法的一些代码示例,展示了Utils.getTokenStrForm()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.getTokenStrForm()
方法的具体详情如下:
包路径:org.apache.hadoop.hive.shims.Utils
类名称:Utils
方法名:getTokenStrForm
[英]Get the string form of the token given a token signature. The signature is used as the value of the "service" field in the token for lookup. Ref: AbstractDelegationTokenSelector in Hadoop. If there exists such a token in the token cache (credential store) of the job, the lookup returns that. This is relevant only when running against a "secure" hadoop release The method gets hold of the tokens if they are set up by hadoop - this should happen on the map/reduce tasks if the client added the tokens into hadoop's credential store in the front end during job submission. The method will select the hive delegation token among the set of tokens and return the string form of it
[中]获取给定令牌签名的令牌的字符串形式。签名用作令牌中“服务”字段的值,用于查找。参考:Hadoop中的AbstractDelegationTokenSelector。如果作业的令牌缓存(凭证存储)中存在这样的令牌,则查找将返回该令牌。这仅在针对“安全”hadoop版本运行时才相关。如果令牌是由hadoop设置的,则该方法会获取令牌。如果客户端在作业提交期间将令牌添加到前端的hadoop凭据存储中,则这应该发生在map/reduce任务上。该方法将在一组令牌中选择配置单元委派令牌,并返回其字符串形式
代码示例来源:origin: com.github.hyukjinkwon/hive-jdbc
private String getClientDelegationToken(Map<String, String> jdbcConnConf)
throws SQLException {
String tokenStr = null;
if (JdbcConnectionParams.AUTH_TOKEN.equalsIgnoreCase(jdbcConnConf.get(JdbcConnectionParams.AUTH_TYPE))) {
// check delegation token in job conf if any
try {
tokenStr = org.apache.hadoop.hive.shims.Utils.getTokenStrForm(HiveAuthFactory.HS2_CLIENT_TOKEN);
} catch (IOException e) {
throw new SQLException("Error reading token ", e);
}
}
return tokenStr;
}
代码示例来源:origin: org.spark-project.hive/hive-jdbc
private String getClientDelegationToken(Map<String, String> jdbcConnConf)
throws SQLException {
String tokenStr = null;
if (JdbcConnectionParams.AUTH_TOKEN.equalsIgnoreCase(jdbcConnConf.get(JdbcConnectionParams.AUTH_TYPE))) {
// check delegation token in job conf if any
try {
tokenStr = org.apache.hadoop.hive.shims.Utils.getTokenStrForm(HiveAuthFactory.HS2_CLIENT_TOKEN);
} catch (IOException e) {
throw new SQLException("Error reading token ", e);
}
}
return tokenStr;
}
代码示例来源:origin: org.spark-project.hive/hive-metastore
tokenStrForm = Utils.getTokenStrForm(tokenSig);
if(tokenStrForm != null) {
代码示例来源:origin: com.facebook.presto.hive/hive-apache
tokenStrForm = Utils.getTokenStrForm(tokenSig);
if(tokenStrForm != null) {
内容来源于网络,如有侵权,请联系作者删除!