def __copy__(self): output = object.__new__(ColumnList) Table.__init__(output, "meta.columns") output.data = { t: {c: list(cs) for c, cs in dd.items()} for t, dd in self.data.items() } output.locker = Lock() output._schema = None return output
def __init__(self, db): Table.__init__(self, META_COLUMNS_NAME) self.data = {} # MAP FROM fact_name TO (abs_column_name to COLUMNS) self.locker = Lock() self._schema = None self.dirty = False self.db = db self.es_index = None self.last_load = Null self.todo = Queue( "update columns to es" ) # HOLD (action, column) PAIR, WHERE action in ['insert', 'update'] self._snowflakes = Data() self._load_from_database()
def __init__(self, name): Table.__init__(self, "meta.columns") self.db_file = File("metadata." + name + ".sqlite") self.data = {} # MAP FROM ES_INDEX TO (abs_column_name to COLUMNS) self.locker = Lock() self._schema = None self.db = sqlite3.connect( database=self.db_file.abspath, check_same_thread=False, isolation_level=None ) self.last_load = Null self.todo = Queue( "update columns to db" ) # HOLD (action, column) PAIR, WHERE action in ['insert', 'update'] self._db_load() Thread.run("update " + name, self._db_worker)
def __init__(self, es_cluster): Table.__init__(self, META_COLUMNS_NAME) self.data = {} # MAP FROM ES_INDEX TO (abs_column_name to COLUMNS) self.locker = Lock() self._schema = None self.dirty = False self.es_cluster = es_cluster self.es_index = None self.last_load = Null self.todo = Queue( "update columns to es" ) # HOLD (action, column) PAIR, WHERE action in ['insert', 'update'] self._db_load() Thread.run("update " + META_COLUMNS_NAME, self._update_from_es, parent_thread=MAIN_THREAD)
def __init__(self): Table.__init__(self, "meta.columns") self.data = {} # MAP FROM ES_INDEX TO (abs_column_name to COLUMNS) self.locker = Lock() self._schema = None self.extend(METADATA_COLUMNS)