本文整理汇总了Java中org.apache.hadoop.yarn.api.records.ApplicationReport.getHost方法的典型用法代码示例。如果您正苦于以下问题:Java ApplicationReport.getHost方法的具体用法?Java ApplicationReport.getHost怎么用?Java ApplicationReport.getHost使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.yarn.api.records.ApplicationReport
的用法示例。
在下文中一共展示了ApplicationReport.getHost方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AppInfo
import org.apache.hadoop.yarn.api.records.ApplicationReport; //导入方法依赖的package包/类
public AppInfo(ApplicationReport app) {
appId = app.getApplicationId().toString();
if (app.getCurrentApplicationAttemptId() != null) {
currentAppAttemptId = app.getCurrentApplicationAttemptId().toString();
}
user = app.getUser();
queue = app.getQueue();
name = app.getName();
type = app.getApplicationType();
host = app.getHost();
rpcPort = app.getRpcPort();
appState = app.getYarnApplicationState();
diagnosticsInfo = app.getDiagnostics();
trackingUrl = app.getTrackingUrl();
originalTrackingUrl = app.getOriginalTrackingUrl();
submittedTime = app.getStartTime();
startedTime = app.getStartTime();
finishedTime = app.getFinishTime();
elapsedTime = Times.elapsed(startedTime, finishedTime);
finalAppStatus = app.getFinalApplicationStatus();
progress = app.getProgress() * 100; // in percent
if (app.getApplicationTags() != null && !app.getApplicationTags().isEmpty()) {
this.applicationTags = CSV_JOINER.join(app.getApplicationTags());
}
}
示例2: getClusterSpec
import org.apache.hadoop.yarn.api.records.ApplicationReport; //导入方法依赖的package包/类
static ClusterSpec getClusterSpec(YarnClient client, ApplicationId appId) throws Exception {
ClusterSpec clusterSpec = ClusterSpec.empty();
ApplicationReport report = client.getApplicationReport(appId);
YarnApplicationState state = report.getYarnApplicationState();
if (state.equals(YarnApplicationState.RUNNING)) {
String hostname = report.getHost();
int port = report.getRpcPort();
TFApplicationRpc rpc = TFApplicationRpcClient.getInstance(hostname, port);
String spec = rpc.getClusterSpec();
if (spec != null) {
clusterSpec = ClusterSpec.fromJsonString(spec);
}
}
return clusterSpec;
}