@Test public void collaborativeFilteringTest() throws Exception { ConfigurationLoader.testPropertyAccess = true; String path = "src/test/resources/recommendation"; if(GraphProcessor.javaSparkContext == null) GraphProcessor.initializeSparkContext(); algorithms.collaborativeFiltering(GraphProcessor.javaSparkContext.sc(), path).iterator() .forEachRemaining(System.out::println); }
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; }