Class RetryableRecordReader<P>

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

    public class RetryableRecordReader<P>
    extends java.lang.Object
    implements RecordReader<P>
    Decorator that makes a RecordReader retryable whenever the data source is temporarily unavailable.
    Author:
    Mahmoud Ben Hassine ([email protected])
    • Method Detail

      • open

        public void open()
                  throws java.lang.Exception
        Description copied from interface: RecordReader
        Open the reader.
        Specified by:
        open in interface RecordReader<P>
        Throws:
        java.lang.Exception - if an error occurs during reader opening
      • readRecord

        public Record<P> readRecord()
                             throws java.lang.Exception
        Description copied from interface: RecordReader
        Read next record from the data source.
        Specified by:
        readRecord in interface RecordReader<P>
        Returns:
        the next record from the data source or null if the end of the data source is reached
        Throws:
        java.lang.Exception - if an error occurs during reading next record
      • close

        public void close()
                   throws java.lang.Exception
        Description copied from interface: RecordReader
        Close the reader.
        Specified by:
        close in interface RecordReader<P>
        Throws:
        java.lang.Exception - if an error occurs during reader closing