- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.hadoop.yarn.client.api.YarnClient.getApplicationReport()
方法的一些代码示例,展示了YarnClient.getApplicationReport()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YarnClient.getApplicationReport()
方法的具体详情如下:
包路径:org.apache.hadoop.yarn.client.api.YarnClient
类名称:YarnClient
方法名:getApplicationReport
[英]Get a report of the given Application.
In secure mode, YARN
verifies access to the application, queue etc. before accepting the request.
If the user does not have VIEW_APP
access then the following fields in the report will be set to stubbed values:
代码示例来源:origin: Qihoo360/XLearning
private static ApplicationReport getApplicationReport(ApplicationId appId, YarnClient yarnClient)
throws YarnException, IOException {
return yarnClient.getApplicationReport(appId);
}
代码示例来源:origin: apache/flink
private void tryRetrieveAndLogApplicationReport(YarnClient yarnClient, ApplicationId yarnApplicationId) {
ApplicationReport applicationReport;
try {
applicationReport = yarnClient.getApplicationReport(yarnApplicationId);
} catch (YarnException | IOException e) {
LOG.info("Could not log the final application report.", e);
applicationReport = null;
}
if (applicationReport != null) {
logApplicationReport(applicationReport);
}
}
代码示例来源:origin: apache/drill
public ApplicationReport getAppReport() throws YarnClientException {
try {
return yarnClient.getApplicationReport(appId);
} catch (YarnException | IOException e) {
throw new YarnClientException("Get application report failed", e);
}
}
代码示例来源:origin: apache/incubator-gobblin
@Override
public void run() {
try {
eventBus.post(new ApplicationReportArrivalEvent(yarnClient.getApplicationReport(applicationId.get())));
} catch (YarnException | IOException e) {
LOGGER.error("Failed to get application report for Gobblin Yarn application " + applicationId.get(), e);
eventBus.post(new GetApplicationReportFailureEvent(e));
}
}
}, 0, this.appReportIntervalMinutes, TimeUnit.MINUTES);
代码示例来源:origin: apache/flink
private void updateApplicationStatus() {
if (yarnClient.isInState(Service.STATE.STARTED)) {
final ApplicationReport applicationReport;
try {
applicationReport = yarnClient.getApplicationReport(yarnApplicationId);
} catch (Exception e) {
LOG.info("Could not retrieve the Yarn application report for {}.", yarnApplicationId);
applicationStatus = ApplicationStatus.UNKNOWN;
return;
}
YarnApplicationState yarnApplicationState = applicationReport.getYarnApplicationState();
if (yarnApplicationState == YarnApplicationState.FAILED || yarnApplicationState == YarnApplicationState.KILLED) {
applicationStatus = ApplicationStatus.FAILED;
} else {
applicationStatus = ApplicationStatus.SUCCEEDED;
}
} else {
LOG.info("Yarn client is no longer in state STARTED. Stopping the Yarn application status monitor.");
applicationStatusUpdateFuture.cancel(false);
}
}
}
代码示例来源:origin: apache/hive
public boolean isApplicationAccepted(HiveConf conf, String applicationId) {
if (applicationId == null) {
return false;
}
YarnClient yarnClient = null;
try {
LOG.info("Trying to find " + applicationId);
ApplicationId appId = getApplicationIDFromString(applicationId);
yarnClient = YarnClient.createYarnClient();
yarnClient.init(conf);
yarnClient.start();
ApplicationReport appReport = yarnClient.getApplicationReport(appId);
return appReport != null && appReport.getYarnApplicationState() == YarnApplicationState.ACCEPTED;
} catch (Exception ex) {
LOG.error("Failed getting application status for: " + applicationId + ": " + ex, ex);
return false;
} finally {
if (yarnClient != null) {
try {
yarnClient.stop();
} catch (Exception ex) {
LOG.error("Failed to stop yarn client: " + ex, ex);
}
}
}
}
}
代码示例来源:origin: apache/flink
final ApplicationReport appReport = yarnClient.getApplicationReport(applicationId);
代码示例来源:origin: apache/incubator-gobblin
@Test(enabled=false, groups = { "disabledOnTravis" }, dependsOnMethods = "testSetupAndSubmitApplication")
public void testGetReconnectableApplicationId() throws Exception {
Assert.assertEquals(this.gobblinYarnAppLauncher.getReconnectableApplicationId().get(), this.applicationId);
this.yarnClient.killApplication(this.applicationId);
Assert.assertEquals(yarnClient.getApplicationReport(applicationId).getYarnApplicationState(),
YarnApplicationState.KILLED, "Application not killed");
// takes some time for kill to take effect and app master to go down
Thread.sleep(5000);
}
代码示例来源:origin: apache/hive
public static boolean isApplicationAccepted(HiveConf conf, String applicationId) {
if (applicationId == null) {
return false;
}
YarnClient yarnClient = null;
try {
ApplicationId appId = getApplicationIDFromString(applicationId);
yarnClient = YarnClient.createYarnClient();
yarnClient.init(conf);
yarnClient.start();
ApplicationReport appReport = yarnClient.getApplicationReport(appId);
return appReport != null && appReport.getYarnApplicationState() == YarnApplicationState.ACCEPTED;
} catch (Exception ex) {
LOG.error("Failed getting application status for: " + applicationId + ": " + ex, ex);
return false;
} finally {
if (yarnClient != null) {
try {
yarnClient.stop();
} catch (Exception ex) {
LOG.error("Failed to stop yarn client: " + ex, ex);
}
}
}
}
代码示例来源:origin: apache/flink
loop: while (true) {
try {
report = yarnClient.getApplicationReport(appId);
} catch (IOException e) {
throw new YarnDeploymentException("Failed to deploy the cluster.", e);
代码示例来源:origin: apache/hive
appReport = serviceClient.getYarnClient().getApplicationReport(appId);
if (timeoutMs == 0) {
代码示例来源:origin: apache/incubator-gobblin
/**
* For some yet unknown reason, hostname resolution for the ResourceManager in {@link MiniYARNCluster}
* has some issue that causes the {@link YarnClient} not be able to connect and submit the Gobblin Yarn
* application successfully. This works fine on local machine though. So disabling this and the test
* below that depends on it on Travis-CI.
*/
@Test(enabled=false, groups = { "disabledOnTravis" }, dependsOnMethods = "testCreateHelixCluster")
public void testSetupAndSubmitApplication() throws Exception {
this.gobblinYarnAppLauncher.startYarnClient();
this.applicationId = this.gobblinYarnAppLauncher.setupAndSubmitApplication();
int i;
// wait for application to come up
for (i = 0; i < 120; i++) {
if (yarnClient.getApplicationReport(applicationId).getYarnApplicationState() ==
YarnApplicationState.RUNNING) {
break;
}
Thread.sleep(1000);
}
Assert.assertTrue(i < 120, "timed out waiting for RUNNING state");
// wait another 10 seconds and check state again to make sure that the application stays up
Thread.sleep(10000);
Assert.assertEquals(yarnClient.getApplicationReport(applicationId).getYarnApplicationState(),
YarnApplicationState.RUNNING, "Application may have aborted");
}
代码示例来源:origin: alibaba/jstorm
ApplicationReport report = jstormClientContext.yarnClient.getApplicationReport(appId);
代码示例来源:origin: apache/drill
@Override
public void start(CallbackHandler resourceCallback,
org.apache.hadoop.yarn.client.api.async.NMClientAsync.CallbackHandler nodeCallback ) {
conf = new YarnConfiguration();
resourceMgr = AMRMClientAsync.createAMRMClientAsync(pollPeriodMs, resourceCallback);
resourceMgr.init(conf);
resourceMgr.start();
// Create the asynchronous node manager client
nodeMgr = NMClientAsync.createNMClientAsync(nodeCallback);
nodeMgr.init(conf);
nodeMgr.start();
client = YarnClient.createYarnClient();
client.init(conf);
client.start();
String appIdStr = System.getenv(DrillOnYarnConfig.APP_ID_ENV_VAR);
if (appIdStr != null) {
appId = ConverterUtils.toApplicationId(appIdStr);
try {
appReport = client.getApplicationReport(appId);
} catch (YarnException | IOException e) {
LOG.error(
"Failed to get YARN applicaiton report for App ID: " + appIdStr, e);
}
}
}
代码示例来源:origin: apache/ignite
ApplicationReport appReport = yarnClient.getApplicationReport(appId);
YarnApplicationState appState = appReport.getYarnApplicationState();
TimeUnit.SECONDS.sleep(1L);
appReport = yarnClient.getApplicationReport(appId);
代码示例来源:origin: apache/flink
private void waitForApplicationAttempt(final ApplicationId applicationId, final int attemptId) throws Exception {
final YarnClient yarnClient = getYarnClient();
checkState(yarnClient != null, "yarnClient must be initialized");
waitUntilCondition(() -> {
final ApplicationReport applicationReport = yarnClient.getApplicationReport(applicationId);
return applicationReport.getCurrentApplicationAttemptId().getAttemptId() >= attemptId;
}, Deadline.fromNow(TIMEOUT));
}
代码示例来源:origin: apache/incubator-gobblin
ApplicationReport applicationReport = this.yarnClient.getApplicationReport(applicationId);
LOGGER.info("Application Name: " + applicationReport.getName());
LOGGER.info("Application Tracking URL: " + applicationReport.getTrackingUrl());
代码示例来源:origin: apache/flink
final ApplicationReport applicationReport = yarnClient.getApplicationReport(clusterId);
代码示例来源:origin: uber/AthenaX
private ApplicationReport poll() throws IOException, YarnException {
ApplicationReport report;
report = yarnClient.getApplicationReport(appId);
YarnApplicationState appState = report.getYarnApplicationState();
LOG.debug("Application State: {}", appState);
代码示例来源:origin: uber/AthenaX
public static YarnApplicationState pollFinishedApplicationState(YarnClient client, ApplicationId appId)
throws IOException, YarnException, InterruptedException {
EnumSet<YarnApplicationState> finishedState = EnumSet.of(FINISHED, KILLED, FAILED);
while (true) {
ApplicationReport report = client.getApplicationReport(appId);
YarnApplicationState state = report.getYarnApplicationState();
if (finishedState.contains(state)) {
return state;
} else {
Thread.sleep(250);
}
}
}
本文整理了Java中org.springframework.yarn.client.YarnClient.getApplicationReport()方法的一些代码示例,展示了YarnClient.g
本文整理了Java中org.apache.hadoop.yarn.client.api.YarnClient.getApplicationReport()方法的一些代码示例,展示了YarnClient
本文整理了Java中org.apache.hadoop.yarn.client.api.impl.YarnClientImpl.getApplicationReport()方法的一些代码示例,展示了Y
我是一名优秀的程序员,十分优秀!