public override void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();

            _config = new TFChunkDbConfig(PathName,
                                          new VersionedPatternFileNamingStrategy(PathName, "chunk-"),
                                          1000,
                                          0,
                                          new InMemoryCheckpoint(1711),
                                          new InMemoryCheckpoint(5500),
                                          new InMemoryCheckpoint(5500),
                                          new InMemoryCheckpoint(1111));

            var rnd = new Random();

            _file1Contents = new byte[_config.ChunkSize];
            _file2Contents = new byte[_config.ChunkSize];
            rnd.NextBytes(_file1Contents);
            rnd.NextBytes(_file2Contents);

            DbUtil.CreateSingleChunk(_config, 0, GetFilePathFor("chunk-000000.000001"), contents: _file1Contents);
            DbUtil.CreateSingleChunk(_config, 1, GetFilePathFor("chunk-000001.000002"), contents: _file2Contents);

            var truncator = new TFChunkDbTruncator(_config);

            truncator.TruncateDb(_config.TruncateCheckpoint.ReadNonFlushed());
        }
        public override async Task TestFixtureSetUp()
        {
            await base.TestFixtureSetUp();

            _config = TFChunkHelper.CreateDbConfig(PathName, 1711, 5500, 5500, 1111, 1000);

            var rnd = new Random();

            _file1Contents = new byte[_config.ChunkSize];
            _file2Contents = new byte[_config.ChunkSize];
            rnd.NextBytes(_file1Contents);
            rnd.NextBytes(_file2Contents);

            DbUtil.CreateSingleChunk(_config, 0, GetFilePathFor("chunk-000000.000001"), contents: _file1Contents);
            DbUtil.CreateSingleChunk(_config, 1, GetFilePathFor("chunk-000001.000002"), contents: _file2Contents);

            var truncator = new TFChunkDbTruncator(_config);

            truncator.TruncateDb(_config.TruncateCheckpoint.ReadNonFlushed());
        }
示例#3
0
        public override async Task TestFixtureSetUp()
        {
            await base.TestFixtureSetUp();

            _config = TFChunkHelper.CreateDbConfigEx(PathName, 11111, 5500, 5500, -1, 5757, 1000, -1);

            DbUtil.CreateMultiChunk(_config, 0, 2, GetFilePathFor("chunk-000000.000001"));
            DbUtil.CreateMultiChunk(_config, 0, 2, GetFilePathFor("chunk-000000.000002"));
            DbUtil.CreateSingleChunk(_config, 3, GetFilePathFor("chunk-000003.000000"));
            DbUtil.CreateMultiChunk(_config, 3, 10, GetFilePathFor("chunk-000003.000001"));
            DbUtil.CreateMultiChunk(_config, 3, 10, GetFilePathFor("chunk-000003.000002"));
            DbUtil.CreateSingleChunk(_config, 4, GetFilePathFor("chunk-000004.000000"));
            DbUtil.CreateMultiChunk(_config, 4, 4, GetFilePathFor("chunk-000004.000002"));
            DbUtil.CreateMultiChunk(_config, 5, 7, GetFilePathFor("chunk-000005.000001"));
            DbUtil.CreateMultiChunk(_config, 8, 9, GetFilePathFor("chunk-000008.000001"));
            DbUtil.CreateOngoingChunk(_config, 11, GetFilePathFor("chunk-000011.000000"));

            var truncator = new TFChunkDbTruncator(_config);

            truncator.TruncateDb(_config.TruncateCheckpoint.ReadNonFlushed());
        }