- void updateLastMessage(long machineid, long seqnum, Slot slot, LastMessage entry) {
+ void updateLastMessage(long machineid, long seqnum, Liveness liveness) {
+ Pair<Long, Liveness> lastmsgentry = lastmessagetable.put(machineid, new Pair<Long, Liveness>(seqnum, liveness));
+ if (lastmsgentry == null)
+ return;
+
+ long lastmsgseqnum = lastmsgentry.getFirst();
+ Liveness lastentry = lastmsgentry.getSecond();
+ if (lastentry instanceof LastMessage) {
+ ((LastMessage)lastentry).decrementLiveCount();
+ } else if (lastentry instanceof Slot) {
+ ((Slot)lastentry).decrementLiveCount();
+ } else {
+ throw new Error("Unrecognized type");
+ }