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 booleandeletePermanent(org.apache.flink.api.common.JobID jobId, PermanentBlobKey key)Delete the uploaded data with the givenJobIDandPermanentBlobKey.static VoidBlobWritergetInstance()intgetMinOffloadingSize()Returns the min size before data will be offloaded to the BLOB store.PermanentBlobKeyputPermanent(org.apache.flink.api.common.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.PermanentBlobKeyputPermanent(org.apache.flink.api.common.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(org.apache.flink.api.common.JobID jobId, byte[] value) throws IOException
Description copied from interface:BlobWriterUploads the data of the given byte array for the given job to the BLOB server and makes it a permanent BLOB.- Specified by:
putPermanentin 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(org.apache.flink.api.common.JobID jobId, InputStream inputStream) throws IOException
Description copied from interface:BlobWriterUploads the data from the given input stream for the given job to the BLOB server and makes it a permanent BLOB.- Specified by:
putPermanentin 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(org.apache.flink.api.common.JobID jobId, PermanentBlobKey key)Description copied from interface:BlobWriterDelete the uploaded data with the givenJobIDandPermanentBlobKey.- Specified by:
deletePermanentin interfaceBlobWriter- Parameters:
jobId- ID of the job this blob belongs tokey- the key of this blob
-
getMinOffloadingSize
public int getMinOffloadingSize()
Description copied from interface:BlobWriterReturns the min size before data will be offloaded to the BLOB store.- Specified by:
getMinOffloadingSizein interfaceBlobWriter- Returns:
- minimum offloading size
-
getInstance
public static VoidBlobWriter getInstance()
-
-