Class JacksonRecordReader

    • Constructor Detail

      • JacksonRecordReader

        public JacksonRecordReader​(FieldSelection selection,
                                   org.nd4j.shade.jackson.databind.ObjectMapper mapper)
      • JacksonRecordReader

        public JacksonRecordReader​(FieldSelection selection,
                                   org.nd4j.shade.jackson.databind.ObjectMapper mapper,
                                   boolean shuffle)
      • JacksonRecordReader

        public JacksonRecordReader​(FieldSelection selection,
                                   org.nd4j.shade.jackson.databind.ObjectMapper mapper,
                                   boolean shuffle,
                                   long rngSeed,
                                   PathLabelGenerator labelGenerator)
      • JacksonRecordReader

        public JacksonRecordReader​(FieldSelection selection,
                                   org.nd4j.shade.jackson.databind.ObjectMapper mapper,
                                   boolean shuffle,
                                   long rngSeed,
                                   PathLabelGenerator labelGenerator,
                                   int labelPosition)
    • Method Detail

      • hasNext

        public boolean hasNext()
        Description copied from interface: RecordReader
        Whether there are anymore records
        Returns:
      • getLabels

        public List<String> getLabels()
        Description copied from interface: RecordReader
        List of label strings
        Returns:
      • reset

        public void reset()
        Description copied from interface: RecordReader
        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
        Description copied from interface: RecordReader
        Load the record from the given DataInputStream Unlike RecordReader.next() the internal state of the RecordReader is not modified Implementations of this method should not close the DataInputStream
        Throws:
        IOException - if error occurs during reading from the input stream
      • setConf

        public void setConf​(Configuration conf)
        Description copied from interface: Configurable
        Set the configuration to be used by this object.
      • getConf

        public Configuration getConf()
        Description copied from interface: Configurable
        Return the configuration used by this object.
      • 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