agave-jobs/jobs-core/src/main/java/org/iplantc/service/jobs/queue/actions/StagingAction.java
/**
     * Carries out the transfer of the job input file using a {@link URLCopy} operation. This will handle both
     * files and folders regardless of protocol and track the transfers with {@link TransferTask} linked to
     * {@link JobStatusType#STAGING_INPUTS} events associated with the current job.
     *
     * @param jobInputRemoteDataClient a preauthenticated clien to the job input
     * @param jobExecutionSystemRemoteDataClient a preauthenticated client to the execution system
     * @param singleRawInputValue the raw job input value
     * @param remoteJobInputPath the path to the job input on the source system
     * @param destPath the target path to which data will be copied
     * @throws TransferException when the transfer cannot be carried out due to procedural issues
     * @throws JobException when the job status and/or event cannot be udpated
     * @throws ClosedByInterruptException when the transfer is interrupted by an outside process
     */
Carries out the transfer of the job input file using a  URLCopy operation. This will handle both
files and folders regardless of protocol and track the transfers with  TransferTask linked to
JobStatusType#STAGING_INPUTS events associated with the current job.


Carries out the transfer of the job input file using a URLCopy operation . This will handle both files and folders regardless of protocol and track the transfers with TransferTask linked to JobStatusType#STAGING_INPUTS events associated with the current job .
protected void transferJobInput(RemoteDataClient jobInputRemoteDataClient, RemoteDataClient jobExecutionSystemRemoteDataClient, String singleRawInputValue, String remoteJobInputPath, String destPath)
    throws TransferException, JobException, ClosedByInterruptException {
        TransferTask rootTransferTask = new TransferTask(
                singleRawInputValue,
                "agave://" + getJob().getSystem() + "/" + destPath,
                getJob().getOwner(),
                null,
                null);
        TransferTaskDao.persist(rootTransferTask);
        JobEvent event = new JobEvent(
                JobStatusType.STAGING_INPUTS,
                "Copy in progress",
                rootTransferTask,
                getJob().getOwner());
        getJob().setStatus(JobStatusType.STAGING_INPUTS, event);
        getJob().setLastUpdated(new DateTime().toDate());
        JobDao.persist(getJob());
        URLCopy urlCopy = getURLCopy(jobInputRemoteDataClient, jobExecutionSystemRemoteDataClient);
        try {
            urlCopy.copy(remoteJobInputPath, destPath, rootTransferTask);
        } catch (ClosedByInterruptException e) {
            throw e;
        } catch (Throwable e) {
            checkStopped();
            if (urlCopy.isKilled()) {
                throw new ClosedByInterruptException();
            }
            throw new TransferException("Failed to transfer input " + singleRawInputValue + " for job " +
                    getJob().getUuid(), e);
        }
    }
protected void transferJobInput ( RemoteDataClient jobInputRemoteDataClient , RemoteDataClient jobExecutionSystemRemoteDataClient , String singleRawInputValue , String remoteJobInputPath , String destPath ) throws TransferException , JobException , ClosedByInterruptException { TransferTask rootTransferTask = new TransferTask ( singleRawInputValue , "agave://" + getJob ( ) . getSystem ( ) + "/" + destPath , getJob ( ) . getOwner ( ) , null , null ) ; TransferTaskDao . persist ( rootTransferTask ) ; JobEvent event = new JobEvent ( JobStatusType . STAGING_INPUTS , "Copy in progress" , rootTransferTask , getJob ( ) . getOwner ( ) ) ; getJob ( ) . setStatus ( JobStatusType . STAGING_INPUTS , event ) ; getJob ( ) . setLastUpdated ( new DateTime ( ) . toDate ( ) ) ; JobDao . persist ( getJob ( ) ) ; URLCopy urlCopy = getURLCopy ( jobInputRemoteDataClient , jobExecutionSystemRemoteDataClient ) ; try { urlCopy . copy ( remoteJobInputPath , destPath , rootTransferTask ) ; } catch ( ClosedByInterruptException e ) { throw e ; } catch ( Throwable e ) { checkStopped ( ) ; if ( urlCopy . isKilled ( ) ) { throw new ClosedByInterruptException ( ) ; } throw new TransferException ( "Failed to transfer input " + singleRawInputValue + " for job " + getJob ( ) . getUuid ( ) , e ) ; } }
Carries out the transfer of the job input file using a {@link URLCopy} operation.
Carries out the transfer of the job input file using a { @link URLCopy } operation .
// nope. still have to copy them. proceed // we may not be able to kill the gridftp threads associated with this transfer, // so in that event, the transfer will time out and we can catch the exception // here to rethrow as a ClosedByInterruptException.