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
A
Client that pins all requests of a single transaction to one Host. Used internally by
transactions; obtain one indirectly via Cluster.transact() or Cluster.transact(String) rather
than directly.
This is a lightweight routing view that owns no connection pools. All transactions share a single
Client.ClusteredClient (one per Cluster) and borrow a connection per request from the pinned host's
pool, returning it once the response completes. Those pools are closed when the Cluster closes, never by this
client.
-
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
Modifier and TypeMethodDescriptionprotected org.apache.tinkerpop.gremlin.driver.ConnectionchooseConnection(org.apache.tinkerpop.gremlin.util.message.RequestMessage msg) Chooses aConnectionto write the message to.Records the closed state for theisClosing()contract.protected voidCalled in theClient.init()method.booleanMethods inherited from class org.apache.tinkerpop.gremlin.driver.Client
alias, buildMessage, chooseRandomHost, close, getCluster, init, submit, submit, submit, submitAsync, submitAsync, submitAsync, submitAsync, submitAsync
-
Method Details
-
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(org.apache.tinkerpop.gremlin.util.message.RequestMessage msg) throws TimeoutException, org.apache.tinkerpop.gremlin.driver.exception.ConnectionException Description copied from class:ClientChooses aConnectionto write the message to.- Specified by:
chooseConnectionin classClient- Throws:
TimeoutExceptionorg.apache.tinkerpop.gremlin.driver.exception.ConnectionException
-
isClosing
public boolean isClosing() -
closeAsync
Records the closed state for theisClosing()contract. Intentionally closes no connections: the shared pools are owned by the transactionClient.ClusteredClientand closed with theCluster.- Specified by:
closeAsyncin classClient
-