public class Round
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
TOMMessage[] |
deserializedPropValue |
java.util.HashSet<PaxosMessage> |
proof |
byte[] |
propValue |
byte[] |
propValueHash |
Constructor and Description |
---|
Round(ServerViewController controller,
Execution parent,
int number)
Creates a new instance of Round for acceptors
|
Modifier and Type | Method and Description |
---|---|
void |
addToProof(PaxosMessage pm) |
void |
clear()
Clear all round info.
|
int |
countAccept(byte[] value)
Retrieves the amount of replicas from which this process accepted a specified value
|
int |
countWrite(byte[] value)
Retrieves the amount of replicas from which this process received a WRITE value
|
boolean |
equals(java.lang.Object o) |
byte[][] |
getAccept()
Retrieves all accepted values from all replicas
|
byte[] |
getAccept(int acceptor)
Retrieves the accepted value from the specified replica
|
Execution |
getExecution()
Retrieves this round's execution
|
int |
getNumber()
Retrieves this round's number
|
java.util.Set<PaxosMessage> |
getProof() |
byte[][] |
getWrite()
Retrieves all WRITE value from all replicas
|
byte[] |
getWrite(int acceptor)
Retrives the WRITE value from the specified replica
|
boolean |
isAcceptSetted(int acceptor)
Informs if there is a accepted value from a replica
|
boolean |
isRemoved()
Informs if this round was removed from its execution
|
boolean |
isWriteSetted(int acceptor)
Informs if there is a WRITE value from a replica
|
void |
setAccept(int acceptor,
byte[] value)
Sets the accepted value from the specified replica
|
void |
setRemoved()
Set this round as removed from its execution
|
void |
setWrite(int acceptor,
byte[] value)
Sets the WRITE value from the specified replica
|
java.lang.String |
toString()
Print round information.
|
public byte[] propValue
public TOMMessage[] deserializedPropValue
public byte[] propValueHash
public java.util.HashSet<PaxosMessage> proof
public Round(ServerViewController controller, Execution parent, int number)
parent
- Execution to which this round belongsnumber
- Number of the roundtimeout
- Timeout duration for this roundpublic void setRemoved()
public boolean isRemoved()
public void addToProof(PaxosMessage pm)
public java.util.Set<PaxosMessage> getProof()
public int getNumber()
public Execution getExecution()
public boolean isWriteSetted(int acceptor)
acceptor
- The replica IDpublic boolean isAcceptSetted(int acceptor)
acceptor
- The replica IDpublic byte[] getWrite(int acceptor)
acceptor
- The replica IDpublic byte[][] getWrite()
public void setWrite(int acceptor, byte[] value)
acceptor
- The replica IDvalue
- The valuefrom the specified replicapublic byte[] getAccept(int acceptor)
acceptor
- The replica IDpublic byte[][] getAccept()
public void setAccept(int acceptor, byte[] value)
acceptor
- The replica IDvalue
- The value accepted from the specified replicapublic int countWrite(byte[] value)
value
- The value in questionpublic int countAccept(byte[] value)
value
- The value in questionpublic java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public void clear()