You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/09/25 02:26:21 UTC

[jira] [Commented] (TINKERPOP-790) Implement AutoCloseable on TraversalSource

    [ https://issues.apache.org/jira/browse/TINKERPOP-790?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15520004#comment-15520004 ] 

ASF GitHub Bot commented on TINKERPOP-790:
------------------------------------------

GitHub user spmallette opened a pull request:

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

    TINKERPOP-790 TraversalSource and Traversal implement AutoCloseable.

    https://issues.apache.org/jira/browse/TINKERPOP-790
    
    This allowed for `TraversalSource` instances created using `withRemote()` to close out open `RemoteConnection` instances. It also sets up for side-effects created by a "remote" `Traversal` to be cleared from cache on the server. That work is not done yet and is reserved for a different ticket.
    
    Builds with `$ mvn clean install && mvn verify -pl gremlin-server -DskipIntegrationTests=false`
    
    I won't VOTE on this yet as I suspect there might be some feedback from @okram perhaps.
    
    @davebshow note the placeholder for sending the "close" message for side-effects.

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

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

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

    https://github.com/apache/tinkerpop/pull/437.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 #437
    
----
commit 14211691effffec1f9fdf6ddd92c5833dff234de
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2016-09-25T02:18:56Z

    TraversalSource and Traversal implement AutoCloseable.
    
    This allowed for TraversalSource instances created using withRemote() to close out open RemoteConnection instances. It also sets up for side-effects created by a "remote" Traversal to be cleared from cache on the server. That work is not done yet and is reserved for a different ticket.

----


> Implement AutoCloseable on TraversalSource
> ------------------------------------------
>
>                 Key: TINKERPOP-790
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-790
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: process
>    Affects Versions: 3.0.2-incubating
>            Reporter: stephen mallette
>            Assignee: stephen mallette
>             Fix For: 3.2.3
>
>
> A {{TraversalSource}} may have resources to release so having a {{close}} method would allows that release to occur.  The specific case has to do with {{EventStrategy}} which registers a listener on {{Transaction}}.  That listener should be removed when the user is done with the {{TraversalSource}}, but there is currently no way to clean that up.  The calling of {{close}} should prevent future traversals from that {{TraversalSource}}. 
> I suppose this also means that a {{TraversalStrategy}} will need to optionally implement {{AutoCloseable}} or some other marker interface to designate it as a strategy that needs to release resources.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)