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
Modifier and TypeClassDescriptionstatic final record
Message self-lopped by a node to trigger a timeout.static final record
Message to acknowledge a CrashRequest.static final record
Message to ask for a crash.static enum
Enum to represent all the possible crashes that can be triggered.static enum
Enum to represent all the possible decisions that can be taken by the coordinator.static final record
Message to propagate the coordinator final decision regarding a certain epoch.static final record
Message to send election datastatic final record
Message to acknowledge an Electionstatic final record
Struct to represent and send an epoch and an iteration.static final record
Special message to multicast a heartbeat from a coordinator to all the nodes.static enum
Enum to represent all the log levels, selected a level all the highest levels would be printed.static final record
Message used by a Client to generate a random request to a random Node.static final record
Struct cache the best candidate data during the election.static final record
Message used by a Client to ask for a read operation.static final record
Message used by a Node to notify the Client that it received the ReadRequest, and reply to it.static final record
Start message that sends the list of participants to everyone.static final record
Message to synchronise all the node after an election.static final record
Message to notify a timeout.static enum
Enum to represent all the possible reasons for a timeout.static enum
Enum to represent all the possible votes that can be taken by a Node.static final record
Struct to represent the map of voters for every write, and the final decision taken for that write.static final record
Message that asks for a vote.static final record
Message to send the vote of a node to the coordinator.static final record
Message used by a Client to ask for a read operation.static final record
Message used by a Node to notify the Client that it received the WriteRequest, and reply to it. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
matchNodeID
(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.
-