@Override public void run(Context context) throws IOException, InterruptedException { setup(context); while (context.nextKeyValue()) { map(context.getCurrentKey(), context.getCurrentValue(), context); } for (Map.Entry<Interval, HyperLogLogCollector> entry : hyperLogLogs.entrySet()) { context.write( new LongWritable(entry.getKey().getStartMillis()), new BytesWritable(entry.getValue().toByteArray()) ); } cleanup(context); }
try { while (context.nextKeyValue()) { this.map(context.getCurrentKey(), context.getCurrentValue(), context);
@Override public void run(Context context) throws IOException, InterruptedException { setup(context); while (context.nextKeyValue()) { map(context.getCurrentKey(), context.getCurrentValue(), context); } for (Map.Entry<Interval, HyperLogLogCollector> entry : hyperLogLogs.entrySet()) { context.write( new LongWritable(entry.getKey().getStartMillis()), new BytesWritable(entry.getValue().toByteArray()) ); } cleanup(context); }
public void runThreadSafe(Context outerCtx, Context subCtx) throws IOException, InterruptedException { setup(subCtx); KEYIN key = null; VALUEIN value = null; try { while (!ContentPump.shutdown) { synchronized (outerCtx) { if (!subCtx.nextKeyValue()) { break; } key = subCtx.getCurrentKey(); value = subCtx.getCurrentValue(); } map(key, value, subCtx); } } finally { if (ContentPump.shutdown && LOG.isDebugEnabled()) { LOG.debug("Aborting task..."); } cleanup(subCtx); } }
/** * Expert users can override this method for more complete control over the * execution of the Mapper. * @param context * @throws IOException */ public void run(Context context) throws IOException, InterruptedException { setup(context); try { while (context.nextKeyValue()) { map(context.getCurrentKey(), context.getCurrentValue(), context); } } finally { cleanup(context); } } }
/** * Expert users can override this method for more complete control over the * execution of the Mapper. * @param context * @throws IOException */ public void run(Context context) throws IOException, InterruptedException { setup(context); try { while (context.nextKeyValue()) { map(context.getCurrentKey(), context.getCurrentValue(), context); } } finally { cleanup(context); } } }
@Override protected void map(NullWritable key, RowResult value, Mapper.Context context) throws IOException, InterruptedException { // Add as many heads as we need, then we skip the rest. do { if (headsCache.size() < numUpdatesPerMapper) { value = (RowResult)context.getCurrentValue(); headsCache.add(new Pair<Long, Long>(value.getLong(0), value.getLong(1))); } } while (context.nextKeyValue()); // At this point we've exhausted the scanner and hopefully gathered all the linked list // heads we needed. LOG.info("Processing " + headsCache.size() + " linked lists, out of " + numUpdatesPerMapper); processAllHeads(context); }
@Override public void run(Context context) throws IOException, InterruptedException { this.setup(context); try { while (context.nextKeyValue()) { this.map(context.getCurrentKey(), context.getCurrentValue(), context); annotateVariants(context, false); } annotateVariants(context, true); } catch (VariantAnnotatorException e) { throw new RuntimeException(e); } finally { this.cleanup(context); } }
/** * Expert users can override this method for more complete control over the * execution of the Mapper. * @param context * @throws IOException */ public void run(Context context) throws IOException, InterruptedException { setup(context); try { while (context.nextKeyValue()) { map(context.getCurrentKey(), context.getCurrentValue(), context); } } finally { cleanup(context); } } }
@Override public void run(Context context) throws IOException, InterruptedException { setup(context); while (context.nextKeyValue()) { map(context.getCurrentKey(), context.getCurrentValue(), context); } for (Map.Entry<Interval, HyperLogLogCollector> entry : hyperLogLogs.entrySet()) { context.write( new LongWritable(entry.getKey().getStartMillis()), new BytesWritable(entry.getValue().toByteArray()) ); } cleanup(context); }
@Override public void run(Context context) throws IOException, InterruptedException { setup(context); while (context.nextKeyValue()) { map(context.getCurrentKey(), context.getCurrentValue(), context); } for (Map.Entry<Interval, HyperLogLogCollector> entry : hyperLogLogs.entrySet()) { context.write( new LongWritable(entry.getKey().getStartMillis()), new BytesWritable(entry.getValue().toByteArray()) ); } cleanup(context); }
/** * Expert users can override this method for more complete control over the * execution of the Mapper. * @param context * @throws IOException */ public void run(Context context) throws IOException, InterruptedException { setup(context); try { while (context.nextKeyValue()) { map(context.getCurrentKey(), context.getCurrentValue(), context); } } finally { cleanup(context); } } }
@Override public void run(Context context) throws IOException, InterruptedException { setup(context); try { while (!ContentPump.shutdown && context.nextKeyValue()) { map(context.getCurrentKey(), context.getCurrentValue(), context); } } finally { if (ContentPump.shutdown && LOG.isDebugEnabled()) { LOG.debug("Aborting task..."); } cleanup(context); } } }
/** * Expert users can override this method for more complete control over the * execution of the Mapper. * @param context * @throws IOException */ public void run(Context context) throws IOException, InterruptedException { setup(context); while (context.nextKeyValue()) { map(context.getCurrentKey(), context.getCurrentValue(), context); } cleanup(context); } }
private static RyaStatement nextRyaStatement(final Context context, final RyaTripleContext ryaContext) throws IOException, InterruptedException { RyaStatement ryaStatement = null; if (context.nextKeyValue()) { final Key key = context.getCurrentKey(); final Value value = context.getCurrentValue(); try { ryaStatement = createRyaStatement(key, value, ryaContext); } catch (final TripleRowResolverException e) { log.error("TripleRowResolverException encountered while creating statement", e); } } return ryaStatement; }
/** * Expert users can override this method for more complete control over the * execution of the Mapper. * @param context * @throws IOException */ public void run(Context context) throws IOException, InterruptedException { setup(context); while (context.nextKeyValue()) { map(context.getCurrentKey(), context.getCurrentValue(), context); } cleanup(context); } }
@Override public boolean nextKeyValue() throws IOException, InterruptedException { synchronized(outer) { if(!outer.nextKeyValue()) { return false; } key = ReflectionUtils.copy(outer.getConfiguration(), outer.getCurrentKey(), key); value = ReflectionUtils.copy(conf, outer.getCurrentValue(), value); return true; } }
@Override public void run(Context context) throws IOException, InterruptedException { setup(context); while ((count < fequency) && context.nextKeyValue()) { float diff = fequency - count; if (random.nextFloat() <= diff) { map(context.getCurrentKey(), context.getCurrentValue(), context); } count++; } cleanup(context); }
@Override public void run(Context context) throws IOException, InterruptedException { setup(context); while ((count < limit) && context.nextKeyValue()) { map(context.getCurrentKey(), context.getCurrentValue(), context); count++; } cleanup(context); }
@Override public boolean nextKeyValue() throws IOException, InterruptedException { synchronized(outer) { if(!outer.nextKeyValue()) { return false; } key = ReflectionUtils.copy(outer.getConfiguration(), outer.getCurrentKey(), key); value = ReflectionUtils.copy(conf, outer.getCurrentValue(), value); return true; } }