| Modifier and Type | Field and Description |
|---|---|
| private Object | message
This is the content of the replication message. |
| public static final long | serialVersionUID
The version number is determined based on the database version of the current database. |
| private int | type
The valid values for the type of the content of the message are listed below. |
| public static final int | TYPE_ACK
This flag is used to send an acknowledgment of successful completion of a requested operation. |
| public static final int | TYPE_ERROR
Indicates that the requested operation was not able to be completed successfully. |
| public static final int | TYPE_FAILOVER
Used to signal the slave that it must failover. |
| public static final int | TYPE_INITIATE_INSTANT
Used during the intial handshake between the master and the slave. |
| public static final int | TYPE_INITIATE_VERSION
used during the intial handshake between the master and the slave. |
| public static final int | TYPE_LOG
This flag will be used for all messages that carry log records. |
| public static final int | TYPE_PING
A message used to check if the replication network is working. |
| public static final int | TYPE_PONG
A message sent as a response to a TYPE_PING message. |
| public static final int | TYPE_STOP
Used to send a stop replication signal to the slave. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | ReplicationMessage(int
The type of this message. Must be one of the message
type constants of this class (TYPE_LOG, TYPE_ACK,
TYPE_ERROR, TYPE_INITIATE). type, Object The message to be transmitted. message)Constructor used to set the |
| Modifier and Type | Method and Description |
|---|---|
| public Object | Returns: The object contained in the messageUsed to get the actual message that is wrapped inside the ReplicationMessage object. |
| public int | |
| public void | readExternal(ObjectInput
the stream to read data from in order to restore the object. in)Implements java. Used to restore the contents of this object. |
| public void | writeExternal(ObjectOutput
the stream to write the object to. out)Implements java. Used to save the contents of this Object. |
| message | back to summary |
|---|---|
| private Object message This is the content of the replication message. | |
| serialVersionUID | back to summary |
|---|---|
| public static final long serialVersionUID The version number is determined based on the database version of the current database. This would help to establish if the master and the slave in replication are at compatible database versions. | |
| type | back to summary |
|---|---|
| private int type The valid values for the type of the content of the message are listed below. | |
| TYPE_ACK | back to summary |
|---|---|
| public static final int TYPE_ACK This flag is used to send an acknowledgment of successful completion
of a requested operation. It will however not be used to signify
reception for every message transmission. The object this message
type contains will be a | |
| TYPE_ERROR | back to summary |
|---|---|
| public static final int TYPE_ERROR Indicates that the requested operation was not able to be
completed successfully. The object this message type contains
will be a | |
| TYPE_FAILOVER | back to summary |
|---|---|
| public static final int TYPE_FAILOVER Used to signal the slave that it must failover. The object associated with this message will be null. | |
| TYPE_INITIATE_INSTANT | back to summary |
|---|---|
| public static final int TYPE_INITIATE_INSTANT Used during the intial handshake between the master and
the slave. Messages of this type are used to ensure that master and
slave have identical log files by checking that they will insert
the next log record on the same byte position in the log.
The object this message contains will be a | |
| TYPE_INITIATE_VERSION | back to summary |
|---|---|
| public static final int TYPE_INITIATE_VERSION used during the intial handshake between the master and
the slave. The initial handshake helps to negotiate the
message UIDs and send a appropriate error or acknowledgment.
The object this message contains will be a Important Note This constant must not be changed in future versions since we need it to decide slave/master version mismatch | |
| TYPE_LOG | back to summary |
|---|---|
| public static final int TYPE_LOG This flag will be used for all messages that carry log records.
The Object this message type contains will be a | |
| TYPE_PING | back to summary |
|---|---|
| public static final int TYPE_PING A message used to check if the replication network is working. This message type has no object | |
| TYPE_PONG | back to summary |
|---|---|
| public static final int TYPE_PONG A message sent as a response to a TYPE_PING message. This message type has no object | |
| TYPE_STOP | back to summary |
|---|---|
| public static final int TYPE_STOP Used to send a stop replication signal to the slave. Since this is a control signal the object this message contains will be null. | |
| ReplicationMessage | back to summary |
|---|---|
| public ReplicationMessage() public No args constructor required with Externalizable. | |
| ReplicationMessage | back to summary |
|---|---|
| public ReplicationMessage(int type, Object message) Constructor used to set the
| |
| getMessage | back to summary |
|---|---|
| public Object getMessage() Used to get the actual message that is wrapped inside the ReplicationMessage object.
| |
| getType | back to summary |
|---|---|
| public int getType() Used to get the type of this
| |
| readExternal | back to summary |
|---|---|
| public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException Implements java. Used to restore the contents of this object.
| |
| writeExternal | back to summary |
|---|---|
| public void writeExternal(ObjectOutput out) throws IOException Implements java. Used to save the contents of this Object.
| |