You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by spmallette <gi...@git.apache.org> on 2017/01/05 11:13:07 UTC

[GitHub] tinkerpop pull request #521: TINKERPOP-1589 Re-introduced CloseableIterator

GitHub user spmallette opened a pull request:

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

    TINKERPOP-1589 Re-introduced CloseableIterator

    https://issues.apache.org/jira/browse/TINKERPOP-1589
    
    Made it so that the `CloseableIterator` is closed by `GraphStep` if it is provided by the iterator supplier. Furthermore, any steps in a `Traversal` implement `AutoCloseable` then its `close()` method will be called. In this way `Traversal.close()`, the common API a user will work with, has a way to release resources in `Graph` implementations that require it.
    
    Builds with `docker/build.sh -t - i -n`.

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

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

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

    https://github.com/apache/tinkerpop/pull/521.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 #521
    
----
commit 3597dc5f06407a8b1ada0e49a52b36b2f31b8a34
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2017-01-04T21:14:23Z

    TINKERPOP-1589 Re-introduced CloseableIterator
    
    Made it so that the CloseableIterator is closed by GraphStep if it is provided by the iterator supplier. Furthermore, any steps in a Traversal implement AutoCloseable then its close() method will be called.

----


---
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] tinkerpop pull request #521: TINKERPOP-1589 Re-introduced CloseableIterator

Posted by spmallette <gi...@git.apache.org>.
Github user spmallette commented on a diff in the pull request:

    https://github.com/apache/tinkerpop/pull/521#discussion_r94782450
  
    --- Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Traversal.java ---
    @@ -254,9 +254,14 @@ public default void forEachRemaining(final Consumer<? super E> action) {
             }
         }
     
    +    /**
    +     * Releases resources opened in any steps that implement {@link AutoCloseable}.
    +     */
         @Override
         public default void close() throws Exception {
    --- End diff --
    
    changes are made now - thanks - didn't know that stuff.


---
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] tinkerpop pull request #521: TINKERPOP-1589 Re-introduced CloseableIterator

Posted by okram <gi...@git.apache.org>.
Github user okram commented on a diff in the pull request:

    https://github.com/apache/tinkerpop/pull/521#discussion_r94776952
  
    --- Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Traversal.java ---
    @@ -254,9 +254,14 @@ public default void forEachRemaining(final Consumer<? super E> action) {
             }
         }
     
    +    /**
    +     * Releases resources opened in any steps that implement {@link AutoCloseable}.
    +     */
         @Override
         public default void close() throws Exception {
    --- End diff --
    
    This is bad. `Steps` that are `TraversalParents` are responsible for propagating operations on them to those below. I would do the following:
    
    ```
    for(final Step<?,?> step : this.getSteps()) {
      if(step instanceof AutoCloseable)
        step.close();
    }
    ```
    
    Next, I would have `TraversalParent`  extend `AutoCloseable` with its default `close()` method being:
    
    ```
    for(final Traversal.Admin<?,?> traversal : this.getLocalChildren()) {
      traversal.close()
    }
    
    for(final Traversal.Admin<?,? traversal: this.getGlobalChildren()) {
      traversal.close();
    }
    ```


---
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] tinkerpop pull request #521: TINKERPOP-1589 Re-introduced CloseableIterator

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

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


---
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] tinkerpop issue #521: TINKERPOP-1589 Re-introduced CloseableIterator

Posted by lvca <gi...@git.apache.org>.
Github user lvca commented on the issue:

    https://github.com/apache/tinkerpop/pull/521
  
    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] tinkerpop issue #521: TINKERPOP-1589 Re-introduced CloseableIterator

Posted by spmallette <gi...@git.apache.org>.
Github user spmallette commented on the issue:

    https://github.com/apache/tinkerpop/pull/521
  
    I think I'm done - It's already implemented on `Traversal.close()`. I think it's good for vote. Don't think i'm missing anything.


---
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] tinkerpop issue #521: TINKERPOP-1589 Re-introduced CloseableIterator

Posted by okram <gi...@git.apache.org>.
Github user okram commented on the issue:

    https://github.com/apache/tinkerpop/pull/521
  
    Nice. Clean backwards compatible `GraphStep.close()` method which uses `instanceof`.
    
    Are you looking for a VOTE now or are you still building on this PR? -- e.g. integrating it with `Traversal.close()`/etc.


---
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] tinkerpop issue #521: TINKERPOP-1589 Re-introduced CloseableIterator

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

    https://github.com/apache/tinkerpop/pull/521
  
    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] tinkerpop issue #521: TINKERPOP-1589 Re-introduced CloseableIterator

Posted by okram <gi...@git.apache.org>.
Github user okram commented on the issue:

    https://github.com/apache/tinkerpop/pull/521
  
    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.
---