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

Swapped comunication protocol between replicas to multicast #13

Closed Guergeiro closed 4 years ago

Guergeiro commented 4 years ago

Removed Consensus Unicast dependencies, namely ConsensusAppendRequest, ConsensusVoteRequest and ConsensusRequestInterface.

Added new class FullAddress, that contains Address+Port. It is used to reduce complexity. In every part of the code that used to use String+Integer representing Address+Port, was changed to implement this new class.

ComunicationInterface now uses FullAddress.

PlaceManager now uses FullAddress to represent a replica in the ConcurrentHashMap of replicas.

ReplicasManagerInterface now uses FullAddress.

Added new class ComunicationMessage, that contains the heartbeat of the replicas. With the message we want to address, the term of the replica that sends the message and their IP.

ConsensusRole handler now uses FullAddress and ComunicationMessage to comunicate with other replicas.

General code improvements.

Guergeiro commented 4 years ago

CodeFactor found multiple issues last seen at cfc87f3b22199e28acdab54d6ccf614ad7baf0b3:

switch without "default" clause. #14

src\consensus\ConsensusRole.java:27

Definition of 'equals()' without corresponding definition of 'hashCode()'. #15

src\comunication\FullAddress.java:56

Guergeiro commented 4 years ago

I will now merge this pull request. It fixes #14 and fixes #15.