示例#1
0
    def __init__(self, conf):
        """Initializer."""

        self.conf = conf

        # Initialize Prometheus metrics Endpoint
        # Data service uses index 0
        PC._init_metrics(0)
        self.init_extension_managers(conf)
示例#2
0
    def __init__(self, conf):

        self.conf = conf

        # Set up Music access.
        self.music = db_backend.get_client()
        self.music.keyspace_create(keyspace=conf.keyspace)

        # Dynamically create a plan class for the specified keyspace
        self.Plan = base.create_dynamic_model(keyspace=conf.keyspace,
                                              baseclass=plan.Plan,
                                              classname="Plan")
        self.OrderLock = base.create_dynamic_model(
            keyspace=conf.keyspace,
            baseclass=order_lock.OrderLock,
            classname="OrderLock")
        self.OrderLockHistory = base.create_dynamic_model(
            keyspace=conf.keyspace,
            baseclass=order_lock_history.OrderLockHistory,
            classname="OrderLockHistory")
        self.RegionPlaceholders = base.create_dynamic_model(
            keyspace=conf.keyspace,
            baseclass=region_placeholders.RegionPlaceholders,
            classname="RegionPlaceholders")
        self.CountryLatency = base.create_dynamic_model(
            keyspace=conf.keyspace,
            baseclass=country_latency.CountryLatency,
            classname="CountryLatency")
        self.TriageTool = base.create_dynamic_model(
            keyspace=conf.keyspace,
            baseclass=triage_tool.TriageTool,
            classname="TriageTool")
        # self.Groups = base.create_dynamic_model(
        #    keyspace=conf.keyspace, baseclass=groups.Groups, classname="Groups")
        # self.GroupRules = base.create_dynamic_model(
        #    keyspace=conf.keyspace, baseclass=group_rules.GroupRules, classname="GroupRules")

        # Initialize Prometheus metrics Endpoint
        # Solver service uses index 1
        PC._init_metrics(1)

        if not self.Plan:
            raise
        if not self.OrderLock:
            raise
        if not self.OrderLockHistory:
            raise
        if not self.RegionPlaceholders:
            raise
        if not self.CountryLatency:
            raise
        if not self.TriageTool:
            raise