def test_table_write_delete(self): common.create_singleversion_table() table_name = 'test' scan_file = 'scan.out' common.run_tera_mark([], op='w', table_name=table_name, cf='cf0:q,cf1:q', random='random', key_seed=1, value_seed=1, value_size=100, num=10000, key_size=20) common.run_tera_mark([], op='d', table_name=table_name, cf='cf0:q,cf1:q', random='random', key_seed=1, value_seed=1, value_size=100, num=10000, key_size=20) common.scan_table(table_name=table_name, file_path=scan_file, allversion=True) nose.tools.assert_true(common.file_is_empty(scan_file)) common.scan_table(table_name=table_name, file_path=scan_file, allversion=False, snapshot=0, is_async=True) nose.tools.assert_true(common.file_is_empty(scan_file)) '''
def test_scan_empty_table(): """ scan empty table table """ table_name = 'test' scan_file = 'scan.out' common.scan_table(table_name=table_name, file_path=scan_file, allversion=True) nose.tools.assert_true(common.file_is_empty(scan_file))
def test_scan_empty_table(self): common.create_singleversion_table() table_name = 'test' scan_file = 'scan.out' common.scan_table(table_name=table_name, file_path=scan_file, allversion=True) nose.tools.assert_true(common.file_is_empty(scan_file)) '''
def test_table_write_delete(): """ table write and deletion 1. write data set 1 2. delete data set 1 3. scan & compare :return: None """ table_name = 'test' scan_file = 'scan.out' common.run_tera_mark([], op='w', table_name=table_name, cf='cf0:q,cf1:q', random='random', key_seed=1, value_seed=1, value_size=100, num=10000, key_size=20) common.run_tera_mark([], op='d', table_name=table_name, cf='cf0:q,cf1:q', random='random', key_seed=1, value_seed=1, value_size=100, num=10000, key_size=20) common.scan_table(table_name=table_name, file_path=scan_file, allversion=True) nose.tools.assert_true(common.file_is_empty(scan_file)) common.scan_table(table_name=table_name, file_path=scan_file, allversion=False, snapshot=0, is_async=True) nose.tools.assert_true(common.file_is_empty(scan_file))
def test_table_write_del_snapshot(): """ table write deletion w/snapshot 1. write data set 1 2. create snapshot 3. delete data set 1 4. scan w/snapshot, scan w/o snapshot & compare :return: None """ table_name = 'test' dump_file = 'dump.out' scan_file1 = 'scan1.out' scan_file2 = 'scan2.out' common.run_tera_mark([(dump_file, False)], op='w', table_name=table_name, cf='cf0:q,cf1:q', random='random', key_seed=1, value_seed=10, value_size=100, num=10000, key_size=20) snapshot = common.snapshot_op(table_name) common.run_tera_mark([], op='d', table_name=table_name, cf='cf0:q,cf1:q', random='random', key_seed=1, value_seed=11, value_size=100, num=10000, key_size=20) common.compact_tablets(common.get_tablet_list(table_name)) common.scan_table(table_name=table_name, file_path=scan_file1, allversion=False, snapshot=snapshot) common.scan_table(table_name=table_name, file_path=scan_file2, allversion=False, snapshot=0) nose.tools.assert_true( common.compare_files(dump_file, scan_file1, need_sort=True)) nose.tools.assert_true(common.file_is_empty(scan_file2))
def test_table_write_del_snapshot(self): common.create_singleversion_table() table_name = 'test' dump_file = 'dump.out' scan_file1 = 'scan1.out' scan_file2 = 'scan2.out' common.run_tera_mark([(dump_file, False)], op='w', table_name=table_name, cf='cf0:q,cf1:q', random='random', key_seed=1, value_seed=10, value_size=100, num=10000, key_size=20) snapshot = common.snapshot_op(table_name) common.run_tera_mark([], op='d', table_name=table_name, cf='cf0:q,cf1:q', random='random', key_seed=1, value_seed=11, value_size=100, num=10000, key_size=20) common.compact_tablets(common.get_tablet_list(table_name)) common.scan_table(table_name=table_name, file_path=scan_file1, allversion=False, snapshot=snapshot) common.scan_table(table_name=table_name, file_path=scan_file2, allversion=False, snapshot=0) nose.tools.assert_true(common.compare_files(dump_file, scan_file1, need_sort=True)) nose.tools.assert_true(common.file_is_empty(scan_file2)) '''
def test_table_write_del_snapshot(): """ table write deletion w/snapshot 1. write data set 1 2. create snapshot 3. delete data set 1 4. scan w/snapshot, scan w/o snapshot & compare :return: None """ table_name = 'test' dump_file = 'dump.out' scan_file1 = 'scan1.out' scan_file2 = 'scan2.out' common.run_tera_mark([(dump_file, False)], op='w', table_name=table_name, cf='cf0:q,cf1:q', random='random', key_seed=1, value_seed=10, value_size=100, num=10000, key_size=20) snapshot = common.snapshot_op(table_name) common.run_tera_mark([], op='d', table_name=table_name, cf='cf0:q,cf1:q', random='random', key_seed=1, value_seed=11, value_size=100, num=10000, key_size=20) common.compact_tablets(common.get_tablet_list(table_name)) common.scan_table(table_name=table_name, file_path=scan_file1, allversion=False, snapshot=snapshot) common.scan_table(table_name=table_name, file_path=scan_file2, allversion=False, snapshot=0) nose.tools.assert_true(common.compare_files(dump_file, scan_file1, need_sort=True)) nose.tools.assert_true(common.file_is_empty(scan_file2))