How to verify the graph.PartitionStrategy has worked or not?

Viewed 34

I have used the GraphX API in java and created a graph from the EdgeRDD and the VertexRDD. Initially the RDDs were created using the dataset. If I run the below code I see no error. However, I cannot verify that the code is running and it is partitioning the graph using the partitioning strategy.

JavaRDD<Edge<Double>> edgeRDD = javaSparkContext.parallelize(edges);
JavaRDD<Tuple2<Object, String>> nodeRDD = javaSparkContext.parallelize(nodes);
Graph<String, Double> graph = Graph.apply(nodeRDD.rdd(), edgeRDD.rdd(), "", StorageLevel.MEMORY_ONLY(),
                StorageLevel.MEMORY_ONLY(), stringTag, doubleTag);
//This graph.partitionBy method
graph.partitionBy(PartitionStrategy.EdgePartition2D$.MODULE$, 3);

Is there any way to verify that the EdgePartition2D has worked and it created 3 partitions. Or may be print the 3 subgraphs after running this method? I have been running these codes on a standalone machine for now.

0 Answers
Related