Homework 2 forum

Clarification AddSearchMessage

 
Nutzerbild von Dorian Ros
Clarification AddSearchMessage
von Dorian Ros - Donnerstag, 12. November 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
von Kirill Nikitin - Donnerstag, 12. November 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

Nutzerbild von Dorian Ros
Re: Clarification AddSearchMessage
von Dorian Ros - Donnerstag, 12. November 2020, 20:39
 

Thank you very much!

Nutzerbild von Francesco Intoci
Re: Clarification AddSearchMessage
von Francesco Intoci - Freitag, 13. November 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
von Kirill Nikitin - Freitag, 13. November 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