コード例 #1
0
        public CreateSessionResult <IReadOnlyCacheSession> CreateReadOnlySession(Context context, string name, ImplicitPin implicitPin)
        {
            return(Tracing.CreateReadOnlySessionCall.Run(_tracer, context, name, () =>
            {
                var backingContentSessionResult = _backingContentStore.CreateSession(context, name, implicitPin);
                if (!backingContentSessionResult.Succeeded)
                {
                    return new CreateSessionResult <IReadOnlyCacheSession>(backingContentSessionResult);
                }

                IContentSession writeThroughContentSession = null;
                if (_writeThroughContentStore != null)
                {
                    var writeThroughContentSessionResult = _writeThroughContentStore.CreateSession(context, name, implicitPin);
                    if (!writeThroughContentSessionResult.Succeeded)
                    {
                        return new CreateSessionResult <IReadOnlyCacheSession>(writeThroughContentSessionResult);
                    }

                    writeThroughContentSession = writeThroughContentSessionResult.Session;
                }

                return new CreateSessionResult <IReadOnlyCacheSession>(
                    new BuildCacheReadOnlySession(
                        _fileSystem,
                        name,
                        implicitPin,
                        _cacheNamespace,
                        Id,
                        _contentHashListAdapterFactory.Create(backingContentSessionResult.Session),
                        backingContentSessionResult.Session,
                        _maxFingerprintSelectorsToFetch,
                        _minimumTimeToKeepContentHashLists,
                        _rangeOfTimeToKeepContentHashLists,
                        _fingerprintIncorporationEnabled,
                        _maxDegreeOfParallelismForIncorporateRequests,
                        _maxFingerprintsPerIncorporateRequest,
                        writeThroughContentSession,
                        _sealUnbackedContentHashLists,
                        _overrideUnixFileAccessMode,
                        _tracer,
                        _enableEagerFingerprintIncorporation,
                        _inlineFingerprintIncorporationExpiry,
                        _eagerFingerprintIncorporationNagleInterval,
                        _eagerFingerprintIncorporationNagleBatchSize,
                        _manuallyExtendContentLifetime,
                        _forceUpdateOnAddContentHashList));
            }));
        }
コード例 #2
0
        public CreateSessionResult <IReadOnlyCacheSession> CreateReadOnlySession(Context context, string name, ImplicitPin implicitPin)
        {
            return(Tracing.CreateReadOnlySessionCall.Run(_tracer, context, name, () =>
            {
                var backingContentSessionResult = _backingContentStore.CreateSession(context, name, implicitPin);
                if (!backingContentSessionResult.Succeeded)
                {
                    return new CreateSessionResult <IReadOnlyCacheSession>(backingContentSessionResult);
                }

                IContentSession writeThroughContentSession = null;
                if (_writeThroughContentStore != null)
                {
                    var writeThroughContentSessionResult = _writeThroughContentStore.CreateSession(context, name, implicitPin);
                    if (!writeThroughContentSessionResult.Succeeded)
                    {
                        return new CreateSessionResult <IReadOnlyCacheSession>(writeThroughContentSessionResult);
                    }

                    writeThroughContentSession = writeThroughContentSessionResult.Session;
                }

                return new CreateSessionResult <IReadOnlyCacheSession>(
                    new BuildCacheReadOnlySession(
                        _fileSystem,
                        name,
                        implicitPin,
                        _cacheNamespace,
                        Id,
                        _contentHashListAdapterFactory.Create(backingContentSessionResult.Session),
                        backingContentSessionResult.Session,
                        _maxFingerprintSelectorsToFetch,
                        _minimumTimeToKeepContentHashLists,
                        _rangeOfTimeToKeepContentHashLists,
                        _fingerprintIncorporationEnabled,
                        _maxDegreeOfParallelismForIncorporateRequests,
                        _maxFingerprintsPerIncorporateRequest,
                        writeThroughContentSession,
                        _sealUnbackedContentHashLists,
                        _tracer));
            }));
        }