Class Client.PinnedClient
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.driver.Client
-
- org.apache.tinkerpop.gremlin.driver.Client.PinnedClient
-
- All Implemented Interfaces:
RequestSubmitter,RequestSubmitterAsync
- Enclosing class:
- Client
public static class Client.PinnedClient extends Client
AClientthat pins all requests to a singleHost. Used internally by transactions to ensure all requests within a transaction go to the same server.This client is not intended to be used directly — obtain a
TransactionviaCluster.transact()orCluster.transact(String)instead.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.tinkerpop.gremlin.driver.Client
Client.AliasClusteredClient, Client.ClusteredClient, Client.PinnedClient
-
-
Field Summary
-
Fields inherited from class org.apache.tinkerpop.gremlin.driver.Client
cluster, initialized, TOO_MANY_IN_FLIGHT_REQUESTS
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.apache.tinkerpop.gremlin.driver.ConnectionchooseConnection(RequestMessage msg)Chooses aConnectionto write the message to.CompletableFuture<Void>closeAsync()Marks this client as closed.HostgetPinnedHost()protected voidinitializeImplementation()Called in theClient.init()method.booleanisClosing()-
Methods inherited from class org.apache.tinkerpop.gremlin.driver.Client
alias, buildMessage, chooseRandomHost, close, getCluster, init, submit, submit, submit, submitAsync, submitAsync, submitAsync, submitAsync, submitAsync
-
-
-
-
Method Detail
-
getPinnedHost
public Host getPinnedHost()
-
initializeImplementation
protected void initializeImplementation()
Description copied from class:ClientCalled in theClient.init()method.- Specified by:
initializeImplementationin classClient
-
chooseConnection
protected org.apache.tinkerpop.gremlin.driver.Connection chooseConnection(RequestMessage msg) throws TimeoutException, ConnectionException
Description copied from class:ClientChooses aConnectionto write the message to.- Specified by:
chooseConnectionin classClient- Throws:
TimeoutExceptionConnectionException
-
closeAsync
public CompletableFuture<Void> closeAsync()
Marks this client as closed. The underlying pool is owned byClient.ClusteredClientand is not closed here.- Specified by:
closeAsyncin classClient
-
-