public interface BlobWriter
Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
LOG |
Modifier and Type | Method and Description |
---|---|
int |
getMinOffloadingSize()
Returns the min size before data will be offloaded to the BLOB store.
|
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.
|
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 storeint 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 serializedCopyright © 2014–2020 The Apache Software Foundation. All rights reserved.