protected override ICache CreateCache(DisposableDirectory testDirectory)
        {
            var rootPathForStream = RootPathOfContentStoreForStream(testDirectory);
            var rootPathForPath   = RootPathOfContentStoreForPath(testDirectory);

            FileSystem.CreateDirectory(rootPathForStream);
            FileSystem.CreateDirectory(rootPathForPath);

            var configuration1 = ContentStoreConfiguration.CreateWithMaxSizeQuotaMB(1);
            var configuration2 = ContentStoreConfiguration.CreateWithMaxSizeQuotaMB(1);

            configuration1.Write(FileSystem, rootPathForStream).Wait();
            configuration2.Write(FileSystem, rootPathForPath).Wait();

            var memoConfig = new RocksDbMemoizationStoreConfiguration()
            {
                Database = new RocksDbContentLocationDatabaseConfiguration(rootPathForPath)
                {
                    CleanOnInitialize = false,
                    OnFailureDeleteExistingStoreAndRetry = true,
                    LogsKeepLongTerm = true,
                    MetadataGarbageCollectionEnabled = true,
                    MetadataGarbageCollectionMaximumNumberOfEntriesToKeep = MaxContentHashListItems,
                },
            };

            return(LocalCache.CreateStreamPathContentStoreInProcMemoizationStoreCache(Logger, rootPathForStream, rootPathForPath, memoConfig, clock: Clock));
        }
        private static LocalCache CreateLocalCacheWithStreamPathCas(Config config, DisposeLogger logger)
        {
            Contract.Requires(config.UseStreamCAS);

            SetDefaultsForStreamCas(config);
            var configCoreForPath = GetCasConfig(config);

            return(LocalCache.CreateStreamPathContentStoreInProcMemoizationStoreCache(
                       logger,
                       new AbsolutePath(config.StreamCAS.CacheRootPath),
                       new AbsolutePath(configCoreForPath.CacheRootPath),
                       GetInProcMemoizationStoreConfiguration(new AbsolutePath(config.CacheRootPath), config, configCoreForPath),
                       CreateConfigurationModel(config.StreamCAS),
                       CreateConfigurationModel(configCoreForPath)));
        }
Exemple #3
0
        protected override ICache CreateCache(DisposableDirectory testDirectory)
        {
            var rootPathForStream = RootPathOfContentStoreForStream(testDirectory);
            var rootPathForPath   = RootPathOfContentStoreForPath(testDirectory);

            FileSystem.CreateDirectory(rootPathForStream);
            FileSystem.CreateDirectory(rootPathForPath);

            var configuration1 = ContentStoreConfiguration.CreateWithMaxSizeQuotaMB(1);
            var configuration2 = ContentStoreConfiguration.CreateWithMaxSizeQuotaMB(1);

            configuration1.Write(FileSystem, rootPathForStream).Wait();
            configuration2.Write(FileSystem, rootPathForPath).Wait();

            var memoConfig = new SQLiteMemoizationStoreConfiguration(rootPathForPath)
            {
                MaxRowCount = MaxContentHashListItems
            };

            memoConfig.Database.JournalMode = ContentStore.SQLite.JournalMode.OFF;
            return(LocalCache.CreateStreamPathContentStoreInProcMemoizationStoreCache(Logger, rootPathForStream, rootPathForPath, memoConfig, clock: Clock));
        }