public interface TransientBlobService extends Closeable
BlobServer
when they are retrieved.
These may include per-job BLOBs like files in the DistributedCache
, for example.
Note: None of these BLOBs is highly available (HA). This case is covered by BLOBs in the
PermanentBlobService
.
TODO: change API to not rely on local files but return InputStream
objects
Modifier and Type | Method and Description |
---|---|
boolean |
deleteFromCache(JobID jobId,
TransientBlobKey key)
Deletes the file associated with the provided job ID and blob key from the local cache.
|
boolean |
deleteFromCache(TransientBlobKey key)
Deletes the (job-unrelated) file associated with the provided blob key from the local cache.
|
File |
getFile(JobID jobId,
TransientBlobKey key)
Returns the path to a local copy of the file associated with the provided job ID and blob
key.
|
File |
getFile(TransientBlobKey key)
Returns the path to a local copy of the (job-unrelated) file associated with the provided
blob key.
|
TransientBlobKey |
putTransient(byte[] value)
Uploads the (job-unrelated) data of the given byte array to the BLOB server.
|
TransientBlobKey |
putTransient(InputStream inputStream)
Uploads the (job-unrelated) data from the given input stream to the BLOB server.
|
TransientBlobKey |
putTransient(JobID jobId,
byte[] value)
Uploads the data of the given byte array for the given job to the BLOB server.
|
TransientBlobKey |
putTransient(JobID jobId,
InputStream inputStream)
Uploads the data from the given input stream for the given job to the BLOB server.
|
File getFile(TransientBlobKey key) throws IOException
key
- blob key associated with the requested fileFileNotFoundException
- when the path does not exist;IOException
- if any other error occurs when retrieving the fileFile getFile(JobID jobId, TransientBlobKey key) throws IOException
jobId
- ID of the job this blob belongs tokey
- blob key associated with the requested fileFileNotFoundException
- when the path does not exist;IOException
- if any other error occurs when retrieving the fileTransientBlobKey putTransient(byte[] value) throws IOException
value
- the buffer to uploadIOException
- thrown if an I/O error occurs while uploading the data to the BLOB serverTransientBlobKey putTransient(JobID jobId, byte[] value) throws IOException
jobId
- the ID of the job the BLOB belongs tovalue
- the buffer to uploadIOException
- thrown if an I/O error occurs while uploading the data to the BLOB serverTransientBlobKey putTransient(InputStream inputStream) throws IOException
inputStream
- the input stream to read the data fromIOException
- thrown if an I/O error occurs while reading the data from the input stream or uploading the
data to the BLOB serverTransientBlobKey putTransient(JobID jobId, InputStream inputStream) throws IOException
jobId
- ID of the job this blob belongs toinputStream
- the input stream to read the data fromIOException
- thrown if an I/O error occurs while reading the data from the input stream or uploading the
data to the BLOB serverboolean deleteFromCache(TransientBlobKey key)
key
- associated with the file to be deletedboolean deleteFromCache(JobID jobId, TransientBlobKey key)
jobId
- ID of the job this blob belongs tokey
- associated with the file to be deletedCopyright © 2014–2020 The Apache Software Foundation. All rights reserved.