Search in sources :

Example 1 with IridaWorkflowException

use of ca.corefacility.bioinformatics.irida.exceptions.IridaWorkflowException in project irida by phac-nml.

the class AnalysisExecutionScheduledTaskImpl method transferAnalysesResults.

/**
 * {@inheritDoc}
 */
@Override
public Set<Future<AnalysisSubmission>> transferAnalysesResults() {
    synchronized (transferAnalysesResultsLock) {
        logger.trace("Running transferAnalysesResults");
        List<AnalysisSubmission> analysisSubmissions = analysisSubmissionRepository.findByAnalysisState(AnalysisState.FINISHED_RUNNING);
        Set<Future<AnalysisSubmission>> submissions = Sets.newHashSet();
        for (AnalysisSubmission analysisSubmission : analysisSubmissions) {
            logger.debug("Transferring results for " + analysisSubmission);
            try {
                submissions.add(analysisExecutionService.transferAnalysisResults(analysisSubmission));
            } catch (ExecutionManagerException | IOException | IridaWorkflowException e) {
                logger.error("Error transferring submission " + analysisSubmission, e);
            }
        }
        return submissions;
    }
}
Also used : AnalysisSubmission(ca.corefacility.bioinformatics.irida.model.workflow.submission.AnalysisSubmission) Future(java.util.concurrent.Future) IOException(java.io.IOException) ExecutionManagerException(ca.corefacility.bioinformatics.irida.exceptions.ExecutionManagerException) IridaWorkflowException(ca.corefacility.bioinformatics.irida.exceptions.IridaWorkflowException)

Example 2 with IridaWorkflowException

use of ca.corefacility.bioinformatics.irida.exceptions.IridaWorkflowException in project irida by phac-nml.

the class AnalysisExecutionScheduledTaskImpl method executeAnalyses.

/**
 * {@inheritDoc}
 */
@Override
public Set<Future<AnalysisSubmission>> executeAnalyses() {
    synchronized (executeAnalysesLock) {
        logger.trace("Running executeAnalyses");
        List<AnalysisSubmission> analysisSubmissions = analysisSubmissionRepository.findByAnalysisState(AnalysisState.PREPARED);
        Set<Future<AnalysisSubmission>> submissions = Sets.newHashSet();
        for (AnalysisSubmission analysisSubmission : analysisSubmissions) {
            logger.debug("Executing " + analysisSubmission);
            try {
                submissions.add(analysisExecutionService.executeAnalysis(analysisSubmission));
            } catch (ExecutionManagerException | IridaWorkflowException e) {
                logger.error("Error executing submission " + analysisSubmission, e);
            }
        }
        return submissions;
    }
}
Also used : AnalysisSubmission(ca.corefacility.bioinformatics.irida.model.workflow.submission.AnalysisSubmission) Future(java.util.concurrent.Future) ExecutionManagerException(ca.corefacility.bioinformatics.irida.exceptions.ExecutionManagerException) IridaWorkflowException(ca.corefacility.bioinformatics.irida.exceptions.IridaWorkflowException)

Example 3 with IridaWorkflowException

use of ca.corefacility.bioinformatics.irida.exceptions.IridaWorkflowException in project irida by phac-nml.

the class IridaWorkflowsService method registerWorkflow.

/**
 * Registers the given workflow with this service.
 *
 * @param iridaWorkflow
 *            The workflow to register.
 * @throws IridaWorkflowException
 *             If there was an issue when registering the workflow.
 */
public void registerWorkflow(IridaWorkflow iridaWorkflow) throws IridaWorkflowException {
    checkNotNull(iridaWorkflow, "iridaWorkflow is null");
    checkNotNull(iridaWorkflow.getWorkflowDescription().getAnalysisType(), "analysisType is null");
    UUID workflowId = iridaWorkflow.getWorkflowDescription().getId();
    logger.debug("Registering workflow: " + iridaWorkflow);
    if (allRegisteredWorkflows.containsKey(workflowId)) {
        throw new IridaWorkflowException("Duplicate workflow " + workflowId);
    } else {
        allRegisteredWorkflows.put(workflowId, iridaWorkflow);
    }
}
Also used : UUID(java.util.UUID) IridaWorkflowException(ca.corefacility.bioinformatics.irida.exceptions.IridaWorkflowException)

Aggregations

IridaWorkflowException (ca.corefacility.bioinformatics.irida.exceptions.IridaWorkflowException)3 ExecutionManagerException (ca.corefacility.bioinformatics.irida.exceptions.ExecutionManagerException)2 AnalysisSubmission (ca.corefacility.bioinformatics.irida.model.workflow.submission.AnalysisSubmission)2 Future (java.util.concurrent.Future)2 IOException (java.io.IOException)1 UUID (java.util.UUID)1