Interface ReaderFailoverHandler

All Known Implementing Classes:
ClusterAwareReaderFailoverHandler

public interface ReaderFailoverHandler
Interface for Reader Failover Process handler. This handler implements all necessary logic to try to reconnect to another reader host.
  • Method Details

    • failover

      ReaderFailoverResult failover​(java.util.List<HostInfo> hosts, HostInfo currentHost) throws java.sql.SQLException
      Called to start Reader Failover Process. This process tries to connect to any reader. If no reader is available then driver may also try to connect to a writer host, down hosts, and the current reader host.
      Parameters:
      hosts - Cluster current topology.
      currentHost - The currently connected host that has failed.
      Returns:
      ReaderFailoverResult The results of this process.
      Throws:
      java.sql.SQLException
    • getReaderConnection

      ReaderFailoverResult getReaderConnection​(java.util.List<HostInfo> hostList) throws java.sql.SQLException
      Called to get any available reader connection. If no reader is available then result of process is unsuccessful. This process will not attempt to connect to the writer host.
      Parameters:
      hostList - Cluster current topology.
      Returns:
      ReaderFailoverResult The results of this process.
      Throws:
      java.sql.SQLException