本文整理汇总了Java中org.apache.hadoop.security.token.TokenSelector类的典型用法代码示例。如果您正苦于以下问题:Java TokenSelector类的具体用法?Java TokenSelector怎么用?Java TokenSelector使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TokenSelector类属于org.apache.hadoop.security.token包,在下文中一共展示了TokenSelector类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getServerToken
import org.apache.hadoop.security.token.TokenSelector; //导入依赖的package包/类
/**
* Try to locate the required token for the server.
*
* @param authType of the SASL client
* @return Token for server, or null if no token available
* @throws IOException - token selector cannot be instantiated
*/
private Token<?> getServerToken(SaslAuth authType) throws IOException {
TokenInfo tokenInfo = SecurityUtil.getTokenInfo(protocol, conf);
LOG.debug("Get token info proto:" + protocol + " info:" + tokenInfo);
if (tokenInfo == null) { // protocol has no support for tokens
return null;
}
TokenSelector<?> tokenSelector = null;
try {
tokenSelector = tokenInfo.value().newInstance();
} catch (InstantiationException | IllegalAccessException e) {
throw new IOException(e.toString(), e);
}
return tokenSelector.selectToken(
SecurityUtil.buildTokenService(serverAddr), ugi.getTokens());
}
示例2: getTokenInfo
import org.apache.hadoop.security.token.TokenSelector; //导入依赖的package包/类
@Override
public TokenInfo getTokenInfo(Class<?> protocol, Configuration conf) {
if (!protocol
.equals(ContainerManagementProtocolPB.class)) {
return null;
}
return new TokenInfo() {
@Override
public Class<? extends Annotation> annotationType() {
return null;
}
@Override
public Class<? extends TokenSelector<? extends TokenIdentifier>>
value() {
return NMTokenSelector.class;
}
};
}
示例3: getTokenInfo
import org.apache.hadoop.security.token.TokenSelector; //导入依赖的package包/类
@Override
public TokenInfo getTokenInfo(Class<?> protocol, Configuration conf) {
if (!protocol.equals(ApplicationMasterProtocolPB.class)) {
return null;
}
return new TokenInfo() {
@Override
public Class<? extends Annotation> annotationType() {
return null;
}
@Override
public Class<? extends TokenSelector<? extends TokenIdentifier>>
value() {
return AMRMTokenSelector.class;
}
};
}
示例4: getTokenInfo
import org.apache.hadoop.security.token.TokenSelector; //导入依赖的package包/类
@Override
public TokenInfo getTokenInfo(Class<?> protocol, Configuration conf) {
if (!protocol
.equals(ApplicationClientProtocolPB.class)) {
return null;
}
return new TokenInfo() {
@Override
public Class<? extends Annotation> annotationType() {
return null;
}
@Override
public Class<? extends TokenSelector<? extends TokenIdentifier>>
value() {
return RMDelegationTokenSelector.class;
}
};
}
示例5: getTokenInfo
import org.apache.hadoop.security.token.TokenSelector; //导入依赖的package包/类
@Override
public TokenInfo getTokenInfo(Class<?> protocol, Configuration conf) {
if (!protocol
.equals(ApplicationHistoryProtocolPB.class)) {
return null;
}
return new TokenInfo() {
@Override
public Class<? extends Annotation> annotationType() {
return null;
}
@Override
public Class<? extends TokenSelector<? extends TokenIdentifier>>
value() {
return TimelineDelegationTokenSelector.class;
}
};
}
示例6: getTokenInfo
import org.apache.hadoop.security.token.TokenSelector; //导入依赖的package包/类
@Override
public TokenInfo getTokenInfo(Class<?> protocol, Configuration conf) {
if (!protocol
.equals(LocalizationProtocolPB.class)) {
return null;
}
return new TokenInfo() {
@Override
public Class<? extends Annotation> annotationType() {
return null;
}
@Override
public Class<? extends TokenSelector<? extends TokenIdentifier>>
value() {
LOG.debug("Using localizerTokenSecurityInfo");
return LocalizerTokenSelector.class;
}
};
}
示例7: getTokenInfo
import org.apache.hadoop.security.token.TokenSelector; //导入依赖的package包/类
@Override
public TokenInfo getTokenInfo(Class<?> protocol, Configuration conf) {
return new TokenInfo() {
@Override
public Class<? extends Annotation> annotationType() {
return null;
}
@Override
public Class<? extends TokenSelector<? extends TokenIdentifier>>
value() {
return ClientToAMTokenSelector.class;
}
};
}
示例8: getTokenInfo
import org.apache.hadoop.security.token.TokenSelector; //导入依赖的package包/类
@Override
public TokenInfo getTokenInfo(Class<?> protocol, Configuration conf) {
if (!protocol.equals(MRClientProtocolPB.class)) {
return null;
}
return new TokenInfo() {
@Override
public Class<? extends Annotation> annotationType() {
return null;
}
@Override
public Class<? extends TokenSelector<? extends TokenIdentifier>>
value() {
return ClientToAMTokenSelector.class;
}
};
}
示例9: getTokenInfo
import org.apache.hadoop.security.token.TokenSelector; //导入依赖的package包/类
@Override
public TokenInfo getTokenInfo(Class<?> protocol, Configuration conf) {
if (!protocol
.equals(HSClientProtocolPB.class)) {
return null;
}
return new TokenInfo() {
@Override
public Class<? extends Annotation> annotationType() {
return null;
}
@Override
public Class<? extends TokenSelector<? extends TokenIdentifier>>
value() {
return ClientHSTokenSelector.class;
}
}; }