tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davebs...@apache.org
Subject [5/9] tinkerpop git commit: TINKERPOP-1490 Deprecated the old RemoteConnection submit method.
Date Wed, 07 Dec 2016 21:37:50 GMT
TINKERPOP-1490 Deprecated the old RemoteConnection submit method.

That method isn't called at all anymore - needs to be removed completely for 3.3.x.


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

Branch: refs/heads/TINKERPOP-1490
Commit: 57eb5ec6238a319a0c844bd2ddce87d735846c1d
Parents: 69e0f66
Author: Stephen Mallette <spmva@genoprime.com>
Authored: Mon Nov 14 10:08:48 2016 -0500
Committer: Stephen Mallette <spmva@genoprime.com>
Committed: Tue Nov 15 09:52:58 2016 -0500

----------------------------------------------------------------------
 CHANGELOG.asciidoc                                |  1 +
 .../gremlin/process/remote/RemoteConnection.java  | 18 ++++++++++++++++--
 .../process/remote/traversal/RemoteTraversal.java |  6 +++---
 .../driver/remote/DriverRemoteConnection.java     |  6 +++++-
 4 files changed, 25 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/57eb5ec6/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 93e418c..6bfb8ad 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -39,6 +39,7 @@ TinkerPop 3.2.4 (Release Date: NOT OFFICIALLY RELEASED YET)
 * Added a `force` option for killing sessions without waiting for transaction close or timeout
of a currently running job or multiple jobs.
 * Deprecated `Session.kill()` and `Session.manualKill()`.
 * Added `Traversal.promise()` method to allow for asynchronous traversal processing on "remote"
traversals.
+* Deprecated `RemoteConnection.submit(Bytecode)` in favor of `submitAsync(Bytecode)`.
 * Added `choose(predicate,traversal)` and `choose(traversal,traversal)` to effect if/then-semantics
(no else). Equivalent to `choose(x,y,identity())`.
 * Removed `ImmutablePath.TailPath` as it is no longer required with new recursion model.
 * Removed call stack recursion in `ImmutablePath`.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/57eb5ec6/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/RemoteConnection.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/RemoteConnection.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/RemoteConnection.java
index f4e3976..1831276 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/RemoteConnection.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/RemoteConnection.java
@@ -38,7 +38,7 @@ import java.util.concurrent.CompletableFuture;
 public interface RemoteConnection extends AutoCloseable {
 
     /**
-     * @deprecated As of release 3.2.2, replaced by {@link #submit(Bytecode)}.
+     * @deprecated As of release 3.2.2, replaced by {@link #submitAsync(Bytecode)}.
      */
     @Deprecated
     public <E> Iterator<Traverser.Admin<E>> submit(final Traversal<?,
E> traversal) throws RemoteConnectionException;
@@ -47,13 +47,27 @@ public interface RemoteConnection extends AutoCloseable {
      * Submits {@link Traversal} {@link Bytecode} to a server and returns a {@link RemoteTraversal}.
      * The {@link RemoteTraversal} is an abstraction over two types of results that can be
returned as part of the
      * response from the server: the results of the {@link Traversal} itself and the side-effects
that it produced.
+     *
+     * @deprecated As of release 3.2.4, replaced by {@link #submitAsync(Bytecode)}.
      */
+    @Deprecated
     public <E> RemoteTraversal<?,E> submit(final Bytecode bytecode) throws RemoteConnectionException;
 
     /**
      * Submits {@link Traversal} {@link Bytecode} to a server and returns a promise of a
{@link RemoteTraversal}.
      * The {@link RemoteTraversal} is an abstraction over two types of results that can be
returned as part of the
      * response from the server: the results of the {@link Traversal} itself and the side-effects
that it produced.
+     * <p/>
+     * The default implementation calls the {@link #submit(Bytecode)} method for backward
compatibility, but generally
+     * speaking this method should be implemented directly as {@link #submit(Bytecode)} is
not called directly by
+     * any part of TinkerPop. Even if the {@code RemoteConnection} itself is not capable
of asynchronous behaviour, it
+     * should simply implement this method in a blocking form.
      */
-    public <E> CompletableFuture<RemoteTraversal<?, E>> submitAsync(final
Bytecode bytecode) throws RemoteConnectionException;
+    public default <E> CompletableFuture<RemoteTraversal<?, E>> submitAsync(final
Bytecode bytecode) throws RemoteConnectionException {
+        // default implementation for backward compatibility to 3.2.4 - this method will
probably just become
+        // the new submit() in 3.3.x when the deprecation is removed
+        final CompletableFuture<RemoteTraversal<?, E>> promise = new CompletableFuture<>();
+        promise.complete(submit(bytecode));
+        return promise;
+    }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/57eb5ec6/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/traversal/RemoteTraversal.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/traversal/RemoteTraversal.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/traversal/RemoteTraversal.java
index 57b0cda..70ec27f 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/traversal/RemoteTraversal.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/traversal/RemoteTraversal.java
@@ -25,9 +25,9 @@ import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep;
 
 /**
- * A {@link RemoteTraversal} is returned from {@link RemoteConnection#submit(Bytecode)}.
It is iterated from within
- * {@link RemoteStep} using {@link #nextTraverser()}. Implementations should typically be
given a "result" from a
- * remote source where the traversal was executed. The "result" should be an iterator which
preferably has its data
+ * A {@link RemoteTraversal} is returned from {@link RemoteConnection#submitAsync(Bytecode)}.
It is iterated from
+ * within {@link RemoteStep} using {@link #nextTraverser()}. Implementations should typically
be given a "result" from
+ * a remote source where the traversal was executed. The "result" should be an iterator which
preferably has its data
  * bulked.
  * <p/>
  * Note that internally {@link #nextTraverser()} is called from within a loop (specifically
in

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/57eb5ec6/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/remote/DriverRemoteConnection.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/remote/DriverRemoteConnection.java
b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/remote/DriverRemoteConnection.java
index be3fa28..d6415de 100644
--- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/remote/DriverRemoteConnection.java
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/remote/DriverRemoteConnection.java
@@ -165,7 +165,7 @@ public class DriverRemoteConnection implements RemoteConnection {
     }
 
     /**
-     * @deprecated As of release 3.2.2, replaced by {@link #submit(Bytecode)}.
+     * @deprecated As of release 3.2.2, replaced by {@link #submitAsync(Bytecode)}.
      */
     @Deprecated
     @Override
@@ -183,6 +183,10 @@ public class DriverRemoteConnection implements RemoteConnection {
         }
     }
 
+    /**
+     * @deprecated As of release 3.2.4, replaced by {@link #submitAsync(Bytecode)}.
+     */
+    @Deprecated
     @Override
     public <E> RemoteTraversal<?,E> submit(final Bytecode bytecode) throws RemoteConnectionException
{
         try {


Mime
View raw message