本文整理了Java中org.apache.hadoop.yarn.ipc.YarnRPC.getProxy()
方法的一些代码示例,展示了YarnRPC.getProxy()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YarnRPC.getProxy()
方法的具体详情如下:
包路径:org.apache.hadoop.yarn.ipc.YarnRPC
类名称:YarnRPC
方法名:getProxy
暂无
代码示例来源:origin: apache/incubator-gobblin
private static void getJhToken(Configuration conf, Credentials cred) throws IOException {
YarnRPC rpc = YarnRPC.create(conf);
final String serviceAddr = conf.get(JHAdminConfig.MR_HISTORY_ADDRESS);
LOG.debug("Connecting to HistoryServer at: " + serviceAddr);
HSClientProtocol hsProxy =
(HSClientProtocol) rpc.getProxy(HSClientProtocol.class, NetUtils.createSocketAddr(serviceAddr), conf);
LOG.info("Pre-fetching JH token from job history server");
Token<?> jhToken = null;
try {
jhToken = getDelegationTokenFromHS(hsProxy, conf);
} catch (Exception exc) {
throw new IOException("Failed to fetch JH token.", exc);
}
if (jhToken == null) {
LOG.error("getDelegationTokenFromHS() returned null");
throw new IOException("Unable to fetch JH token.");
}
LOG.info("Created JH token: " + jhToken.toString());
LOG.info("Token kind: " + jhToken.getKind());
LOG.info("Token id: " + Arrays.toString(jhToken.getIdentifier()));
LOG.info("Token service: " + jhToken.getService());
cred.addToken(jhToken.getService(), jhToken);
}
代码示例来源:origin: org.apache.hadoop/hadoop-mapreduce-client-common
@Override
public MRClientProtocol run() {
return (MRClientProtocol) rpc.getProxy(HSClientProtocol.class,
hsAddress, conf);
}
});
代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-common
@Override
public T run() {
return (T) rpc.getProxy(protocol, serverAddress, conf);
}
});
代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-common
@Override
public T run() {
return (T) rpc.getProxy(protocol, serverAddress, conf);
}
});
代码示例来源:origin: apache/oozie
@Override
public MRClientProtocol run() {
return (MRClientProtocol) rpc.getProxy(HSClientProtocol.class,
NetUtils.createSocketAddr(serviceAddr), configuration);
}
});
代码示例来源:origin: org.apache.hadoop/hadoop-mapreduce-client-jobclient
@Override
public MRClientProtocol run() {
return (MRClientProtocol) rpc.getProxy(HSClientProtocol.class,
NetUtils.createSocketAddr(serviceAddr), conf);
}
});
代码示例来源:origin: org.apache.hadoop/hadoop-mapreduce-client-jobclient
MRClientProtocol instantiateAMProxy(final InetSocketAddress serviceAddr)
throws IOException {
LOG.trace("Connecting to ApplicationMaster at: " + serviceAddr);
YarnRPC rpc = YarnRPC.create(conf);
MRClientProtocol proxy =
(MRClientProtocol) rpc.getProxy(MRClientProtocol.class,
serviceAddr, conf);
usingAMProxy.set(true);
LOG.trace("Connected to ApplicationMaster at: " + serviceAddr);
return proxy;
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
@Override
public ApplicationClientProtocol run() throws Exception {
return (ApplicationClientProtocol) rpc.getProxy(ApplicationClientProtocol.class,
rmAddress, conf);
}
});
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
@Override
public ApplicationClientProtocol run() throws Exception {
return (ApplicationClientProtocol) rpc.getProxy(
ApplicationClientProtocol.class, rmAddress, conf);
}
});
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
@Override
public ApplicationClientProtocol run() throws Exception {
return (ApplicationClientProtocol) rpc.getProxy(ApplicationClientProtocol.class,
rmAddress, conf);
}
});
代码示例来源:origin: com.github.jiayuhan-it/hadoop-mapreduce-client-jobclient
@Override
public MRClientProtocol run() {
return (MRClientProtocol) rpc.getProxy(HSClientProtocol.class,
NetUtils.createSocketAddr(serviceAddr), conf);
}
});
代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-nodemanager
LocalizationProtocol getProxy(final InetSocketAddress nmAddr) {
YarnRPC rpc = YarnRPC.create(conf);
return (LocalizationProtocol)
rpc.getProxy(LocalizationProtocol.class, nmAddr, conf);
}
代码示例来源:origin: ch.cern.hadoop/hadoop-mapreduce-client-jobclient
@Override
public MRClientProtocol run() {
return (MRClientProtocol) rpc.getProxy(HSClientProtocol.class,
hsAddress, conf);
}
});
代码示例来源:origin: com.github.jiayuhan-it/hadoop-mapreduce-client-jobclient
MRClientProtocol instantiateAMProxy(final InetSocketAddress serviceAddr)
throws IOException {
LOG.trace("Connecting to ApplicationMaster at: " + serviceAddr);
YarnRPC rpc = YarnRPC.create(conf);
MRClientProtocol proxy =
(MRClientProtocol) rpc.getProxy(MRClientProtocol.class,
serviceAddr, conf);
usingAMProxy.set(true);
LOG.trace("Connected to ApplicationMaster at: " + serviceAddr);
return proxy;
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-nodemanager
private SCMUploaderProtocol createSCMClient(Configuration conf) {
YarnRPC rpc = YarnRPC.create(conf);
InetSocketAddress scmAddress =
conf.getSocketAddr(YarnConfiguration.SCM_UPLOADER_SERVER_ADDRESS,
YarnConfiguration.DEFAULT_SCM_UPLOADER_SERVER_ADDRESS,
YarnConfiguration.DEFAULT_SCM_UPLOADER_SERVER_PORT);
return (SCMUploaderProtocol)rpc.getProxy(
SCMUploaderProtocol.class, scmAddress, conf);
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-client
@VisibleForTesting
protected ClientSCMProtocol createClientProxy() {
YarnRPC rpc = YarnRPC.create(getConfig());
return (ClientSCMProtocol) rpc.getProxy(ClientSCMProtocol.class,
this.scmAddress, getConfig());
}
代码示例来源:origin: io.hops/hadoop-yarn-client
@VisibleForTesting
protected ClientSCMProtocol createClientProxy() {
YarnRPC rpc = YarnRPC.create(getConfig());
return (ClientSCMProtocol) rpc.getProxy(ClientSCMProtocol.class,
this.scmAddress, getConfig());
}
代码示例来源:origin: linkedin/TonY
private static <T> T getProxy(final Configuration conf, final YarnRPC rpc, final UserGroupInformation user,
final InetSocketAddress serverAddress, final Class<T> protocol, RetryPolicy retryPolicy) {
YarnClient client = YarnClient.createYarnClient();
client.init(conf);
client.start();
T proxy = user.doAs((PrivilegedAction<T>) () -> (T) rpc.getProxy(protocol, serverAddress, conf));
return (T) RetryProxy.create(protocol, proxy, retryPolicy);
}
代码示例来源:origin: org.apache.twill/twill-yarn
/**
* Helper to connect to container manager (node manager).
*/
private ContainerManager connectContainerManager(Container container) {
String cmIpPortStr = String.format("%s:%d", container.getNodeId().getHost(), container.getNodeId().getPort());
InetSocketAddress cmAddress = NetUtils.createSocketAddr(cmIpPortStr);
return ((ContainerManager) yarnRPC.getProxy(ContainerManager.class, cmAddress, yarnConf));
}
代码示例来源:origin: ch.cern.hadoop/hadoop-mapreduce-client-jobclient
private HSClientProtocol instantiateHistoryProxy() {
final String serviceAddr =
mrCluster.getConfig().get(JHAdminConfig.MR_HISTORY_ADDRESS);
final YarnRPC rpc = YarnRPC.create(conf);
HSClientProtocol historyClient =
(HSClientProtocol) rpc.getProxy(HSClientProtocol.class,
NetUtils.createSocketAddr(serviceAddr), mrCluster.getConfig());
return historyClient;
}
}
内容来源于网络,如有侵权,请联系作者删除!