本文整理汇总了Java中org.apache.hadoop.yarn.security.client.ClientToAMTokenSelector类的典型用法代码示例。如果您正苦于以下问题:Java ClientToAMTokenSelector类的具体用法?Java ClientToAMTokenSelector怎么用?Java ClientToAMTokenSelector使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ClientToAMTokenSelector类属于org.apache.hadoop.yarn.security.client包,在下文中一共展示了ClientToAMTokenSelector类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTokenInfo
import org.apache.hadoop.yarn.security.client.ClientToAMTokenSelector; //导入依赖的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;
}
};
}
示例2: getTokenInfo
import org.apache.hadoop.yarn.security.client.ClientToAMTokenSelector; //导入依赖的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;
}
};
}
示例3: recoverAppAttemptTokens
import org.apache.hadoop.yarn.security.client.ClientToAMTokenSelector; //导入依赖的package包/类
private void recoverAppAttemptTokens(Credentials appAttemptTokens) {
if (appAttemptTokens == null) {
return;
}
if (UserGroupInformation.isSecurityEnabled()) {
ClientToAMTokenSelector clientToAMTokenSelector =
new ClientToAMTokenSelector();
this.clientToAMToken =
clientToAMTokenSelector.selectToken(new Text(),
appAttemptTokens.getAllTokens());
}
// Only one AMRMToken is stored per-attempt, so this should be fine. Can't
// use TokenSelector as service may change - think fail-over.
this.amrmToken =
(Token<AMRMTokenIdentifier>) appAttemptTokens
.getToken(RMStateStore.AM_RM_TOKEN_SERVICE);
// For now, no need to populate tokens back to AMRMTokenSecretManager,
// because running attempts are rebooted. Later in work-preserve restart,
// we'll create NEW->RUNNING transition in which the restored tokens will be
// added to the secret manager
}
示例4: getTokenInfo
import org.apache.hadoop.yarn.security.client.ClientToAMTokenSelector; //导入依赖的package包/类
@Override
public TokenInfo getTokenInfo(Class<?> protocol, Configuration conf) {
if (!protocol.equals(SliderClusterProtocolPB.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;
}
@Override
public String toString() {
return "SliderClusterProtocolPB token info";
}
};
}
示例5: getTokenInfo
import org.apache.hadoop.yarn.security.client.ClientToAMTokenSelector; //导入依赖的package包/类
@Override
public TokenInfo getTokenInfo(Class<?> protocol, Configuration conf) {
if (!protocol.equals(DAGClientAMProtocolBlockingPB.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;
}
};
}