|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cascading.scheme.Scheme<org.apache.hadoop.mapred.JobConf,org.apache.hadoop.mapred.RecordReader,org.apache.hadoop.mapred.OutputCollector,Object[],Void> cascading.scheme.hadoop.SequenceFile cascading.scheme.hadoop.WritableSequenceFile
public class WritableSequenceFile
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.
NullWritable
is used as the empty type for either a null keyType or valueType.
Field Summary | |
---|---|
protected Class<? extends org.apache.hadoop.io.Writable> |
keyType
|
protected Class<? extends org.apache.hadoop.io.Writable> |
valueType
|
Constructor Summary | |
---|---|
WritableSequenceFile(Fields fields,
Class<? extends org.apache.hadoop.io.Writable> valueType)
Constructor WritableSequenceFile creates a new WritableSequenceFile instance. |
|
WritableSequenceFile(Fields fields,
Class<? extends org.apache.hadoop.io.Writable> keyType,
Class<? extends org.apache.hadoop.io.Writable> valueType)
Constructor WritableSequenceFile creates a new WritableSequenceFile instance. |
Method Summary | |
---|---|
boolean |
equals(Object object)
|
int |
hashCode()
|
void |
sink(FlowProcess<org.apache.hadoop.mapred.JobConf> flowProcess,
SinkCall<Void,org.apache.hadoop.mapred.OutputCollector> sinkCall)
Method sink writes out the given Tuple found on SinkCall.getOutgoingEntry() to
the SinkCall.getOutput() . |
void |
sinkConfInit(FlowProcess<org.apache.hadoop.mapred.JobConf> flowProcess,
Tap<org.apache.hadoop.mapred.JobConf,org.apache.hadoop.mapred.RecordReader,org.apache.hadoop.mapred.OutputCollector> tap,
org.apache.hadoop.mapred.JobConf conf)
Method sinkInit initializes this instance as a sink. |
boolean |
source(FlowProcess<org.apache.hadoop.mapred.JobConf> flowProcess,
SourceCall<Object[],org.apache.hadoop.mapred.RecordReader> sourceCall)
Method source will read a new "record" or value from SourceCall.getInput() and populate
the available Tuple via SourceCall.getIncomingEntry() and return true
on success or false if no more values available. |
Methods inherited from class cascading.scheme.hadoop.SequenceFile |
---|
sourceCleanup, sourceConfInit, sourcePrepare |
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 |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final Class<? extends org.apache.hadoop.io.Writable> keyType
protected final Class<? extends org.apache.hadoop.io.Writable> valueType
Constructor Detail |
---|
@ConstructorProperties(value={"fields","valueType"}) public WritableSequenceFile(Fields fields, Class<? extends org.apache.hadoop.io.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 org.apache.hadoop.io.Writable> keyType, Class<? extends org.apache.hadoop.io.Writable> valueType)
fields
- of type FieldskeyType
- of type Class extends Writable>valueType
- of type Class extends Writable>Method Detail |
---|
public void sinkConfInit(FlowProcess<org.apache.hadoop.mapred.JobConf> flowProcess, Tap<org.apache.hadoop.mapred.JobConf,org.apache.hadoop.mapred.RecordReader,org.apache.hadoop.mapred.OutputCollector> tap, org.apache.hadoop.mapred.JobConf conf)
Scheme
Scheme.sinkPrepare(cascading.flow.FlowProcess, SinkCall)
if resources much be initialized
before use. And Scheme.sinkCleanup(cascading.flow.FlowProcess, SinkCall)
if resources must be
destroyed after use.
sinkConfInit
in class SequenceFile
flowProcess
- of type FlowProcesstap
- of type Tapconf
- of type Configpublic boolean source(FlowProcess<org.apache.hadoop.mapred.JobConf> flowProcess, SourceCall<Object[],org.apache.hadoop.mapred.RecordReader> sourceCall) throws IOException
Scheme
SourceCall.getInput()
and populate
the available Tuple
via SourceCall.getIncomingEntry()
and return true
on success or false
if no more values available.
It's ok to set a new Tuple instance on the incomingEntry
TupleEntry
, or
to simply re-use the existing instance.
Note this is only time it is safe to modify a Tuple instance handed over via a method call.
This method may optionally throw a TapException
if it cannot process a particular
instance of data. If the payload Tuple is set on the TapException, that Tuple will be written to
any applicable failure trap Tap.
source
in class SequenceFile
flowProcess
- of type FlowProcesssourceCall
- of SourceCall
true
when a Tuple was successfully read
IOException
public void sink(FlowProcess<org.apache.hadoop.mapred.JobConf> flowProcess, SinkCall<Void,org.apache.hadoop.mapred.OutputCollector> sinkCall) throws IOException
Scheme
Tuple
found on SinkCall.getOutgoingEntry()
to
the SinkCall.getOutput()
.
This method may optionally throw a TapException
if it cannot process a particular
instance of data. If the payload Tuple is set on the TapException, that Tuple will be written to
any applicable failure trap Tap. If not set, the incoming Tuple will be written instead.
sink
in class SequenceFile
flowProcess
- of ProcesssinkCall
- of SinkCall
IOException
public boolean equals(Object object)
equals
in class Scheme<org.apache.hadoop.mapred.JobConf,org.apache.hadoop.mapred.RecordReader,org.apache.hadoop.mapred.OutputCollector,Object[],Void>
public int hashCode()
hashCode
in class Scheme<org.apache.hadoop.mapred.JobConf,org.apache.hadoop.mapred.RecordReader,org.apache.hadoop.mapred.OutputCollector,Object[],Void>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |