コード例 #1
0
TEST_F(TestApplicationClient,TestGetApplicationReport){
	ApplicationId appId;
	ApplicationReport report = client->getApplicationReport(appId);
	EXPECT_EQ(report.getUser(), "postgres");
	EXPECT_EQ(report.getQueue(), "default");
	EXPECT_EQ(report.getName(), "hawq");
	EXPECT_EQ(report.getHost(), "master");
	EXPECT_EQ(report.getRpcPort(), 8090);
	EXPECT_FLOAT_EQ(report.getProgress(), 0.5);
}
コード例 #2
0
	int getApplicationReport(LibYarnClient_t *client,char *jobId,
							LibYarnApplicationReport_t **applicationReport) {
		string jobIdStr(jobId);
		ApplicationReport applicationReportCpp;
		int result = client->getApplicationReport(jobIdStr,applicationReportCpp);
		if (result == FUNCTION_SUCCEEDED){
			*applicationReport = (LibYarnApplicationReport_t *) malloc(sizeof (LibYarnApplicationReport_t));
			(*applicationReport)->appId = applicationReportCpp.getApplicationId().getId();
			(*applicationReport)->user = strdup(applicationReportCpp.getUser().c_str());
			(*applicationReport)->queue = strdup(applicationReportCpp.getQueue().c_str());
			(*applicationReport)->name = strdup(applicationReportCpp.getName().c_str());
			(*applicationReport)->host = strdup(applicationReportCpp.getHost().c_str());
			(*applicationReport)->port = applicationReportCpp.getRpcPort();
			(*applicationReport)->url = strdup(applicationReportCpp.getTrackingUrl().c_str());
			(*applicationReport)->status = applicationReportCpp.getYarnApplicationState();
			(*applicationReport)->diagnostics = strdup(applicationReportCpp.getDiagnostics().c_str());
			(*applicationReport)->startTime = applicationReportCpp.getStartTime();
			(*applicationReport)->progress = applicationReportCpp.getProgress();
			return FUNCTION_SUCCEEDED;
		} else{
			setErrorMessage(client->getErrorMessage());
			return FUNCTION_FAILED;
		}
	}