You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2017/04/17 15:32:31 UTC

[1/7] tinkerpop git commit: Fixed bad casing in docs CTR

Repository: tinkerpop
Updated Branches:
  refs/heads/tp32 5282ad7dd -> 1e349c8ce


Fixed bad casing in docs CTR


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/70a0eb03
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/70a0eb03
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/70a0eb03

Branch: refs/heads/tp32
Commit: 70a0eb03b2a746e39eb6faa891ac08b2f2489bc2
Parents: 5282ad7
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Apr 17 10:03:59 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Apr 17 10:03:59 2017 -0400

----------------------------------------------------------------------
 docs/src/reference/gremlin-applications.asciidoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/70a0eb03/docs/src/reference/gremlin-applications.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/gremlin-applications.asciidoc b/docs/src/reference/gremlin-applications.asciidoc
index af01cce..1ecb616 100644
--- a/docs/src/reference/gremlin-applications.asciidoc
+++ b/docs/src/reference/gremlin-applications.asciidoc
@@ -1076,7 +1076,7 @@ The following table describes the various configuration options that Gremlin Ser
 |authentication.authenticationHandler | The fully qualified classname of an `AbstractAuthenticationHandler` implementation to use. If this setting is not present, but the `authentication.authenticator` is, it will use that authenticator with the default `AbstractAuthenticationHandler` implementation for the specified `Channelizer` |_none_
 |authentication.config |A `Map` of configuration settings to be passes to the `Authenticator` when it is constructed.  The settings available are dependent on the implementation. |_none_
 |channelizer |The fully qualified classname of the `Channelizer` implementation to use.  A `Channelizer` is a "channel initializer" which Gremlin Server uses to define the type of processing pipeline to use.  By allowing different `Channelizer` implementations, Gremlin Server can support different communication protocols (e.g. Websockets, Java NIO, etc.). |`WebSocketChannelizer`
-|graphManager |The fully qualified classname of the `GraphManager` implementation to use.  A `GraphManager` is a class that adheres to the Tinkerpop `GraphManager` interface, allowing custom implementations for storing and managing graph references, as well as defining custom methods to open and close graphs instantiations. It is important to note that the Tinkerpop Http and WebSocketChannelizers auto-commit and auto-rollback based on the graphs stored in the graphManager upon script execution completion. |`DefaultGraphManager`
+|graphManager |The fully qualified classname of the `GraphManager` implementation to use.  A `GraphManager` is a class that adheres to the TinkerPop `GraphManager` interface, allowing custom implementations for storing and managing graph references, as well as defining custom methods to open and close graphs instantiations. It is important to note that the Tinkerpop Http and WebSocketChannelizers auto-commit and auto-rollback based on the graphs stored in the graphManager upon script execution completion. |`DefaultGraphManager`
 |graphs |A `Map` of `Graph` configuration files where the key of the `Map` becomes the name to which the `Graph` will be bound and the value is the file name of a `Graph` configuration file. |_none_
 |gremlinPool |The number of "Gremlin" threads available to execute actual scripts in a `ScriptEngine`. This pool represents the workers available to handle blocking operations in Gremlin Server. When set to `0`, Gremlin Server will use the value provided by `Runtime.availableProcessors()`. |0
 |host |The name of the host to bind the server to. |localhost


[6/7] tinkerpop git commit: Javadoc cleanup CTR

Posted by sp...@apache.org.
Javadoc cleanup CTR


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/d28b276e
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/d28b276e
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/d28b276e

Branch: refs/heads/tp32
Commit: d28b276ed1307751d03998301539b5c2df9f1032
Parents: 7bcf70c
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Apr 17 10:49:09 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Apr 17 10:49:09 2017 -0400

----------------------------------------------------------------------
 .../gremlin/server/util/DefaultGraphManager.java    | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d28b276e/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
