Class ClientStatusListenerExt

java.lang.Object
org.voltdb.client.ClientStatusListenerExt

public class ClientStatusListenerExt extends Object
Listener that a client application can provide to a Client in order to receive notifications when certain events occur, such as backpressure or connection issues. To use this class, implement one or more methods in a subclass and set it in your ClientConfig object.
  • Constructor Details

    • ClientStatusListenerExt

      public ClientStatusListenerExt()
  • Method Details

    • connectionLost

      public void connectionLost(String hostname, int port, int connectionsLeft, ClientStatusListenerExt.DisconnectCause cause)
      Notify listeners that a connection to a host was lost.
      Parameters:
      hostname - Name of the host the connection was lost from.
      port - Port number of the connection to the lost host.
      connectionsLeft - Number of remaining connections this client has to the DB
      cause - The reason why this callback is being called
    • connectionCreated

      public void connectionCreated(String hostname, int port, ClientStatusListenerExt.AutoConnectionStatus status)
      Notify listeners that the client tried to create connection to unconnected nodes upon topology change. When topology-change awareness is enabled, connections to newly joined nodes or other unconnected nodes within the cluster will be created. This method will be invoked to notify the client upon a new connection is created. Client can override this method to keep track of the connections
      Parameters:
      hostname - Name of the host the connection was created.
      port - Port number of the connection to the node.
      status - The creation status
    • backpressure

      public void backpressure(boolean status)
      Called by the client API whenever backpressure starts/stops. Backpressure is a condition where all TCP connections to the servers are full and the Client will no longer queue invocations.
      Parameters:
      status - true if there is backpressure and false otherwise.
    • uncaughtException

      public void uncaughtException(ProcedureCallback callback, ClientResponse r, Throwable e)
      Called when a ProcedureCallback.clientCallback(ClientResponse) invocation throws an exception.
      Parameters:
      callback - The callback that threw an exception.
      r - The response object passed to the callback.
      e - The exception thrown by the callback.
    • lateProcedureResponse

      public void lateProcedureResponse(ClientResponse r, String hostname, int port)
      Called when a response arrives on a connection that has already had its callback called due to an elapsed timeout.
      Parameters:
      r - The late response received.
      hostname - The hostname or ip given at connection create time.
      port - The port given at connection create time.