예제 #1
0
 public DatabaseAuxiliaryDataFetcher(
     ISqlConnectionFactory <GalleryDbConfiguration> connectionFactory,
     IEntitiesContextFactory entitiesContextFactory,
     IAzureSearchTelemetryService telemetryService,
     ILogger <DatabaseAuxiliaryDataFetcher> logger)
 {
     _connectionFactory      = connectionFactory ?? throw new ArgumentNullException(nameof(connectionFactory));
     _entitiesContextFactory = entitiesContextFactory ?? throw new ArgumentNullException(nameof(entitiesContextFactory));
     _telemetryService       = telemetryService ?? throw new ArgumentNullException(nameof(telemetryService));
     _logger = logger;
 }
예제 #2
0
 public AuxiliaryDataCache(
     IDownloadDataClient downloadDataClient,
     IVerifiedPackagesDataClient verifiedPackagesDataClient,
     IAzureSearchTelemetryService telemetryService,
     ILogger <AuxiliaryDataCache> logger)
 {
     _downloadDataClient         = downloadDataClient ?? throw new ArgumentNullException(nameof(downloadDataClient));
     _verifiedPackagesDataClient = verifiedPackagesDataClient ?? throw new ArgumentNullException(nameof(verifiedPackagesDataClient));
     _telemetryService           = telemetryService ?? throw new ArgumentNullException(nameof(telemetryService));
     _logger      = logger ?? throw new ArgumentNullException(nameof(logger));
     _stringCache = new StringCache();
 }
예제 #3
0
 public UpdateVerifiedPackagesCommand(
     IDatabaseAuxiliaryDataFetcher databaseFetcher,
     IVerifiedPackagesDataClient verifiedPackagesDataClient,
     IAzureSearchTelemetryService telemetryService,
     ILogger <Auxiliary2AzureSearchCommand> logger)
 {
     _databaseFetcher            = databaseFetcher ?? throw new ArgumentNullException(nameof(databaseFetcher));
     _verifiedPackagesDataClient = verifiedPackagesDataClient ?? throw new ArgumentNullException(nameof(verifiedPackagesDataClient));
     _telemetryService           = telemetryService ?? throw new ArgumentNullException(nameof(telemetryService));
     _logger      = logger ?? throw new ArgumentNullException(nameof(logger));
     _stringCache = new StringCache();
 }
예제 #4
0
 public AzureSearchService(
     IIndexOperationBuilder operationBuilder,
     ISearchIndexClientWrapper searchIndex,
     ISearchIndexClientWrapper hijackIndex,
     ISearchResponseBuilder responseBuilder,
     IAzureSearchTelemetryService telemetryService)
 {
     _operationBuilder = operationBuilder ?? throw new ArgumentNullException(nameof(operationBuilder));
     _searchIndex      = searchIndex ?? throw new ArgumentNullException(nameof(searchIndex));
     _hijackIndex      = hijackIndex ?? throw new ArgumentNullException(nameof(hijackIndex));
     _responseBuilder  = responseBuilder ?? throw new ArgumentNullException(nameof(responseBuilder));
     _telemetryService = telemetryService ?? throw new ArgumentNullException(nameof(telemetryService));
 }
예제 #5
0
        public PopularityTransferDataClient(
            ICloudBlobClient cloudBlobClient,
            IOptionsSnapshot <AzureSearchConfiguration> options,
            IAzureSearchTelemetryService telemetryService,
            ILogger <PopularityTransferDataClient> logger)
        {
            _cloudBlobClient  = cloudBlobClient ?? throw new ArgumentNullException(nameof(cloudBlobClient));
            _options          = options ?? throw new ArgumentNullException(nameof(options));
            _telemetryService = telemetryService ?? throw new ArgumentNullException(nameof(telemetryService));
            _logger           = logger ?? throw new ArgumentNullException(nameof(logger));

            _lazyContainer = new Lazy <ICloudBlobContainer>(
                () => _cloudBlobClient.GetContainerReference(_options.Value.StorageContainer));
        }
