Class ReplicationMessageTransmit.MasterReceiverThread

  • All Implemented Interfaces:
    java.lang.Runnable
    Enclosing class:
    ReplicationMessageTransmit

    private class ReplicationMessageTransmit.MasterReceiverThread
    extends java.lang.Thread
    Thread that listens for messages from the slave. A separate thread listening for messages from the slave is needed because the slave may send messages to the master at any time, and these messages require immediate action.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private ReplicationMessage pongMsg  
      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
    • Constructor Summary

      Constructors 
      Constructor Description
      MasterReceiverThread​(java.lang.String dbname)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private ReplicationMessage readMessage()
      Used to read a replication message sent by the slave.
      void run()  
      • Methods inherited from class java.lang.Thread

        activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • MasterReceiverThread

        MasterReceiverThread​(java.lang.String dbname)
    • Method Detail

      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
        Overrides:
        run in class java.lang.Thread
      • readMessage

        private ReplicationMessage readMessage()
                                        throws java.lang.ClassNotFoundException,
                                               java.io.IOException
        Used to read a replication message sent by the slave. Hangs until a message is received from the slave
        Returns:
        the reply message.
        Throws:
        java.lang.ClassNotFoundException - Class of a serialized object cannot be found.
        java.io.IOException - 1) if an exception occurs while reading from the stream. 2) if the connection handle is invalid.