Github user twilmes commented on a diff in the pull request: https://github.com/apache/incubator-tinkerpop/pull/196#discussion_r49265086 --- Diff: spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/structure/io/PersistedInputOutputRDDTest.java --- @@ -54,6 +56,44 @@ public class PersistedInputOutputRDDTest extends AbstractSparkTest { @Test + public void shouldPersistRDDBasedOnStorageLevel() throws Exception { + Spark.create("local[4]"); + int counter = 0; + for (final String storageLevel : Arrays.asList("MEMORY_ONLY", "DISK_ONLY","MEMORY_ONLY_SER","MEMORY_AND_DISK_SER","OFF_HEAP")) { + assertEquals(counter * 2, Spark.getRDDs().size()); + counter++; + final String rddName = TestHelper.makeTestDataDirectory(PersistedInputOutputRDDTest.class, UUID.randomUUID().toString()); + final Configuration configuration = new BaseConfiguration(); + configuration.setProperty("spark.master", "local[4]"); + configuration.setProperty("spark.serializer", GryoSerializer.class.getCanonicalName()); + configuration.setProperty(Graph.GRAPH, HadoopGraph.class.getName()); + configuration.setProperty(Constants.GREMLIN_HADOOP_INPUT_LOCATION, SparkHadoopGraphProvider.PATHS.get("tinkerpop-modern.kryo")); + configuration.setProperty(Constants.GREMLIN_HADOOP_GRAPH_INPUT_FORMAT, GryoInputFormat.class.getCanonicalName()); + configuration.setProperty(Constants.GREMLIN_SPARK_GRAPH_OUTPUT_RDD, PersistedOutputRDD.class.getCanonicalName()); + configuration.setProperty(Constants.GREMLIN_SPARK_PERSIST_STORAGE_LEVEL, storageLevel); + configuration.setProperty(Constants.GREMLIN_HADOOP_JARS_IN_DISTRIBUTED_CACHE, false); + configuration.setProperty(Constants.GREMLIN_HADOOP_OUTPUT_LOCATION, rddName); + configuration.setProperty(Constants.GREMLIN_SPARK_PERSIST_CONTEXT, true); + Graph graph = GraphFactory.open(configuration); + graph.compute(SparkGraphComputer.class) + .result(GraphComputer.ResultGraph.NEW) + .persist(GraphComputer.Persist.EDGES) + .program(TraversalVertexProgram.build() + .traversal(GraphTraversalSource.build().engine(ComputerTraversalEngine.build().computer(SparkGraphComputer.class)), + "gremlin-groovy", + "g.V()").create(graph)).submit().get(); + //////// + assertTrue(Spark.hasRDD(Constants.getGraphLocation(rddName))); + assertEquals(StorageLevel.fromString(storageLevel), Spark.getRDD(Constants.getGraphLocation(rddName)).getStorageLevel()); + assertTrue(Spark.hasRDD(Constants.getMemoryLocation(rddName, Graph.Hidden.hide("traversers")))); + assertEquals(StorageLevel.fromString(storageLevel), Spark.getRDD(Constants.getMemoryLocation(rddName, Graph.Hidden.hide("traversers"))).getStorageLevel()); + assertEquals(counter * 2, Spark.getRDDs().size()); + //System.out.println(SparkContextStorage.open().ls()); --- End diff -- Looks like there was a lingering debug println here that could be removed.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---