def on_died(self, agent, brothers, monitor): agent.info("Shard partner died.") if agent.is_migrating(): return recipients = map(operator.attrgetter("recipient"), brothers) task = agent.collectively_restart_shard(recipients, self.recipient.key, monitor) return partners.accept_responsability(task)
def on_goodbye(self, agent, brothers): ''' Algorithm for resolving this situation goes as follows. We receive the list of brothers (HostPartner currently in same comporomising position). The algorithm always picks the first from the list as the one to resolve the problem. Everybody else needs to ask his lefthand neighbour to resolve a situation for him. If the requests to the neighbour timeouts, he is removed from the local list and the algorithm iterates in. ''' agent.info('Shard partner said goodbye.') return self._handle_no_shard(agent, brothers)
def on_died(self, agent, brothers, monitor): agent.info('Shard partner died.') recipients = map(operator.attrgetter('recipient'), brothers) task = agent.collectively_restart_shard( recipients, self.recipient.key, monitor) return partners.accept_responsability(task)
def on_buried(self, agent, brothers): agent.info('Received shard partner on buried.') return self._handle_no_shard(agent, brothers)