Homework 2 forum

Clarification AddSearchMessage

 
Avatar Dorian Ros
Clarification AddSearchMessage
par Dorian Ros, jeudi, 12 novembre 2020, 15:41
 

Hi,

I had a question regarding the implementation of AddSearchMessage which is not clear to me from the handout:

Do this method also implement the division of budget among peers or does it simply broadcast the search request with the original budget to all peers ?

Thanks in advance!

profile
Re: Clarification AddSearchMessage
par Kirill Nikitin, jeudi, 12 novembre 2020, 20:27
 

Hi,

It should indeed divide the budget among the peers to whom the request is broadcast. It should not though subtract 1 from the budget at the origin gossiper, only relays do that.

Kirill

Avatar Dorian Ros
Re: Clarification AddSearchMessage
par Dorian Ros, jeudi, 12 novembre 2020, 20:39
 

Thank you very much!

Avatar Francesco Intoci
Re: Clarification AddSearchMessage
par Francesco Intoci, vendredi, 13 novembre 2020, 11:04
 

Hello,

I have also a question about this method: when we receive a number of total matches that satisfies the threshold, should we start downloading such files inside the method itself?

Regards

profile
Re: Clarification AddSearchMessage
par Kirill Nikitin, vendredi, 13 novembre 2020, 14:52
 

Hi,

No, the AddSearchMeesage method should have only the search logic. When your gossiper receives enough matches, you simply stop waiting for replies to the given search. Obviously, you still can receive more replies afterwards but you don't need to match them to anything.

Kirill