Java Code Examples for org.apache.hadoop.yarn.api.records.ApplicationReport#setQueue()
The following examples show how to use
org.apache.hadoop.yarn.api.records.ApplicationReport#setQueue() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractYarnClusterTest.java From flink with Apache License 2.0 | 6 votes |
private ApplicationReport createApplicationReport( ApplicationId applicationId, YarnApplicationState yarnApplicationState, FinalApplicationStatus finalApplicationStatus) { ApplicationReport applicationReport = Records.newRecord(ApplicationReport.class); applicationReport.setApplicationId(applicationId); applicationReport.setCurrentApplicationAttemptId(ApplicationAttemptId.newInstance(applicationId, 0)); applicationReport.setUser("user"); applicationReport.setQueue("queue"); applicationReport.setName("name"); applicationReport.setHost("localhost"); applicationReport.setRpcPort(42); applicationReport.setYarnApplicationState(yarnApplicationState); applicationReport.setStartTime(1L); applicationReport.setFinishTime(2L); applicationReport.setFinalApplicationStatus(finalApplicationStatus); applicationReport.setProgress(1.0f); return applicationReport; }
Example 2
Source File: BuilderUtils.java From hadoop with Apache License 2.0 | 5 votes |
public static ApplicationReport newApplicationReport( ApplicationId applicationId, ApplicationAttemptId applicationAttemptId, String user, String queue, String name, String host, int rpcPort, Token clientToAMToken, YarnApplicationState state, String diagnostics, String url, long startTime, long finishTime, FinalApplicationStatus finalStatus, ApplicationResourceUsageReport appResources, String origTrackingUrl, float progress, String appType, Token amRmToken, Set<String> tags) { ApplicationReport report = recordFactory .newRecordInstance(ApplicationReport.class); report.setApplicationId(applicationId); report.setCurrentApplicationAttemptId(applicationAttemptId); report.setUser(user); report.setQueue(queue); report.setName(name); report.setHost(host); report.setRpcPort(rpcPort); report.setClientToAMToken(clientToAMToken); report.setYarnApplicationState(state); report.setDiagnostics(diagnostics); report.setTrackingUrl(url); report.setStartTime(startTime); report.setFinishTime(finishTime); report.setFinalApplicationStatus(finalStatus); report.setApplicationResourceUsageReport(appResources); report.setOriginalTrackingUrl(origTrackingUrl); report.setProgress(progress); report.setApplicationType(appType); report.setAMRMToken(amRmToken); report.setApplicationTags(tags); return report; }
Example 3
Source File: TestClientRedirect.java From hadoop with Apache License 2.0 | 5 votes |
@Override public GetApplicationReportResponse getApplicationReport( GetApplicationReportRequest request) throws IOException { ApplicationId applicationId = request.getApplicationId(); ApplicationReport application = recordFactory .newRecordInstance(ApplicationReport.class); application.setApplicationId(applicationId); application.setFinalApplicationStatus(FinalApplicationStatus.UNDEFINED); if (amRunning) { application.setYarnApplicationState(YarnApplicationState.RUNNING); } else if (amRestarting) { application.setYarnApplicationState(YarnApplicationState.SUBMITTED); } else { application.setYarnApplicationState(YarnApplicationState.FINISHED); application.setFinalApplicationStatus(FinalApplicationStatus.SUCCEEDED); } String[] split = AMHOSTADDRESS.split(":"); application.setHost(split[0]); application.setRpcPort(Integer.parseInt(split[1])); application.setUser("TestClientRedirect-user"); application.setName("N/A"); application.setQueue("N/A"); application.setStartTime(0); application.setFinishTime(0); application.setTrackingUrl("N/A"); application.setDiagnostics("N/A"); GetApplicationReportResponse response = recordFactory .newRecordInstance(GetApplicationReportResponse.class); response.setApplicationReport(application); return response; }
Example 4
Source File: BuilderUtils.java From big-c with Apache License 2.0 | 5 votes |
public static ApplicationReport newApplicationReport( ApplicationId applicationId, ApplicationAttemptId applicationAttemptId, String user, String queue, String name, String host, int rpcPort, Token clientToAMToken, YarnApplicationState state, String diagnostics, String url, long startTime, long finishTime, FinalApplicationStatus finalStatus, ApplicationResourceUsageReport appResources, String origTrackingUrl, float progress, String appType, Token amRmToken, Set<String> tags) { ApplicationReport report = recordFactory .newRecordInstance(ApplicationReport.class); report.setApplicationId(applicationId); report.setCurrentApplicationAttemptId(applicationAttemptId); report.setUser(user); report.setQueue(queue); report.setName(name); report.setHost(host); report.setRpcPort(rpcPort); report.setClientToAMToken(clientToAMToken); report.setYarnApplicationState(state); report.setDiagnostics(diagnostics); report.setTrackingUrl(url); report.setStartTime(startTime); report.setFinishTime(finishTime); report.setFinalApplicationStatus(finalStatus); report.setApplicationResourceUsageReport(appResources); report.setOriginalTrackingUrl(origTrackingUrl); report.setProgress(progress); report.setApplicationType(appType); report.setAMRMToken(amRmToken); report.setApplicationTags(tags); return report; }
Example 5
Source File: TestClientRedirect.java From big-c with Apache License 2.0 | 5 votes |
@Override public GetApplicationReportResponse getApplicationReport( GetApplicationReportRequest request) throws IOException { ApplicationId applicationId = request.getApplicationId(); ApplicationReport application = recordFactory .newRecordInstance(ApplicationReport.class); application.setApplicationId(applicationId); application.setFinalApplicationStatus(FinalApplicationStatus.UNDEFINED); if (amRunning) { application.setYarnApplicationState(YarnApplicationState.RUNNING); } else if (amRestarting) { application.setYarnApplicationState(YarnApplicationState.SUBMITTED); } else { application.setYarnApplicationState(YarnApplicationState.FINISHED); application.setFinalApplicationStatus(FinalApplicationStatus.SUCCEEDED); } String[] split = AMHOSTADDRESS.split(":"); application.setHost(split[0]); application.setRpcPort(Integer.parseInt(split[1])); application.setUser("TestClientRedirect-user"); application.setName("N/A"); application.setQueue("N/A"); application.setStartTime(0); application.setFinishTime(0); application.setTrackingUrl("N/A"); application.setDiagnostics("N/A"); GetApplicationReportResponse response = recordFactory .newRecordInstance(GetApplicationReportResponse.class); response.setApplicationReport(application); return response; }