Class MasterProtocol

    • Constructor Detail

      • MasterProtocol

        public MasterProtocol​(UrlParser urlParser,
                              GlobalStateInfo globalInfo,
                              java.util.concurrent.locks.ReentrantLock lock)
        Get a protocol instance.
        Parameters:
        urlParser - connection URL infos
        globalInfo - server global variables information
        lock - the lock for thread synchronisation
    • Method Detail

      • loop

        public static void loop​(Listener listener,
                                GlobalStateInfo globalInfo,
                                java.util.List<HostAddress> addresses,
                                SearchFilter searchFilter)
                         throws java.sql.SQLException
        loop until found the failed connection.
        Parameters:
        listener - current failover
        globalInfo - server global variables information
        addresses - list of HostAddress to loop
        searchFilter - search parameter
        Throws:
        java.sql.SQLException - if not found
      • resetHostList

        private static void resetHostList​(Listener listener,
                                          java.util.Deque<HostAddress> loopAddresses)
        Reinitialize loopAddresses with all hosts : all servers in randomize order without connected host.
        Parameters:
        listener - current listener
        loopAddresses - the list to reinitialize