public class WritableSequenceFile extends SequenceFile
SequenceFile
that reads and writes values of the given
writableType
Class
, instead of Tuple
instances used by default in SequenceFile.
This Class is a convenience for those who need to read/write specific types from existing sequence files without
them being wrapped in a Tuple instance.
Note due to the nature of sequence files, only one type can be stored in the key and value positions, they they can be
uniquely different types (LongWritable, Text).
If keyType is null, valueType must not be null, and vice versa, assuming you only wish to store a single value.
NullWritable
is used as the empty type for either a null keyType or valueType.Modifier and Type | Field and Description |
---|---|
protected Class<? extends Writable> |
keyType |
protected Class<? extends Writable> |
valueType |
Constructor and Description |
---|
WritableSequenceFile(Fields fields,
Class<? extends Writable> valueType)
Constructor WritableSequenceFile creates a new WritableSequenceFile instance.
|
WritableSequenceFile(Fields fields,
Class<? extends Writable> keyType,
Class<? extends Writable> valueType)
Constructor WritableSequenceFile creates a new WritableSequenceFile instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object object) |
int |
hashCode() |
void |
sink(FlowProcess<? extends Configuration> flowProcess,
SinkCall<Void,OutputCollector> sinkCall) |
void |
sinkConfInit(FlowProcess<? extends Configuration> flowProcess,
Tap<Configuration,RecordReader,OutputCollector> tap,
Configuration conf) |
boolean |
source(FlowProcess<? extends Configuration> flowProcess,
SourceCall<Object[],RecordReader> sourceCall) |
sourceCleanup, sourceConfInit, sourcePrepare
getNumSinkParts, getSinkFields, getSourceFields, getTrace, isSink, isSource, isSymmetrical, presentSinkFields, presentSinkFieldsInternal, presentSourceFields, presentSourceFieldsInternal, retrieveSinkFields, retrieveSourceFields, setNumSinkParts, setSinkFields, setSourceFields, sinkCleanup, sinkPrepare, toString
@ConstructorProperties(value={"fields","valueType"}) public WritableSequenceFile(Fields fields, Class<? extends Writable> valueType)
fields
- of type FieldsvalueType
- of type Class extends Writable>, may not be null@ConstructorProperties(value={"fields","keyType","valueType"}) public WritableSequenceFile(Fields fields, Class<? extends Writable> keyType, Class<? extends Writable> valueType)
fields
- of type FieldskeyType
- of type Class extends Writable>valueType
- of type Class extends Writable>public void sinkConfInit(FlowProcess<? extends Configuration> flowProcess, Tap<Configuration,RecordReader,OutputCollector> tap, Configuration conf)
sinkConfInit
in class SequenceFile
public boolean source(FlowProcess<? extends Configuration> flowProcess, SourceCall<Object[],RecordReader> sourceCall) throws IOException
source
in class SequenceFile
IOException
public void sink(FlowProcess<? extends Configuration> flowProcess, SinkCall<Void,OutputCollector> sinkCall) throws IOException
sink
in class SequenceFile
IOException
public boolean equals(Object object)
equals
in class Scheme<Configuration,RecordReader,OutputCollector,Object[],Void>
public int hashCode()
hashCode
in class Scheme<Configuration,RecordReader,OutputCollector,Object[],Void>
Copyright © 2007-2015 Concurrent, Inc. All Rights Reserved.