/** * Returns the (designated) physical storage location of the BLOB with the given job ID and key. * * @param jobID * the ID of the job the BLOB belongs to * @param key * the key of the BLOB * @return the (designated) physical storage location of the BLOB with the given job ID and key */ static File getStorageLocation(File storageDir, JobID jobID, String key) { return new File(getJobDirectory(storageDir, jobID), BLOB_FILE_PREFIX + encodeKey(key)); }
/** * Returns the path for the given job ID and key. * * <p>The returned path can be used with the state backend for recovery purposes. * * <p>This follows the same scheme as {@link #getStorageLocation(File, JobID, String)}. */ static String getRecoveryPath(String basePath, JobID jobId, String key) { // format: $base/job_$id/blob_$key return String.format("%s/%s%s/%s%s", basePath, JOB_DIR_PREFIX, jobId.toString(), BLOB_FILE_PREFIX, encodeKey(key)); }