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
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.

  • Method Details

    • getPinnedHost

      public Host getPinnedHost()
    • initializeImplementation

      protected void initializeImplementation()
      Description copied from class: Client
      Called in the Client.init() method.
      Specified by:
      initializeImplementation in class Client
    • 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: Client
      Chooses a Connection to write the message to.
      Specified by:
      chooseConnection in class Client
      Throws:
      TimeoutException
      org.apache.tinkerpop.gremlin.driver.exception.ConnectionException
    • isClosing

      public boolean isClosing()
      Specified by:
      isClosing in class Client
    • closeAsync

      public CompletableFuture<Void> closeAsync()
      Records the closed state for the isClosing() contract. Intentionally closes no connections: the shared pools are owned by the transaction Client.ClusteredClient and closed with the Cluster.
      Specified by:
      closeAsync in class Client