cascading.scheme.hadoop
Class WritableSequenceFile
java.lang.Object
cascading.scheme.Scheme<JobConf,RecordReader,OutputCollector,Object[],Void>
cascading.scheme.hadoop.SequenceFile
cascading.scheme.hadoop.WritableSequenceFile
- All Implemented Interfaces:
- Traceable, Serializable
public class WritableSequenceFile
- extends SequenceFile
Class WritableSequenceFile is a sub-class of 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.
- See Also:
- Serialized Form
Methods inherited from class cascading.scheme.Scheme |
getNumSinkParts, getSinkFields, getSourceFields, getTrace, isSink, isSource, isSymmetrical, presentSinkFields, presentSinkFieldsInternal, presentSourceFields, presentSourceFieldsInternal, retrieveSinkFields, retrieveSourceFields, setNumSinkParts, setSinkFields, setSourceFields, sinkCleanup, sinkPrepare, toString |
keyType
protected final Class<? extends Writable> keyType
valueType
protected final Class<? extends Writable> valueType
WritableSequenceFile
@ConstructorProperties(value={"fields","valueType"})
public WritableSequenceFile(Fields fields,
Class<? extends Writable> valueType)
- Constructor WritableSequenceFile creates a new WritableSequenceFile instance.
- Parameters:
fields
- of type FieldsvalueType
- of type Class extends Writable>, may not be null
WritableSequenceFile
@ConstructorProperties(value={"fields","keyType","valueType"})
public WritableSequenceFile(Fields fields,
Class<? extends Writable> keyType,
Class<? extends Writable> valueType)
- Constructor WritableSequenceFile creates a new WritableSequenceFile instance.
- Parameters:
fields
- of type FieldskeyType
- of type Class extends Writable>valueType
- of type Class extends Writable>
sinkConfInit
public void sinkConfInit(FlowProcess<JobConf> flowProcess,
Tap<JobConf,RecordReader,OutputCollector> tap,
JobConf conf)
- Overrides:
sinkConfInit
in class SequenceFile
source
public boolean source(FlowProcess<JobConf> flowProcess,
SourceCall<Object[],RecordReader> sourceCall)
throws IOException
- Overrides:
source
in class SequenceFile
- Throws:
IOException
sink
public void sink(FlowProcess<JobConf> flowProcess,
SinkCall<Void,OutputCollector> sinkCall)
throws IOException
- Overrides:
sink
in class SequenceFile
- Throws:
IOException
equals
public boolean equals(Object object)
- Overrides:
equals
in class Scheme<JobConf,RecordReader,OutputCollector,Object[],Void>
hashCode
public int hashCode()
- Overrides:
hashCode
in class Scheme<JobConf,RecordReader,OutputCollector,Object[],Void>
Copyright © 2007-2014 Concurrent, Inc. All Rights Reserved.