Пример #1
0
 // use IndexSamplingControllerFactory.create do not instantiate directly
 internal IndexSamplingController(IndexSamplingConfig config, IndexSamplingJobFactory jobFactory, IndexSamplingJobQueue <long> jobQueue, IndexSamplingJobTracker jobTracker, IndexMapSnapshotProvider indexMapSnapshotProvider, JobScheduler scheduler, RecoveryCondition indexRecoveryCondition)
 {
     this._backgroundSampling       = config.BackgroundSampling();
     this._jobFactory               = jobFactory;
     this._indexMapSnapshotProvider = indexMapSnapshotProvider;
     this._jobQueue               = jobQueue;
     this._jobTracker             = jobTracker;
     this._scheduler              = scheduler;
     this._indexRecoveryCondition = indexRecoveryCondition;
 }
Пример #2
0
        public virtual IndexSamplingController Create(IndexMapSnapshotProvider snapshotProvider)
        {
            OnlineIndexSamplingJobFactory jobFactory = new OnlineIndexSamplingJobFactory(_storeView, _tokenNameLookup, _logProvider);

            System.Predicate <long>      samplingUpdatePredicate = CreateSamplingPredicate();
            IndexSamplingJobQueue <long> jobQueue   = new IndexSamplingJobQueue <long>(samplingUpdatePredicate);
            IndexSamplingJobTracker      jobTracker = new IndexSamplingJobTracker(_config, _scheduler);

            IndexSamplingController.RecoveryCondition indexRecoveryCondition = CreateIndexRecoveryCondition(_logProvider, _tokenNameLookup);
            return(new IndexSamplingController(_config, jobFactory, jobQueue, jobTracker, snapshotProvider, _scheduler, indexRecoveryCondition));
        }