@Test public void performanceTestBetweennessCentrality() throws Exception { ConfigurationLoader.testPropertyAccess = true; if (GraphProcessor.javaSparkContext == null) GraphProcessor.initializeSparkContext(); Graph<Object, Object> graph = GraphGenerators.logNormalGraph(GraphProcessor.javaSparkContext.sc(), 100, 0, 4, 5, 423); List<String> starGraph = JavaConversions.asJavaCollection(graph.edges().toLocalIterator().toIterable()).stream() .map(a -> a.srcId() + " " + a.dstId() + "\n") .collect(Collectors.toList()); System.out.println(starGraph); System.out.println(getBetweennessCentrality("performance-graph", starGraph)); }
public static JavaSparkContext initializeSparkContext() { SparkConf conf = new SparkConf().setAppName(ConfigurationLoader.getInstance().getAppName()) .setMaster(ConfigurationLoader.getInstance().getSparkHost()) .set("spark.executor.memory", "4g") .set("spark.driver.memory", "4g") .set("spark.executor.instances", "2"); javaSparkContext = new JavaSparkContext(conf); return javaSparkContext; }
GraphProcessor { public static JavaSparkContext initializeSparkContext() { SparkConf conf = new SparkConf().setAppName(ConfigurationLoader.getInstance().getAppName()) .setMaster(ConfigurationLoader.getInstance().getSparkHost()) .set("spark.executor.memory", "4g") .set("spark.driver.memory", "4g") .set("spark.executor.instances", "2"); javaSparkContext = new JavaSparkContext(conf); return javaSparkContext; } }
GraphProcessor { public static JavaSparkContext initializeSparkContext() { SparkConf conf = new SparkConf().setAppName(ConfigurationLoader.getInstance().getAppName()) .setMaster(ConfigurationLoader.getInstance().getSparkHost()) .set("spark.executor.memory", "4g") .set("spark.driver.memory", "4g") .set("spark.executor.instances", "2"); javaSparkContext = new JavaSparkContext(conf); return javaSparkContext; }  }
GraphProcessor { public static JavaSparkContext initializeSparkContext() { SparkConf conf = new SparkConf().setAppName(ConfigurationLoader.getInstance().getAppName()) .setMaster(ConfigurationLoader.getInstance().getSparkHost()) .set("spark.executor.memory", "4g") .set("spark.driver.memory", "4g") .set("spark.executor.instances", "2"); javaSparkContext = new JavaSparkContext(conf); return javaSparkContext; }  static void processEdgeList(ProcessorMessage processorMessage); static JavaSparkContext initializeSparkContext(); }
GraphProcessor { public static JavaSparkContext initializeSparkContext() { SparkConf conf = new SparkConf().setAppName(ConfigurationLoader.getInstance().getAppName()) .setMaster(ConfigurationLoader.getInstance().getSparkHost()) .set("spark.executor.memory", "4g") .set("spark.driver.memory", "4g") .set("spark.executor.instances", "2"); javaSparkContext = new JavaSparkContext(conf); return javaSparkContext; }  static void processEdgeList(ProcessorMessage processorMessage); static JavaSparkContext initializeSparkContext(); static final String PROPERTY_GRAPH_UPDATE_PATH; static final String PARTITIONED_PROPERTY_GRAPH_UPDATE_PATH; static final String TRIANGLE_COUNT; static final String CONNECTED_COMPONENTS; static final String PAGERANK; static final String STRONGLY_CONNECTED_COMPONENTS; static final String CLOSENESS_CENTRALITY; static final String BETWEENNESS_CENTRALITY; static final String EDGE_BETWEENNESS; static final String COLLABORATIVE_FILTERING; static JavaSparkContext javaSparkContext; }