本文整理汇总了Java中org.apache.flink.graph.spargel.ScatterFunction类的典型用法代码示例。如果您正苦于以下问题:Java ScatterFunction类的具体用法?Java ScatterFunction怎么用?Java ScatterFunction使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ScatterFunction类属于org.apache.flink.graph.spargel包,在下文中一共展示了ScatterFunction类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: runScatterGatherIteration
import org.apache.flink.graph.spargel.ScatterFunction; //导入依赖的package包/类
/**
* Runs a ScatterGather iteration on the graph with configuration options.
*
* @param scatterFunction the scatter function
* @param gatherFunction the gather function
* @param maximumNumberOfIterations maximum number of iterations to perform
* @param parameters the iteration configuration parameters
*
* @return the updated Graph after the scatter-gather iteration has converged or
* after maximumNumberOfIterations.
*/
public <M> Graph<K, VV, EV> runScatterGatherIteration(
ScatterFunction<K, VV, M, EV> scatterFunction,
org.apache.flink.graph.spargel.GatherFunction<K, VV, M> gatherFunction,
int maximumNumberOfIterations, ScatterGatherConfiguration parameters) {
ScatterGatherIteration<K, VV, M, EV> iteration = ScatterGatherIteration.withEdges(
edges, scatterFunction, gatherFunction, maximumNumberOfIterations);
iteration.configure(parameters);
DataSet<Vertex<K, VV>> newVertices = this.getVertices().runOperation(iteration);
return new Graph<>(newVertices, this.edges, this.context);
}