本文整理汇总了Java中parquet.hadoop.mapred.Container类的典型用法代码示例。如果您正苦于以下问题:Java Container类的具体用法?Java Container怎么用?Java Container使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Container类属于parquet.hadoop.mapred包,在下文中一共展示了Container类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: source
import parquet.hadoop.mapred.Container; //导入依赖的package包/类
/**
* Reads in Avro records of type T and adds them as the first field in a tuple.
*
* @param flowProcess The cascading FlowProcess object. Should be passed in by cascading automatically.
* @param sourceCall The cascading SourceCall object. Should be passed in by cascading automatically.
* @return boolean true on successful parsing and collection, false on failure.
* @throws java.io.IOException
*/
@Override
public boolean source(FlowProcess<JobConf> flowProcess, SourceCall<Object[], RecordReader> sourceCall) throws IOException {
@SuppressWarnings("unchecked") RecordReader<Void, Container<HashMap>> input = sourceCall.getInput();
Container<HashMap> value = input.createValue();
if (!input.next(null, value)) {
return false;
}
Tuple tuple = sourceCall.getIncomingEntry().getTuple();
tuple.clear();
HashMap hm = value.get();
// PersistentArrayMap m = (PersistentArrayMap) ClojureAvroParquetScheme.into.invoke(PersistentArrayMap.EMPTY, hm);
tuple.add(hm);
return true;
}
示例2: map
import parquet.hadoop.mapred.Container; //导入依赖的package包/类
public void map(Void aVoid, Container<Group> valueContainer, OutputCollector<LongWritable, Text> longWritableTextOutputCollector, Reporter reporter) throws IOException {
Group value = valueContainer.get();
longWritableTextOutputCollector.collect(new LongWritable(value.getInteger("line", 0)), new Text(value.getString("content", 0)));
}