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(); }
@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); }
@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); }
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>(); }
@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!"); }
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()); }