Example #1
0
    def test_table_random_write_versions(self):

        common.create_multiversion_table()
        table_name = 'test'
        dump_file1 = 'dump1.out'
        dump_file2 = 'dump2.out'
        scan_file = 'scan.out'
        common.run_tera_mark([(dump_file1, 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)
        common.run_tera_mark([(dump_file1, True), (dump_file2, False)],
                             op='w',
                             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.scan_table(table_name=table_name,
                          file_path=scan_file,
                          allversion=True)
        nose.tools.assert_true(
            common.compare_files(dump_file1, scan_file, need_sort=True))

        common.scan_table(table_name=table_name,
                          file_path=scan_file,
                          allversion=True,
                          snapshot=0,
                          is_async=True)
        nose.tools.assert_true(
            common.compare_files(dump_file1, scan_file, need_sort=True))

        common.scan_table(table_name=table_name,
                          file_path=scan_file,
                          allversion=False)
        nose.tools.assert_true(
            common.compare_files(dump_file2, scan_file, need_sort=True))

        common.scan_table(table_name=table_name,
                          file_path=scan_file,
                          allversion=False,
                          snapshot=0,
                          is_async=True)
        nose.tools.assert_true(
            common.compare_files(dump_file2, scan_file, need_sort=True))
        '''
Example #2
0
    def test_table_write_delete_version(self):

        common.create_multiversion_table()
        table_name = 'test'
        dump_file1 = 'dump1.out'
        dump_file2 = 'dump2.out'
        scan_file1 = 'scan1.out'
        scan_file2 = 'scan2.out'
        common.run_tera_mark([(dump_file1, False), (dump_file2, 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)
        common.run_tera_mark([(dump_file1, True), (dump_file2, True)], op='w', 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.run_tera_mark([(dump_file1, True)], op='w', table_name=table_name, cf='cf0:q,cf1:q', random='random',
                             key_seed=1, value_seed=12, value_size=100, num=10000, key_size=20)
        common.run_tera_mark([(dump_file1, True), (dump_file2, True)], op='w', table_name=table_name, cf='cf0:q,cf1:q',
                             random='random', key_seed=1, value_seed=13, 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=True, snapshot=0)
        common.run_tera_mark([], op='d', table_name=table_name, cf='cf0:q,cf1:q', random='random', key_seed=1,
                             value_seed=12, 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_file2, allversion=True, snapshot=0)
        nose.tools.assert_true(common.compare_files(dump_file1, scan_file1, need_sort=True))
        nose.tools.assert_true(common.compare_files(dump_file2, scan_file2, need_sort=True))
Example #3
0
    def test_table_random_write_versions(self):

        common.create_multiversion_table()
        table_name = 'test'
        dump_file1 = 'dump1.out'
        dump_file2 = 'dump2.out'
        scan_file = 'scan.out'
        common.run_tera_mark([(dump_file1, 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)
        common.run_tera_mark([(dump_file1, True), (dump_file2, False)], op='w', 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.scan_table(table_name=table_name, file_path=scan_file, allversion=True)
        nose.tools.assert_true(common.compare_files(dump_file1, scan_file, need_sort=True))
    
        common.scan_table(table_name=table_name, file_path=scan_file, allversion=True, snapshot=0, is_async=True)
        nose.tools.assert_true(common.compare_files(dump_file1, scan_file, need_sort=True))
    
        common.scan_table(table_name=table_name, file_path=scan_file, allversion=False)
        nose.tools.assert_true(common.compare_files(dump_file2, scan_file, need_sort=True))
    
        common.scan_table(table_name=table_name, file_path=scan_file, allversion=False, snapshot=0, is_async=True)
        nose.tools.assert_true(common.compare_files(dump_file2, scan_file, need_sort=True))
    
        '''
Example #4
0
    def test_table_write_multiversion_snapshot(self):

        common.create_multiversion_table()
        table_name = 'test'
        dump_file1 = 'dump1.out'
        dump_file2 = 'dump2.out'
        scan_file1 = 'scan1.out'
        scan_file2 = 'scan2.out'
        common.run_tera_mark([(dump_file1, 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)
        common.run_tera_mark([(dump_file1, True)], op='w', 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)
        snapshot = common.snapshot_op(table_name)
        common.run_tera_mark([(dump_file2, 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)
        common.run_tera_mark([(dump_file2, True)], op='w', 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=True, snapshot=snapshot)
        common.scan_table(table_name=table_name, file_path=scan_file2, allversion=True, snapshot=0)
        nose.tools.assert_true(common.compare_files(dump_file1, scan_file1, need_sort=True))
        nose.tools.assert_true(common.compare_files(dump_file2, scan_file2, need_sort=True))

        '''