Class 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.
    • Constructor Detail

      • VoidBlobWriter

        public VoidBlobWriter()
    • 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 interface BlobWriter
        Parameters:
        jobId - the ID of the job the BLOB belongs to
        value - 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 interface BlobWriter
        Parameters:
        jobId - ID of the job this blob belongs to
        inputStream - 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
      • 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 interface BlobWriter
        Returns:
        minimum offloading size