protected override IContentStore CreateStore(DisposableDirectory testDirectory, ContentStoreConfiguration configuration)
        {
            var rootPath           = testDirectory.Path;
            var configurationModel = new ConfigurationModel(configuration);
            var fsStore            = new FileSystemContentStore(FileSystem, SystemClock.Instance, rootPath / "fs", configurationModel);

            _vfsStore = new VirtualizedContentStore(fsStore, Logger, new VfsCasConfiguration.Builder()
            {
                RootPath = rootPath / "vfs",
            }.Build());

            return(_vfsStore);
        }
Пример #2
0
        /// <inheritdoc />
        protected override async Task <(BoolResult contentStoreResult, BoolResult memoizationStoreResult)> CreateAndStartStoresAsync(OperationContext context)
        {
            // Explicitly startup/shutdown inner cache so content store and memoization store wrappers do not need to startup
            await _cache.StartupAsync(context).ThrowIfFailure();

            var innerContentStore = new CacheAsContentStore(_cache, startupInnerCache: false);

            ContentStore = new VirtualizedContentStore(innerContentStore, context.TracingContext.Logger, _configuration);

            var contentStoreResult = await ContentStore.StartupAsync(context);

            MemoizationStore = new CacheAsMemoizationStore(_cache, startupInnerCache: false);

            var memoizationStoreResult = await MemoizationStore.StartupAsync(context);

            return(contentStoreResult, memoizationStoreResult);
        }