Guergeiro / distributed-systems-2019

This repository contains our practical project for the class of distributed systems
https://cepos-e-mabecos.github.io/distributed-systems-2019/docs
MIT License
0 stars 2 forks source link

Added leader election and consensus #7

Closed Guergeiro closed 4 years ago

Guergeiro commented 4 years ago

Refers to #5

Changed UDPInterface to ComunicationInterface, since it's a better name.

Added ConsensusRole that defines the state of a replica into 3 categories: FOLLOWER, CANDIDATE, LEADER.

RMIServer.java handles most of the consensus mechanism. It isn't a pretty solution, but it works.

ReplicasManagerInterface was added to handle everything related to the replicas address storage. It can be called via RMI if needed.

Implemented missing interfaces on PlaceManager and, added synchronized methods to everything related to replicas memory access.

Guergeiro commented 4 years ago

To test this via another Java app, using #3 testing should be enough.

diogofalken commented 4 years ago

For me is just about the remove all replicas every 15s, but since we already found a way of fixing it and it's coming in forward enhancements, looks great to me.