Package org.apache.flink.runtime.blob
Class VoidBlobWriter
- java.lang.Object
-
- org.apache.flink.runtime.blob.VoidBlobWriter
-
- All Implemented Interfaces:
BlobWriter
@VisibleForTesting public class VoidBlobWriter extends Object implements BlobWriter
BlobWriter which does not support writing BLOBs to a store. This class is mainly used for testing purposes where we don't want to store data in the BLOB store.
-
-
Field Summary
-
Fields inherited from interface org.apache.flink.runtime.blob.BlobWriter
LOG
-
-
Constructor Summary
Constructors Constructor Description VoidBlobWriter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
deletePermanent(JobID jobId, PermanentBlobKey key)
Delete the uploaded data with the givenJobID
andPermanentBlobKey
.static VoidBlobWriter
getInstance()
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.
-
-
-
Method Detail
-
putPermanent
public PermanentBlobKey putPermanent(JobID jobId, byte[] value) throws IOException
Description copied from interface:BlobWriter
Uploads the data of the given byte array for the given job to the BLOB server and makes it a permanent BLOB.- Specified by:
putPermanent
in interfaceBlobWriter
- Parameters:
jobId
- the ID of the job the BLOB belongs tovalue
- the buffer to upload- Returns:
- the computed BLOB key identifying the BLOB on the server
- Throws:
IOException
- thrown if an I/O error occurs while writing it to a local file, or uploading it to the HA store
-
putPermanent
public PermanentBlobKey putPermanent(JobID jobId, InputStream inputStream) throws IOException
Description copied from interface:BlobWriter
Uploads the data from the given input stream for the given job to the BLOB server and makes it a permanent BLOB.- Specified by:
putPermanent
in interfaceBlobWriter
- Parameters:
jobId
- ID of the job this blob belongs toinputStream
- the input stream to read the data from- Returns:
- the computed BLOB key identifying the BLOB on the server
- Throws:
IOException
- 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 store
-
deletePermanent
public boolean deletePermanent(JobID jobId, PermanentBlobKey key)
Description copied from interface:BlobWriter
Delete the uploaded data with the givenJobID
andPermanentBlobKey
.- Specified by:
deletePermanent
in interfaceBlobWriter
- Parameters:
jobId
- ID of the job this blob belongs tokey
- the key of this blob
-
getMinOffloadingSize
public int getMinOffloadingSize()
Description copied from interface:BlobWriter
Returns the min size before data will be offloaded to the BLOB store.- Specified by:
getMinOffloadingSize
in interfaceBlobWriter
- Returns:
- minimum offloading size
-
getInstance
public static VoidBlobWriter getInstance()
-
-