Class ListStringRecordReader

    • Constructor Detail

      • ListStringRecordReader

        public ListStringRecordReader()
    • Method Detail

      • next

        public List<Writable> next()
        Get the next record
        Returns:
        The list of next record
      • hasNext

        public boolean hasNext()
        Check whether there are anymore records
        Returns:
        Whether there are more records
      • getLabels

        public List<String> getLabels()
        List of label strings
        Returns:
      • reset

        public void reset()
        Reset record reader iterator
      • resetSupported

        public boolean resetSupported()
        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
        Parameters:
        uri -
        dataInputStream -
        Throws:
        IOException - if error occurs during reading from the input stream
      • nextRecord

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

        public Record loadFromMetaData​(RecordMetaData recordMetaData)
                                throws IOException
        Description copied from interface: RecordReader
        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 RecordReader.loadFromMetaData(List)
        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
      • loadFromMetaData

        public List<Record> loadFromMetaData​(List<RecordMetaData> recordMetaDatas)
                                      throws IOException
        Description copied from interface: RecordReader
        Load multiple records from the given a list of RecordMetaData instances
        Parameters:
        recordMetaDatas - Metadata for the records that we want to load from
        Returns:
        Multiple records for the given RecordMetaData instances
        Throws:
        IOException - If I/O error occurs during loading
      • 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.

        Throws:
        IOException - if an I/O error occurs
      • setConf

        public void setConf​(Configuration conf)
        Set the configuration to be used by this object.
        Parameters:
        conf -
      • getConf

        public Configuration getConf()
        Return the configuration used by this object.