public List<Object> deserialize(ByteBuffer ser) { // Maintain backward compatibility for 0.10 byte[] b = Utils.toByteArray(ser); return Utils.tuple(new Object[]{ b }); }
@Override public Iterable<List<Object>> deserialize(ByteBuffer ser) { return asList(Utils.tuple(Utils.toByteArray(ser))); }
public void execute(Tuple input, BasicOutputCollector collector) { total = total.add(new BigInteger(input.getValues().get(1).toString())); collector.emit(tuple(total.toString())); //prints the total with low probability. if (RANDOM.nextInt(1000) > 995) { LOG.info("Running total = " + total); } }
public void execute(Tuple input, BasicOutputCollector collector) { total = total.add(new BigInteger(input.getValues().get(1).toString())); collector.emit(tuple(total.toString())); //prints the total with low probability. if(RANDOM.nextInt(1000) > 995) { LOG.info("Running total = " + total); } }
public void execute(Tuple input, BasicOutputCollector collector) { String word = getTupleValue(input, 0); int count = 0; if (_counts.containsKey(word)) { count = _counts.get(word); } count++; _counts.put(word, count); collector.emit(tuple(word, count)); }
public void execute(Tuple input) { String word = (String) input.getValues().get(0); int count = (Integer) input.getValues().get(1); _counts.put(word, count); int globalCount = 0; for (String w : _counts.keySet()) { globalCount += _counts.get(w); } _collector.emit(tuple(globalCount)); _collector.ack(input); }
public void execute(Tuple input, BasicOutputCollector collector) { collector.emit(tuple(input.getValues().get(0), 1)); }
public void execute(Tuple input, BasicOutputCollector collector) { collector.emit(tuple(input.getValues().get(0), 1)); }
@Override public List<Object> deserialize(ByteBuffer ser) { byte[] bytes = new byte[ser.remaining()]; ser.get(bytes); return tuple(bytes); }
@Override public Iterable<List<Object>> deserialize(ByteBuffer ser) { byte[] bytes = new byte[ser.remaining()]; ser.get(bytes); return asList(tuple(bytes)); }
@Override public Iterable<List<Object>> deserialize(ByteBuffer ser) { return asList(tuple(Utils.toByteArray(ser))); }
public List<Object> deserialize(ByteBuffer ser) { // Maintain backward compatibility for 0.10 byte[] b = Utils.toByteArray(ser); return tuple(new Object[]{b}); }
public void execute(Tuple input, BasicOutputCollector collector) { String word = getTupleValue(input, 0); int count = 0; if(_counts.containsKey(word)) { count = _counts.get(word); } count++; _counts.put(word, count); collector.emit(tuple(word, count)); }
public void execute(Tuple input) { String word = (String) input.getValues().get(0); int count = (Integer) input.getValues().get(1); _counts.put(word, count); int globalCount = 0; for(String w: _counts.keySet()) { globalCount+=_counts.get(w); } _collector.emit(tuple(globalCount)); _collector.ack(input); }