def __init__(self, my_node, bootstrap_nodes): self.my_node = my_node self.bootstrap_nodes = iter(bootstrap_nodes) self.table = RoutingTable(my_node, NODES_PER_BUCKET) self.ping_msg = message.OutgoingPingQuery(my_node.id) self.find_closest_msg = message.OutgoingFindNodeQuery( my_node.id, my_node.id) self._next_stale_maintenance_index = 0 self._maintenance_mode = BOOTSTRAP_MODE self._replacement_queue = _ReplacementQueue(self.table) self._query_received_queue = _QueryReceivedQueue(self.table) self._found_nodes_queue = _FoundNodesQueue(self.table) self._maintenance_tasks = [ self._ping_a_staled_rnode, self._ping_a_query_received_node, self._ping_a_found_node, self._ping_a_replacement_node ]
def __init__(self, my_node, bootstrap_nodes): self.my_node = my_node #Copy the bootstrap list self.bootstrap_nodes = iter(bootstrap_nodes) self.table = RoutingTable(my_node, NODES_PER_BUCKET) # maintenance variables self._maintenance_mode = BOOTSTRAP_MODE self._pinged_q_rnodes = {} # questionable nodes which have been # recently pinged self._maintenance_tasks = [ self._refresh_stale_bucket, #self._ping_a_staled_rnode, # self._ping_a_query_received_node, # self._ping_a_found_node, ]
def __init__(self, my_node, bootstrap_nodes): self.my_node = my_node #Copy the bootstrap list self.bootstrap_nodes = iter(bootstrap_nodes) self.table = RoutingTable(my_node, NODES_PER_BUCKET) # maintenance variables self._next_stale_maintenance_index = 0 self._maintenance_mode = BOOTSTRAP_MODE self._replacement_queue = _ReplacementQueue(self.table) self._query_received_queue = _QueryReceivedQueue(self.table) self._found_nodes_queue = _FoundNodesQueue(self.table) self._maintenance_tasks = [self._ping_a_staled_rnode, self._ping_a_query_received_node, self._ping_a_found_node, self._ping_a_replacement_node, ]
def __init__(self, my_node, msg_f, bootstrapper): self.my_node = my_node self.msg_f = msg_f self.bootstrapper = bootstrapper self.table = RoutingTable(my_node, NODES_PER_BUCKET) # maintenance variables self._next_stale_maintenance_index = 0 self._maintenance_mode = FILL_BUCKETS self._replacement_queue = _ReplacementQueue(self.table) self._query_received_queue = _QueryReceivedQueue(self.table) self._found_nodes_queue = _FoundNodesQueue(self.table) self._maintenance_tasks = [ self._ping_a_staled_rnode, self._ping_a_query_received_node, self._ping_a_found_node, self._ping_a_replacement_node, ] self._num_pending_filling_lookups = NUM_FILLING_LOOKUPS self._num_timeouts_in_a_row = 0
def __init__(self, my_node, bootstrap_nodes, msg_f): self.my_node = my_node self.bootstrapper = bootstrap.OverlayBootstrapper( my_node.id, bootstrap_nodes, msg_f) self.msg_f = msg_f self.table = RoutingTable(my_node, NODES_PER_BUCKET) # maintenance variables self._next_stale_maintenance_index = 0 self._maintenance_mode = BOOTSTRAP_MODE self._replacement_queue = _ReplacementQueue(self.table) self._query_received_queue = _QueryReceivedQueue(self.table) self._found_nodes_queue = _FoundNodesQueue(self.table) self._maintenance_tasks = [ self._ping_a_staled_rnode, self._ping_a_query_received_node, self._ping_a_found_node, self._ping_a_replacement_node, ] self._num_pending_filling_lookups = NUM_FILLING_LOOKUPS