コード例 #1
0
ファイル: MemoryMapper.java プロジェクト: hasantayyar/faunus
 public MemoryMapContext(final Mapper.Context context) throws IOException, InterruptedException {
   super(
       context.getConfiguration(),
       context.getTaskAttemptID() == null ? new TaskAttemptID() : context.getTaskAttemptID(),
       null,
       null,
       context.getOutputCommitter(),
       null,
       context.getInputSplit());
   this.context = context;
   this.globalConfiguration = context.getConfiguration();
 }
コード例 #2
0
ファイル: ScriptMap.java プロジェクト: imclab/faunus
 @Override
 public void setup(final Mapper.Context context) throws IOException, InterruptedException {
   final FileSystem fs = FileSystem.get(context.getConfiguration());
   try {
     this.engine.eval(
         new InputStreamReader(fs.open(new Path(context.getConfiguration().get(SCRIPT_PATH)))));
     this.engine.put(ARGS, context.getConfiguration().getStrings(SCRIPT_ARGS));
     this.engine.eval(SETUP_ARGS);
   } catch (Exception e) {
     throw new InterruptedException(e.getMessage());
   }
   this.outputs = new SafeMapperOutputs(context);
 }
コード例 #3
0
 @Override
 public void setup(final Mapper.Context context) throws IOException, InterruptedException {
   this.map = new CounterMap<Object>();
   this.property = context.getConfiguration().get(PROPERTY);
   this.isVertex =
       context
           .getConfiguration()
           .getClass(CLASS, Element.class, Element.class)
           .equals(Vertex.class);
   this.handler =
       new WritableHandler(
           context.getConfiguration().getClass(TYPE, Text.class, WritableComparable.class));
   this.outputs = new SafeMapperOutputs(context);
 }
コード例 #4
0
 private BWAAlnInstance(Mapper.Context context, String bin)
     throws IOException, URISyntaxException {
   super(context, bin);
   taskId = context.getTaskAttemptID().toString();
   taskId = taskId.substring(taskId.indexOf("m_"));
   ref = HalvadeFileUtils.downloadBWAIndex(context, taskId);
   alnCustomArgs = HalvadeConf.getCustomArgs(context.getConfiguration(), "bwa", "aln");
 }
コード例 #5
0
  @Override
  protected void setup(org.apache.hadoop.mapreduce.Mapper.Context context)
      throws IOException, InterruptedException {

    kMaxValues = context.getConfiguration().getInt("map.numberOfKWords", 10);

    this.sortValues = new TreeSet<WordCount>();
  }
コード例 #6
0
 @Override
 public void setup(final Mapper.Context context) throws IOException, InterruptedException {
   this.isVertex =
       context
           .getConfiguration()
           .getClass(CLASS, Element.class, Element.class)
           .equals(Vertex.class);
 }
コード例 #7
0
 @Override
 protected void setup(Mapper.Context ctx) throws IOException, InterruptedException {
   maxSimilaritiesPerRow = ctx.getConfiguration().getInt(MAX_SIMILARITIES_PER_ROW, 0);
   Preconditions.checkArgument(
       maxSimilaritiesPerRow > 0, "Incorrect maximum number of similarities per row!");
 }
コード例 #8
0
 protected void setup(Mapper.Context context) throws IOException, InterruptedException {
   Configuration config = context.getConfiguration();
   this.caseSensitive = config.getBoolean("wordcount.case.sensitive", false);
 }
コード例 #9
0
 protected void setup(org.apache.hadoop.mapreduce.Mapper.Context context)
     throws IOException, InterruptedException {
   sourceColumn = ByteBuffer.wrap(context.getConfiguration().get(CONF_COLUMN_NAME).getBytes());
 }