Class HAServer

    • Method Detail

      • isCurrentServer

        protected boolean isCurrentServer​(String serverEntry)
      • startElection

        public void startElection​(boolean waitForCompletion)
      • disconnectAllReplicas

        public void disconnectAllReplicas()
      • setReplicaStatus

        public void setReplicaStatus​(String remoteServerName,
                                     boolean online)
      • receivedResponse

        public void receivedResponse​(String remoteServerName,
                                     long messageNumber,
                                     Object payload)
      • receivedResponseFromForward

        public void receivedResponseFromForward​(long messageNumber,
                                                Object result,
                                                ErrorResponse error)
      • isLeader

        public boolean isLeader()
      • getLeaderName

        public String getLeaderName()
      • getServerName

        public String getServerName()
      • getClusterName

        public String getClusterName()
      • setServerAddresses

        public void setServerAddresses​(String serverAddress)
      • forwardCommandToLeader

        public Object forwardCommandToLeader​(HACommand command,
                                             long timeout)
        Forward a command to the leader server. This occurs with transactions and DDL commands. If the timeout is 0, then the request is asynchronous and the response is a Resultset containing `{"operation", "forwarded to the leader"}`
        Parameters:
        command - HACommand to forward
        timeout - Timeout in milliseconds. 0 for asynchronous commands
        Returns:
        the result from the command if synchronous, otherwise a result set containing `{"operation", "forwarded to the leader"}`
      • sendCommandToReplicasNoLog

        public void sendCommandToReplicasNoLog​(HACommand command)
      • sendCommandToReplicasWithQuorum

        public List<Object> sendCommandToReplicasWithQuorum​(HACommand command,
                                                            int quorum,
                                                            long timeout)
      • getMessagesInQueue

        public int getMessagesInQueue()
      • setReplicasHTTPAddresses

        public void setReplicasHTTPAddresses​(String replicasHTTPAddresses)
      • getReplicaServersHTTPAddressesList

        public String getReplicaServersHTTPAddressesList()
      • removeServer

        public void removeServer​(String remoteServerName)
      • getOnlineServers

        public int getOnlineServers()
      • getOnlineReplicas

        public int getOnlineReplicas()
      • getConfiguredServers

        public int getConfiguredServers()
      • getServerAddressList

        public String getServerAddressList()
      • printClusterConfiguration

        public void printClusterConfiguration()
      • getServerAddress

        public String getServerAddress()
      • resendMessagesToReplica

        public void resendMessagesToReplica​(long fromMessageNumber,
                                            String replicaName)