예제 #6
0
        public UpdateDownloadsCommand(
            IAuxiliaryFileClient auxiliaryFileClient,
            IDatabaseAuxiliaryDataFetcher databaseFetcher,
            IDownloadDataClient downloadDataClient,
            IDownloadSetComparer downloadSetComparer,
            IDownloadTransferrer downloadTransferrer,
            IPopularityTransferDataClient popularityTransferDataClient,
            ISearchDocumentBuilder searchDocumentBuilder,
            ISearchIndexActionBuilder indexActionBuilder,
            Func <IBatchPusher> batchPusherFactory,
            ISystemTime systemTime,
            IFeatureFlagService featureFlags,
            IOptionsSnapshot <Auxiliary2AzureSearchConfiguration> options,
            IAzureSearchTelemetryService telemetryService,
            ILogger <Auxiliary2AzureSearchCommand> logger)
        {
            _auxiliaryFileClient          = auxiliaryFileClient ?? throw new ArgumentException(nameof(auxiliaryFileClient));
            _databaseFetcher              = databaseFetcher ?? throw new ArgumentNullException(nameof(databaseFetcher));
            _downloadDataClient           = downloadDataClient ?? throw new ArgumentNullException(nameof(downloadDataClient));
            _downloadSetComparer          = downloadSetComparer ?? throw new ArgumentNullException(nameof(downloadSetComparer));
            _downloadTransferrer          = downloadTransferrer ?? throw new ArgumentNullException(nameof(downloadTransferrer));
            _popularityTransferDataClient = popularityTransferDataClient ?? throw new ArgumentNullException(nameof(popularityTransferDataClient));
            _searchDocumentBuilder        = searchDocumentBuilder ?? throw new ArgumentNullException(nameof(searchDocumentBuilder));
            _indexActionBuilder           = indexActionBuilder ?? throw new ArgumentNullException(nameof(indexActionBuilder));
            _batchPusherFactory           = batchPusherFactory ?? throw new ArgumentNullException(nameof(batchPusherFactory));
            _systemTime       = systemTime ?? throw new ArgumentNullException(nameof(systemTime));
            _featureFlags     = featureFlags ?? throw new ArgumentNullException(nameof(featureFlags));
            _options          = options ?? throw new ArgumentNullException(nameof(options));
            _telemetryService = telemetryService ?? throw new ArgumentNullException(nameof(telemetryService));
            _logger           = logger ?? throw new ArgumentNullException(nameof(logger));
            _stringCache      = new StringCache();

            if (_options.Value.MaxConcurrentBatches <= 0)
            {
                throw new ArgumentOutOfRangeException(
                          nameof(options),
                          $"The {nameof(AzureSearchJobConfiguration.MaxConcurrentBatches)} must be greater than zero.");
            }

            if (_options.Value.MaxConcurrentVersionListWriters <= 0)
            {
                throw new ArgumentOutOfRangeException(
                          nameof(options),
                          $"The {nameof(AzureSearchJobConfiguration.MaxConcurrentVersionListWriters)} must be greater than zero.");
            }
        }
예제 #7
0
 public SearchStatusService(
     ISearchIndexClientWrapper searchIndex,
     ISearchIndexClientWrapper hijackIndex,
     ISearchParametersBuilder parametersBuilder,
     IAuxiliaryDataCache auxiliaryDataCache,
     ISecretRefresher secretRefresher,
     IOptionsSnapshot <SearchServiceConfiguration> options,
     IAzureSearchTelemetryService telemetryService,
     ILogger <SearchStatusService> logger)
 {
     _searchIndex        = searchIndex ?? throw new ArgumentNullException(nameof(searchIndex));
     _hijackIndex        = hijackIndex ?? throw new ArgumentNullException(nameof(hijackIndex));
     _parametersBuilder  = parametersBuilder ?? throw new ArgumentNullException(nameof(parametersBuilder));
     _auxiliaryDataCache = auxiliaryDataCache ?? throw new ArgumentNullException(nameof(auxiliaryDataCache));
     _secretRefresher    = secretRefresher ?? throw new ArgumentNullException(nameof(secretRefresher));
     _options            = options ?? throw new ArgumentNullException(nameof(options));
     _telemetryService   = telemetryService ?? throw new ArgumentNullException(nameof(telemetryService));
     _logger             = logger ?? throw new ArgumentNullException(nameof(logger));
 }
