コード例 #1
0
    def __init__(self, name, configuration):
        self.name = name
        self.graphs = {}
        self.structure_pb = configuration['structure']

        for table_name, fields in self.structure_pb.items():
            self.graphs[table_name] = Graph.Graph()

        self.operatorFactory = DapOperatorFactory.DapOperatorFactory()
コード例 #2
0
ファイル: DapManager.py プロジェクト: jl789/oef-search-pluto
 def __init__(self):
     self.instances = {}
     self.operator_factory = DapOperatorFactory.DapOperatorFactory()
     self.structures = {}
     self.dap_options = {}
     self.embedderName = None  # SUPPORT_SINGLE_GLOBAL_EMBEDDING_QUERY
     self.embeddingFieldName = None  # SUPPORT_SINGLE_GLOBAL_EMBEDDING_QUERY
     self.embeddingTableName = None  # SUPPORT_SINGLE_GLOBAL_EMBEDDING_QUERY
     self.classmakers = {}
     self.log.update_local_name("DapManager")
     self.planes = {}
     self.dap_processes = []
コード例 #3
0
    def __init__(self, name, configuration):
        self.name = name
        self.geos = {}
        self.structure = configuration['structure']
        self.fields_by_table = {}
        self.log.update_local_name("DapGeo("+name+")")
        self.info("Starting geo dap, with the following config:", json.dumps(self.structure, indent=2))

        self.stats = {
            "rows_added": 0,
            "rows_removed": 0,
            "row_add_fails": 0,
            "row_remove_fails": 0,
            "execute_count": 0,
            "empty_execute_response": 0,
            "total_result_count": 0,
            "filter_inputs": 0,
            "originated_queries": 0,
            "num_originated_rows": 0,
            "prepare_count": 0,
            "row_remove_not_found": 0,
            "row_add_duplicate": 0
        }

        for table_name, fields in self.structure.items():
            self.geos[table_name] = GeoStore.GeoStore()
            for field_name, config in fields.items():

                r = {
                    'type': 'location',
                    'distance_calculator': GeoStore.GeoStore.EquirectangularDistance,
                }
                if isinstance(config, dict):
                    r['type'] = config.get('type', 'location')
                    r['options'] = set(config.get('options', []))
                elif isinstance(config, str):
                    r['type'] = config
                    r['options'] = set()
                else:
                    raise Exception("Unexpected specification for a field")

                if 'os-grid' in r['options']:
                    r['distance_calculator'] = GeoStore.GeoStore.OSGridDistance

                if field_name[-9:] != ".location":
                    field_name = field_name + ".location"
                self.fields_by_table.setdefault(table_name, {}).setdefault(field_name, {}).update(r)

        self.operatorFactory = DapOperatorFactory.DapOperatorFactory()
        self._service_alias_store = {}
コード例 #4
0
    def __init__(self, name, configuration):
        self.store = {}
        self.name = name
        self.structure_pb = configuration['structure']
        self.log.update_local_name("EarlyInMemoryDap("+name+")")
        self.operatorFactory = DapOperatorFactory.DapOperatorFactory()

        self.tablenames = []
        self.structure = {}
        self.fields = {}

        self.all_my_keys = set()

        for table_name, fields in self.structure_pb.items():
            self.tablenames.append(table_name)
            for field_name, field_type in fields.items():
                self.structure.setdefault(table_name, {}).setdefault(field_name, {})['type'] = field_type
                self.fields.setdefault(field_name, {})['tablename']=table_name
                self.fields.setdefault(field_name, {})['type']=field_type
