/** * Creates a new gather-sum-apply iteration operator for graphs. * * @param edges The edge DataSet * * @param gather The gather function of the GSA iteration * @param sum The sum function of the GSA iteration * @param apply The apply function of the GSA iteration * * @param maximumNumberOfIterations The maximum number of iterations executed * * @param <K> The type of the vertex key in the graph * @param <VV> The type of the vertex value in the graph * @param <EV> The type of the edge value in the graph * @param <M> The intermediate type used by the gather, sum and apply functions * * @return An in stance of the gather-sum-apply graph computation operator. */ public static <K, VV, EV, M> GatherSumApplyIteration<K, VV, EV, M> withEdges(DataSet<Edge<K, EV>> edges, GatherFunction<VV, EV, M> gather, SumFunction<VV, EV, M> sum, ApplyFunction<K, VV, M> apply, int maximumNumberOfIterations) { return new GatherSumApplyIteration<>(gather, sum, apply, edges, maximumNumberOfIterations); }
/** * Runs a Gather-Sum-Apply iteration on the graph with configuration options. * * @param gatherFunction the gather function collects information about adjacent vertices and edges * @param sumFunction the sum function aggregates the gathered information * @param applyFunction the apply function updates the vertex values with the aggregates * @param maximumNumberOfIterations maximum number of iterations to perform * @param parameters the iteration configuration parameters * @param <M> the intermediate type used between gather, sum and apply * * @return the updated Graph after the gather-sum-apply iteration has converged or * after maximumNumberOfIterations. */ public <M> Graph<K, VV, EV> runGatherSumApplyIteration( org.apache.flink.graph.gsa.GatherFunction<VV, EV, M> gatherFunction, SumFunction<VV, EV, M> sumFunction, ApplyFunction<K, VV, M> applyFunction, int maximumNumberOfIterations, GSAConfiguration parameters) { GatherSumApplyIteration<K, VV, EV, M> iteration = GatherSumApplyIteration.withEdges( edges, gatherFunction, sumFunction, applyFunction, maximumNumberOfIterations); iteration.configure(parameters); DataSet<Vertex<K, VV>> newVertices = vertices.runOperation(iteration); return new Graph<>(newVertices, this.edges, this.context); }
/** * Runs a Gather-Sum-Apply iteration on the graph with configuration options. * * @param gatherFunction the gather function collects information about adjacent vertices and edges * @param sumFunction the sum function aggregates the gathered information * @param applyFunction the apply function updates the vertex values with the aggregates * @param maximumNumberOfIterations maximum number of iterations to perform * @param parameters the iteration configuration parameters * @param <M> the intermediate type used between gather, sum and apply * * @return the updated Graph after the gather-sum-apply iteration has converged or * after maximumNumberOfIterations. */ public <M> Graph<K, VV, EV> runGatherSumApplyIteration( org.apache.flink.graph.gsa.GatherFunction<VV, EV, M> gatherFunction, SumFunction<VV, EV, M> sumFunction, ApplyFunction<K, VV, M> applyFunction, int maximumNumberOfIterations, GSAConfiguration parameters) { GatherSumApplyIteration<K, VV, EV, M> iteration = GatherSumApplyIteration.withEdges( edges, gatherFunction, sumFunction, applyFunction, maximumNumberOfIterations); iteration.configure(parameters); DataSet<Vertex<K, VV>> newVertices = vertices.runOperation(iteration); return new Graph<>(newVertices, this.edges, this.context); }
/** * Creates a new gather-sum-apply iteration operator for graphs. * * @param edges The edge DataSet * * @param gather The gather function of the GSA iteration * @param sum The sum function of the GSA iteration * @param apply The apply function of the GSA iteration * * @param maximumNumberOfIterations The maximum number of iterations executed * * @param <K> The type of the vertex key in the graph * @param <VV> The type of the vertex value in the graph * @param <EV> The type of the edge value in the graph * @param <M> The intermediate type used by the gather, sum and apply functions * * @return An in stance of the gather-sum-apply graph computation operator. */ public static <K, VV, EV, M> GatherSumApplyIteration<K, VV, EV, M> withEdges(DataSet<Edge<K, EV>> edges, GatherFunction<VV, EV, M> gather, SumFunction<VV, EV, M> sum, ApplyFunction<K, VV, M> apply, int maximumNumberOfIterations) { return new GatherSumApplyIteration<>(gather, sum, apply, edges, maximumNumberOfIterations); }
/** * Runs a Gather-Sum-Apply iteration on the graph with configuration options. * * @param gatherFunction the gather function collects information about adjacent vertices and edges * @param sumFunction the sum function aggregates the gathered information * @param applyFunction the apply function updates the vertex values with the aggregates * @param maximumNumberOfIterations maximum number of iterations to perform * @param parameters the iteration configuration parameters * @param <M> the intermediate type used between gather, sum and apply * * @return the updated Graph after the gather-sum-apply iteration has converged or * after maximumNumberOfIterations. */ public <M> Graph<K, VV, EV> runGatherSumApplyIteration( org.apache.flink.graph.gsa.GatherFunction<VV, EV, M> gatherFunction, SumFunction<VV, EV, M> sumFunction, ApplyFunction<K, VV, M> applyFunction, int maximumNumberOfIterations, GSAConfiguration parameters) { GatherSumApplyIteration<K, VV, EV, M> iteration = GatherSumApplyIteration.withEdges( edges, gatherFunction, sumFunction, applyFunction, maximumNumberOfIterations); iteration.configure(parameters); DataSet<Vertex<K, VV>> newVertices = vertices.runOperation(iteration); return new Graph<>(newVertices, this.edges, this.context); }
/** * Creates a new gather-sum-apply iteration operator for graphs * * @param edges The edge DataSet * * @param gather The gather function of the GSA iteration * @param sum The sum function of the GSA iteration * @param apply The apply function of the GSA iteration * * @param maximumNumberOfIterations The maximum number of iterations executed * * @param <K> The type of the vertex key in the graph * @param <VV> The type of the vertex value in the graph * @param <EV> The type of the edge value in the graph * @param <M> The intermediate type used by the gather, sum and apply functions * * @return An in stance of the gather-sum-apply graph computation operator. */ public static <K, VV, EV, M> GatherSumApplyIteration<K, VV, EV, M> withEdges(DataSet<Edge<K, EV>> edges, GatherFunction<VV, EV, M> gather, SumFunction<VV, EV, M> sum, ApplyFunction<K, VV, M> apply, int maximumNumberOfIterations) { return new GatherSumApplyIteration<>(gather, sum, apply, edges, maximumNumberOfIterations); }
/** * Runs a Gather-Sum-Apply iteration on the graph with configuration options. * * @param gatherFunction the gather function collects information about adjacent vertices and edges * @param sumFunction the sum function aggregates the gathered information * @param applyFunction the apply function updates the vertex values with the aggregates * @param maximumNumberOfIterations maximum number of iterations to perform * @param parameters the iteration configuration parameters * @param <M> the intermediate type used between gather, sum and apply * * @return the updated Graph after the gather-sum-apply iteration has converged or * after maximumNumberOfIterations. */ public <M> Graph<K, VV, EV> runGatherSumApplyIteration( org.apache.flink.graph.gsa.GatherFunction<VV, EV, M> gatherFunction, SumFunction<VV, EV, M> sumFunction, ApplyFunction<K, VV, M> applyFunction, int maximumNumberOfIterations, GSAConfiguration parameters) { GatherSumApplyIteration<K, VV, EV, M> iteration = GatherSumApplyIteration.withEdges( edges, gatherFunction, sumFunction, applyFunction, maximumNumberOfIterations); iteration.configure(parameters); DataSet<Vertex<K, VV>> newVertices = vertices.runOperation(iteration); return new Graph<>(newVertices, this.edges, this.context); }
/** * Creates a new gather-sum-apply iteration operator for graphs. * * @param edges The edge DataSet * * @param gather The gather function of the GSA iteration * @param sum The sum function of the GSA iteration * @param apply The apply function of the GSA iteration * * @param maximumNumberOfIterations The maximum number of iterations executed * * @param <K> The type of the vertex key in the graph * @param <VV> The type of the vertex value in the graph * @param <EV> The type of the edge value in the graph * @param <M> The intermediate type used by the gather, sum and apply functions * * @return An in stance of the gather-sum-apply graph computation operator. */ public static <K, VV, EV, M> GatherSumApplyIteration<K, VV, EV, M> withEdges(DataSet<Edge<K, EV>> edges, GatherFunction<VV, EV, M> gather, SumFunction<VV, EV, M> sum, ApplyFunction<K, VV, M> apply, int maximumNumberOfIterations) { return new GatherSumApplyIteration<>(gather, sum, apply, edges, maximumNumberOfIterations); }