use of uk.gov.gchq.gaffer.spark.operation.javardd.GetJavaRDDOfAllElements in project Gaffer by gchq.
the class GetJavaRDDOfAllElementsExample method getJavaRddOfAllElementsReturningEdgesOnly.
public void getJavaRddOfAllElementsReturningEdgesOnly(final JavaSparkContext sc, final Graph graph) throws OperationException {
ROOT_LOGGER.setLevel(Level.INFO);
log("#### get Java RDD of elements returning edges only\n");
printGraph();
ROOT_LOGGER.setLevel(Level.OFF);
final GetJavaRDDOfAllElements operation = new GetJavaRDDOfAllElements.Builder().includeEntities(false).javaSparkContext(sc).build();
final JavaRDD<Element> rdd = graph.execute(operation, new User("user01"));
final List<Element> elements = rdd.collect();
ROOT_LOGGER.setLevel(Level.INFO);
printJava("GetJavaRDDOfAllElements<ElementSeed> operation = new GetJavaRDDOfAllElements.Builder<>()\n" + " .includeEntities(false)\n" + " .javaSparkContext(sc)\n" + " .build();\n" + "JavaRDD<Element> rdd = graph.execute(operation, new User(\"user01\"));\n" + "List<Element> elements = rdd.collect();");
log("The results are:");
log("```");
for (final Element e : elements) {
log(e.toString());
}
log("```");
ROOT_LOGGER.setLevel(Level.OFF);
}
Aggregations