Exemplo n.º 1
0
        public override async Task TestFixtureSetUp()
        {
            hasher = new Murmur3AUnsafe();
            await base.TestFixtureSetUp();

            _files.Add(GetTempFilePath());
            var table = new HashListMemTable(PTableVersions.IndexV1, maxSize: 20);

            table.Add(0x010100000000, 0, 1);
            table.Add(0x010200000000, 0, 2);
            table.Add(0x010300000000, 0, 3);
            table.Add(0x010300000000, 1, 4);
            _tables.Add(PTable.FromMemtable(table, GetTempFilePath(), Constants.PTableInitialReaderCount, Constants.PTableMaxReaderCountDefault));
            table = new HashListMemTable(PTableVersions.IndexV2, maxSize: 20);
            table.Add(0x010100000000, 2, 5);
            table.Add(0x010200000000, 1, 6);
            table.Add(0x010200000000, 2, 7);
            table.Add(0x010400000000, 0, 8);
            table.Add(0x010400000000, 1, 9);
            _tables.Add(PTable.FromMemtable(table, GetTempFilePath(), Constants.PTableInitialReaderCount, Constants.PTableMaxReaderCountDefault));
            table = new HashListMemTable(PTableVersions.IndexV1, maxSize: 20);
            table.Add(0x010100000000, 1, 10);
            table.Add(0x010100000000, 2, 11);
            table.Add(0x010500000000, 1, 12);
            table.Add(0x010500000000, 2, 13);
            table.Add(0x010500000000, 3, 14);
            _tables.Add(PTable.FromMemtable(table, GetTempFilePath(), Constants.PTableInitialReaderCount, Constants.PTableMaxReaderCountDefault));
            _newtable = PTable.MergeTo(_tables, GetTempFilePath(),
                                       (streamId, hash) => hash << 32 | hasher.Hash(streamId), x => x.Position % 2 == 0,
                                       x => new Tuple <string, bool>(x.Stream.ToString(), x.Position % 2 == 0), PTableVersions.IndexV2, Constants.PTableInitialReaderCount, Constants.PTableMaxReaderCountDefault,
                                       skipIndexVerify: _skipIndexVerify);
        }
Exemplo n.º 2
0
        public override async Task TestFixtureSetUp()
        {
            await base.TestFixtureSetUp();

            _files.Add(GetTempFilePath());
            var table = new HashListMemTable(PTableVersions.IndexV1, maxSize: 20);

            table.Add(0x010100000000, 0, 0x010100000000);
            table.Add(0x010200000000, 0, 0x010200000000);
            table.Add(0x010300000000, 0, 0x010300000000);
            table.Add(0x010400000000, 0, 0x010400000000);
            _tables.Add(PTable.FromMemtable(table, GetTempFilePath(), Constants.PTableInitialReaderCount, Constants.PTableMaxReaderCountDefault));
            table = new HashListMemTable(PTableVersions.IndexV1, maxSize: 20);
            table.Add(0x010500000000, 0, 0x010500000000);
            table.Add(0x010600000000, 0, 0x010600000000);
            table.Add(0x010700000000, 0, 0x010700000000);
            table.Add(0x010800000000, 0, 0x010800000000);
            _tables.Add(PTable.FromMemtable(table, GetTempFilePath(), Constants.PTableInitialReaderCount, Constants.PTableMaxReaderCountDefault));
            table = new HashListMemTable(PTableVersions.IndexV2, maxSize: 20);
            table.Add(0x010900000000, 0, 0x010900000000);
            table.Add(0x101000000000, 0, 0x101000000000);
            table.Add(0x111000000000, 0, 0x111000000000);
            table.Add(0x121000000000, 0, 0x121000000000);
            _tables.Add(PTable.FromMemtable(table, GetTempFilePath(), Constants.PTableInitialReaderCount, Constants.PTableMaxReaderCountDefault));
            _newtable = PTable.MergeTo(_tables, GetTempFilePath(), (streamId, hash) => hash + 1, x => true,
                                       x => new Tuple <string, bool>(x.Stream.ToString(), true), PTableVersions.IndexV2, Constants.PTableInitialReaderCount, Constants.PTableMaxReaderCountDefault,
                                       skipIndexVerify: _skipIndexVerify);
        }
