当前位置: 首页>>代码示例>>Java>>正文


Java Container类代码示例

本文整理汇总了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;
}
 
开发者ID:Datasio,项目名称:cascalog-avro-parquet,代码行数:23,代码来源:HMAvroParquetScheme.java

示例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)));
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:5,代码来源:DeprecatedInputFormatTest.java


注:本文中的parquet.hadoop.mapred.Container类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。