public class RemoteGraph extends Object implements Graph
RemoteGraph
is only required for integrating with the test suite as there must be a Graph
instance
for the test suite to bind to. Test suites that use this must ensure that the TraversalSource
be
generated from their GraphProvider
in via AnonymousTraversalSource#withRemote(RemoteConnection)
or
similar overload. See RemoteGraphProvider
in the gremlin-server module for an example.Modifier and Type | Class and Description |
---|---|
static class |
RemoteGraph.RemoteFeatures |
static class |
RemoteGraph.RemoteGraphFeatures |
Graph.Exceptions, Graph.Features, Graph.Hidden, Graph.OptIn, Graph.OptIns, Graph.OptOut, Graph.OptOuts, Graph.Variables
Modifier and Type | Method and Description |
---|---|
Vertex |
addVertex(Object... keyValues)
Add a
Vertex to the graph given an optional series of key/value pairs. |
void |
close()
Closes the underlying
RemoteConnection . |
GraphComputer |
compute()
Generate a
GraphComputer using the default engine of the underlying graph system. |
<C extends GraphComputer> |
compute(Class<C> graphComputerClass)
Declare the
GraphComputer to use for OLAP operations on the graph. |
Configuration |
configuration()
Get the
org.apache.commons.configuration.Configuration associated with the construction of this graph. |
Iterator<Edge> |
edges(Object... edgeIds)
This method returns an empty
Iterator - it is not meant to be called directly. |
Graph.Features |
features()
Gets the
Graph.Features exposed by the underlying Graph implementation. |
RemoteConnection |
getConnection() |
static RemoteGraph |
open(Configuration conf)
Creates a new
RemoteGraph instance using the specified configuration, which allows RemoteGraph
to be compliant with GraphFactory . |
static RemoteGraph |
open(RemoteConnection connection,
Configuration conf)
Creates a new
RemoteGraph instance. |
String |
toString() |
Transaction |
tx()
Configure and control the transactions for those graphs that support this feature.
|
Graph.Variables |
variables()
A collection of global
Graph.Variables associated with the graph. |
Iterator<Vertex> |
vertices(Object... vertexIds)
This method returns an empty
Iterator - it is not meant to be called directly. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addVertex, io, traversal, traversal
getHostingVertex
public static RemoteGraph open(Configuration conf)
RemoteGraph
instance using the specified configuration, which allows RemoteGraph
to be compliant with GraphFactory
. Expects key for RemoteConnection.GREMLIN_REMOTE_CONNECTION_CLASS
as well as any configuration required by the underlying RemoteConnection
which will be instantiated.
Note that the Configuration
object is passed down without change to the creation of the
RemoteConnection
instance.public static RemoteGraph open(RemoteConnection connection, Configuration conf)
RemoteGraph
instance. RemoteGraph
will attempt to call the
AutoCloseable.close()
method when the close()
method is called on this class.connection
- the RemoteConnection
instance to use
RemoteConnection
public RemoteConnection getConnection()
public void close() throws Exception
RemoteConnection
.close
in interface AutoCloseable
close
in interface Graph
Exception
public <C extends GraphComputer> C compute(Class<C> graphComputerClass) throws IllegalArgumentException
Graph
GraphComputer
to use for OLAP operations on the graph.
If the graph does not support graph computer then an UnsupportedOperationException
is thrown.compute
in interface Graph
graphComputerClass
- The graph computer class to use.IllegalArgumentException
- if the provided GraphComputer
class is not supported.public GraphComputer compute() throws IllegalArgumentException
Graph
GraphComputer
using the default engine of the underlying graph system.
This is a shorthand method for the more involved method that uses Graph.compute(Class)
.compute
in interface Graph
IllegalArgumentException
- if there is no default graph computerpublic Iterator<Vertex> vertices(Object... vertexIds)
Iterator
- it is not meant to be called directly.public Iterator<Edge> edges(Object... edgeIds)
Iterator
- it is not meant to be called directly.public Transaction tx()
Graph
Transaction
in the TinkerPop context is a
transaction "factory" or "controller" that helps manage transactions owned by the underlying graph database.public Graph.Variables variables()
Graph
Graph.Variables
associated with the graph.
Variables are used for storing metadata about the graph.public Configuration configuration()
Graph
org.apache.commons.configuration.Configuration
associated with the construction of this graph.
Whatever configuration was passed to GraphFactory#open(org.apache.commons.configuration.Configuration)
is what should be returned by this method.configuration
in interface Graph
public Graph.Features features()
Graph
Graph.Features
exposed by the underlying Graph
implementation.Copyright © 2013–2018 Apache Software Foundation. All rights reserved.