本文整理匯總了Java中org.apache.hadoop.yarn.api.records.ApplicationReport.getRpcPort方法的典型用法代碼示例。如果您正苦於以下問題:Java ApplicationReport.getRpcPort方法的具體用法?Java ApplicationReport.getRpcPort怎麽用?Java ApplicationReport.getRpcPort使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.hadoop.yarn.api.records.ApplicationReport
的用法示例。
在下文中一共展示了ApplicationReport.getRpcPort方法的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;
}