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

The leader is responsible for every update #16

Closed Guergeiro closed 4 years ago

Guergeiro commented 4 years ago

Now Followers memory is updated by Leader!

To test this you can use the example bellow. Leader needs to be on Port: 6001 and Follower on Port: 6002:

public static void main(String[] args) throws MalformedURLException, RemoteException, NotBoundException, InterruptedException {

    PlacesListInterface leader = (PlacesListInterface) Naming.lookup("rmi://localhost:6001/placelist");

    leader.addPlace(new Place("3600", "Viseu"));

    Thread.sleep(5000);

    PlacesListInterface follower = (PlacesListInterface) Naming.lookup("rmi://localhost:6002/placelist");

    Place place = follower.getPlace("3600");

    System.out.println(place);
  }
Guergeiro commented 4 years ago

@diogofalken It seems that round robing keeps getting you...

image

Guergeiro commented 4 years ago

I will merge this pull request since the feature that it implements is working. A new bug was found (#17) and will be fixed in the future.