Beispiel #1
0
 def get_table(self, name):
     table = Table(name)
     if (lstore.globals.diskManager.open_table_file(name, table) == None):
         return None
     else:
         lstore.globals.tables.append(table)
         return table
Beispiel #2
0
 def create_table(self, name, num_columns, key):
     if (lstore.globals.diskManager.new_table_file(name, key, num_columns)
         ):  # check if new table file was successfully created
         table = Table(name, key, num_columns)
         lstore.globals.tables.append(table)
         return table
     else:
         return None
Beispiel #3
0
    def create_table(self, name, num_columns, key):
        table = Table(name, num_columns, key)
        BufferPool.init_latest_tail(name)
        BufferPool.init_tps(name)

        # create a new table in database
        self.tables.append(table)
        # table.mergeProcessController()
        return table
    def create_table(self, name, num_columns, key):
        expanded = os.path.expanduser(self.filename)
        db_file = open(expanded, "rb")
        db = pickle.load(db_file)
        db_file.close()

        self.tables.append(
            Table(name, num_columns, key, self.bp, Index(num_columns)))

        return self.tables[len(self.tables) - 1]
Beispiel #5
0
 def create_table(self, name, num_columns, key):
     table = Table(name,
                   key,
                   num_columns,
                   self.bufferpool,
                   latest_range_index=-1,
                   base_current_rid=0,
                   tail_current_rid=Config.MAX_RID,
                   tail_tracker=[],
                   merge_tracker=[],
                   base_tracker=[])
     self.tables.update({name: table})  # insert table with name
     return table
Beispiel #6
0
    def get_table(self, name):
        with open(os.getcwd() + '/' + name + '/metadata.json', 'r') as fp:
            meta_dict = json.loads(fp.read())
        fp.close()

        table = Table(name,
                      meta_dict['key'],
                      meta_dict['num_columns'],
                      self.bufferpool,
                      meta_dict['latest_range'],
                      meta_dict['base_rid'],
                      meta_dict['tail_rid'],
                      meta_dict['tail_tracker'],
                      meta_dict['merge_tracker'],
                      meta_dict['base_tracker'],
                      method='get')
        self.tables.update({name: table})
        return table