Class TransformProcessRecordReader

    • Constructor Detail

    • Method Detail

      • batchesSupported

        public boolean batchesSupported()
        Description copied from interface: RecordReader
        This method returns true, if next(int) signature is supported by this RecordReader implementation.
        Specified by:
        batchesSupported in interface RecordReader
        Returns:
      • next

        public List<List<Writable>> next​(int num)
        Description copied from interface: RecordReader
        This method will be used, if batchesSupported() returns true.
        Specified by:
        next in interface RecordReader
        Returns:
      • hasNext

        public boolean hasNext()
        Whether there are anymore records
        Specified by:
        hasNext in interface RecordReader
        Returns:
      • reset

        public void reset()
        Reset record reader iterator
        Specified by:
        reset in interface RecordReader
      • resetSupported

        public boolean resetSupported()
        Specified by:
        resetSupported in interface RecordReader
        Returns:
        True if the record reader can be reset, false otherwise. Note that some record readers cannot be reset - for example, if they are backed by a non-resettable input split (such as certain types of streams)
      • record

        public List<Writable> record​(URI uri,
                                     DataInputStream dataInputStream)
                              throws IOException
        Load the record from the given DataInputStream Unlike next() the internal state of the RecordReader is not modified Implementations of this method should not close the DataInputStream
        Specified by:
        record in interface RecordReader
        Parameters:
        uri -
        dataInputStream -
        Throws:
        IOException - if error occurs during reading from the input stream
      • nextRecord

        public Record nextRecord()
        Similar to next(), but returns a Record object, that may include metadata such as the source of the data
        Specified by:
        nextRecord in interface RecordReader
        Returns:
        next record
      • loadFromMetaData

        public Record loadFromMetaData​(RecordMetaData recordMetaData)
                                throws IOException
        Load a single record from the given RecordMetaData instance
        Note: that for data that isn't splittable (i.e., text data that needs to be scanned/split), it is more efficient to load multiple records at once using loadFromMetaData(List)
        Specified by:
        loadFromMetaData in interface RecordReader
        Parameters:
        recordMetaData - Metadata for the record that we want to load from
        Returns:
        Single record for the given RecordMetaData instance
        Throws:
        IOException - If I/O error occurs during loading
      • setListeners

        public void setListeners​(RecordListener... listeners)
        Set the record listeners for this record reader.
        Specified by:
        setListeners in interface RecordReader
        Parameters:
        listeners -
      • close

        public void close()
                   throws IOException
        Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

        As noted in AutoCloseable.close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        Throws:
        IOException - if an I/O error occurs
      • setConf

        public void setConf​(Configuration conf)
        Set the configuration to be used by this object.
        Specified by:
        setConf in interface Configurable
        Parameters:
        conf -