def __init__(self, kv_store_connector): self.kv_store_connector = kv_store_connector self.route_table = RoutingTable(kv_store_connector) self.backend_table = BackendTable(kv_store_connector) self.policy_table = TrafficPolicyTable(kv_store_connector) self.tag_to_actor_handles = dict() self.router = None self.http_proxy = None self.metric_monitor = None
def __init__(self, kv_store_connector): self.kv_store_connector = kv_store_connector self.route_table = RoutingTable(kv_store_connector) self.backend_table = BackendTable(kv_store_connector) self.policy_table = TrafficPolicyTable(kv_store_connector) # Dictionary of backend tag to dictionaries of replica tag to worker. self.workers = defaultdict(dict) self.router = None self.http_proxy = None self.metric_monitor = None
def __init__(self, actor_nursery_handle=None): # Get actor nursery handle if actor_nursery_handle is None: actor_nursery_handle = ray.util.get_actor(SERVE_NURSERY_NAME) self.actor_nursery_handle = actor_nursery_handle # Connect to all the table bootstrap_config = ray.get( self.actor_nursery_handle.get_bootstrap_state_dict.remote()) kv_store_connector = bootstrap_config[BOOTSTRAP_KV_STORE_CONN_KEY] self.route_table = RoutingTable(kv_store_connector) self.backend_table = BackendTable(kv_store_connector) self.policy_table = TrafficPolicyTable(kv_store_connector) self.refresh_actor_handle_cache()