/** * Sets the new value of this vertex. Setting a new value triggers the sending of outgoing messages from this vertex. * * @param newValue The new vertex value. */ public void setNewVertexValue(VertexValue newValue) { outVal.f1 = newValue; out.collect(outVal); }
@Override public void close() { this.outputCollector.close(); } }
@Override public void close() { if (delegate != null) { delegate.close(); } } }
@Override public void collect(T record) { try { solutionSet.insertOrReplaceRecord(record, tmpHolder); if (delegate != null) { delegate.collect(record); } } catch (IOException e) { throw new RuntimeException(e); } }
@Override public void close() { if (delegate != null) { delegate.close(); } } }
@Override public final void reduce(Iterator<IN> values, Collector<OUT> out) throws Exception { for (Iterator<OUT> iter = reduceGroup(values); iter.hasNext(); ) { out.collect(iter.next()); } } }
@Override public void close() { if (delegate != null) { delegate.close(); } } }
@Override public void collect(T record) { try { this.serializer.serialize(record, this.outputView); if (delegate != null) { delegate.collect(record); } this.elementsCollected++; } catch (IOException e) { throw new RuntimeException("Unable to serialize the record", e); } }
@Override public void close() { this.outputCollector.close(); } }
/** * Delegates calls to the {@link #flatMap(Object)} method. */ @Override public final void flatMap(IN value, Collector<OUT> out) throws Exception { for (Iterator<OUT> iter = flatMap(value); iter.hasNext(); ) { out.collect(iter.next()); } } }
@Override public void close() { if (delegate != null) { delegate.close(); } } }
@Override public void map(Record record, Collector<Record> out) throws Exception { out.collect(record); } }
@Override public void close() { this.outputCollector.close(); } }
@Override public final void flatMap(T value, Collector<T> out) throws Exception { if (this.wrappedFunction.filter(value)) { out.collect(value); } } }
@Override public void close() { this.outputCollector.close(); } }
@Override public void flatMap(Tuple3<Integer, Long, String> value, Collector<String> out) throws Exception { out.collect(value.f2); } });
@Override public void close() { if (delegate != null) { delegate.close(); } } }
public void flatMap(Long value, Collector<Tuple3<Long, Long, Double>> out) { int numOutEdges = (int) (Math.random() * (numVertices / 2)); for (int i = 0; i < numOutEdges; i++) { long target = (long) (Math.random() * numVertices) + 1; out.collect(new Tuple3<Long, Long, Double>(value, target, 1.0/numOutEdges)); } } });
@Override public void close() { this.outputCollector.close(); } }