Class KeyValueReader

java.lang.Object
org.apache.nifi.processors.hadoop.KeyValueReader
All Implemented Interfaces:
SequenceFileReader<Set<org.apache.nifi.flowfile.FlowFile>>

public class KeyValueReader extends Object implements SequenceFileReader<Set<org.apache.nifi.flowfile.FlowFile>>
This class reads a SequenceFile and generates FlowFiles, one per KeyValue pair in the SequenceFile. The FlowFile name is based on the the incoming file name with System nanotime appended; the FlowFile content is the key/value pair serialized via Text.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    (package private) static class 
    Serializes the key and value and writes to the flow file's output stream.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final org.slf4j.Logger
     
    private static final Pattern
     
    private final org.apache.nifi.processor.ProcessSession
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    KeyValueReader(org.apache.nifi.processor.ProcessSession session)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Set<org.apache.nifi.flowfile.FlowFile>
    readSequenceFile(org.apache.hadoop.fs.Path file, org.apache.hadoop.conf.Configuration configuration, org.apache.hadoop.fs.FileSystem fileSystem)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • LOG

      private static final org.slf4j.Logger LOG
    • session

      private final org.apache.nifi.processor.ProcessSession session
    • LOOKS_LIKE_FILENAME

      private static final Pattern LOOKS_LIKE_FILENAME
  • Constructor Details

    • KeyValueReader

      public KeyValueReader(org.apache.nifi.processor.ProcessSession session)
  • Method Details

    • readSequenceFile

      public Set<org.apache.nifi.flowfile.FlowFile> readSequenceFile(org.apache.hadoop.fs.Path file, org.apache.hadoop.conf.Configuration configuration, org.apache.hadoop.fs.FileSystem fileSystem) throws IOException
      Specified by:
      readSequenceFile in interface SequenceFileReader<Set<org.apache.nifi.flowfile.FlowFile>>
      Throws:
      IOException