from template.db import Database
from template.query import Query
from template.transaction import Transaction
from template.transaction_worker import TransactionWorker
from template.config import init
from template.lock_manager_config import *
from random import choice, randint, sample, seed

# TESTING REMOVEAL ABORT
init()
db = Database()
db.open('./ECS165')
grades_table = db.create_table('Grades', 5, 0)

keys = []
records = {}
seed(3562901)
num_threads = 4

try:
    grades_table.index.create_index(1)
    grades_table.index.create_index(2)
    grades_table.index.create_index(3)
    grades_table.index.create_index(4)
except Exception as e:
    print('Index API not implemented properly, tests may fail.')

transaction_workers = []
insert_transactions = []
select_transactions = []
update_transactions = []
Example #2
0
 def __init__(self, table):
     # One index for each table. All our empty initially.
     self.indices = [None] * table.num_columns
     self.table = table
     self.config = init()