public StorageManager(IRocksDbContext rocksDbContext) { var versionIndexer = new VersionRepository(rocksDbContext); _versionFactory = new VersionFactory(versionIndexer.GetVersion(0)); foreach (var repository in Enum.GetValues(typeof(RepositoryType)).Cast <RepositoryType>()) { _repositoryManagers[(uint)repository] = new RepositoryManager( (uint)repository, rocksDbContext, _versionFactory, versionIndexer ); } }
public RepositoryManager( uint repositoryId, IRocksDbContext dbContext, VersionFactory versionFactory, VersionRepository versionRepository ) { _repositoryId = repositoryId; _dbContext = dbContext; _versionFactory = versionFactory; _versionRepository = versionRepository; var storageContext = new NodeRepository(dbContext); TrieMap = new TrieHashMap(storageContext, versionFactory); LatestVersion = _versionRepository.GetVersion(_repositoryId); }