예제 #8
0
        public AzureSearchCollectorLogic(
            ICatalogIndexActionBuilder indexActionBuilder,
            Func <IBatchPusher> batchPusherFactory,
            IDocumentFixUpEvaluator fixUpEvaluator,
            CommitCollectorUtility utility,
            IOptionsSnapshot <Catalog2AzureSearchConfiguration> options,
            IAzureSearchTelemetryService telemetryService,
            ILogger <AzureSearchCollectorLogic> logger)
        {
            _indexActionBuilder = indexActionBuilder ?? throw new ArgumentNullException(nameof(indexActionBuilder));
            _batchPusherFactory = batchPusherFactory ?? throw new ArgumentNullException(nameof(batchPusherFactory));
            _fixUpEvaluator     = fixUpEvaluator ?? throw new ArgumentNullException(nameof(fixUpEvaluator));
            _utility            = utility ?? throw new ArgumentNullException(nameof(utility));
            _options            = options ?? throw new ArgumentNullException(nameof(options));
            _telemetryService   = telemetryService ?? throw new ArgumentNullException(nameof(telemetryService));
            _logger             = logger ?? throw new ArgumentNullException(nameof(logger));

            if (_options.Value.MaxConcurrentBatches <= 0)
            {
                throw new ArgumentOutOfRangeException(
                          nameof(options),
                          $"The {nameof(AzureSearchJobConfiguration.MaxConcurrentBatches)} must be greater than zero.");
            }
        }
예제 #9
0
        public BatchPusher(
            ISearchIndexClientWrapper searchIndexClient,
            ISearchIndexClientWrapper hijackIndexClient,
            IVersionListDataClient versionListDataClient,
            IOptionsSnapshot <AzureSearchJobConfiguration> options,
            IOptionsSnapshot <AzureSearchJobDevelopmentConfiguration> developmentOptions,
            IAzureSearchTelemetryService telemetryService,
            ILogger <BatchPusher> logger)
        {
            _searchIndexClient     = searchIndexClient ?? throw new ArgumentNullException(nameof(searchIndexClient));
            _hijackIndexClient     = hijackIndexClient ?? throw new ArgumentNullException(nameof(hijackIndexClient));
            _versionListDataClient = versionListDataClient ?? throw new ArgumentNullException(nameof(versionListDataClient));
            _options            = options ?? throw new ArgumentNullException(nameof(options));
            _developmentOptions = developmentOptions ?? throw new ArgumentNullException(nameof(developmentOptions));
            _telemetryService   = telemetryService ?? throw new ArgumentNullException(nameof(telemetryService));
            _logger             = logger ?? throw new ArgumentNullException(nameof(logger));
            _idReferenceCount   = new Dictionary <string, int>(StringComparer.OrdinalIgnoreCase);

            _searchActions          = new Queue <IdAndValue <IndexAction <KeyedDocument> > >();
            _hijackActions          = new Queue <IdAndValue <IndexAction <KeyedDocument> > >();
            _versionListDataResults = new Dictionary <string, ResultAndAccessCondition <VersionListData> >();

            if (_options.Value.MaxConcurrentVersionListWriters <= 0)
            {
                throw new ArgumentOutOfRangeException(
                          nameof(options),
                          $"The {nameof(AzureSearchJobConfiguration.MaxConcurrentVersionListWriters)} must be greater than zero.");
            }

            if (_options.Value.AzureSearchBatchSize <= 0)
            {
                throw new ArgumentOutOfRangeException(
                          nameof(options),
                          $"The {nameof(AzureSearchJobConfiguration.AzureSearchBatchSize)} must be greater than zero.");
            }
        }