<commit_before>﻿using BitSharp.Common;
using BitSharp.Common.ExtensionMethods;
using BitSharp.Data;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace BitSharp.Storage
{
    public class CacheContext : IDisposable
    {
        private readonly IStorageContext _storageContext;

        private readonly BlockStorage _blockStorage;
        private readonly BlockCache _blockCache;
        private readonly BlockHeaderCache _blockHeaderCache;
        private readonly ChainedBlockCache _chainedBlockCache;
        private readonly TransactionCache _transactionCache;

        public CacheContext(IStorageContext storageContext)
        {
            this._storageContext = storageContext;

            this._blockStorage = new BlockStorage(this);
            this._blockCache = new BlockCache
            (
                cacheContext: this,
                maxFlushMemorySize: 1.MILLION(),
                maxCacheMemorySize: 1.MILLION()
            );

            this._blockHeaderCache = new BlockHeaderCache
            (
                cacheContext: this,
                maxFlushMemorySize: 0,
                maxCacheMemorySize: 1.MILLION()
            );

            this._chainedBlockCache = new ChainedBlockCache
            (
                cacheContext: this,
                maxFlushMemorySize: 1.MILLION(),
                maxCacheMemorySize: 100.MILLION()
            );

            this._transactionCache = new TransactionCache
            (
                cacheContext: this,
                maxCacheMemorySize: 1.MILLION()
            );
        }

        public IStorageContext StorageContext { get { return this._storageContext; } }

        public BlockStorage BlockStorage { get { return this._blockStorage; } }

        public BlockCache BlockCache { get { return this._blockCache; } }

        public BlockHeaderCache BlockHeaderCache { get { return this._blockHeaderCache; } }

        public ChainedBlockCache ChainedBlockCache { get { return this._chainedBlockCache; } }

        public TransactionCache TransactionCache { get { return this._transactionCache; } }

        public void Dispose()<commit_msg>trying different cache values again<commit_after>﻿using BitSharp.Common;
using BitSharp.Common.ExtensionMethods;
using BitSharp.Data;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace BitSharp.Storage
{
    public class CacheContext : IDisposable
    {
        private readonly IStorageContext _storageContext;

        private readonly BlockStorage _blockStorage;
        private readonly BlockCache _blockCache;
        private readonly BlockHeaderCache _blockHeaderCache;
        private readonly ChainedBlockCache _chainedBlockCache;
        private readonly TransactionCache _transactionCache;

        public CacheContext(IStorageContext storageContext)
        {
            this._storageContext = storageContext;

            this._blockStorage = new BlockStorage(this);
            this._blockCache = new BlockCache
            (
                cacheContext: this,
                maxFlushMemorySize: 10.MILLION(),
                maxCacheMemorySize: 1.MILLION()
            );

            this._blockHeaderCache = new BlockHeaderCache
            (
                cacheContext: this,
                maxFlushMemorySize: 10.MILLION(),
                maxCacheMemorySize: 1.MILLION()
            );

            this._chainedBlockCache = new ChainedBlockCache
            (
                cacheContext: this,
                maxFlushMemorySize: 1.MILLION(),
                maxCacheMemorySize: 100.MILLION()
            );

            this._transactionCache = new TransactionCache
            (
                cacheContext: this,
                maxCacheMemorySize: 100.MILLION()
            );
        }

        public IStorageContext StorageContext { get { return this._storageContext; } }

        public BlockStorage BlockStorage { get { return this._blockStorage; } }

        public BlockCache BlockCache { get { return this._blockCache; } }

        public BlockHeaderCache BlockHeaderCache { get { return this._blockHeaderCache; } }

        public ChainedBlockCache ChainedBlockCache { get { return this._chainedBlockCache; } }

        public TransactionCache TransactionCache { get { return this._transactionCache; } }

        public void Dispose()
{'fraction_non_alphanumeric': 0.06365546218487395, 'fraction_numerical': 0.004621848739495798, 'mean_word_length': 2.3433988764044944, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3723032', 'n_tokens_mistral': 1180, 'n_tokens_neox': 1105, 'n_words': 277}