def setUp(self): self.handles = list() self.list_tables_requests = list() self.num_handles = 1 if is_prod_pod() or is_onprem() else 2 for handle in range(self.num_handles): tenant = tenant_id + ('' if handle == 0 else str(handle)) self.handles.append(get_handle(tenant)) self.list_tables_requests.append( ListTablesRequest().set_timeout(timeout)) self.list_tables_request = ListTablesRequest().set_timeout(timeout)
def setUpClass(cls): add_tier() cls._handles = list() cls._drop_requests = list() global table_names table_names = list() num_tables = 3 # # In pod env create 1 handle, otherwise create 2 handles for additional # testing # cls._num_handles = 1 if is_pod() else 2 for handle in range(cls._num_handles): add_tenant(tenant_id + str(handle)) table_names.append(list()) cls._drop_requests.append(list()) cls._handles.append(get_handle(tenant_id + str(handle))) for table in range(handle + num_tables): table_names[handle].append(table_name + str(table)) for table in range(handle + num_tables): # # Add a sleep for a pod to let things happen # if is_pod(): sleep(60) drop_statement = ('DROP TABLE IF EXISTS ' + table_names[handle][table]) drop_request = TableRequest().set_statement(drop_statement) cls._drop_requests[handle].append(drop_request) cls._result = cls._handles[handle].table_request(drop_request) cls._result.wait_for_state(cls._handles[handle], table_names[handle][table], State.DROPPED, wait_timeout, 1000) create_statement = ('CREATE TABLE ' + table_names[handle][table] + '(\ fld_id INTEGER, fld_long LONG, fld_float FLOAT, fld_double DOUBLE, \ fld_bool BOOLEAN, fld_str STRING, fld_bin BINARY, fld_time TIMESTAMP(2), \ fld_num NUMBER, fld_json JSON, fld_arr ARRAY(STRING), fld_map MAP(STRING), \ fld_rec RECORD(fld_id LONG, fld_bool BOOLEAN, fld_str STRING), \ PRIMARY KEY(fld_id)) USING TTL 16 HOURS') limits = TableLimits(5000, 5000, 50) create_request = TableRequest().set_statement( create_statement).set_table_limits(limits) cls._result = cls._handles[handle].table_request( create_request) cls._result.wait_for_state(cls._handles[handle], table_names[handle][table], State.ACTIVE, wait_timeout, 1000)
def setUpClass(cls): add_tier() cls.handles = list() global table_names table_names = list() num_tables = 3 # # In pod env create 1 handle, otherwise create 2 handles for additional # testing # num_handles = 1 if is_prod_pod() or is_onprem() else 2 for handle in range(num_handles): tenant = tenant_id + ('' if handle == 0 else str(handle)) add_tenant(tenant) table_names.append(list()) cls.handles.append(get_handle(tenant)) for table in range(handle + num_tables): tb_name = table_name + str(table) table_names[handle].append(tb_name) # # Add a sleep for a pod to let things happen # if is_pod(): sleep(60) drop_request = TableRequest().set_statement( 'DROP TABLE IF EXISTS ' + tb_name) cls.table_request(drop_request, cls.handles[handle]) create_statement = ('CREATE TABLE ' + tb_name + '(fld_id INTEGER, \ fld_long LONG, fld_float FLOAT, fld_double DOUBLE, fld_bool BOOLEAN, \ fld_str STRING, fld_bin BINARY, fld_time TIMESTAMP(2), fld_num NUMBER, \ fld_json JSON, fld_arr ARRAY(STRING), fld_map MAP(STRING), \ fld_rec RECORD(fld_id LONG, fld_bool BOOLEAN, fld_str STRING), \ PRIMARY KEY(fld_id)) USING TTL 16 HOURS') limits = TableLimits(10, 10, 1) create_request = TableRequest().set_statement( create_statement).set_table_limits(limits) cls.table_request(create_request, cls.handles[handle])
def setUp(self): self.handle = get_handle(tenant_id) self.limits = TableLimits(30, 10, 1) self.table_request = TableRequest().set_statement( 'CREATE TABLE ' + table_name + '(fld_id INTEGER, fld_long LONG, \ PRIMARY KEY(fld_id))')
def set_up_class(cls): add_test_tier_tenant(tenant_id) cls.handle = get_handle(tenant_id) cls.drop_all_tables()
def set_up(self): self.handle = get_handle(tenant_id)
def setUp(self): self.handle = get_handle(tenant_id) self.multi_delete_request = MultiDeleteRequest().set_table_name( table_name).set_key({'fld_sid': 1})
def setUp(self): self.handles = list() self.num_handles = 1 if is_pod() else 2 for handle in range(self.num_handles): self.handles.append(get_handle(tenant_id + str(handle))) self.list_tables_request = ListTablesRequest().set_timeout(timeout)