예제 #1
0
 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
 @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");
 }
  @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);
 }
 @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);
 }
 protected void setup(org.apache.hadoop.mapreduce.Mapper.Context context)
     throws IOException, InterruptedException {
   sourceColumn = ByteBuffer.wrap(context.getConfiguration().get(CONF_COLUMN_NAME).getBytes());
 }