/** * Retrieves the local path of a (job-unrelated) file associated with a job and a blob key. * * <p>The blob server looks the blob key up in its local storage. If the file exists, it is * returned. If the file does not exist, it is retrieved from the HA blob store (if available) * or a {@link FileNotFoundException} is thrown. * * @param key * blob key associated with the requested file * * @return file referring to the local storage location of the BLOB * * @throws IOException * Thrown if the file retrieval failed. */ @Override public File getFile(TransientBlobKey key) throws IOException { return getFileInternal(null, key); }
/** * Retrieves the local path of a (job-unrelated) file associated with a job and a blob key. * * <p>The blob server looks the blob key up in its local storage. If the file exists, it is * returned. If the file does not exist, it is retrieved from the HA blob store (if available) * or a {@link FileNotFoundException} is thrown. * * @param key * blob key associated with the requested file * * @return file referring to the local storage location of the BLOB * * @throws IOException * Thrown if the file retrieval failed. */ @Override public File getFile(TransientBlobKey key) throws IOException { return getFileInternal(null, key); }
/** * Retrieves the local path of a (job-unrelated) file associated with a job and a blob key. * * <p>The blob server looks the blob key up in its local storage. If the file exists, it is * returned. If the file does not exist, it is retrieved from the HA blob store (if available) * or a {@link FileNotFoundException} is thrown. * * @param key * blob key associated with the requested file * * @return file referring to the local storage location of the BLOB * * @throws IOException * Thrown if the file retrieval failed. */ @Override public File getFile(TransientBlobKey key) throws IOException { return getFileInternal(null, key); }
/** * Retrieves the local path of a file associated with a job and a blob key. * * <p>The blob server looks the blob key up in its local storage. If the file exists, it is * returned. If the file does not exist, it is retrieved from the HA blob store (if available) * or a {@link FileNotFoundException} is thrown. * * @param jobId * ID of the job this blob belongs to * @param key * blob key associated with the requested file * * @return file referring to the local storage location of the BLOB * * @throws IOException * Thrown if the file retrieval failed. */ @Override public File getFile(JobID jobId, TransientBlobKey key) throws IOException { checkNotNull(jobId); return getFileInternal(jobId, key); }
/** * Retrieves the local path of a file associated with a job and a blob key. * * <p>The blob server looks the blob key up in its local storage. If the file exists, it is * returned. If the file does not exist, it is retrieved from the HA blob store (if available) * or a {@link FileNotFoundException} is thrown. * * @param jobId * ID of the job this blob belongs to * @param key * blob key associated with the requested file * * @return file referring to the local storage location of the BLOB * * @throws IOException * Thrown if the file retrieval failed. */ @Override public File getFile(JobID jobId, TransientBlobKey key) throws IOException { checkNotNull(jobId); return getFileInternal(jobId, key); }
/** * Retrieves the local path of a file associated with a job and a blob key. * * <p>The blob server looks the blob key up in its local storage. If the file exists, it is * returned. If the file does not exist, it is retrieved from the HA blob store (if available) * or a {@link FileNotFoundException} is thrown. * * @param jobId * ID of the job this blob belongs to * @param key * blob key associated with the requested file * * @return file referring to the local storage location of the BLOB * * @throws IOException * Thrown if the file retrieval failed. */ @Override public File getFile(JobID jobId, TransientBlobKey key) throws IOException { checkNotNull(jobId); return getFileInternal(jobId, key); }
/** * Returns the path to a local copy of the file associated with the provided job ID and blob * key. * * <p>We will first attempt to serve the BLOB from the local storage. If the BLOB is not in * there, we will try to download it from the HA store. * * @param jobId * ID of the job this blob belongs to * @param key * blob key associated with the requested file * * @return The path to the file. * * @throws java.io.FileNotFoundException * if the BLOB does not exist; * @throws IOException * if any other error occurs when retrieving the file */ @Override public File getFile(JobID jobId, PermanentBlobKey key) throws IOException { checkNotNull(jobId); return getFileInternal(jobId, key); }
/** * Returns the path to a local copy of the file associated with the provided job ID and blob * key. * * <p>We will first attempt to serve the BLOB from the local storage. If the BLOB is not in * there, we will try to download it from the HA store. * * @param jobId * ID of the job this blob belongs to * @param key * blob key associated with the requested file * * @return The path to the file. * * @throws java.io.FileNotFoundException * if the BLOB does not exist; * @throws IOException * if any other error occurs when retrieving the file */ @Override public File getFile(JobID jobId, PermanentBlobKey key) throws IOException { checkNotNull(jobId); return getFileInternal(jobId, key); }
/** * Returns the path to a local copy of the file associated with the provided job ID and blob * key. * * <p>We will first attempt to serve the BLOB from the local storage. If the BLOB is not in * there, we will try to download it from the HA store. * * @param jobId * ID of the job this blob belongs to * @param key * blob key associated with the requested file * * @return The path to the file. * * @throws java.io.FileNotFoundException * if the BLOB does not exist; * @throws IOException * if any other error occurs when retrieving the file */ @Override public File getFile(JobID jobId, PermanentBlobKey key) throws IOException { checkNotNull(jobId); return getFileInternal(jobId, key); }
/** * Retrieves the local path of a file associated with a job and a blob key. * * <p>The blob server looks the blob key up in its local storage. If the file exists, it is * returned. If the file does not exist, it is retrieved from the HA blob store (if available) * or a {@link FileNotFoundException} is thrown. * * @param jobId * ID of the job this blob belongs to (or <tt>null</tt> if job-unrelated) * @param blobKey * blob key associated with the requested file * * @return file referring to the local storage location of the BLOB * * @throws IOException * Thrown if the file retrieval failed. */ private File getFileInternal(@Nullable JobID jobId, BlobKey blobKey) throws IOException { checkArgument(blobKey != null, "BLOB key cannot be null."); final File localFile = BlobUtils.getStorageLocation(storageDir, jobId, blobKey); readWriteLock.readLock().lock(); try { getFileInternal(jobId, blobKey, localFile); return localFile; } finally { readWriteLock.readLock().unlock(); } }
/** * Retrieves the local path of a file associated with a job and a blob key. * * <p>The blob server looks the blob key up in its local storage. If the file exists, it is * returned. If the file does not exist, it is retrieved from the HA blob store (if available) * or a {@link FileNotFoundException} is thrown. * * @param jobId * ID of the job this blob belongs to (or <tt>null</tt> if job-unrelated) * @param blobKey * blob key associated with the requested file * * @return file referring to the local storage location of the BLOB * * @throws IOException * Thrown if the file retrieval failed. */ private File getFileInternal(@Nullable JobID jobId, BlobKey blobKey) throws IOException { checkArgument(blobKey != null, "BLOB key cannot be null."); final File localFile = BlobUtils.getStorageLocation(storageDir, jobId, blobKey); readWriteLock.readLock().lock(); try { getFileInternal(jobId, blobKey, localFile); return localFile; } finally { readWriteLock.readLock().unlock(); } }
/** * Retrieves the local path of a file associated with a job and a blob key. * * <p>The blob server looks the blob key up in its local storage. If the file exists, it is * returned. If the file does not exist, it is retrieved from the HA blob store (if available) * or a {@link FileNotFoundException} is thrown. * * @param jobId * ID of the job this blob belongs to (or <tt>null</tt> if job-unrelated) * @param blobKey * blob key associated with the requested file * * @return file referring to the local storage location of the BLOB * * @throws IOException * Thrown if the file retrieval failed. */ private File getFileInternal(@Nullable JobID jobId, BlobKey blobKey) throws IOException { checkArgument(blobKey != null, "BLOB key cannot be null."); final File localFile = BlobUtils.getStorageLocation(storageDir, jobId, blobKey); readWriteLock.readLock().lock(); try { getFileInternal(jobId, blobKey, localFile); return localFile; } finally { readWriteLock.readLock().unlock(); } }
blobServer.getFileInternal(jobId, blobKey, blobFile);
blobServer.getFileInternal(jobId, blobKey, blobFile);
blobServer.getFileInternal(jobId, blobKey, blobFile);