@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 protected boolean filter(Context context, Cell cell) { // TODO: Can I do a better compare than this copying out key? byte [] row = new byte [cell.getRowLength()]; System.arraycopy(cell.getRowArray(), cell.getRowOffset(), row, 0, cell.getRowLength()); boolean b = this.keysToFind.contains(row); if (b) { String keyStr = Bytes.toStringBinary(row); try { LOG.info("Found cell=" + cell + " , walKey=" + context.getCurrentKey()); } catch (IOException|InterruptedException e) { LOG.warn(e.toString(), e); } if (rows.addAndGet(1) < MISSING_ROWS_TO_LOG) { context.getCounter(FOUND_GROUP_KEY, keyStr).increment(1); } context.getCounter(FOUND_GROUP_KEY, "CELL_WITH_MISSING_ROW").increment(1); } return b; } }
@Override protected boolean filter(Context context, Cell cell) { // TODO: Can I do a better compare than this copying out key? byte [] row = new byte [cell.getRowLength()]; System.arraycopy(cell.getRowArray(), cell.getRowOffset(), row, 0, cell.getRowLength()); boolean b = this.keysToFind.contains(row); if (b) { String keyStr = Bytes.toStringBinary(row); try { LOG.info("Found cell=" + cell + " , walKey=" + context.getCurrentKey()); } catch (IOException|InterruptedException e) { LOG.warn(e.toString(), e); } if (rows.addAndGet(1) < MISSING_ROWS_TO_LOG) { context.getCounter(FOUND_GROUP_KEY, keyStr).increment(1); } context.getCounter(FOUND_GROUP_KEY, "CELL_WITH_MISSING_ROW").increment(1); } return b; } }
/** * 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); } } }
/** * 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 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); } }
@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); }
@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); 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); } }
/** * 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; }
@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; } }
this.map(context.getCurrentKey(), context.getCurrentValue(), context);