Exemplo n.º 3
0
        public override void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();
            _files.Add(GetTempFilePath());
            var table = new HashListMemTable(PTableVersions.Index32Bit, maxSize: 20);

            table.Add(0x010100000000, 0, 0x010100000000);
            table.Add(0x010200000000, 0, 0x010200000000);
            table.Add(0x010300000000, 0, 0x010300000000);
            table.Add(0x010400000000, 0, 0x010400000000);
            _tables.Add(PTable.FromMemtable(table, GetTempFilePath()));
            table = new HashListMemTable(PTableVersions.Index32Bit, maxSize: 20);
            table.Add(0x010500000000, 0, 0x010500000000);
            table.Add(0x010600000000, 0, 0x010600000000);
            table.Add(0x010700000000, 0, 0x010700000000);
            table.Add(0x010800000000, 0, 0x010800000000);
            _tables.Add(PTable.FromMemtable(table, GetTempFilePath()));
            table = new HashListMemTable(PTableVersions.Index64Bit, maxSize: 20);
            table.Add(0x010900000000, 0, 0x010900000000);
            table.Add(0x101000000000, 0, 0x101000000000);
            table.Add(0x111000000000, 0, 0x111000000000);
            table.Add(0x121000000000, 0, 0x121000000000);
            _tables.Add(PTable.FromMemtable(table, GetTempFilePath()));
            _newtable = PTable.MergeTo(_tables, GetTempFilePath(), (streamId, hash) => hash + 1, x => true, x => new Tuple <string, bool>(x.Stream.ToString(), true), PTableVersions.Index64Bit);
        }
Exemplo n.º 4
0
        public override void TestFixtureSetUp()
        {
            hasher = new Murmur3AUnsafe();
            base.TestFixtureSetUp();
            _files.Add(GetTempFilePath());
            var table = new HashListMemTable(PTableVersions.Index32Bit, maxSize: 20);

            table.Add(0x010100000000, 0, 1);
            table.Add(0x010200000000, 0, 2);
            table.Add(0x010300000000, 0, 3);
            table.Add(0x010300000000, 1, 4);
            _tables.Add(PTable.FromMemtable(table, GetTempFilePath()));
            table = new HashListMemTable(PTableVersions.Index64Bit, maxSize: 20);
            table.Add(0x010100000000, 2, 5);
            table.Add(0x010200000000, 1, 6);
            table.Add(0x010200000000, 2, 7);
            table.Add(0x010400000000, 0, 8);
            table.Add(0x010400000000, 1, 9);
            _tables.Add(PTable.FromMemtable(table, GetTempFilePath()));
            table = new HashListMemTable(PTableVersions.Index32Bit, maxSize: 20);
            table.Add(0x010100000000, 1, 10);
            table.Add(0x010100000000, 2, 11);
            table.Add(0x010500000000, 1, 12);
            table.Add(0x010500000000, 2, 13);
            table.Add(0x010500000000, 3, 14);
            _tables.Add(PTable.FromMemtable(table, GetTempFilePath()));
            _newtable = PTable.MergeTo(_tables, GetTempFilePath(), (streamId, hash) => hash << 32 | hasher.Hash(streamId), x => x.Position % 2 == 0, x => new Tuple <string, bool>(x.Stream.ToString(), x.Position % 2 == 0), PTableVersions.Index64Bit);
        }
