Documentation of 'org.apache.derby.impl.store.replication.net.ReplicationMessageTransmit' Java class
ReplicationMessageTransmit
org.apache.derby.impl.store.replication.net

Class ReplicationMessageTransmit



  • public class ReplicationMessageTransmit
    extends java.lang.Object
    Used to send replication messages to the slave. Called by the Master controller to transmit replication messages wrapped in a ReplicationMessage object to a receiver. The receiver is implemented by the ReplicationMessageReceive class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void initConnection(int timeout, long synchOnInstant)
      Used to create a Socket connection to the slave and establish compatibility with the database version of the slave by comparing the UID's of the ReplicationMessage classes of the master and the slave.
      void sendMessage(ReplicationMessage message)
      Used to send a replication message to the slave.
      ReplicationMessage sendMessageWaitForReply(ReplicationMessage message)
      Send a replication message to the slave and return the message received as a response.
      void tearDown()
      Tear down the network connection established with the other replication peer
      • Methods inherited from class java.lang.Object

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

      • ReplicationMessageTransmit

        public ReplicationMessageTransmit(SlaveAddress slaveAddress)
        Constructor initializes the slave address used in replication.
        Parameters:
        slaveAddress - contains the address (host name and port number) of the slave to connect to.
    • Method Detail

      • initConnection

        public void initConnection(int timeout,
                                   long synchOnInstant)
                            throws java.io.IOException,
                                   StandardException,
                                   java.lang.ClassNotFoundException
        Used to create a Socket connection to the slave and establish compatibility with the database version of the slave by comparing the UID's of the ReplicationMessage classes of the master and the slave.
        Parameters:
        timeout - the amount of time for which the connection should block before being established.
        synchOnInstant - the master log instant, used to check that the master and slave log files are in synch. If no chunks of log records have been shipped to the slave yet, this is the end position in the current log file. If a chunk of log has been shipped, this is the instant of the log record shipped last. Note that there is a difference!
        Throws:
        java.io.IOException - if an exception occurs while trying to create the SocketConnection class or open a connection.
        StandardException - If an error message is received from the server indicating incompatible software versions of master and slave.
        java.lang.ClassNotFoundException - Class of a serialized object cannot be found.
      • tearDown

        public void tearDown()
                      throws java.io.IOException
        Tear down the network connection established with the other replication peer
        Throws:
        java.io.IOException - if an exception occurs while trying to tear down the network connection
      • sendMessage

        public void sendMessage(ReplicationMessage message)
                         throws java.io.IOException
        Used to send a replication message to the slave.
        Parameters:
        message - a ReplicationMessage object that contains the message to be transmitted.
        Throws:
        java.io.IOException - 1) if an exception occurs while transmitting the message. 2) if the connection handle is invalid.
      • sendMessageWaitForReply

        public ReplicationMessage sendMessageWaitForReply(ReplicationMessage message)
                                                   throws java.io.IOException,
                                                          StandardException
        Send a replication message to the slave and return the message received as a response. Will only wait DEFAULT_MESSAGE_RESPONSE_TIMEOUT millis for the response message. If not received when the wait times out, no message is returned. The method is synchronized to guarantee that only one thread will be waiting for a response message at any time.
        Parameters:
        message - a ReplicationMessage object that contains the message to be transmitted.
        Returns:
        the response message
        Throws:
        java.io.IOException - 1) if an exception occurs while sending or receiving a message. 2) if the connection handle is invalid.
        StandardException - if the response message has not been received after DEFAULT_MESSAGE_RESPONSE_TIMEOUT millis

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.