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 ClassesModifier and TypeClassDescription(package private) static classSerializes the key and value and writes to the flow file's output stream. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.slf4j.Loggerprivate static final Patternprivate final org.apache.nifi.processor.ProcessSession -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSet<org.apache.nifi.flowfile.FlowFile> readSequenceFile(org.apache.hadoop.fs.Path file, org.apache.hadoop.conf.Configuration configuration, org.apache.hadoop.fs.FileSystem fileSystem)
-
Field Details
-
LOG
private static final org.slf4j.Logger LOG -
session
private final org.apache.nifi.processor.ProcessSession session -
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:
readSequenceFilein interfaceSequenceFileReader<Set<org.apache.nifi.flowfile.FlowFile>>- Throws:
IOException
-