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 2018/12/04 13:43:09 UTC
[tinkerpop] branch master updated (7de9880 -> 1041f86)
This is an automated email from the ASF dual-hosted git repository.
spmallette pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git.
from 7de9880 Merge pull request #1006 from apache/TINKERPOP-2103
add 6cc7b7d TINKERPOP-2102 Deprecate static fields on TraversalSource
new 0bd3824 Merge branch 'TINKERPOP-2102' into tp33
new 1041f86 Merge branch 'tp33'
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
CHANGELOG.asciidoc | 1 +
.../gremlin/process/remote/RemoteConnection.java | 25 +++++++++++++++++++++-
.../traversal/AnonymousTraversalSource.java | 16 +++-----------
.../gremlin/process/traversal/TraversalSource.java | 3 ---
.../driver/remote/DriverRemoteConnection.java | 5 ++---
.../gremlin/driver/remote/RemoteGraphProvider.java | 3 ++-
.../gremlin/server/GremlinServerIntegrateTest.java | 2 +-
.../tinkerpop/gremlin/structure/RemoteGraph.java | 8 +++----
8 files changed, 37 insertions(+), 26 deletions(-)
[tinkerpop] 02/02: Merge branch 'tp33'
Posted by sp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
spmallette pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
commit 1041f86d2e77d14dc214fdb917c73387987de546
Merge: 7de9880 0bd3824
Author: Stephen Mallette <sp...@genoprime.com>
AuthorDate: Tue Dec 4 08:42:54 2018 -0500
Merge branch 'tp33'
Conflicts:
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/RemoteConnection.java
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSource.java
gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/remote/DriverRemoteConnection.java
CHANGELOG.asciidoc | 1 +
.../gremlin/process/remote/RemoteConnection.java | 25 +++++++++++++++++++++-
.../traversal/AnonymousTraversalSource.java | 16 +++-----------
.../gremlin/process/traversal/TraversalSource.java | 3 ---
.../driver/remote/DriverRemoteConnection.java | 5 ++---
.../gremlin/driver/remote/RemoteGraphProvider.java | 3 ++-
.../gremlin/server/GremlinServerIntegrateTest.java | 2 +-
.../tinkerpop/gremlin/structure/RemoteGraph.java | 8 +++----
8 files changed, 37 insertions(+), 26 deletions(-)
diff --cc gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/RemoteConnection.java
index 51968dd,8128fdc..0c124e7
--- 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
@@@ -21,8 -22,9 +22,8 @@@ import org.apache.commons.configuration
import org.apache.tinkerpop.gremlin.process.remote.traversal.RemoteTraversal;
import org.apache.tinkerpop.gremlin.process.traversal.Bytecode;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
--import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
+ import java.lang.reflect.Constructor;
import java.util.Iterator;
import java.util.concurrent.CompletableFuture;
@@@ -36,10 -38,64 +37,32 @@@
* @author Marko A. Rodriguez (http://markorodriguez.com)
*/
public interface RemoteConnection extends AutoCloseable {
-
+ public static final String GREMLIN_REMOTE = "gremlin.remote.";
+ public static final String GREMLIN_REMOTE_CONNECTION_CLASS = GREMLIN_REMOTE + "remoteConnectionClass";
+
/**
- * @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;
-
- /**
- * 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 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<>();
- try {
- promise.complete(submit(bytecode));
- } catch (Exception t) {
- promise.completeExceptionally(t);
- }
- return promise;
- }
+ public <E> CompletableFuture<RemoteTraversal<?, E>> submitAsync(final Bytecode bytecode) throws RemoteConnectionException;
+
+ /**
+ * Create a {@link RemoteConnection} from a {@code Configuration} object. The configuration must contain a
+ * {@code gremlin.remote.remoteConnectionClass} key which is the fully qualified class name of a
+ * {@link RemoteConnection} class.
+ */
+ public static RemoteConnection from(final Configuration conf) {
+ if (!conf.containsKey(RemoteConnection.GREMLIN_REMOTE_CONNECTION_CLASS))
+ throw new IllegalArgumentException("Configuration must contain the '" + GREMLIN_REMOTE_CONNECTION_CLASS + "' key");
+
+ try {
+ final Class<? extends RemoteConnection> clazz = Class.forName(
+ conf.getString(GREMLIN_REMOTE_CONNECTION_CLASS)).asSubclass(RemoteConnection.class);
+ final Constructor<? extends RemoteConnection> ctor = clazz.getConstructor(Configuration.class);
+ return ctor.newInstance(conf);
+ } catch (Exception ex) {
+ throw new IllegalStateException(ex);
+ }
+ }
}
diff --cc gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/AnonymousTraversalSource.java
index 03d203f,7cb62c3..05fcab7
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/AnonymousTraversalSource.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/AnonymousTraversalSource.java
@@@ -23,9 -22,8 +23,11 @@@ import org.apache.commons.configuration
import org.apache.tinkerpop.gremlin.process.remote.RemoteConnection;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.apache.tinkerpop.gremlin.structure.util.empty.EmptyGraph;
+
+import java.lang.reflect.Constructor;
+
++import static org.apache.tinkerpop.gremlin.process.remote.RemoteConnection.GREMLIN_REMOTE_CONNECTION_CLASS;
+
/**
* Provides a unified way to construct a {@link TraversalSource} from the perspective of the traversal. In this syntax
* the user is creating the source and binding it to a reference which is either an existing {@link Graph} instance
@@@ -70,19 -70,9 +72,7 @@@ public class AnonymousTraversalSource<
* traversals spawned from it will execute over that reference.
*/
public T withRemote(final Configuration conf) {
- if (!conf.containsKey(TraversalSource.GREMLIN_REMOTE_CONNECTION_CLASS))
- throw new IllegalArgumentException("Configuration must contain the '" + TraversalSource.GREMLIN_REMOTE_CONNECTION_CLASS + "' key");
-
- final RemoteConnection remoteConnection;
- try {
- final Class<? extends RemoteConnection> clazz = Class.forName(conf.getString(TraversalSource.GREMLIN_REMOTE_CONNECTION_CLASS)).asSubclass(RemoteConnection.class);
- final Constructor<? extends RemoteConnection> ctor = clazz.getConstructor(Configuration.class);
- remoteConnection = ctor.newInstance(conf);
- } catch (Exception ex) {
- throw new IllegalStateException(ex);
- }
-
- return withRemote(remoteConnection);
- // for now, this method simply uses the deprecated approach. when this approach is removed we just need to
- // make it possible to set a RemoteConnection directly on TraversalSource construction.
- return (T) withGraph(EmptyGraph.instance()).withRemote(conf);
++ return withRemote(RemoteConnection.from(conf));
}
/**
diff --cc gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSource.java
index 67d75a2,c9684bc..a909edf
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSource.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSource.java
@@@ -49,10 -51,19 +49,7 @@@ import java.util.function.UnaryOperator
*/
public interface TraversalSource extends Cloneable, AutoCloseable {
- public static final String GREMLIN_REMOTE = "gremlin.remote.";
- public static final String GREMLIN_REMOTE_CONNECTION_CLASS = GREMLIN_REMOTE + "remoteConnectionClass";
-
/**
- * @deprecated As of release 3.3.5, replaced by {@link RemoteConnection#GREMLIN_REMOTE}.
- */
- @Deprecated
- public static final String GREMLIN_REMOTE = "gremlin.remote.";
-
- /**
- * @deprecated As of release 3.3.5, replaced by {@link RemoteConnection#GREMLIN_REMOTE_CONNECTION_CLASS}.
- */
- @Deprecated
- public static final String GREMLIN_REMOTE_CONNECTION_CLASS = GREMLIN_REMOTE + "remoteConnectionClass";
-
- /**
* Get the {@link TraversalStrategies} associated with this traversal source.
*
* @return the traversal strategies of the traversal source
diff --cc gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/remote/DriverRemoteConnection.java
index 794f705,338a53b..4088caf
--- 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
@@@ -21,16 -21,24 +21,15 @@@ package org.apache.tinkerpop.gremlin.dr
import org.apache.commons.configuration.Configuration;
import org.apache.tinkerpop.gremlin.driver.Client;
import org.apache.tinkerpop.gremlin.driver.Cluster;
-import org.apache.tinkerpop.gremlin.driver.ResultSet;
-import org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.decoration.VertexProgramStrategy;
import org.apache.tinkerpop.gremlin.process.remote.RemoteConnection;
import org.apache.tinkerpop.gremlin.process.remote.RemoteConnectionException;
-import org.apache.tinkerpop.gremlin.process.remote.RemoteGraph;
import org.apache.tinkerpop.gremlin.process.remote.traversal.RemoteTraversal;
import org.apache.tinkerpop.gremlin.process.traversal.Bytecode;
- import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
-import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
-import java.util.Iterator;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
-import java.util.function.Supplier;
/**
* A {@link RemoteConnection} implementation for Gremlin Server. Each {@code DriverServerConnection} is bound to one
diff --cc gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/RemoteGraphProvider.java
index 204d21a,a7ef58a..df93ec4
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/RemoteGraphProvider.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/RemoteGraphProvider.java
@@@ -23,8 -23,7 +23,9 @@@ import org.apache.tinkerpop.gremlin.Abs
import org.apache.tinkerpop.gremlin.LoadGraphWith;
import org.apache.tinkerpop.gremlin.driver.Client;
import org.apache.tinkerpop.gremlin.driver.Cluster;
-import org.apache.tinkerpop.gremlin.process.remote.RemoteGraph;
++import org.apache.tinkerpop.gremlin.process.remote.RemoteConnection;
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+import org.apache.tinkerpop.gremlin.structure.RemoteGraph;
import org.apache.tinkerpop.gremlin.process.traversal.AnonymousTraversalSource;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
import org.apache.tinkerpop.gremlin.server.GremlinServer;
@@@ -86,7 -85,7 +87,7 @@@ public class RemoteGraphProvider extend
final Supplier<Graph> graphGetter = () -> server.getServerGremlinExecutor().getGraphManager().getGraph(serverGraphName);
return new HashMap<String, Object>() {{
put(Graph.GRAPH, RemoteGraph.class.getName());
- put(TraversalSource.GREMLIN_REMOTE_CONNECTION_CLASS, DriverRemoteConnection.class.getName());
- put(RemoteGraph.GREMLIN_REMOTE_GRAPH_REMOTE_CONNECTION_CLASS, DriverRemoteConnection.class.getName());
++ put(RemoteConnection.GREMLIN_REMOTE_CONNECTION_CLASS, DriverRemoteConnection.class.getName());
put(DriverRemoteConnection.GREMLIN_REMOTE_DRIVER_SOURCENAME, "g" + serverGraphName);
put("clusterConfiguration.port", TestClientFactory.PORT);
put("clusterConfiguration.hosts", "localhost");
diff --cc gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/RemoteGraph.java
index 5523900,0000000..954118b
mode 100644,000000..100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/RemoteGraph.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/RemoteGraph.java
@@@ -1,250 -1,0 +1,250 @@@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tinkerpop.gremlin.structure;
+
+import org.apache.commons.configuration.Configuration;
+import org.apache.commons.configuration.PropertiesConfiguration;
+import org.apache.tinkerpop.gremlin.GraphProvider;
+import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
+import org.apache.tinkerpop.gremlin.process.remote.RemoteConnection;
+import org.apache.tinkerpop.gremlin.process.traversal.AnonymousTraversalSource;
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
+import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
+
+import java.lang.reflect.Constructor;
+import java.util.Collections;
+import java.util.Iterator;
+
+/**
+ * {@code RemoteGraph} is only required for integrating with the test suite as there must be a {@link Graph} instance
+ * for the test suite to bind to. Test suites that use this must ensure that the {@link TraversalSource} be
+ * generated from their {@link GraphProvider} in via {@link AnonymousTraversalSource#withRemote(RemoteConnection)} or
+ * similar overload. See {@code RemoteGraphProvider} in the gremlin-server module for an example.
+ *
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+@Graph.OptIn(Graph.OptIn.SUITE_PROCESS_STANDARD)
+@Graph.OptIn(Graph.OptIn.SUITE_PROCESS_COMPUTER)
+@Graph.OptOut(
+ test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.ShortestPathTest",
+ method = "*",
+ reason = "https://issues.apache.org/jira/browse/TINKERPOP-1976")
+@Graph.OptOut(
+ test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.ConnectedComponentTest",
+ method = "*",
+ reason = "https://issues.apache.org/jira/browse/TINKERPOP-1976")
+@Graph.OptOut(
+ test = "org.apache.tinkerpop.gremlin.process.traversal.CoreTraversalTest",
+ method = "*",
+ reason = "The test suite does not support profiling or lambdas and for groovy tests: 'Could not locate method: GraphTraversalSource.withStrategies([{traversalCategory=interface org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy$DecorationStrategy}])'")
+@Graph.OptOut(
+ test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.ProgramTest",
+ method = "*",
+ reason = "RemoteGraph retrieves detached vertices that can't be attached to a remote OLAP graph")
+@Graph.OptOut(
+ test = "org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.ElementIdStrategyProcessTest",
+ method = "*",
+ reason = "RemoteGraph does not support ElementIdStrategy at this time - it requires a lambda in construction which is not serializable")
+@Graph.OptOut(
+ test = "org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.EventStrategyProcessTest",
+ method = "*",
+ reason = "RemoteGraph does not support EventStrategy at this time - some of its members are not serializable")
+@Graph.OptOut(
+ test = "org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.PartitionStrategyProcessTest",
+ method = "*",
+ reason = "RemoteGraph does not support PartitionStrategy at this time")
+@Graph.OptOut(
+ test = "org.apache.tinkerpop.gremlin.process.computer.ranking.pagerank.PageRankVertexProgramTest",
+ method = "*",
+ reason = "RemoteGraph does not support direct Graph.compute() access")
+@Graph.OptOut(
+ test = "org.apache.tinkerpop.gremlin.process.computer.search.path.ShortestPathVertexProgramTest",
+ method = "*",
+ reason = "RemoteGraph does not support direct Graph.compute() access")
+@Graph.OptOut(
+ test = "org.apache.tinkerpop.gremlin.process.computer.bulkloading.BulkLoaderVertexProgramTest",
+ method = "*",
+ reason = "RemoteGraph does not support direct Graph.compute() access")
+@Graph.OptOut(
+ test = "org.apache.tinkerpop.gremlin.process.computer.bulkdumping.BulkDumperVertexProgramTest",
+ method = "*",
+ reason = "RemoteGraph does not support direct Graph.compute() access")
+@Graph.OptOut(
+ test = "org.apache.tinkerpop.gremlin.process.computer.clone.CloneVertexProgramTest",
+ method = "*",
+ reason = "RemoteGraph does not support direct Graph.compute() access")
+@Graph.OptOut(
+ test = "org.apache.tinkerpop.gremlin.process.computer.GraphComputerTest",
+ method = "*",
+ reason = "RemoteGraph does not support direct Graph.compute() access")
+@Graph.OptOut(
+ test = "org.apache.tinkerpop.gremlin.process.traversal.TraversalInterruptionTest",
+ method = "*",
+ reason = "The interruption model in the test can't guarantee interruption at the right time with RemoteGraph.")
+@Graph.OptOut(
+ test = "org.apache.tinkerpop.gremlin.process.traversal.TraversalInterruptionComputerTest",
+ method = "*",
+ reason = "The interruption model in the test can't guarantee interruption at the right time with RemoteGraph.")
+public class RemoteGraph implements Graph {
+
+ private final RemoteConnection connection;
+ private final Configuration conf;
+
+ private RemoteGraph(final RemoteConnection connection, final Configuration conf) {
+ this.connection = connection;
+ this.conf = conf;
+ }
+
+ /**
+ * Creates a new {@link RemoteGraph} instance using the specified configuration, which allows {@link RemoteGraph}
- * to be compliant with {@link GraphFactory}. Expects key for {@link TraversalSource#GREMLIN_REMOTE_CONNECTION_CLASS}
++ * to be compliant with {@link GraphFactory}. Expects key for {@link RemoteConnection#GREMLIN_REMOTE_CONNECTION_CLASS}
+ * as well as any configuration required by the underlying {@link RemoteConnection} which will be instantiated.
+ * Note that the {@code Configuration} object is passed down without change to the creation of the
+ * {@link RemoteConnection} instance.
+ */
+ public static RemoteGraph open(final Configuration conf) {
- if (!conf.containsKey(TraversalSource.GREMLIN_REMOTE_CONNECTION_CLASS))
- throw new IllegalArgumentException("Configuration must contain the '" + TraversalSource.GREMLIN_REMOTE_CONNECTION_CLASS + "' key");
++ if (!conf.containsKey(RemoteConnection.GREMLIN_REMOTE_CONNECTION_CLASS))
++ throw new IllegalArgumentException("Configuration must contain the '" + RemoteConnection.GREMLIN_REMOTE_CONNECTION_CLASS + "' key");
+
+ final RemoteConnection remoteConnection;
+ try {
- final Class<? extends RemoteConnection> clazz = Class.forName(conf.getString(TraversalSource.GREMLIN_REMOTE_CONNECTION_CLASS)).asSubclass(RemoteConnection.class);
++ final Class<? extends RemoteConnection> clazz = Class.forName(conf.getString(RemoteConnection.GREMLIN_REMOTE_CONNECTION_CLASS)).asSubclass(RemoteConnection.class);
+ final Constructor<? extends RemoteConnection> ctor = clazz.getConstructor(Configuration.class);
+ remoteConnection = ctor.newInstance(conf);
+ } catch (Exception ex) {
+ throw new IllegalStateException(ex);
+ }
+
+ return new RemoteGraph(remoteConnection, conf);
+ }
+
+ public static RemoteGraph open(final String configFile) throws Exception {
+ return open(new PropertiesConfiguration(configFile));
+ }
+
+ /**
+ * Creates a new {@link RemoteGraph} instance. {@link RemoteGraph} will attempt to call the
+ * {@link RemoteConnection#close()} method when the {@link #close()} method is called on this class.
+ *
+ * @param connection the {@link RemoteConnection} instance to use
+ * {@link RemoteConnection}
+ */
+ public static RemoteGraph open(final RemoteConnection connection, final Configuration conf) {
+ return new RemoteGraph(connection, conf);
+ }
+
+ public RemoteConnection getConnection() {
+ return connection;
+ }
+
+ /**
+ * Closes the underlying {@link RemoteConnection}.
+ */
+ @Override
+ public void close() throws Exception {
+ connection.close();
+ }
+
+ @Override
+ public Vertex addVertex(final Object... keyValues) {
+ throw new UnsupportedOperationException(String.format("RemoteGraph is a proxy to %s - this method is not supported", connection));
+ }
+
+ @Override
+ public <C extends GraphComputer> C compute(final Class<C> graphComputerClass) throws IllegalArgumentException {
+ throw new UnsupportedOperationException(String.format("RemoteGraph is a proxy to %s - this method is not supported", connection));
+ }
+
+ @Override
+ public GraphComputer compute() throws IllegalArgumentException {
+ throw new UnsupportedOperationException(String.format("RemoteGraph is a proxy to %s - this method is not supported", connection));
+ }
+
+ /**
+ * This method returns an empty {@link Iterator} - it is not meant to be called directly.
+ */
+ @Override
+ public Iterator<Vertex> vertices(final Object... vertexIds) {
+ return Collections.emptyIterator();
+ }
+
+ /**
+ * This method returns an empty {@link Iterator} - it is not meant to be called directly.
+ */
+ @Override
+ public Iterator<Edge> edges(final Object... edgeIds) {
+ return Collections.emptyIterator();
+ }
+
+ @Override
+ public Transaction tx() {
+ throw new UnsupportedOperationException(String.format("RemoteGraph is a proxy to %s - this method is not supported", connection));
+ }
+
+ @Override
+ public Variables variables() {
+ throw new UnsupportedOperationException(String.format("RemoteGraph is a proxy to %s - this method is not supported", connection));
+ }
+
+ @Override
+ public Configuration configuration() {
+ return conf;
+ }
+
+ @Override
+ public Features features() {
+ return RemoteFeatures.INSTANCE;
+ }
+
+ @Override
+ public String toString() {
+ return StringFactory.graphString(this, connection.toString());
+ }
+
+ public static class RemoteFeatures implements Features {
+ static RemoteFeatures INSTANCE = new RemoteFeatures();
+
+ private RemoteFeatures() {
+ }
+
+ @Override
+ public GraphFeatures graph() {
+ return RemoteGraphFeatures.INSTANCE;
+ }
+ }
+
+ public static class RemoteGraphFeatures implements Features.GraphFeatures {
+
+ static RemoteGraphFeatures INSTANCE = new RemoteGraphFeatures();
+
+ private RemoteGraphFeatures() {
+ }
+
+ @Override
+ public boolean supportsTransactions() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsThreadedTransactions() {
+ return false;
+ }
+ }
+}
[tinkerpop] 01/02: Merge branch 'TINKERPOP-2102' into tp33
Posted by sp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
spmallette pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
commit 0bd3824b7897b4001df0615c6c3078cb9204a50e
Merge: d53c1bd 6cc7b7d
Author: Stephen Mallette <sp...@genoprime.com>
AuthorDate: Tue Dec 4 07:48:50 2018 -0500
Merge branch 'TINKERPOP-2102' into tp33
CHANGELOG.asciidoc | 1 +
.../gremlin/process/remote/RemoteConnection.java | 24 +++++++++++++++++++
.../gremlin/process/traversal/TraversalSource.java | 27 ++++++++++------------
.../driver/remote/DriverRemoteConnection.java | 5 ++--
.../gremlin/server/GremlinServerIntegrateTest.java | 2 +-
5 files changed, 40 insertions(+), 19 deletions(-)