universal
Class AckReadMessage

java.lang.Object
  |
  +--universal.Message
        |
        +--universal.ReadMessage
              |
              +--universal.AckReadMessage
All Implemented Interfaces:
java.io.Serializable

public class AckReadMessage
extends ReadMessage

Used for creating AckReadMessage.
An AckReadMessage is sent during the consensus by all the replicated server
to the leader to acknowledge the Read message that the leader has sent.
It contains the last value (Request, Reply, Update) reading and the last round number it has written this value for this place in the total order.

See Also:
Serialized Form

Field Summary
 int lastwrite
          The last round number it has written for the place in the total order for which it has received the read message
 universal.Outcome value
          The last value read for the place in the total order for which it has received the read message
 
Fields inherited from class universal.ReadMessage
batchno, roundno
 
Fields inherited from class universal.Message
ACK_READ_MSG, ACK_WRITE_MSG, AM_ALIVE_MSG, mid, msgType, NACK_READ_MSG, NACK_WRITE_MSG, READ_MSG, senderid, WRITE_MSG
 
Constructor Summary
AckReadMessage(int batchno, int roundno, int lastwrite, universal.Outcome value)
          The constructor
 
Method Summary
static universal.ReadMessage decode(java.io.DataInputStream dis)
          If you want to decode an AckReadMessage, you should call the method Decode of the superclass Message, not this one.
 byte[] encode()
          If you want to encode a ReadMessage, you should call this method not the one from the superclass.
 boolean equals(java.lang.Object obj)
          Compares two objects for equality.
 java.lang.String toString()
           
 
Methods inherited from class universal.Message
decode, msgId, msgType
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

value

public universal.Outcome value
The last value read for the place in the total order for which it has received the read message


lastwrite

public int lastwrite
The last round number it has written for the place in the total order for which it has received the read message

Constructor Detail

AckReadMessage

public AckReadMessage(int batchno,
                      int roundno,
                      int lastwrite,
                      universal.Outcome value)
The constructor

Parameters:
batchno - the place in the total order for which the consensus is actually made
roundno - the round number for this consensus
lastwrite - the last round number the sender of this message has written for the place in the total order
value - the last value read at the round number lastwrite
Method Detail

decode

public static universal.ReadMessage decode(java.io.DataInputStream dis)
If you want to decode an AckReadMessage, you should call the method Decode of the superclass Message, not this one.

Returns:
an AckReadMessage but as a type of ReadMessage(superclass)

encode

public byte[] encode()
If you want to encode a ReadMessage, you should call this method not the one from the superclass.

Overrides:
encode in class ReadMessage
Returns:
an array of byte which contains all the information of this AckReadMessage

equals

public boolean equals(java.lang.Object obj)
Compares two objects for equality. Returns a boolean that indicates whether this object is equivalent to the specified object. This method is used when an object is stored in a hashtable.

Overrides:
equals in class ReadMessage
Parameters:
obj - the Object to compare with
Returns:
true if these Objects are equal; false otherwise.
See Also:
Hashtable

toString

public java.lang.String toString()
Overrides:
toString in class ReadMessage