Exemplo n.º 1
0
    def stop(self):
        self.status = DS_DESTROYING
        for range_obj in self.ranges_table.iter_table():
            if range_obj.node_address == self.self_address:
                self._move_range(range_obj)
                break

        Operator.stop(self)

        self.__check_hash_table_thread.stop()
        self.__monitor_dht_ranges.stop()

        self.__check_hash_table_thread.join()
        self.__monitor_dht_ranges.join()
Exemplo n.º 2
0
    def test_manage_neighbours(self):
        operator = Operator('127.0.0.1:1986')

        manage_neighbours = ManageNeighbour(operator, FriClient(), '127.0.0.1:1986', '/tmp', None)

        manage_neighbours._init_operation = _init_operation_mock

        threads = []
        for i in xrange(10):
            tst = TestServerThread(manage_neighbours)
            threads.append(tst)

        for thread in threads:
            thread.start()

        for thread in threads:
            thread.join()

        operator.stop()