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 2015/06/12 20:44:16 UTC

[2/2] incubator-tinkerpop git commit: GremlinServer now returns the ServerGremlinExecutor on start().

GremlinServer now returns the ServerGremlinExecutor on start().


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

Branch: refs/heads/master
Commit: be988ce8236a91593365f363af44e20c49b13adf
Parents: 0b3e50e
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Jun 12 14:43:47 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Jun 12 14:43:47 2015 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                                           | 1 +
 .../org/apache/tinkerpop/gremlin/server/GremlinServer.java   | 8 ++++----
 2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/be988ce8/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 3e31faa..fa4a8a6 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,6 +26,7 @@ TinkerPop 3.0.0.GA (NOT OFFICIALLY RELEASED YET)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 * Added `Path.getSingle(pop,label)` and `Path.getList(label)` as default helpers in `Path`.
+* Changed `GremlinServer.start()` to return a `CompletableFuture` that contains the constructed `ServerGremlinExecutor`.
 * Restructured `IoTest` breaking it up into smaller and more logically grouped test cases.
 * Gremlin Server `Settings` now has sensible defaults thus allowing the server to be started with no additional configuration.
 * Fixed garbled characters in Gremlin Console that notably showed up in `:help`

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/be988ce8/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 8b66a84..f34ccc8 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
@@ -64,7 +64,7 @@ public class GremlinServer {
     private Channel ch;
 
     private CompletableFuture<Void> serverStopped = null;
-    private CompletableFuture<Void> serverStarted = null;
+    private CompletableFuture<ServerGremlinExecutor<EventLoopGroup>> serverStarted = null;
 
     private final EventLoopGroup bossGroup;
     private final EventLoopGroup workerGroup;
@@ -110,14 +110,14 @@ public class GremlinServer {
     /**
      * Start Gremlin Server with {@link Settings} provided to the constructor.
      */
-    public synchronized CompletableFuture<Void> start() throws Exception {
+    public synchronized CompletableFuture<ServerGremlinExecutor<EventLoopGroup>> start() throws Exception {
         if(serverStarted != null) {
             // server already started - don't get it rolling again
             return serverStarted;
         }
 
         serverStarted = new CompletableFuture<>();
-        final CompletableFuture<Void> serverReadyFuture = serverStarted = new CompletableFuture<>();
+        final CompletableFuture<ServerGremlinExecutor<EventLoopGroup>> serverReadyFuture = serverStarted = new CompletableFuture<>();
         try {
             final ServerBootstrap b = new ServerBootstrap();
 
@@ -156,7 +156,7 @@ public class GremlinServer {
                                 settings.threadPoolWorker, settings.gremlinPool, settings.threadPoolBoss);
                         logger.info("Channel started at port {}.", settings.port);
 
-                        serverReadyFuture.complete(null);
+                        serverReadyFuture.complete(serverGremlinExecutor);
                     } else {
                         serverReadyFuture.completeExceptionally(new IOException(
                                 String.format("Could not bind to %s and %s - perhaps something else is bound to that address.", settings.host, settings.port)));