Skip to content

Commit

Permalink
[GOBBLIN-654] Fix the argument order of JobStatusRetriever APIs to re…
Browse files Browse the repository at this point in the history
…flect actual usage.[]

Closes #2523 from sv2000/jobStatusRetriever
  • Loading branch information
suvasude authored and htran1 committed Dec 14, 2018
1 parent 69c65f8 commit f8d791b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
Expand Up @@ -34,7 +34,7 @@ public abstract Iterator<JobStatus> getJobStatusesForFlowExecution(String flowNa
long flowExecutionId);

public abstract Iterator<JobStatus> getJobStatusesForFlowExecution(String flowName, String flowGroup,
long flowExecutionId, String jobGroup, String jobName);
long flowExecutionId, String jobName, String jobGroup);

/**
* Get the latest {@link JobStatus}es that belongs to the same latest flow execution. Currently, latest flow execution
Expand Down
Expand Up @@ -349,7 +349,7 @@ private JobStatus pollJobStatus(DagNode<JobExecutionPlan> dagNode) {
String jobName = jobConfig.getString(ConfigurationKeys.JOB_NAME_KEY);

Iterator<JobStatus> jobStatusIterator =
this.jobStatusRetriever.getJobStatusesForFlowExecution(flowGroup, flowName, flowExecutionId, jobGroup, jobName);
this.jobStatusRetriever.getJobStatusesForFlowExecution(flowName, flowGroup, flowExecutionId, jobName, jobGroup);
if (jobStatusIterator.hasNext()) {
return jobStatusIterator.next();
} else {
Expand Down
Expand Up @@ -142,13 +142,13 @@ public void testSuccessfulDag() throws URISyntaxException, IOException {

//Add a dag to the queue of dags
this.queue.offer(dag);
Iterator<JobStatus> jobStatusIterator1 = getMockJobStatus(flowName, flowGroup, flowExecutionId, flowGroup, jobName0, String.valueOf(ExecutionStatus.RUNNING));
Iterator<JobStatus> jobStatusIterator2 = getMockJobStatus(flowName, flowGroup, flowExecutionId, flowGroup, jobName0, String.valueOf(ExecutionStatus.COMPLETE));
Iterator<JobStatus> jobStatusIterator3 = getMockJobStatus(flowName, flowGroup, flowExecutionId, flowGroup, jobName1, String.valueOf(ExecutionStatus.RUNNING));
Iterator<JobStatus> jobStatusIterator4 = getMockJobStatus(flowName, flowGroup, flowExecutionId, flowGroup, jobName2, String.valueOf(ExecutionStatus.RUNNING));
Iterator<JobStatus> jobStatusIterator5 = getMockJobStatus(flowName, flowGroup, flowExecutionId, flowGroup, jobName1, String.valueOf(ExecutionStatus.RUNNING));
Iterator<JobStatus> jobStatusIterator6 = getMockJobStatus(flowName, flowGroup, flowExecutionId, flowGroup, jobName2, String.valueOf(ExecutionStatus.COMPLETE));
Iterator<JobStatus> jobStatusIterator7 = getMockJobStatus(flowName, flowGroup, flowExecutionId, flowGroup, jobName1, String.valueOf(ExecutionStatus.COMPLETE));
Iterator<JobStatus> jobStatusIterator1 = getMockJobStatus(flowName, flowGroup, flowExecutionId, jobName0, flowGroup, String.valueOf(ExecutionStatus.RUNNING));
Iterator<JobStatus> jobStatusIterator2 = getMockJobStatus(flowName, flowGroup, flowExecutionId, jobName0, flowGroup, String.valueOf(ExecutionStatus.COMPLETE));
Iterator<JobStatus> jobStatusIterator3 = getMockJobStatus(flowName, flowGroup, flowExecutionId, jobName1, flowGroup, String.valueOf(ExecutionStatus.RUNNING));
Iterator<JobStatus> jobStatusIterator4 = getMockJobStatus(flowName, flowGroup, flowExecutionId, jobName2, flowGroup, String.valueOf(ExecutionStatus.RUNNING));
Iterator<JobStatus> jobStatusIterator5 = getMockJobStatus(flowName, flowGroup, flowExecutionId, jobName1, flowGroup, String.valueOf(ExecutionStatus.RUNNING));
Iterator<JobStatus> jobStatusIterator6 = getMockJobStatus(flowName, flowGroup, flowExecutionId, jobName2, flowGroup, String.valueOf(ExecutionStatus.COMPLETE));
Iterator<JobStatus> jobStatusIterator7 = getMockJobStatus(flowName, flowGroup, flowExecutionId, jobName1, flowGroup, String.valueOf(ExecutionStatus.COMPLETE));

Mockito.when(_jobStatusRetriever.getJobStatusesForFlowExecution(Mockito.anyString(), Mockito.anyString(),
Mockito.anyLong(), Mockito.anyString(), Mockito.anyString())).
Expand Down Expand Up @@ -223,23 +223,23 @@ public void testFailedDag() throws URISyntaxException, IOException {
//Add a dag to the queue of dags
this.queue.offer(dag);
Iterator<JobStatus> jobStatusIterator1 =
getMockJobStatus(flowName, flowGroup, flowExecutionId, flowGroup, jobName0, String.valueOf(ExecutionStatus.RUNNING));
getMockJobStatus(flowName, flowGroup, flowExecutionId, jobName0, flowGroup, String.valueOf(ExecutionStatus.RUNNING));
Iterator<JobStatus> jobStatusIterator2 =
getMockJobStatus(flowName, flowGroup, flowExecutionId, flowGroup, jobName0, String.valueOf(ExecutionStatus.COMPLETE));
getMockJobStatus(flowName, flowGroup, flowExecutionId, jobName0, flowGroup, String.valueOf(ExecutionStatus.COMPLETE));
Iterator<JobStatus> jobStatusIterator3 =
getMockJobStatus(flowName, flowGroup, flowExecutionId, flowGroup, jobName1, String.valueOf(ExecutionStatus.RUNNING));
getMockJobStatus(flowName, flowGroup, flowExecutionId, jobName1, flowGroup, String.valueOf(ExecutionStatus.RUNNING));
Iterator<JobStatus> jobStatusIterator4 =
getMockJobStatus(flowName, flowGroup, flowExecutionId, flowGroup, jobName2, String.valueOf(ExecutionStatus.RUNNING));
getMockJobStatus(flowName, flowGroup, flowExecutionId, jobName2, flowGroup, String.valueOf(ExecutionStatus.RUNNING));
Iterator<JobStatus> jobStatusIterator5 =
getMockJobStatus(flowName, flowGroup, flowExecutionId, flowGroup, jobName1, String.valueOf(ExecutionStatus.RUNNING));
getMockJobStatus(flowName, flowGroup, flowExecutionId, jobName1, flowGroup, String.valueOf(ExecutionStatus.RUNNING));
Iterator<JobStatus> jobStatusIterator6 =
getMockJobStatus(flowName, flowGroup, flowExecutionId, flowGroup, jobName2, String.valueOf(ExecutionStatus.FAILED));
getMockJobStatus(flowName, flowGroup, flowExecutionId, jobName2, flowGroup, String.valueOf(ExecutionStatus.FAILED));
Iterator<JobStatus> jobStatusIterator7 =
getMockJobStatus(flowName, flowGroup, flowExecutionId, flowGroup, jobName1, String.valueOf(ExecutionStatus.COMPLETE));
getMockJobStatus(flowName, flowGroup, flowExecutionId, jobName1, flowGroup, String.valueOf(ExecutionStatus.COMPLETE));
Iterator<JobStatus> jobStatusIterator8 =
getMockJobStatus(flowName, flowGroup, flowExecutionId, flowGroup, jobName1, String.valueOf(ExecutionStatus.RUNNING));
getMockJobStatus(flowName, flowGroup, flowExecutionId, jobName1, flowGroup, String.valueOf(ExecutionStatus.RUNNING));
Iterator<JobStatus> jobStatusIterator9 =
getMockJobStatus(flowName, flowGroup, flowExecutionId, flowGroup, jobName1, String.valueOf(ExecutionStatus.COMPLETE));
getMockJobStatus(flowName, flowGroup, flowExecutionId, jobName1, flowGroup, String.valueOf(ExecutionStatus.COMPLETE));


Mockito.when(_jobStatusRetriever
Expand Down

0 comments on commit f8d791b

Please sign in to comment.