use of org.apache.airavata.cloud.aurora.client.bean.JobDetailsResponseBean in project airavata by apache.
the class AuroraThriftClient method getJobDetails.
/**
* Gets the job details.
*
* @param jobKeyBean the job key bean
* @return the job details
* @throws Exception the exception
*/
public JobDetailsResponseBean getJobDetails(JobKeyBean jobKeyBean) throws Exception {
JobDetailsResponseBean response = null;
// try till we get response or scheduler connection not found
while (response == null) {
try {
if (jobKeyBean != null) {
JobKey jobKey = AuroraThriftClientUtil.getAuroraJobKey(jobKeyBean);
Set<JobKey> jobKeySet = new HashSet<>();
jobKeySet.add(jobKey);
TaskQuery query = new TaskQuery();
query.setJobKeys(jobKeySet);
Response jobDetailsResponse = this.readOnlySchedulerClient.getTasksStatus(query);
response = (JobDetailsResponseBean) AuroraThriftClientUtil.getResponseBean(jobDetailsResponse, ResponseResultType.GET_JOB_DETAILS);
}
} catch (Exception ex) {
if (ex instanceof TTransportException) {
// if re-connection success, retry command
if (this.reconnectWithAuroraScheduler()) {
continue;
}
}
logger.error(ex.getMessage(), ex);
throw ex;
}
}
return response;
}
use of org.apache.airavata.cloud.aurora.client.bean.JobDetailsResponseBean in project airavata by apache.
the class AuroraThriftClientUtil method getJobDetailsResponseBean.
/**
* Gets the job details response bean.
*
* @param response the response
* @return the job details response bean
*/
private static JobDetailsResponseBean getJobDetailsResponseBean(Response response) {
JobDetailsResponseBean responseBean = null;
if (response != null) {
responseBean = new JobDetailsResponseBean(getJobResponse(response));
responseBean.setTasks(response.getResult().getScheduleStatusResult().getTasks());
}
return responseBean;
}
Aggregations