agave-jobs/jobs-core/src/main/java/org/iplantc/service/jobs/managers/JobManager.java
/**
     * Calculates the remote job work directory as an agave relative path. This agave path value will be identical for every
     * staging attempt, regardless of changes in the execution system root and home directory values, so this method
     * ensures the work directory exists and returns the path for use in staging each file.
     *
     * @param job the job for which the directory is calculated
     * @param executionSystem the job execution system
     * @return the agave relative path to the job work directory on the execution system.
     */
Calculates the remote job work directory as an agave relative path. This agave path value will be identical for every
staging attempt, regardless of changes in the execution system root and home directory values, so this method
ensures the work directory exists and returns the path for use in staging each file.

@param job the job for which the directory is calculated
@param executionSystem the job execution system
@return the agave relative path to the job work directory on the execution system.
Calculates the remote job work directory as an agave relative path . This agave path value will be identical for every staging attempt regardless of changes in the execution system root and home directory values so this method ensures the work directory exists and returns the path for use in staging each file . @param job the job for which the directory is calculated @param executionSystem the job execution system @return the agave relative path to the job work directory on the execution system .
public String calculateJobRemoteWorkPath(Job job, ExecutionSystem executionSystem) {
        String remoteJobDirectoryPath = executionSystem.getScratchDir();
        if (StringUtils.isBlank(remoteJobDirectoryPath)) {
            remoteJobDirectoryPath = executionSystem.getWorkDir();
        }
        remoteJobDirectoryPath = StringUtils.trimToEmpty(remoteJobDirectoryPath);
        if (!remoteJobDirectoryPath.isEmpty()) {
            remoteJobDirectoryPath = StringUtils.stripEnd(remoteJobDirectoryPath, "/") + "/";
        }
        remoteJobDirectoryPath += String.format("%s/job-%s-%s",
                job.getOwner(), job.getUuid(), Slug.toSlug(job.getName()));
        remoteJobDirectoryPath = remoteJobDirectoryPath.replaceAll("[/]+", "/");
        if (remoteJobDirectoryPath.length() > 255) {
            remoteJobDirectoryPath = remoteJobDirectoryPath.substring(0, 254);
        }
        return remoteJobDirectoryPath;
    }
public String calculateJobRemoteWorkPath ( Job job , ExecutionSystem executionSystem ) { String remoteJobDirectoryPath = executionSystem . getScratchDir ( ) ; if ( StringUtils . isBlank ( remoteJobDirectoryPath ) ) { remoteJobDirectoryPath = executionSystem . getWorkDir ( ) ; } remoteJobDirectoryPath = StringUtils . trimToEmpty ( remoteJobDirectoryPath ) ; if ( ! remoteJobDirectoryPath . isEmpty ( ) ) { remoteJobDirectoryPath = StringUtils . stripEnd ( remoteJobDirectoryPath , "/" ) + "/" ; } remoteJobDirectoryPath += String . format ( "%s/job-%s-%s" , job . getOwner ( ) , job . getUuid ( ) , Slug . toSlug ( job . getName ( ) ) ) ; remoteJobDirectoryPath = remoteJobDirectoryPath . replaceAll ( "[/]+" , "/" ) ; if ( remoteJobDirectoryPath . length ( ) > 255 ) { remoteJobDirectoryPath = remoteJobDirectoryPath . substring ( 0 , 254 ) ; } return remoteJobDirectoryPath ; }
Calculates the remote job work directory as an agave relative path.
Calculates the remote job work directory as an agave relative path .
// Execution system scratch directory is checked first // Execution system work directory is checked if scratch is blank // trim to remove any spaces and ensure a non-null value // ensure trailing slash // create a unique job directory per job. We do not use another uuid here because we need // the job directory to be consistent between retries so we can save time by avoiding // restaging data. // the job_dir column in the db has a 255 char limit.