/** * A {@code GraphAnalytic} is similar to a {@link GraphAlgorithm} but is terminal * and results are retrieved via accumulators. A Flink program has a single * point of execution. A {@code GraphAnalytic} defers execution to the user to * allow composing multiple analytics and algorithms into a single program. * * @param analytic the analytic to run on the Graph * @param <T> the result type * @throws Exception */ public <T> GraphAnalytic<K, VV, EV, T> run(GraphAnalytic<K, VV, EV, T> analytic) throws Exception { analytic.run(this); return analytic; }
/** * A {@code GraphAnalytic} is similar to a {@link GraphAlgorithm} but is terminal * and results are retrieved via accumulators. A Flink program has a single * point of execution. A {@code GraphAnalytic} defers execution to the user to * allow composing multiple analytics and algorithms into a single program. * * @param analytic the analytic to run on the Graph * @param <T> the result type * @throws Exception */ public <T> GraphAnalytic<K, VV, EV, T> run(GraphAnalytic<K, VV, EV, T> analytic) throws Exception { analytic.run(this); return analytic; }
@Override public void printAnalytics(PrintStream out) { if (computeTriadicCensus.getValue()) { out.print("Triadic census:\n "); out.println(triadicCensus.getResult().toPrintableString().replace(";", "\n ")); } } }
/** * A {@code GraphAnalytic} is similar to a {@link GraphAlgorithm} but is terminal * and results are retrieved via accumulators. A Flink program has a single * point of execution. A {@code GraphAnalytic} defers execution to the user to * allow composing multiple analytics and algorithms into a single program. * * @param analytic the analytic to run on the Graph * @param <T> the result type * @throws Exception */ public <T> GraphAnalytic<K, VV, EV, T> run(GraphAnalytic<K, VV, EV, T> analytic) throws Exception { analytic.run(this); return analytic; }
@Override public Result getResult() { BigInteger bigVertexCount = BigInteger.valueOf(vertexMetrics.getResult().getNumberOfVertices()); BigInteger bigEdgeCount = BigInteger.valueOf(vertexMetrics.getResult().getNumberOfEdges()); BigInteger bigTripletCount = BigInteger.valueOf(vertexMetrics.getResult().getNumberOfTriplets());
/** * A {@code GraphAnalytic} is similar to a {@link GraphAlgorithm} but is terminal * and results are retrieved via accumulators. A Flink program has a single * point of execution. A {@code GraphAnalytic} defers execution to the user to * allow composing multiple analytics and algorithms into a single program. * * @param analytic the analytic to run on the Graph * @param <T> the result type * @throws Exception */ public <T> GraphAnalytic<K, VV, EV, T> run(GraphAnalytic<K, VV, EV, T> analytic) throws Exception { analytic.run(this); return analytic; }
@Override public Result getResult() { // each triangle is counted from each of the three vertices long numberOfTriangles = 3 * triangleCount.getResult(); return new Result(vertexMetrics.getResult().getNumberOfTriplets(), numberOfTriangles); }
@Override public Result getResult() { // each triangle must be counted from each of the three vertices // as each triplet is counted in this manner long numberOfTriangles = 3 * triangleCount.getResult(); return new Result(vertexMetrics.getResult().getNumberOfTriplets(), numberOfTriangles); }
@Override public Result getResult() { BigInteger bigVertexCount = BigInteger.valueOf(vertexMetrics.getResult().getNumberOfVertices()); BigInteger bigEdgeCount = BigInteger.valueOf(vertexMetrics.getResult().getNumberOfEdges()); BigInteger bigTripletCount = BigInteger.valueOf(vertexMetrics.getResult().getNumberOfTriplets());
@Override public Result getResult() { BigInteger bigVertexCount = BigInteger.valueOf(vertexMetrics.getResult().getNumberOfVertices()); BigInteger bigEdgeCount = BigInteger.valueOf(vertexMetrics.getResult().getNumberOfEdges()); BigInteger bigTripletCount = BigInteger.valueOf(vertexMetrics.getResult().getNumberOfTriplets());
@Override public Result getResult() { // each triangle must be counted from each of the three vertices // as each triplet is counted in this manner long numberOfTriangles = 3 * triangleCount.getResult(); return new Result(vertexMetrics.getResult().getNumberOfTriplets(), numberOfTriangles); }
@Override public Result getResult() { // each triangle is counted from each of the three vertices long numberOfTriangles = 3 * triangleCount.getResult(); return new Result(vertexMetrics.getResult().getNumberOfTriplets(), numberOfTriangles); }
@Override public Result getResult() { // each triangle must be counted from each of the three vertices // as each triplet is counted in this manner long numberOfTriangles = 3 * triangleCount.getResult(); return new Result(vertexMetrics.getResult().getNumberOfTriplets(), numberOfTriangles); }
@Override public Result getResult() { // each triangle is counted from each of the three vertices long numberOfTriangles = 3 * triangleCount.getResult(); return new Result(vertexMetrics.getResult().getNumberOfTriplets(), numberOfTriangles); }