Search in sources :

Example 16 with OutputCollector

use of org.apache.hadoop.mapred.OutputCollector in project elephant-bird by twitter.

the class LzoBinaryScheme method sink.

@Override
public void sink(FlowProcess<? extends Configuration> flowProcess, SinkCall<T, OutputCollector> sinkCall) throws IOException {
    OutputCollector collector = sinkCall.getOutput();
    TupleEntry entry = sinkCall.getOutgoingEntry();
    T writable = sinkCall.getContext();
    writable.set((M) entry.getTuple().getObject(0));
    collector.collect(null, writable);
}
Also used : OutputCollector(org.apache.hadoop.mapred.OutputCollector) TupleEntry(cascading.tuple.TupleEntry)

Example 17 with OutputCollector

use of org.apache.hadoop.mapred.OutputCollector in project elephant-bird by twitter.

the class TestCombinedSequenceFile method testHadoopConf.

@Test
public void testHadoopConf() {
    CombinedSequenceFile csfScheme = new CombinedSequenceFile(Fields.ALL);
    JobConf conf = new JobConf();
    FlowProcess fp = new HadoopFlowProcess();
    Tap<Configuration, RecordReader, OutputCollector> tap = new TempHfs(conf, "test", CombinedSequenceFile.class, false);
    csfScheme.sourceConfInit(fp, tap, conf);
    assertEquals("MapReduceInputFormatWrapper shold wrap mapred.SequenceFileinputFormat", "org.apache.hadoop.mapred.SequenceFileInputFormat", conf.get(MapReduceInputFormatWrapper.CLASS_CONF_KEY));
    assertEquals("Delegate combiner should wrap MapReduceInputFormatWrapper", "com.twitter.elephantbird.mapreduce.input.MapReduceInputFormatWrapper", conf.get(DelegateCombineFileInputFormat.COMBINED_INPUT_FORMAT_DELEGATE));
    assertEquals("DeprecatedInputFormatWrapper should wrap Delegate combiner", "com.twitter.elephantbird.mapreduce.input.combine.DelegateCombineFileInputFormat", conf.get(DeprecatedInputFormatWrapper.CLASS_CONF_KEY));
}
Also used : OutputCollector(org.apache.hadoop.mapred.OutputCollector) HadoopFlowProcess(cascading.flow.hadoop.HadoopFlowProcess) FlowProcess(cascading.flow.FlowProcess) Configuration(org.apache.hadoop.conf.Configuration) RecordReader(org.apache.hadoop.mapred.RecordReader) HadoopFlowProcess(cascading.flow.hadoop.HadoopFlowProcess) TempHfs(cascading.tap.hadoop.util.TempHfs) JobConf(org.apache.hadoop.mapred.JobConf) Test(org.junit.Test)

Aggregations

OutputCollector (org.apache.hadoop.mapred.OutputCollector)17 TupleEntry (cascading.tuple.TupleEntry)9 ImmutableBytesWritable (org.apache.hadoop.hbase.io.ImmutableBytesWritable)4 Tuple (cascading.tuple.Tuple)3 JobConf (org.apache.hadoop.mapred.JobConf)3 RecordReader (org.apache.hadoop.mapred.RecordReader)3 Reporter (org.apache.hadoop.mapred.Reporter)3 Test (org.junit.Test)3 FlowProcess (cascading.flow.FlowProcess)2 HadoopFlowProcess (cascading.flow.hadoop.HadoopFlowProcess)2 TempHfs (cascading.tap.hadoop.util.TempHfs)2 Fields (cascading.tuple.Fields)2 Configuration (org.apache.hadoop.conf.Configuration)2 Put (org.apache.hadoop.hbase.client.Put)2 Result (org.apache.hadoop.hbase.client.Result)2 InputSplit (org.apache.hadoop.mapred.InputSplit)2 Reducer (org.apache.hadoop.mapred.Reducer)2 IOException (java.io.IOException)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 Cell (org.apache.hadoop.hbase.Cell)1