示例#1
0
 private LocalCache(
     ILogger logger,
     AbsolutePath rootPath,
     IAbsFileSystem fileSystem,
     IClock clock,
     ConfigurationModel configurationModel,
     SQLiteMemoizationStoreConfiguration memoConfig,
     ContentStoreSettings contentStoreSettings,
     LocalCacheConfiguration localCacheConfiguration)
     : base(
         () => localCacheConfiguration.EnableContentServer
             ? (IContentStore) new ServiceClientContentStore(
             logger,
             fileSystem,
             localCacheConfiguration.CacheName,
             new ServiceClientRpcConfiguration(localCacheConfiguration.GrpcPort),
             (uint)localCacheConfiguration.RetryIntervalSeconds,
             (uint)localCacheConfiguration.RetryCount,
             scenario: localCacheConfiguration.ScenarioName)
             : new FileSystemContentStore(
             fileSystem,
             clock,
             rootPath,
             configurationModel: configurationModel,
             settings: contentStoreSettings),
         () => new SQLiteMemoizationStore(
             logger,
             clock ?? SystemClock.Instance,
             memoConfig),
         PersistentId.Load(fileSystem, rootPath / IdFileName))
 {
     _fileSystem = fileSystem;
 }
示例#2
0
 private LocalCache(
     ILogger logger,
     AbsolutePath rootPath,
     IAbsFileSystem fileSystem,
     IClock clock,
     ServiceClientContentStoreConfiguration configuration,
     MemoizationStoreConfiguration memoConfig)
     : base(
         () => new ServiceClientContentStore(
             logger, fileSystem, configuration),
         CreateMemoizationStoreFactory(logger, clock, memoConfig),
         PersistentId.Load(fileSystem, rootPath / IdFileName))
 {
     _fileSystem = fileSystem;
 }
示例#3
0
 private LocalCache(
     ILogger logger,
     AbsolutePath rootPathForStream,
     AbsolutePath rootPathForPath,
     IAbsFileSystem fileSystem,
     IClock clock,
     ConfigurationModel configurationModelForStream,
     ConfigurationModel configurationModelForPath,
     MemoizationStoreConfiguration memoConfig,
     bool checkLocalFiles,
     bool emptyFileHashShortcutEnabled)
     : base(
         () => new StreamPathContentStore(
             () => new FileSystemContentStore(fileSystem, clock ?? SystemClock.Instance, rootPathForStream, configurationModelForStream, settings: new ContentStoreSettings() { CheckFiles = checkLocalFiles, UseEmptyFileHashShortcut = emptyFileHashShortcutEnabled }),
             () => new FileSystemContentStore(fileSystem, clock ?? SystemClock.Instance, rootPathForPath, configurationModelForPath, settings: new ContentStoreSettings() { CheckFiles = checkLocalFiles, UseEmptyFileHashShortcut = emptyFileHashShortcutEnabled })),
         CreateMemoizationStoreFactory(logger, clock, memoConfig),
         PersistentId.Load(fileSystem, rootPathForPath / IdFileName))
 {
     _fileSystem = fileSystem;
 }
示例#4
0
 private static Guid LoadPersistentCacheGuid(AbsolutePath rootPath, IAbsFileSystem fileSystem)
 {
     return(PersistentId.Load(fileSystem, rootPath / IdFileName));
 }