Class Client.ClusteredClient
- java.lang.Object
- 
- org.apache.tinkerpop.gremlin.driver.Client
- 
- org.apache.tinkerpop.gremlin.driver.Client.ClusteredClient
 
 
- 
- Enclosing class:
- Client
 
 public static final class Client.ClusteredClient extends Client AClientimplementation that does not operate in a session. Requests are sent to multiple servers given aLoadBalancingStrategy. Transactions are automatically committed (or rolled-back on error) after each request.
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class org.apache.tinkerpop.gremlin.driver.ClientClient.AliasClusteredClient, Client.ClusteredClient, Client.SessionedClient, Client.SessionSettings, Client.Settings
 
- 
 - 
Field Summary- 
Fields inherited from class org.apache.tinkerpop.gremlin.driver.Clientcluster, initialized, settings, TOO_MANY_IN_FLIGHT_REQUESTS
 
- 
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Clientalias(String graphOrTraversalSource)Create a newClientthat aliases the specifiedGraphorTraversalSourcename on the server to a variable called "g" for the context of the requests made through thatClient.Clientalias(Map<String,String> aliases)Creates aClientthat supplies the specified set of aliases, thus allowing the user to re-name one or more globally definedGraphorTraversalSourceserver bindings for the context of the createdClient.protected org.apache.tinkerpop.gremlin.driver.ConnectionchooseConnection(org.apache.tinkerpop.gremlin.driver.message.RequestMessage msg)Uses aLoadBalancingStrategyto choose the bestHostand then selects the best connection from that host's connection pool.CompletableFuture<Void>closeAsync()Closes all the connection pools on all hosts.protected voidinitializeImplementation()Initializes the connection pools on all hosts.booleanisClosing()ResultSetsubmit(String gremlin, String graphOrTraversalSource)Submits a Gremlin script to the server and returns aResultSetonce the write of the request is complete.ResultSetsubmit(String gremlin, String graphOrTraversalSource, Map<String,Object> parameters)Submits a Gremlin script and bound parameters to the server and returns aResultSetonce the write of the request is complete.booleantryReInitializeHost(Host host)Attempt to re-initialize theHostthat was previously marked as unavailable.- 
Methods inherited from class org.apache.tinkerpop.gremlin.driver.ClientbuildMessage, close, getCluster, getSettings, init, makeDefaultAliasMap, submit, submit, submit, submit, submit, submit, submitAsync, submitAsync, submitAsync, submitAsync, submitAsync, submitAsync, submitAsync, submitAsync, submitAsync
 
- 
 
- 
- 
- 
Method Detail- 
submitpublic ResultSet submit(String gremlin, String graphOrTraversalSource) Submits a Gremlin script to the server and returns aResultSetonce the write of the request is complete.- Parameters:
- gremlin- the gremlin script to execute
 
 - 
submitpublic ResultSet submit(String gremlin, String graphOrTraversalSource, Map<String,Object> parameters) Submits a Gremlin script and bound parameters to the server and returns aResultSetonce the write of the request is complete. If a script is to be executed repeatedly with slightly different arguments, prefer this method to concatenating a Gremlin script from dynamically produced strings and sending it toClient.submit(String). Parameterized scripts will perform better.- Parameters:
- gremlin- the gremlin script to execute
- parameters- a map of parameters that will be bound to the script on execution
- graphOrTraversalSource- rebinds the specified global Gremlin Server variable to "g"
 
 - 
aliaspublic Client alias(String graphOrTraversalSource) Create a newClientthat aliases the specifiedGraphorTraversalSourcename on the server to a variable called "g" for the context of the requests made through thatClient.
 - 
aliaspublic Client alias(Map<String,String> aliases) Creates aClientthat supplies the specified set of aliases, thus allowing the user to re-name one or more globally definedGraphorTraversalSourceserver bindings for the context of the createdClient.
 - 
chooseConnectionprotected org.apache.tinkerpop.gremlin.driver.Connection chooseConnection(org.apache.tinkerpop.gremlin.driver.message.RequestMessage msg) throws TimeoutException, org.apache.tinkerpop.gremlin.driver.exception.ConnectionExceptionUses aLoadBalancingStrategyto choose the bestHostand then selects the best connection from that host's connection pool.- Specified by:
- chooseConnectionin class- Client
- Throws:
- TimeoutException
- org.apache.tinkerpop.gremlin.driver.exception.ConnectionException
 
 - 
initializeImplementationprotected void initializeImplementation() Initializes the connection pools on all hosts.- Specified by:
- initializeImplementationin class- Client
 
 - 
closeAsyncpublic CompletableFuture<Void> closeAsync() Closes all the connection pools on all hosts.- Specified by:
- closeAsyncin class- Client
 
 - 
tryReInitializeHostpublic boolean tryReInitializeHost(Host host) 
 
- 
 
-