@Override public Tuple2<K, M> map(Tuple2<K, Neighbor<VV, EV>> neighborTuple) { M result = this.gatherFunction.gather(neighborTuple.f1); return new Tuple2<>(neighborTuple.f0, result); }
@Override public void open(Configuration parameters) throws Exception { if (getRuntimeContext().hasBroadcastVariable("number of vertices")) { Collection<LongValue> numberOfVertices = getRuntimeContext().getBroadcastVariable("number of vertices"); this.gatherFunction.setNumberOfVertices(numberOfVertices.iterator().next().getValue()); } if (getIterationRuntimeContext().getSuperstepNumber() == 1) { this.gatherFunction.init(getIterationRuntimeContext()); } this.gatherFunction.preSuperstep(); }
@Override public void close() throws Exception { this.gatherFunction.postSuperstep(); }
@Override public void open(Configuration parameters) throws Exception { if (getRuntimeContext().hasBroadcastVariable("number of vertices")) { Collection<LongValue> numberOfVertices = getRuntimeContext().getBroadcastVariable("number of vertices"); this.gatherFunction.setNumberOfVertices(numberOfVertices.iterator().next().getValue()); } if (getIterationRuntimeContext().getSuperstepNumber() == 1) { this.gatherFunction.init(getIterationRuntimeContext()); } this.gatherFunction.preSuperstep(); }
@Override public void close() throws Exception { this.gatherFunction.postSuperstep(); }
@Override public Tuple2<K, M> map(Tuple2<K, Neighbor<VV, EV>> neighborTuple) { M result = this.gatherFunction.gather(neighborTuple.f1); return new Tuple2<>(neighborTuple.f0, result); }
@Override public void open(Configuration parameters) throws Exception { if (getRuntimeContext().hasBroadcastVariable("number of vertices")) { Collection<LongValue> numberOfVertices = getRuntimeContext().getBroadcastVariable("number of vertices"); this.gatherFunction.setNumberOfVertices(numberOfVertices.iterator().next().getValue()); } if (getIterationRuntimeContext().getSuperstepNumber() == 1) { this.gatherFunction.init(getIterationRuntimeContext()); } this.gatherFunction.preSuperstep(); }
@Override public void close() throws Exception { this.gatherFunction.postSuperstep(); }
@Override public Tuple2<K, M> map(Tuple2<K, Neighbor<VV, EV>> neighborTuple) { M result = this.gatherFunction.gather(neighborTuple.f1); return new Tuple2<>(neighborTuple.f0, result); }
@Override public void open(Configuration parameters) throws Exception { if (getRuntimeContext().hasBroadcastVariable("number of vertices")) { Collection<LongValue> numberOfVertices = getRuntimeContext().getBroadcastVariable("number of vertices"); this.gatherFunction.setNumberOfVertices(numberOfVertices.iterator().next().getValue()); } if (getIterationRuntimeContext().getSuperstepNumber() == 1) { this.gatherFunction.init(getIterationRuntimeContext()); } this.gatherFunction.preSuperstep(); }
@Override public void close() throws Exception { this.gatherFunction.postSuperstep(); }
@Override public Tuple2<K, M> map(Tuple2<K, Neighbor<VV, EV>> neighborTuple) { M result = this.gatherFunction.gather(neighborTuple.f1); return new Tuple2<>(neighborTuple.f0, result); }