Exemplo n.º 5
0
        public void Setup()
        {
            for (int i = 0; i < 4; i++)
            {
                _files.Add(Path.GetRandomFileName());

                var table = new HashListMemTable();
                for (int j = 0; j < 10; j++)
                {
                    table.Add((UInt32)j + 1, i + 1, i * j);
                }
                _tables.Add(PTable.FromMemtable(table, _files[i]));
            }
            _files.Add(Path.GetRandomFileName());
            _newtable = PTable.MergeTo(_tables, _files[4], x => false);
        }
Exemplo n.º 6
0
        public override async Task TestFixtureSetUp()
        {
            await base.TestFixtureSetUp();

            _files.Add(GetTempFilePath());
            var table = new HashListMemTable(_fromVersion, maxSize: 20);

            if (_fromVersion == PTableVersions.IndexV1)
            {
                table.Add(0x010100000000, 0, 0x0101);
                table.Add(0x010200000000, 0, 0x0102);
                table.Add(0x010300000000, 0, 0x0103);
                table.Add(0x010400000000, 0, 0x0104);
            }
            else
            {
                table.Add(0x0101, 0, 0x0101);
                table.Add(0x0102, 0, 0x0102);
                table.Add(0x0103, 0, 0x0103);
                table.Add(0x0104, 0, 0x0104);
            }

            _tables.Add(PTable.FromMemtable(table, GetTempFilePath(), Constants.PTableInitialReaderCount, Constants.PTableMaxReaderCountDefault, skipIndexVerify: _skipIndexVerify));
            table = new HashListMemTable(_fromVersion, maxSize: 20);

            if (_fromVersion == PTableVersions.IndexV1)
            {
                table.Add(0x010500000000, 0, 0x0105);
                table.Add(0x010600000000, 0, 0x0106);
                table.Add(0x010700000000, 0, 0x0107);
                table.Add(0x010800000000, 0, 0x0108);
            }
            else
            {
                table.Add(0x0105, 0, 0x0105);
                table.Add(0x0106, 0, 0x0106);
                table.Add(0x0107, 0, 0x0107);
                table.Add(0x0108, 0, 0x0108);
            }

            _tables.Add(PTable.FromMemtable(table, GetTempFilePath(), Constants.PTableInitialReaderCount, Constants.PTableMaxReaderCountDefault, skipIndexVerify: _skipIndexVerify));
            _newtableFile = GetTempFilePath();
            _newtable     = PTable.MergeTo(_tables, _newtableFile, (streamId, hash) => hash + 1, x => true,
                                           x => new Tuple <string, bool>(x.Stream.ToString(), true), PTableVersions.IndexV4, Constants.PTableInitialReaderCount, Constants.PTableMaxReaderCountDefault,
                                           skipIndexVerify: _skipIndexVerify);
        }
Exemplo n.º 7
0
        public override void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();
            for (int i = 0; i < 2; i++)
            {
                _files.Add(GetTempFilePath());

                var table = new HashListMemTable(maxSize: 20);
                for (int j = 0; j < 10; j++)
                {
                    table.Add((UInt32)j + 1, i + 1, i * j);
                }
                _tables.Add(PTable.FromMemtable(table, _files[i]));
            }
            _files.Add(GetTempFilePath());
            _newtable = PTable.MergeTo(_tables, _files[2], x => false);
        }
Exemplo n.º 8
0
        public override void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();
            for (int i = 0; i < 2; i++)
            {
                _files.Add(GetTempFilePath());

                var table = new HashListMemTable(_ptableVersion, maxSize: 20);
                for (int j = 0; j < 10; j++)
                {
                    table.Add((ulong)(0x010100000000 << (j + 1)), i + 1, i * j);
                }
                _tables.Add(PTable.FromMemtable(table, _files[i], skipIndexVerify: _skipIndexVerify));
            }
            _files.Add(GetTempFilePath());
            _newtable = PTable.MergeTo(_tables, _files[2], (streamId, hash) => hash, x => true, x => new System.Tuple <string, bool>("", true), _ptableVersion, skipIndexVerify: _skipIndexVerify);
        }
        public override void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();
            for (int i = 0; i < 4; i++)
            {
                _files.Add(GetTempFilePath());

                var table = new HashListMemTable(maxSize: 30);
                for (int j = 0; j < 10; j++)
                {
                    table.Add((uint)i, j, i*10 + j);
                }
                _tables.Add(PTable.FromMemtable(table, _files[i]));
            }
            _files.Add(GetTempFilePath());
            _newtable = PTable.MergeTo(_tables, _files[4], x => x.Position % 2 == 0);
        }
