You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by okram <gi...@git.apache.org> on 2016/01/08 19:15:48 UTC

[GitHub] incubator-tinkerpop pull request: TINKERPOP-1072: Allow the user t...

GitHub user okram opened a pull request:

    https://github.com/apache/incubator-tinkerpop/pull/196

    TINKERPOP-1072: Allow the user to set persistence options using StorageLevel.valueOf()

    https://issues.apache.org/jira/browse/TINKERPOP-1072
    
    I always thought Spark had some configuration like `default.storageLevel` and then when a user did `cache()` it would do that default. I was wrong. `cache()` is always `MEMORY_ONLY`. I made it so you can specify the storage level for both persisted RDDs and runtime job RDDs and thus now (internally) use `persist(STORAGE_LEVEL)` where `MEMORY_ONLY` is the default.
    
    Test cases, docs, and Spark integration tests pass.
    
    VOTE +1.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/incubator-tinkerpop TINKERPOP-1072

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-tinkerpop/pull/196.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #196
    
----
commit 4082a4a043b54c102f49f220b14e2644817e1222
Author: Marko A. Rodriguez <ok...@gmail.com>
Date:   2016-01-08T18:05:08Z

    Allow the user to specify the persistence StorageLevel for both the computed job graph and any PersistedOutputRDD data. Updated docs, example conf, and added a test case that validates that persisted to SparkStorage is correct as the configuration changes.

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-tinkerpop pull request: TINKERPOP-1072: Allow the user t...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-tinkerpop/pull/196


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-tinkerpop pull request: TINKERPOP-1072: Allow the user t...

Posted by dkuppitz <gi...@git.apache.org>.
Github user dkuppitz commented on the pull request:

    https://github.com/apache/incubator-tinkerpop/pull/196#issuecomment-170897147
  
    * `mvn clean install`: passed
    * integration tests: almost passed (only 1 error that's fixed in `master/`)
    
    Vote: +1


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-tinkerpop pull request: TINKERPOP-1072: Allow the user t...

Posted by twilmes <gi...@git.apache.org>.
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-tinkerpop pull request: TINKERPOP-1072: Allow the user t...

Posted by twilmes <gi...@git.apache.org>.
Github user twilmes commented on the pull request:

    https://github.com/apache/incubator-tinkerpop/pull/196#issuecomment-170253892
  
    Looking good.  With or without that commented out println I'm a +1


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---