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


Java WrappedMapper.getMapContext方法代码示例

本文整理汇总了Java中org.apache.hadoop.mapreduce.lib.map.WrappedMapper.getMapContext方法的典型用法代码示例。如果您正苦于以下问题:Java WrappedMapper.getMapContext方法的具体用法?Java WrappedMapper.getMapContext怎么用?Java WrappedMapper.getMapContext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.mapreduce.lib.map.WrappedMapper的用法示例。


在下文中一共展示了WrappedMapper.getMapContext方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: buildProxyMapperContext

import org.apache.hadoop.mapreduce.lib.map.WrappedMapper; //导入方法依赖的package包/类
/**
 * Utility to generate dummy Mapper#Context for use in Giraph internals.
 * This is the "key hack" to inject MapReduce-related data structures
 * containing YARN cluster metadata (and our GiraphConf from the AppMaster)
 * into our Giraph BSP task code.
 * @param tid the TaskAttemptID to construct this Mapper#Context from.
 * @return sort of a Mapper#Context if you squint just right.
 */
private Context buildProxyMapperContext(final TaskAttemptID tid) {
  MapContext mc = new MapContextImpl<Object, Object, Object, Object>(
    conf, // our Configuration, populated back at the GiraphYarnClient.
    tid,  // our TaskAttemptId, generated w/YARN app, container, attempt IDs
    null, // RecordReader here will never be used by Giraph
    null, // RecordWriter here will never be used by Giraph
    null, // OutputCommitter here will never be used by Giraph
    new TaskAttemptContextImpl.DummyReporter() { // goes in task logs for now
      @Override
      public void setStatus(String msg) {
        LOG.info("[STATUS: task-" + bspTaskId + "] " + msg);
      }
    },
    null); // Input split setting here will never be used by Giraph

  // now, we wrap our MapContext ref so we can produce a Mapper#Context
  WrappedMapper<Object, Object, Object, Object> wrappedMapper
    = new WrappedMapper<Object, Object, Object, Object>();
  return wrappedMapper.getMapContext(mc);
}
 
开发者ID:renato2099,项目名称:giraph-gora,代码行数:29,代码来源:GiraphYarnTask.java

示例2: StubContext

import org.apache.hadoop.mapreduce.lib.map.WrappedMapper; //导入方法依赖的package包/类
public StubContext(Configuration conf, RecordReader<Text, CopyListingFileStatus> reader, int taskId)
    throws IOException, InterruptedException {

  WrappedMapper<Text, CopyListingFileStatus, Text, Text> wrappedMapper = new WrappedMapper<>();

  MapContextImpl<Text, CopyListingFileStatus, Text, Text> contextImpl = new MapContextImpl<>(conf,
      getTaskAttemptID(taskId), reader, writer, null, reporter, null);

  this.reader = reader;
  mapperContext = wrappedMapper.getMapContext(contextImpl);
}
 
开发者ID:HotelsDotCom,项目名称:circus-train,代码行数:12,代码来源:StubContext.java

示例3: StubContext

import org.apache.hadoop.mapreduce.lib.map.WrappedMapper; //导入方法依赖的package包/类
public StubContext(Configuration conf,
    RecordReader<Text, CopyListingFileStatus> reader, int taskId)
    throws IOException, InterruptedException {

  WrappedMapper<Text, CopyListingFileStatus, Text, Text> wrappedMapper
          = new WrappedMapper<Text, CopyListingFileStatus, Text, Text>();

  MapContextImpl<Text, CopyListingFileStatus, Text, Text> contextImpl
          = new MapContextImpl<Text, CopyListingFileStatus, Text, Text>(conf,
          getTaskAttemptID(taskId), reader, writer,
          null, reporter, null);

  this.reader = reader;
  this.mapperContext = wrappedMapper.getMapContext(contextImpl);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:16,代码来源:StubContext.java

示例4: StubContext

import org.apache.hadoop.mapreduce.lib.map.WrappedMapper; //导入方法依赖的package包/类
public StubContext(Configuration conf, RecordReader<Text, FileStatus> reader,
                   int taskId) throws IOException, InterruptedException {

  WrappedMapper<Text, FileStatus, Text, Text> wrappedMapper
          = new WrappedMapper<Text, FileStatus, Text, Text>();

  MapContextImpl<Text, FileStatus, Text, Text> contextImpl
          = new MapContextImpl<Text, FileStatus, Text, Text>(conf,
          getTaskAttemptID(taskId), reader, writer,
          null, reporter, null);

  this.reader = reader;
  this.mapperContext = wrappedMapper.getMapContext(contextImpl);
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:15,代码来源:StubContext.java


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