Exemplo n.º 10
0
        public override void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();
            for (int i = 0; i < 4; i++)
            {
                _files.Add(GetTempFilePath());

                var table = new HashListMemTable(_ptableVersion, maxSize: 30);
                for (int j = 0; j < 10; j++)
                {
                    table.Add((ulong)(0x010100000000 << i), j, i * 10 + j);
                }
                _tables.Add(PTable.FromMemtable(table, _files[i]));
            }
            _files.Add(GetTempFilePath());
            _newtable = PTable.MergeTo(_tables, _files[4], (streamId, hash) => hash, x => x.Position % 2 == 0, x => new Tuple <string, bool>("", x.Position % 2 == 0), _ptableVersion);
        }
        public void Setup()
        {
            for (int i = 0; i < 2; i++)
            {
                _files.Add(Path.GetRandomFileName());

                var table = new HashListMemTable();
                for (int j = 0; j < 10; j++)
                {
                    table.Add(0, 0, 1000000 - i * 1000 - j);
                    table.Add(0, 0, i * 1000 + j);
                }
                _tables.Add(PTable.FromMemtable(table, _files[i]));
            }
            _files.Add(Path.GetRandomFileName());
            _newtable = PTable.MergeTo(_tables, _files[2], x => false);
        }
        public override void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();
            for (int i = 0; i < 4; i++)
            {
                _files.Add(GetTempFilePath());

                var table = new HashListMemTable(maxSize: 50);
                for (int j = 0; j < 10; j++)
                {
                    table.Add(0, 0, 1000000 - i * 1000 - j);
                    table.Add(0, 0, i * 1000 + j);
                }
                _tables.Add(PTable.FromMemtable(table, _files[i]));
            }
            _files.Add(GetTempFilePath());
            _newtable = PTable.MergeTo(_tables, _files[4], x => false);
        }
        public override void TestFixtureSetUp()
        {
            hasher = new Murmur3AUnsafe();
            base.TestFixtureSetUp();

            for (int i = 0; i < 4; i++)
            {
                _files.Add(GetTempFilePath());

                var table = new HashListMemTable(_ptableVersion, maxSize: 20);
                for (int j = 0; j < 10; j++)
                {
                    table.Add((ulong)(0x010100000000 << (j + 1)), i + 1, i * j);
                }
                _tables.Add(PTable.FromMemtable(table, _files[i]));
            }
            _files.Add(GetTempFilePath());
            _newtable = PTable.MergeTo(_tables, _files[4], (streamId, hash) => hash << 32 | hasher.Hash(streamId), _ => true, _ => new System.Tuple <string, bool>("", true), _ptableVersion);
        }
        public override async Task TestFixtureSetUp()
        {
            await base.TestFixtureSetUp();

            for (int i = 0; i < 4; i++)
            {
                _files.Add(GetTempFilePath());

                var table = new HashListMemTable(_ptableVersion, maxSize: 30);
                for (int j = 0; j < 10; j++)
                {
                    table.Add((ulong)(0x010100000000 << i), j, i * 10 + j);
                }

                _tables.Add(PTable.FromMemtable(table, _files[i], Constants.PTableInitialReaderCount, Constants.PTableMaxReaderCountDefault, skipIndexVerify: _skipIndexVerify));
            }

            _files.Add(GetTempFilePath());
            _newtable = PTable.MergeTo(_tables, _files[4], (streamId, hash) => hash, x => x.Position % 2 == 0,
                                       x => new Tuple <string, bool>("", x.Position % 2 == 0), _ptableVersion, Constants.PTableInitialReaderCount, Constants.PTableMaxReaderCountDefault,
                                       skipIndexVerify: _skipIndexVerify);
        }
        public override async Task TestFixtureSetUp()
        {
            hasher = new Murmur3AUnsafe();
            await base.TestFixtureSetUp();

            for (int i = 0; i < 4; i++)
            {
                _files.Add(GetTempFilePath());

                var table = new HashListMemTable(_ptableVersion, maxSize: 20);
                for (int j = 0; j < 10; j++)
                {
                    table.Add((ulong)(0x010100000000 << (j + 1)), i + 1, i * j);
                }

                _tables.Add(PTable.FromMemtable(table, _files[i], Constants.PTableInitialReaderCount, Constants.PTableMaxReaderCountDefault, skipIndexVerify: _skipIndexVerify));
            }

            _files.Add(GetTempFilePath());
            _newtable = PTable.MergeTo(_tables, _files[4], (streamId, hash) => hash << 32 | hasher.Hash(streamId),
                                       _ => true, _ => new System.Tuple <string, bool>("", true), _ptableVersion, Constants.PTableInitialReaderCount, Constants.PTableMaxReaderCountDefault,
                                       skipIndexVerify: _skipIndexVerify);
        }
