You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- The `Replica` constructor requires a `replicaId`, `nodeIds` (set of all replica IDs in the *cluster*), `transport` (the virtualized network instance) and a `commitLog` (instance where all committed operations from the replica are sent to).
11
-
- A set of protocol message POJOs that *implement*`MessagePayload`: these are the messages that are exchanged between replicas.
12
-
- They just need to have a `String getType()` method that returns e.g. that it is a `PREPARE` message.
Communication between replicas is done via message-passing through the `Transport`. The `Replica` superclass exposes a few methods:
24
+
Using the Actor model, replicas communicate with each other via
25
+
a [`Transport`](../simulator/src/main/java/byzzbench/simulator/transport) instance.
26
+
The `Transport` is a virtualized network that allows replicas to send messages to each other.
27
+
The `Transport` is responsible for delivering messages to the correct recipient, and also for handling timeouts.
28
+
29
+
Communication between replicas is done via message-passing through the `Transport`. The `Replica` superclass exposes a
30
+
few methods:
18
31
19
32
-`sendMessage`: send a message to a recipient
20
33
-`multicastMessage`: send a message to a set of replicas
@@ -23,9 +36,12 @@ Communication between replicas is done via message-passing through the `Transpor
23
36
24
37
Timeouts are implemented via callbacks to a `Runnable`, also handled by the `Transport`:
25
38
26
-
-`setTimeout(Runnable, timeout)`: Creates a timeout event of `timeout` milliseconds, which will then invoke the `Runnable`. The time is currently being ignored, and is instead triggered just like any other event by the scheduler.
39
+
-`setTimeout(Runnable, timeout)`: Creates a timeout event of `timeout` milliseconds, which will then invoke
40
+
the `Runnable`. The time is currently being ignored, and is instead triggered just like any other event by the
41
+
scheduler.
27
42
-`clearAllTimeouts()`: Invalidates all outstanding timeouts for the current replica.
28
43
29
44
## Commit Log
30
45
31
-
Each replica has its own instance of a `CommitLog`: an immutable and total ordered sequence of records. This is used to check whether safety invariants of distributed consensus are broken.
46
+
Each replica has its own instance of a `CommitLog`: an immutable and total ordered sequence of records. This is used to
47
+
check whether safety invariants of distributed consensus are broken.
0 commit comments