index 71c4b98..5e4a355 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
@@ -69,7 +69,7 @@ public final class DefaultGraphManager implements GraphManager {
      * Get a list of the {@link Graph} instances and their binding names as defined in the Gremlin Server
      * configuration file.
      *
-     * @return a {@link Map} where the key is the name of the {@link Graph} and the value is the {@link Graph} itself
+     * @return a {@code Map} where the key is the name of the {@link Graph} and the value is the {@link Graph} itself
      * @deprecated As of release 3.2.5, replaced by a combination of {@link #getGraphNames()} and
      * {@link #getGraph(String)}
      */
@@ -91,12 +91,10 @@ public final class DefaultGraphManager implements GraphManager {
     }
 
     /**
-     * @Deprecated
-     *
      * Get a list of the {@link TraversalSource} instances and their binding names as defined by Gremlin Server
      * initialization scripts.
      *
-     * @return a {@link Map} where the key is the name of the {@link TraversalSource} and the value is the
+     * @return a {@code Map} where the key is the name of the {@link TraversalSource} and the value is the
      * {@link TraversalSource} itself
      * @deprecated As of release 3.2.5, replaced by a combination of {@link #getTraversalSource(String)} ()} and
      * {@link #getTraversalSource(String)} (String)}
@@ -169,10 +167,7 @@ public final class DefaultGraphManager implements GraphManager {
     }
 
     /**
-     * If {@link Map} containing {@link Graph} references contains one corresponding to
-     * {@link String} graphName, then we return that {@link Graph}; otherwise, instantiate a
-     * new {@link Graph} using the {@link Supplier}, add it to the {@link Map} tracking {@link Graph}
-     * references, and return that {@link Graph}.
+     * {@inheritDoc}
      */
     public final Graph openGraph(final String graphName, final Function<String, Graph> supplier) {
         final Graph graph = graphs.get(graphName);
@@ -185,8 +180,7 @@ public final class DefaultGraphManager implements GraphManager {
     }
 
     /**
-     * Remove {@link Graph} corresponding to {@link String} graphName from {@link Map}
-     * tracking graph references and close the {@link Graph}.
+     * {@inheritDoc}
      */
     public final Graph removeGraph(final String graphName) throws Exception {
         Graph graph = graphs.remove(graphName);
@@ -197,7 +191,7 @@ public final class DefaultGraphManager implements GraphManager {
     /**
      * Selectively close transactions on the specified graphs or the graphs of traversal sources.
      */
-    private final void closeTx(final Set<String> graphSourceNamesToCloseTxOn, final Transaction.Status tx) {
+    private void closeTx(final Set<String> graphSourceNamesToCloseTxOn, final Transaction.Status tx) {
         final Set<Graph> graphsToCloseTxOn = new HashSet<>();
 
         // by the time this method has been called, it should be validated that the source/graph is present.


[2/7] tinkerpop git commit: Re-wording of upgrade docs. CTR

Posted by sp...@apache.org.
Re-wording of upgrade docs. CTR


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/91a9201f
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/91a9201f
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/91a9201f

Branch: refs/heads/tp32
Commit: 91a9201fb860c78099d11fb9e1c63a2ac32d9cbe
Parents: 70a0eb0
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Apr 17 10:10:52 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Apr 17 10:10:52 2017 -0400

----------------------------------------------------------------------
 .../upgrade/release-3.2.x-incubating.asciidoc    | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/91a9201f/docs/src/upgrade/release-3.2.x-incubating.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/upgrade/release-3.2.x-incubating.asciidoc b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
index 5b8d70a..4e46ed9 100644
--- a/docs/src/upgrade/release-3.2.x-incubating.asciidoc
+++ b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
@@ -100,14 +100,17 @@ See: link:https://issues.apache.org/jira/browse/TINKERPOP-1387[TINKERPOP-1387]
 
 GraphManager versus DefaultGraphManager
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-The Gremlin-Server previously implemented its own final `GraphManager` class. Now, the `GraphManager` has been 
-updated to an interface, and users can supply their own `GraphManager` implementations in their YAML. The
-previous `GraphManager` class was traditionally only to be used by internal Gremlin-Server classes; however,
-if you previously used the `GraphManager`, then this changeset will be `breaking` for you. To fix the break,
-you can upgrade your code to use the new `DefaultGraphManager`.
-
-The `GraphManager` also deprecated the usage of `getGraphs()` so please use `getGraphNames()` instead.
-The `GraphManager` also deprecated the usage of `getTraversalSources()` so please use `getTraversalSourceNames()` instead.
+Gremlin Server previously implemented its own final `GraphManager` class. Now, the `GraphManager` has been changed to
+an interface, and users can supply their own `GraphManager` implementations in their YAML. The previous `GraphManager`
+class was meant be used by classes internal to Gremlin Server, but it was public so if it was used for some reason by
+usrs then then a compile error can be expected. To correct this problem, which will likely manifest as a compile error
+when trying to create a `new GraphManager()` instance, simply change the code to `new DefaultGraphManager(Settings)`.
+
+In addition to the change mentioned above, several methods on `GraphManager` were deprecated:
+
+* `getGraphs()` should be replaced by the combination of `getGraphNames()` and then `getGraph(String)`
+* `getTraversalSources()` is similarly replaced and should instead use a combinatio of `getTraversalSourceNames()` and
+`getTraversalSource(String)`
 
 See: link:https://issues.apache.org/jira/browse/TINKERPOP-1438[TINKERPOP-1438]
 


[7/7] tinkerpop git commit: Finalize some vars and add an assert to a test CTR

Posted by sp...@apache.org.
Finalize some vars and add an assert to a test CTR


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/1e349c8c
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/1e349c8c
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/1e349c8c

Branch: refs/heads/tp32
Commit: 1e349c8ce03c2ba10cf9cbacc63184cc8c9ba0dd
Parents: d28b276
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Apr 17 10:55:57 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Apr 17 10:55:57 2017 -0400

----------------------------------------------------------------------
 .../gremlin/server/util/DefaultGraphManagerTest.java         | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1e349c8c/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManagerTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManagerTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManagerTest.java
index ff73236..0841ffa 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManagerTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManagerTest.java
@@ -33,6 +33,7 @@ import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertSame;
 
 /**
  * @author Stephen Mallette (http://stephen.genoprime.com)
@@ -112,7 +113,7 @@ public class DefaultGraphManagerTest {
         final Settings settings = Settings.read(DefaultGraphManagerTest.class.getResourceAsStream("../gremlin-server-integration.yaml"));
         final GraphManager graphManager = new DefaultGraphManager(settings);
 
-        Graph graph = graphManager.openGraph("graph", null);
+        final Graph graph = graphManager.openGraph("graph", null);
         assertNotNull(graph);
         assertThat(graph, instanceOf(TinkerGraph.class));
     }
@@ -122,13 +123,14 @@ public class DefaultGraphManagerTest {
         final Settings settings = Settings.read(DefaultGraphManagerTest.class.getResourceAsStream("../gremlin-server-integration.yaml"));
         final GraphManager graphManager = new DefaultGraphManager(settings);
 
-        Graph graph = graphManager.getGraph("graph"); //fake out graph instance
+        final Graph graph = graphManager.getGraph("graph"); //fake out graph instance
 
-        Graph newGraph = graphManager.openGraph("newGraph", (String gName) -> {
+        final Graph newGraph = graphManager.openGraph("newGraph", (String gName) -> {
             return graph;
         });
 
         assertNotNull(graph);
         assertThat(graph, instanceOf(TinkerGraph.class));
+        assertSame(graph, newGraph);
     }
 }


[3/7] tinkerpop git commit: Cleanup some javadoc in GraphManger related classes CTR

Posted by sp...@apache.org.
Cleanup some javadoc in GraphManger related classes CTR


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/b5373050
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/b5373050
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/b5373050

Branch: refs/heads/tp32
Commit: b537305082c593f498e87216df47f9bff46c3460
Parents: 91a9201
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Apr 17 10:25:27 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Apr 17 10:25:27 2017 -0400

----------------------------------------------------------------------
 .../tinkerpop/gremlin/server/GraphManager.java  | 64 +++++++++-----------
 .../server/util/DefaultGraphManager.java        | 23 ++++---
 2 files changed, 41 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b5373050/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GraphManager.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GraphManager.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GraphManager.java
index 23c019b..8e3198f 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GraphManager.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GraphManager.java
@@ -20,7 +20,6 @@ package org.apache.tinkerpop.gremlin.server;
 
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
 import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.apache.tinkerpop.gremlin.structure.Transaction;
 
 import javax.script.Bindings;
 import java.util.Map;
@@ -29,7 +28,7 @@ import java.util.function.Function;
 
 /**
  * The {@link GraphManager} interface allows for reference tracking of Graph references through
- * a {@link Map<String, Graph>}; the interface plugs into the lifeline of gremlin script
+ * a {@code Map<String, Graph>}; the interface plugs into the lifeline of gremlin script
  * executions, meaning that commit() and rollback() will be called on all graphs stored in the
  * graph reference tracker at the end of the script executions; you may want to implement
  * this interface if you want to define a custom graph instantiation/closing mechanism; note that
@@ -37,12 +36,12 @@ import java.util.function.Function;
  */
 public interface GraphManager {
     /**
-     * @Deprecated This returns a {@link Map} that should be immutable. Please refer to
-     * getGraphNames() for replacement.
+     * Get a list of the {@link Graph} instances and their binding names.
      *
-     * Get a list of the {@link Graph} instances and their binding names
-     *
-     * @return a {@link Map} where the key is the name of the {@link Graph} and the value is the {@link Graph} itself
+     * @return a {@code Map} where the key is the name of the {@link Graph} and the value is the {@link Graph} itself
+     * @deprecated  As of release 3.2.5, replaced by a combination of {@link #getGraphNames()} and
+     * {@link #getGraph(String)} - note that the expectation is this method return an immutable {@code Map} which was
+     * not the expectation prior to 3.2.5.
      */
     @Deprecated
     public Map<String, Graph> getGraphs();
@@ -52,58 +51,56 @@ public interface GraphManager {
      * reference tracker.
      */
     public Set<String> getGraphNames();
+
     /**
-     * Get {@link Graph} instance whose name matches {@link gName}
+     * Get {@link Graph} instance whose name matches {@code graphName}.
      *
      * @return {@link Graph} if exists, else null
      */
-    public Graph getGraph(final String gName);
+    public Graph getGraph(final String graphName);
 
     /**
-     * Add or update {@link Graph} g with name {@link String} gName to
-     * {@link Map<String, Graph>}
+     * Add or update the specified {@link Graph} with the specified name to {@code Map<String, Graph>} .
      */
-    public void putGraph(final String gName, final Graph g);
+    public void putGraph(final String graphName, final Graph g);
 
     /**
-     * @Deprecated Please treat as immutable {@link Map} and refer to getTraversalSourceNames()
-     *
      * Get a list of the {@link TraversalSource} instances and their binding names
      *
      * @return a {@link Map} where the key is the name of the {@link TraversalSource} and the value is the
      *         {@link TraversalSource} itself
+     * @deprecated  As of release 3.2.5, replaced by a combination of {@link #getTraversalSource(String)} ()} and
+     * {@link #getTraversalSource(String)} (String)} - note that the expectation is this method return an immutable
+     * {@code Map} which was not the expectation prior to 3.2.5.
      */
     @Deprecated
     public Map<String, TraversalSource> getTraversalSources();
 
     /**
-     * Get {@link TraversalSource} instance whose name matches {@link tsName}
-     *
-     * @return {@link TraversalSource} if exists, else null
-     */
-
-    /**
-     * Get a {@link Set} of {@link String} traversalSourceNames to names stored in the
-     * traversalSources's reference tracker.
+     * Get a {@code Set} of the names of the the stored {@link TraversalSource} instances.
      */
     public Set<String> getTraversalSourceNames();
 
-    public TraversalSource getTraversalSource(final String tsName);
     /**
-     * Get the {@link Graph} and {@link TraversalSource} list as a set of bindings.
+     * Get {@link TraversalSource} instance whose name matches {@code traversalSourceName}
+     *
+     * @return {@link TraversalSource} if exists, else null
      */
+    public TraversalSource getTraversalSource(final String traversalSourceName);
 
     /**
-     * Add or update {@link TraversalSource} ts with name {@link String} tsName to
-     * {@link Map<String, TraversalSource>} returned by call to getTraversalSources()
+     * Add or update the specified {@link TraversalSource} with the specified name.
      */
     public void putTraversalSource(final String tsName, final TraversalSource ts);
 
     /**
-     * Remove {@link TraversalSource} with tsName from {@link Map<String, TraversalSource}.
+     * Remove {@link TraversalSource} by name.
      */
     public TraversalSource removeTraversalSource(final String tsName);
 
+    /**
+     * Get the {@link Graph} and {@link TraversalSource} list as a set of bindings.
+     */
     public Bindings getAsBindings();
 
     /**
@@ -127,17 +124,16 @@ public interface GraphManager {
     public void commit(final Set<String> graphSourceNamesToCloseTxOn);
 
     /**
-     * Implementation that allows for custom graph-opening implementations; if the {@link Map}
-     * tracking graph references has a {@link Graph} object corresponding to the {@link String} graphName,
-     * then we return that {@link Graph}-- otherwise, we use the custom {@link Supplier} to instantiate a
-     * a new {@link Graph}, add it to the {@link Map} tracking graph references, and return said {@link Graph}.
+     * Implementation that allows for custom graph-opening implementations; if the {@code Map}
+     * tracking graph references has a {@link Graph} object corresponding to the graph name, then we return that
+     * {@link Graph}-- otherwise, we use the custom {@code Function} to instantiate a new {@link Graph}, add it to
+     * the {@link Map} tracking graph references, and return said {@link Graph}.
      */
     public Graph openGraph(final String graphName, final Function<String, Graph> supplier);
 
     /**
-     * Implementation that allows for custom graph-closing implementations;
-     * this method should remove the {@link Graph} graph from the {@link Object}
-     * tracking {@link Graph} references.
+     * Implementation that allows for custom graph closing implementations; this method should remove the {@link Graph}
+     * from the {@code GraphManager}.
      */
     public Graph removeGraph(final String graphName) throws Exception;
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b5373050/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
index 54f424c..71c4b98 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java
@@ -25,7 +25,6 @@ import org.apache.tinkerpop.gremlin.server.Settings;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.Transaction;
 import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
-import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -35,7 +34,6 @@ import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
-import java.util.function.Predicate;
 import java.util.function.Function;
 
 /**
@@ -68,13 +66,12 @@ public final class DefaultGraphManager implements GraphManager {
     }
 
     /**
-     * @Deprecated The {@link Map} returned should be immutable. Please refer to
-     * getGraphNames().
-     *
      * Get a list of the {@link Graph} instances and their binding names as defined in the Gremlin Server
      * configuration file.
      *
      * @return a {@link Map} where the key is the name of the {@link Graph} and the value is the {@link Graph} itself
+     * @deprecated As of release 3.2.5, replaced by a combination of {@link #getGraphNames()} and
+     * {@link #getGraph(String)}
      */
     @Deprecated
     public final Map<String, Graph> getGraphs() {
@@ -85,12 +82,12 @@ public final class DefaultGraphManager implements GraphManager {
         return graphs.keySet();
     }
 
-    public final Graph getGraph(final String gName) {
-        return graphs.get(gName);
+    public final Graph getGraph(final String graphName) {
+        return graphs.get(graphName);
     }
 
-    public final void putGraph(final String gName, final Graph g) {
-        graphs.put(gName, g);
+    public final void putGraph(final String graphName, final Graph g) {
+        graphs.put(graphName, g);
     }
 
     /**
@@ -100,7 +97,9 @@ public final class DefaultGraphManager implements GraphManager {
      * initialization scripts.
      *
      * @return a {@link Map} where the key is the name of the {@link TraversalSource} and the value is the
-     *         {@link TraversalSource} itself
+     * {@link TraversalSource} itself
+     * @deprecated As of release 3.2.5, replaced by a combination of {@link #getTraversalSource(String)} ()} and
+     * {@link #getTraversalSource(String)} (String)}
      */
     @Deprecated
     public final Map<String, TraversalSource> getTraversalSources() {
@@ -111,8 +110,8 @@ public final class DefaultGraphManager implements GraphManager {
         return traversalSources.keySet();
     }
 
-    public final TraversalSource getTraversalSource(final String tsName) {
-        return traversalSources.get(tsName);
+    public final TraversalSource getTraversalSource(final String traversalSourceName) {
+        return traversalSources.get(traversalSourceName);
     }
 
     public final void putTraversalSource(final String tsName, final TraversalSource ts) {


[5/7] tinkerpop git commit: Minor logic change for better readability CTR

Posted by sp...@apache.org.
Minor logic change for better readability CTR


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/7bcf70c7
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/7bcf70c7
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/7bcf70c7

Branch: refs/heads/tp32
Commit: 7bcf70c778674abb295d0b0b27094627a66ceb0a
Parents: fcb697d
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Apr 17 10:33:37 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Apr 17 10:33:37 2017 -0400

----------------------------------------------------------------------
 .../gremlin/server/op/traversal/TraversalOpProcessor.java          | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7bcf70c7/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/traversal/TraversalOpProcessor.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/traversal/TraversalOpProcessor.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/traversal/TraversalOpProcessor.java
index 99e9d9b..038a67e 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/traversal/TraversalOpProcessor.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/traversal/TraversalOpProcessor.java
@@ -223,7 +223,7 @@ public class TraversalOpProcessor extends AbstractOpProcessor {
 
     private static void validateTraversalSourceAlias(final Context ctx, final RequestMessage message, final Map<String, String> aliases) throws OpProcessorException {
         final String traversalSourceBindingForAlias = aliases.values().iterator().next();
-        if (null == ctx.getGraphManager().getTraversalSource(traversalSourceBindingForAlias)) {
+        if (!ctx.getGraphManager().getTraversalSourceNames().contains(traversalSourceBindingForAlias)) {
             final String msg = String.format("The traversal source [%s] for alias [%s] is not configured on the server.", traversalSourceBindingForAlias, Tokens.VAL_TRAVERSAL_SOURCE_ALIAS);
             throw new OpProcessorException(msg, ResponseMessage.build(message).code(ResponseStatusCode.REQUEST_ERROR_INVALID_REQUEST_ARGUMENTS).statusMessage(msg).create());
         }


[4/7] tinkerpop git commit: Removed unncessary stream() usage CTR

Posted by sp...@apache.org.
Removed unncessary stream() usage  CTR


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/fcb697db
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/fcb697db
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/fcb697db

Branch: refs/heads/tp32
Commit: fcb697dbd910b56a7ff7ae3dbaec153b0281878d
Parents: b537305
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Apr 17 10:29:15 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Apr 17 10:29:15 2017 -0400

----------------------------------------------------------------------
 .../java/org/apache/tinkerpop/gremlin/server/GremlinServer.java    | 2 +-
 .../org/apache/tinkerpop/gremlin/server/op/session/Session.java    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fcb697db/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GremlinServer.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GremlinServer.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GremlinServer.java
index db1caae..3c7b861 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GremlinServer.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GremlinServer.java
@@ -301,7 +301,7 @@ public class GremlinServer {
                 logger.warn("Timeout waiting for boss/worker thread pools to shutdown - continuing with shutdown process.");
             }
 
-            serverGremlinExecutor.getGraphManager().getGraphNames().stream().forEach(gName -> {
+            serverGremlinExecutor.getGraphManager().getGraphNames().forEach(gName -> {
                 logger.debug("Closing Graph instance [{}]", gName);
                 try {
                     serverGremlinExecutor.getGraphManager().getGraph(gName).close();

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fcb697db/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/session/Session.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/session/Session.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/session/Session.java
index c97a53c..eec0c71 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/session/Session.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/session/Session.java
@@ -193,7 +193,7 @@ public class Session {
 
         if (!force) {
             // when the session is killed open transaction should be rolled back
-            graphManager.getGraphNames().stream().forEach(gName -> {
+            graphManager.getGraphNames().forEach(gName -> {
                 final Graph g = graphManager.getGraph(gName);
                 if (g.features().graph().supportsTransactions()) {
                     // have to execute the rollback in the executor because the transaction is associated with