Exemplo n.º 16
0
        public void Setup()
        {
            for (int i = 0; i < 4; i++)
            {
                _files.Add(Path.GetRandomFileName());

                var table = new HashListMemTable();
                for (int j = 0; j < 10; j++)
                {
                    table.Add((UInt32)j % 8, i, i * j * 100 + i + j); // 0 collisions with 8, 1 collisions with 9
                }
                if (i == 3)
                {
                    table.Add(0, int.MaxValue, 45);
                    table.Add(1, int.MaxValue, 45);
                    table.Add(2, int.MaxValue, 45);
                    table.Add(3, int.MaxValue, 45);
                }
                _tables.Add(PTable.FromMemtable(table, _files[i]));
            }
            _files.Add(Path.GetRandomFileName());
            _newtable = PTable.MergeTo(_tables, _files[4], x => x.Stream <= 1);
        }
        public void Setup()
        {
            for (int i = 0; i < 4; i++)
            {
                _files.Add(Path.GetRandomFileName());

                var table = new HashListMemTable(maxSize: 2000);
                for (int j = 0; j < 10; j++)
                {
                    table.Add((UInt32)j + 1, i + 1, i * j);
                }
                if (i == 3)
                {
                    table.Add(1, int.MaxValue, 45);
                    table.Add(2, int.MaxValue, 45);
                    table.Add(3, int.MaxValue, 45);
                    table.Add(4, int.MaxValue, 45);
                }
                _tables.Add(PTable.FromMemtable(table, _files[i]));
            }
            _files.Add(Path.GetRandomFileName());
            _newtable = PTable.MergeTo(_tables, _files[4], x => false);
        }
Exemplo n.º 18
0
        public override void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();
            for (int i = 0; i < 2; i++)
            {
                _files.Add(GetTempFilePath());

                var table = new HashListMemTable(maxSize: 30);
                for (int j = 0; j < 10; j++)
                {
                    table.Add((UInt32)j % 8, i, i * j * 100 + i + j); // 0 collisions with 8, 1 collisions with 9
                }
                if (i == 1)
                {
                    table.Add(0, int.MaxValue, 45);
                    table.Add(1, int.MaxValue, 45);
                    table.Add(2, int.MaxValue, 45);
                    table.Add(3, int.MaxValue, 45);
                }
                _tables.Add(PTable.FromMemtable(table, _files[i]));
            }
            _files.Add(GetTempFilePath());
            _newtable = PTable.MergeTo(_tables, _files[2], x => x.Stream <= 1);
        }