Class ClusterAwareReaderFailoverHandler

java.lang.Object
com.mysql.cj.jdbc.ha.ca.ClusterAwareReaderFailoverHandler
All Implemented Interfaces:
ReaderFailoverHandler

public class ClusterAwareReaderFailoverHandler
extends java.lang.Object
implements ReaderFailoverHandler
An implementation of ReaderFailoverHandler.

Reader Failover Process goal is to connect to any available reader. In order to connect faster, this implementation tries to connect to two readers at the same time. The first successfully connected reader is returned as the process result. If both readers are unavailable (i.e. could not be connected to), the process picks up another pair of readers and repeat. If no reader has been connected to, the process may consider a writer host, and other hosts marked down, to connect to.