コード例 #5
0
 def __init__(self):
     self.instances = {}
     self.operator_factory = DapOperatorFactory.DapOperatorFactory()
     self.structures = {}
     self.dap_options = {}
     self.embedderName = None  # SUPPORT_SINGLE_GLOBAL_EMBEDDING_QUERY
     self.embeddingFieldName = None  # SUPPORT_SINGLE_GLOBAL_EMBEDDING_QUERY
     self.embeddingTableName = None  # SUPPORT_SINGLE_GLOBAL_EMBEDDING_QUERY
     self.classmakers = {}
     self.log.update_local_name("DapManager")
     self.planes = {}
     self.dap_processes = []
     self.monitoring = {}
     self.dap_stat_names = [
         "row_count", "rows_added", "rows_removed", "row_add_duplicate",
         "row_add_fails", "row_remove_fails", "row_remove_not_found",
         "prepare_constraint_count", "prepare_count", "execute_count",
         "empty_execute_response", "total_result_count", "filter_inputs",
         "originated_queries", "num_originated_rows"
     ]
コード例 #6
0
ファイル: DapGeo.py プロジェクト: jl789/oef-search-pluto
    def __init__(self, name, configuration):
        self.name = name
        self.geos = {}
        self.structure = configuration['structure']
        self.fields_by_table = {}
        self.log.update_local_name("DapGeo(" + name + ")")
        self.error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
                   json.dumps(self.structure, indent=2))

        for table_name, fields in self.structure.items():
            self.geos[table_name] = GeoStore.GeoStore()
            for field_name, config in fields.items():

                r = {
                    'type':
                    'location',
                    'distance_calculator':
                    GeoStore.GeoStore.EquirectangularDistance,
                }
                if isinstance(config, dict):
                    r['type'] = config.get('type', 'location')
                    r['options'] = set(config.get('options', []))
                elif isinstance(config, str):
                    r['type'] = config
                    r['options'] = set()
                else:
                    raise Exception("Unexpected specification for a field")

                if 'os-grid' in r['options']:
                    r['distance_calculator'] = GeoStore.GeoStore.OSGridDistance

                if field_name[-9:] != ".location":
                    field_name = field_name + ".location"
                self.fields_by_table.setdefault(table_name,
                                                {}).setdefault(field_name,
                                                               {}).update(r)

        self.operatorFactory = DapOperatorFactory.DapOperatorFactory()
コード例 #7
0
    def __init__(self, name, configuration):
        self.store = {}
        self.name = name
        self.structure_pb = configuration['structure']
        self.log.update_local_name("InMemoryDap(" + name + ")")

        self.operatorFactory = DapOperatorFactory.DapOperatorFactory()

        self.tablenames = []
        self.structure = {}
        self.fields = {}

        self.stats = {
            "rows_added": 0,
            "rows_removed": 0,
            "row_add_fails": 0,
            "row_remove_fails": 0,
            "prepare_constraint_count": 0,
            "execute_count": 0,
            "empty_execute_response": 0,
            "total_result_count": 0,
            "filter_inputs": 0,
            "originated_queries": 0,
            "num_originated_rows": 0,
            "row_remove_not_found": 0,
            "row_add_duplicate": 0
        }

        for table_name, fields in self.structure_pb.items():
            self.tablenames.append(table_name)
            for field_name, field_type in fields.items():
                self.structure.setdefault(table_name, {}).setdefault(
                    field_name, {})['type'] = field_type
                self.fields.setdefault(field_name,
                                       {})['tablename'] = table_name
                self.fields.setdefault(field_name, {})['type'] = field_type
コード例 #8
0
 def __init__(self, name, configuration):
     self.name = name
     self.table = {}
     self.operatorFactory = DapOperatorFactory.DapOperatorFactory()
     self._service_alias_store = {}
     self.stats = {
         "rows_added": 0,
         "rows_removed": 0,
         "prepare_constraint_count": 0,
         "execute_count": 0,
         "empty_execute_response": 0,
         "total_result_count": 0,
         "filter_inputs": 0,
         "originated_queries": 0,
         "num_originated_rows": 0,
         "row_remove_not_found": 0,
         "row_add_duplicate": 0,
         "fields_added": 0,
         "fields_add_duplicate": 0,
         "fields_removed": 0
     }
     self.custom_stats = [
         "fields_added", "fields_add_duplicate", "fields_removed"
     ]
コード例 #9
0
 def __init__(self, name, configuration):
     self.name = name
     self.table = {}
     self.operatorFactory = DapOperatorFactory.DapOperatorFactory()