Class Client.AliasClusteredClient
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.driver.Client
-
- org.apache.tinkerpop.gremlin.driver.Client.AliasClusteredClient
-
- Enclosing class:
- Client
public static class Client.AliasClusteredClient extends Client
Uses aClient.ClusteredClient
that rebinds requests to a specifiedGraph
orTraversalSource
instances on the server-side.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.tinkerpop.gremlin.driver.Client
Client.AliasClusteredClient, Client.ClusteredClient, Client.SessionedClient, Client.SessionSettings, Client.Settings
-
-
Field Summary
-
Fields inherited from class org.apache.tinkerpop.gremlin.driver.Client
cluster, initialized, settings, TOO_MANY_IN_FLIGHT_REQUESTS
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Client
alias(Map<String,String> aliases)
Creates aClient
that supplies the specified set of aliases, thus allowing the user to re-name one or more globally definedGraph
orTraversalSource
server bindings for the context of the createdClient
.org.apache.tinkerpop.gremlin.driver.message.RequestMessage.Builder
buildMessage(org.apache.tinkerpop.gremlin.driver.message.RequestMessage.Builder builder)
Makes any initial changes to the builder and returns the constructedRequestMessage
.protected org.apache.tinkerpop.gremlin.driver.Connection
chooseConnection(org.apache.tinkerpop.gremlin.driver.message.RequestMessage msg)
Delegates to the underlyingClient.ClusteredClient
.void
close()
Closes the client by making a synchronous call toClient.closeAsync()
.CompletableFuture<Void>
closeAsync()
Asynchronous close of theClient
.Client
init()
Initializes the client which typically means that a connection is established to the server.protected void
initializeImplementation()
Called in theClient.init()
method.boolean
isClosing()
CompletableFuture<ResultSet>
submitAsync(org.apache.tinkerpop.gremlin.driver.message.RequestMessage msg)
A low-level method that allows the submission of a manually constructedRequestMessage
.CompletableFuture<ResultSet>
submitAsync(Bytecode bytecode)
An asynchronous version ofClient.submit(Traversal)
.CompletableFuture<ResultSet>
submitAsync(Bytecode bytecode, RequestOptions options)
A version ofClient.submit(Bytecode)
which provides the ability to set per-request options.CompletableFuture<ResultSet>
submitAsync(Traversal traversal)
An asynchronous version ofClient.submit(Traversal)
.-
Methods inherited from class org.apache.tinkerpop.gremlin.driver.Client
alias, getCluster, getSettings, makeDefaultAliasMap, submit, submit, submit, submit, submit, submit, submitAsync, submitAsync, submitAsync, submitAsync, submitAsync
-
-
-
-
Method Detail
-
submitAsync
public CompletableFuture<ResultSet> submitAsync(Bytecode bytecode)
Description copied from class:Client
An asynchronous version ofClient.submit(Traversal)
. Results are returned asTraverser
instances and are therefore bulked, meaning that to properly iterate the contents of the result eachTraverser.bulk()
must be examined to determine the number of times that object should be presented in iteration.- Overrides:
submitAsync
in classClient
-
submitAsync
public CompletableFuture<ResultSet> submitAsync(Bytecode bytecode, RequestOptions options)
Description copied from class:Client
A version ofClient.submit(Bytecode)
which provides the ability to set per-request options.- Overrides:
submitAsync
in classClient
- Parameters:
bytecode
- request in the form of gremlinBytecode
options
- for the request- See Also:
Client.submitAsync(Bytecode)
-
submitAsync
public CompletableFuture<ResultSet> submitAsync(org.apache.tinkerpop.gremlin.driver.message.RequestMessage msg)
Description copied from class:Client
A low-level method that allows the submission of a manually constructedRequestMessage
.- Overrides:
submitAsync
in classClient
-
submitAsync
public CompletableFuture<ResultSet> submitAsync(Traversal traversal)
Description copied from class:Client
An asynchronous version ofClient.submit(Traversal)
. Results are returned asTraverser
instances and are therefore bulked, meaning that to properly iterate the contents of the result eachTraverser.bulk()
must be examined to determine the number of times that object should be presented in iteration.- Overrides:
submitAsync
in classClient
-
init
public Client init()
Description copied from class:Client
Initializes the client which typically means that a connection is established to the server. Depending on the implementation and configuration this blocking call may take some time. This method will be called automatically if it is not called directly and multiple calls will not have effect.
-
buildMessage
public org.apache.tinkerpop.gremlin.driver.message.RequestMessage.Builder buildMessage(org.apache.tinkerpop.gremlin.driver.message.RequestMessage.Builder builder)
Description copied from class:Client
Makes any initial changes to the builder and returns the constructedRequestMessage
. Implementers may choose to override this message to append data to the request before sending. By default, this method will simply return thebuilder
passed in by the caller.- Overrides:
buildMessage
in classClient
-
initializeImplementation
protected void initializeImplementation()
Description copied from class:Client
Called in theClient.init()
method.- Specified by:
initializeImplementation
in classClient
-
chooseConnection
protected org.apache.tinkerpop.gremlin.driver.Connection chooseConnection(org.apache.tinkerpop.gremlin.driver.message.RequestMessage msg) throws TimeoutException, org.apache.tinkerpop.gremlin.driver.exception.ConnectionException
Delegates to the underlyingClient.ClusteredClient
.- Specified by:
chooseConnection
in classClient
- Throws:
TimeoutException
org.apache.tinkerpop.gremlin.driver.exception.ConnectionException
-
close
public void close()
Description copied from class:Client
Closes the client by making a synchronous call toClient.closeAsync()
.
-
closeAsync
public CompletableFuture<Void> closeAsync()
Description copied from class:Client
Asynchronous close of theClient
.- Specified by:
closeAsync
in classClient
-
-