def test_status_updates(self):
     hosts = [0, 1, 2, 3]
     policy = RoundRobinPolicy()
     policy.populate(None, hosts)
     policy.on_down(0)
     policy.on_remove(1)
     policy.on_up(4)
     policy.on_add(5)
     qplan = list(policy.make_query_plan())
     self.assertEqual(sorted(qplan), [2, 3, 4, 5])
Пример #2
0
 def test_status_updates(self):
     hosts = [0, 1, 2, 3]
     policy = RoundRobinPolicy()
     policy.populate(None, hosts)
     policy.on_down(0)
     policy.on_remove(1)
     policy.on_up(4)
     policy.on_add(5)
     qplan = list(policy.make_query_plan())
     self.assertEqual(sorted(qplan), [2, 3, 4, 5])
Пример #3
0
 def on_add(self, host):
     if host.endpoint in self._allowed_hosts_resolved:
         RoundRobinPolicy.on_add(self, host)