public interface BlobWriter
Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
LOG |
Modifier and Type | Method and Description |
---|---|
boolean |
deletePermanent(JobID jobId,
PermanentBlobKey permanentBlobKey)
Delete the uploaded data with the given
JobID and PermanentBlobKey . |
int |
getMinOffloadingSize()
Returns the min size before data will be offloaded to the BLOB store.
|
static <T> Either<SerializedValue<T>,PermanentBlobKey> |
offloadWithException(SerializedValue<T> serializedValue,
JobID jobId,
BlobWriter blobWriter) |
PermanentBlobKey |
putPermanent(JobID jobId,
byte[] value)
Uploads the data of the given byte array for the given job to the BLOB server and makes it a
permanent BLOB.
|
PermanentBlobKey |
putPermanent(JobID jobId,
InputStream inputStream)
Uploads the data from the given input stream for the given job to the BLOB server and makes
it a permanent BLOB.
|
static <T> Either<SerializedValue<T>,PermanentBlobKey> |
serializeAndTryOffload(T value,
JobID jobId,
BlobWriter blobWriter)
Serializes the given value and offloads it to the BlobServer if its size exceeds the minimum
offloading size of the BlobServer.
|
static <T> Either<SerializedValue<T>,PermanentBlobKey> |
tryOffload(SerializedValue<T> serializedValue,
JobID jobId,
BlobWriter blobWriter) |
PermanentBlobKey putPermanent(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 writing it to a local file, or
uploading it to the HA storePermanentBlobKey putPermanent(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, writing it to a local file, or uploading it to the HA storeboolean deletePermanent(JobID jobId, PermanentBlobKey permanentBlobKey)
JobID
and PermanentBlobKey
.jobId
- ID of the job this blob belongs topermanentBlobKey
- the key of this blobint getMinOffloadingSize()
static <T> Either<SerializedValue<T>,PermanentBlobKey> serializeAndTryOffload(T value, JobID jobId, BlobWriter blobWriter) throws IOException
T
- type of the value to serializevalue
- to serializejobId
- to which the value belongs.blobWriter
- to use to offload the serialized valueIOException
- if the data cannot be serializedstatic <T> Either<SerializedValue<T>,PermanentBlobKey> tryOffload(SerializedValue<T> serializedValue, JobID jobId, BlobWriter blobWriter)
static <T> Either<SerializedValue<T>,PermanentBlobKey> offloadWithException(SerializedValue<T> serializedValue, JobID jobId, BlobWriter blobWriter)
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.