Package it.unitn.disi.ds1.qtop
Class Utils
java.lang.Object
it.unitn.disi.ds1.qtop.Utils
Class that contains all the utility classes and messages used by the actors.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordMessage self-lopped by a node to trigger a timeout.static final recordMessage to acknowledge a CrashRequest.static final recordMessage to ask for a crash.static enumEnum to represent all the possible crashes that can be triggered.static enumEnum to represent all the possible decisions that can be taken by the coordinator.static final recordMessage to propagate the coordinator final decision regarding a certain epoch.static final recordMessage to send election datastatic final recordMessage to acknowledge an Electionstatic final recordStruct to represent and send an epoch and an iteration.static final recordSpecial message to multicast a heartbeat from a coordinator to all the nodes.static enumEnum to represent all the log levels, selected a level all the highest levels would be printed.static final recordMessage used by a Client to generate a random request to a random Node.static final recordStruct cache the best candidate data during the election.static final recordMessage used by a Client to ask for a read operation.static final recordMessage used by a Node to notify the Client that it received the ReadRequest, and reply to it.static final recordStart message that sends the list of participants to everyone.static final recordMessage to synchronise all the node after an election.static final recordMessage to notify a timeout.static enumEnum to represent all the possible reasons for a timeout.static enumEnum to represent all the possible votes that can be taken by a Node.static final recordStruct to represent the map of voters for every write, and the final decision taken for that write.static final recordMessage that asks for a vote.static final recordMessage to send the vote of a node to the coordinator.static final recordMessage used by a Client to ask for a read operation.static final recordMessage used by a Node to notify the Client that it received the WriteRequest, and reply to it. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringmatchNodeID(akka.actor.ActorRef actorRefToMatch) Method to match the ID of a node and build a fancy string out of it.
-
Constructor Details
-
Utils
public Utils()
-
-
Method Details
-
matchNodeID
Method to match the ID of a node and build a fancy string out of it. There are two cases:- if the actor reference is a node, it will return [NODE-xyz]
- if the actor reference is the coordinator, it will return [COORDINATOR]
- Parameters:
actorRefToMatch- the actor reference to match- Returns:
- the fancy String.
-