GitHub user okram opened a pull request:

    https://github.com/apache/tinkerpop/pull/527

    TINKERPOP-1521: Mutating steps don't recognize side-effects

    https://issues.apache.org/jira/browse/TINKERPOP-1521
    
    `AddVertexStartStep` was using an `EmptyTraverser` to compute the 
`Parameters`. I thus, create a dummy traverser that has respective traversal 
side-effects. Added two new test cases to `AddVertexTest`.
    
    ```groovy
    gremlin> g = TinkerGraph.open().traversal()
    ==>graphtraversalsource[tinkergraph[vertices:0 edges:0], standard]
    gremlin> g.withSideEffect("a", "marko").addV().property("name", select("a"))
    ==>v[0]
    gremlin> g.V().valueMap()
    ==>[name:[marko]]
    gremlin>
    ```
    
    Finally, realized that `PathRetractionStrategy` was adding a 
`NoOpBarrierStep` to the end of local traversal. This is pointless computation 
as 99% of local traversals are `by()`-modulators that only need the first 
`next()`.
    
    VOTE +1.

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

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

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

    https://github.com/apache/tinkerpop/pull/527.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 #527
    
----
commit 276064530617c04706b62ac57ec4e2e660a756a4
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2017-01-09T16:36:15Z

    fixed an NPE in AddVertexStartStep. In PathRetractionStrategy, NoOpBarriers 
are only added to global children as 99% of local children are by()-modulation 
based and thus, there is no point to fully compute the traversal if only the 
first next() is going to be used.

----


---
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.
---

Reply via email to