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

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

Github user spmallette commented on a diff in the pull request:

    https://github.com/apache/tinkerpop/pull/451#discussion_r82212090
  
    --- Diff: 
gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
 ---
    @@ -814,18 +829,88 @@ public void 
shouldStillSupportDeprecatedRebindingsParameterOnServer() throws Exc
     
         @Test
         public void shouldSupportLambdasUsingWithRemote() throws Exception {
    -        final Supplier<Graph> graphGetter = () -> 
server.getServerGremlinExecutor().getGraphManager().getGraphs().get("graph");
    -        final Configuration conf = new BaseConfiguration() {{
    -            setProperty(Graph.GRAPH, RemoteGraph.class.getName());
    -            setProperty(GREMLIN_REMOTE_CONNECTION_CLASS, 
DriverRemoteConnection.class.getName());
    -            
setProperty(DriverRemoteConnection.GREMLIN_REMOTE_DRIVER_SOURCENAME, "g");
    -            setProperty("hidden.for.testing.only", graphGetter);
    -        }};
    -
             final Graph graph = EmptyGraph.instance();
             final GraphTraversalSource g = graph.traversal().withRemote(conf);
             g.addV("person").property("age", 20).iterate();
             g.addV("person").property("age", 10).iterate();
             assertEquals(50L, 
g.V().hasLabel("person").map(Lambda.function("it.get().value('age') + 
10")).sum().next());
         }
    +
    +    @Test
    +    public void shouldGetSideEffectKeysUsingWithRemote() throws Exception {
    +        final Graph graph = EmptyGraph.instance();
    +        final GraphTraversalSource g = graph.traversal().withRemote(conf);
    +        g.addV("person").property("age", 20).iterate();
    +        g.addV("person").property("age", 10).iterate();
    +        final GraphTraversal traversal = 
g.V().aggregate("a").aggregate("b");
    +        traversal.iterate();
    +        final DriverRemoteTraversalSideEffects se = 
(DriverRemoteTraversalSideEffects) traversal.asAdmin().getSideEffects();
    +
    +        // Get keys
    +        final Set<String> sideEffectKeys = se.keys();
    +        assertEquals(2, sideEffectKeys.size());
    +
    +        // Get side effects
    +        final BulkSet aSideEffects = se.get("a");
    +        assertThat(aSideEffects.isEmpty(), is(false));
    +        final BulkSet bSideEffects = se.get("b");
    +        assertThat(bSideEffects.isEmpty(), is(false));
    +
    +        // Should get local keys/side effects after close
    +        se.close();
    +
    +        final Set<String> localSideEffectKeys = se.keys();
    +        assertEquals(2, localSideEffectKeys.size());
    +
    +        final BulkSet localASideEffects = se.get("a");
    +        assertThat(localASideEffects.isEmpty(), is(false));
    +
    +        final BulkSet localBSideEffects = se.get("b");
    +        assertThat(localBSideEffects.isEmpty(), is(false));
    +    }
    +
    +    @Test
    +    public void shouldCloseSideEffectsUsingWithRemote() throws Exception {
    +        final Graph graph = EmptyGraph.instance();
    +        final GraphTraversalSource g = graph.traversal().withRemote(conf);
    +        g.addV("person").property("age", 20).iterate();
    +        g.addV("person").property("age", 10).iterate();
    +        final GraphTraversal traversal = 
g.V().aggregate("a").aggregate("b");
    +        traversal.iterate();
    +        final DriverRemoteTraversalSideEffects se = 
(DriverRemoteTraversalSideEffects) traversal.asAdmin().getSideEffects();
    +        final BulkSet sideEffects = se.get("a");
    +        assertThat(sideEffects.isEmpty(), is(false));
    +        se.close();
    +
    +        // Can't get new side effects after close
    +        assertNull(se.get("b"));
    +
    +        // Earlier keys should be cached locally
    +        final Set<String> localSideEffectKeys = se.keys();
    +        assertEquals(1, localSideEffectKeys.size());
    +        final BulkSet localSideEffects = se.get("a");
    +        assertThat(localSideEffects.isEmpty(), is(false));
    +
    +        // Try to get side effect from server
    +        final Cluster cluster = Cluster.build("localhost").create();
    +        final Client client = cluster.connect();
    +        Field field = 
DriverRemoteTraversalSideEffects.class.getDeclaredField("serverSideEffect");
    --- End diff --
    
    please `final` your `Field` and `UUID` variables. glad the reflection trick 
worked for this test.


> Gremlin Server doesn't return confirmation upon Traversal OpProcessor "close" 
> op
> --------------------------------------------------------------------------------
>
>                 Key: TINKERPOP-1458
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1458
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 3.2.2
>            Reporter: David M. Brown
>            Assignee: David M. Brown
>             Fix For: 3.2.3
>
>
> Gremlin Server should return some sort of success message to driver upon 
> invalidating the side effect cache for a traversal.



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

Reply via email to