Skip to content

Commit

Permalink
KYLO-733 Removed unused /v1/jobs/{executionId}/steps endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregory Hart committed May 25, 2017
1 parent 9ae84f2 commit 0f0d889
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,11 @@
import com.thinkbiganalytics.metadata.api.jobrepo.job.BatchJobExecution;
import com.thinkbiganalytics.nifi.provenance.model.ProvenanceEventRecordDTO;

import java.util.List;

/**
* Provider for accessing {@link BatchStepExecution} data
*/
public interface BatchStepExecutionProvider {


/**
* Update a StepExecution record
*/
Expand All @@ -50,13 +47,4 @@ public interface BatchStepExecutionProvider {
* When a step fails, get notified of the failure
*/
void subscribeToFailedSteps(FailedStepExecutionListener listener);


/**
* Return all the step executions for a given job execution id
*
* @return the steps pertaining to a given job
*/
List<? extends BatchStepExecution> getSteps(Long jobExecutionId);

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
*/


import com.thinkbiganalytics.metadata.jpa.feed.security.FeedOpsAccessControlRepository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
Expand All @@ -46,11 +44,4 @@ public interface BatchStepExecutionRepository extends JpaRepository<JpaBatchStep
+ "join JpaNifiEventStepExecution as nifiEventStep on nifiEventStep.stepExecution.stepExecutionId = step.stepExecutionId "
+ "where nifiEventStep.componentId = :componentId and nifiEventStep.jobFlowFileId = :flowFileId")
JpaBatchStepExecution findByProcessorAndJobFlowFile(@Param("componentId") String processorId, @Param("flowFileId") String flowFileId);

@Query("select step from JpaBatchStepExecution as step "
+ "join JpaBatchJobExecution as job on job.jobExecutionId = step.jobExecution.jobExecutionId "
+ FeedOpsAccessControlRepository.JOIN_ACL_TO_JOB
+ "where step.jobExecution.jobExecutionId = :jobExecutionId "
+ "and "+FeedOpsAccessControlRepository.WHERE_PRINCIPALS_MATCH)
List<JpaBatchStepExecution> findSteps(@Param("jobExecutionId") Long jobExecutionId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,4 @@ private void assignStepExecutionContextMap(ProvenanceEventRecordDTO event, JpaBa

}
}


public List<? extends BatchStepExecution> getSteps(Long jobExecutionId) {
return batchStepExecutionRepository.findSteps(jobExecutionId);
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import com.thinkbiganalytics.DateTimeUtil;
import com.thinkbiganalytics.jobrepo.query.model.ExecutedJob;
import com.thinkbiganalytics.jobrepo.query.model.ExecutedStep;
import com.thinkbiganalytics.jobrepo.query.model.FeedHealth;
import com.thinkbiganalytics.jobrepo.query.model.JobStatusCount;
import com.thinkbiganalytics.jobrepo.query.model.SearchResult;
Expand All @@ -37,7 +36,6 @@
import com.thinkbiganalytics.metadata.api.feed.OpsManagerFeedProvider;
import com.thinkbiganalytics.metadata.api.jobrepo.job.BatchJobExecution;
import com.thinkbiganalytics.metadata.api.jobrepo.job.BatchJobExecutionProvider;
import com.thinkbiganalytics.metadata.api.jobrepo.step.BatchStepExecution;
import com.thinkbiganalytics.metadata.api.jobrepo.step.BatchStepExecutionProvider;
import com.thinkbiganalytics.rest.model.RestResponseStatus;
import com.thinkbiganalytics.security.AccessController;
Expand Down Expand Up @@ -124,27 +122,6 @@ public ExecutedJob getJob(@PathParam("executionId") String executionId,

}

/**
* Get the progress of each of the steps of the job execution for the given job instance id
*
* @return A list of each step and its progress, or an HTTP error code on failure
*/
@GET
@Path("/{executionId}/steps")
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation("Gets the steps of the specified job.")
@ApiResponses({
@ApiResponse(code = 200, message = "Returns the steps.", response = ExecutedStep.class, responseContainer = "List"),
@ApiResponse(code = 400, message = "The executionId is not a valid integer.", response = RestResponseStatus.class)
})
public List<ExecutedStep> getJobSteps(@PathParam("executionId") String executionId) {
this.accessController.checkPermission(AccessController.SERVICES, OperationsAccessControl.ACCESS_OPS);
return metadataAccess.read(() -> {
List<? extends BatchStepExecution> steps = stepExecutionProvider.getSteps(Long.parseLong(executionId));
return JobModelTransform.executedSteps(steps);
});
}

/**
* Restart the job associated with the given instance id
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ define(['angular','ops-mgr/module-name'], function (angular,moduleName) {

data.LOAD_JOB_URL = OpsManagerRestUrlService.LOAD_JOB_URL;

data.JOB_PROGRESS_URL = OpsManagerRestUrlService.JOB_PROGRESS_URL;

data.RELATED_JOBS_URL = OpsManagerRestUrlService.RELATED_JOBS_URL;

data.restartJob = function (executionId, params, callback, errorCallback) {
Expand Down Expand Up @@ -104,17 +102,8 @@ define(['angular','ops-mgr/module-name'], function (angular,moduleName) {
return $http.get(data.LOAD_JOB_URL(instanceId));
};

/**
* Get the progress of a Job
* @param executionId
* @returns {HttpPromise}
*/
data.getProgress = function (executionId) {
return $http.get(data.JOB_PROGRESS_URL(executionId));
};

data.lastSelectedTab = 'ALL';

return data;
}]);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ define(['angular','ops-mgr/module-name'], function (angular,moduleName) {
this.LOAD_JOB_URL = function (executionId) {
return self.JOBS_BASE + "/" + executionId;
}
this.JOB_PROGRESS_URL = function (executionId) {
return self.JOBS_BASE + "/" + executionId + "/steps";
}

this.RELATED_JOBS_URL = function (executionId) {
return self.JOBS_BASE + "/" + executionId + "/related";
Expand Down Expand Up @@ -94,4 +91,4 @@ define(['angular','ops-mgr/module-name'], function (angular,moduleName) {
};

});
});
});

0 comments on commit 0f0d889

Please sign in to comment.