Class BlockingQueueRecordWriter<P>

  • Type Parameters:
    P - type of the record's payload
    All Implemented Interfaces:
    RecordWriter<P>

    public class BlockingQueueRecordWriter<P>
    extends java.lang.Object
    implements RecordWriter<P>
    Write records to a BlockingQueue.
    Author:
    Mahmoud Ben Hassine ([email protected])
    • Constructor Detail

      • BlockingQueueRecordWriter

        public BlockingQueueRecordWriter​(java.util.concurrent.BlockingQueue<Record<P>> blockingQueue)
        Parameters:
        blockingQueue - to write records to
      • BlockingQueueRecordWriter

        public BlockingQueueRecordWriter​(java.util.concurrent.BlockingQueue<Record<P>> blockingQueue,
                                         long timeout)
        Parameters:
        blockingQueue - to write records to
        timeout - in milliseconds after which the writer will throw an exception
    • Method Detail

      • writeRecords

        public void writeRecords​(Batch<P> batch)
                          throws java.lang.Exception
        Description copied from interface: RecordWriter
        Write a batch of records to a data sink.
        Specified by:
        writeRecords in interface RecordWriter<P>
        Parameters:
        batch - of records to write.
        Throws:
        java.lang.Exception - if an error occurs during record writing