Class LCMessage

  • All Implemented Interfaces:
    java.io.Externalizable, java.io.Serializable

    public class LCMessage
    extends SystemMessage
    Message used during leader change and synchronization
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      LCMessage()
      Empty constructor
      LCMessage​(int from, int type, int ts, byte[] payload)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] getPayload()
      Obter data of the message
      int getReg()
      Get timestamp of leader change and synchronization
      int getType()
      Get type of message
      void readExternal​(java.io.ObjectInput in)  
      void writeExternal​(java.io.ObjectOutput out)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • TRIGGER_LC_LOCALLY

        public final boolean TRIGGER_LC_LOCALLY
    • Constructor Detail

      • LCMessage

        public LCMessage()
        Empty constructor
      • LCMessage

        public LCMessage​(int from,
                         int type,
                         int ts,
                         byte[] payload)
        Constructor
        Parameters:
        from - replica that creates this message
        type - type of the message (STOP, SYNC, CATCH-UP)
        ts - timestamp of leader change and synchronization
        payload - dada that comes with the message
    • Method Detail

      • getType

        public int getType()
        Get type of message
        Returns:
        type of message
      • getReg

        public int getReg()
        Get timestamp of leader change and synchronization
        Returns:
        timestamp of leader change and synchronization
      • getPayload

        public byte[] getPayload()
        Obter data of the message
        Returns:
        data of the message
      • writeExternal

        public void writeExternal​(java.io.ObjectOutput out)
                           throws java.io.IOException
        Specified by:
        writeExternal in interface java.io.Externalizable
        Overrides:
        writeExternal in class SystemMessage
        Throws:
        java.io.IOException
      • readExternal

        public void readExternal​(java.io.ObjectInput in)
                          throws java.io.IOException,
                                 java.lang.ClassNotFoundException
        Specified by:
        readExternal in interface java.io.Externalizable
        Overrides:
        readExternal in class SystemMessage
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException