示例#1
0
 public AuxiliaryDataCache(
     IDownloadDataClient downloadDataClient,
     IVerifiedPackagesDataClient verifiedPackagesDataClient,
     IPopularityTransferDataClient popularityTransferDataClient,
     IAzureSearchTelemetryService telemetryService,
     ILogger <AuxiliaryDataCache> logger)
 {
     _downloadDataClient           = downloadDataClient ?? throw new ArgumentNullException(nameof(downloadDataClient));
     _verifiedPackagesDataClient   = verifiedPackagesDataClient ?? throw new ArgumentNullException(nameof(verifiedPackagesDataClient));
     _popularityTransferDataClient = popularityTransferDataClient ?? throw new ArgumentNullException(nameof(popularityTransferDataClient));
     _telemetryService             = telemetryService ?? throw new ArgumentNullException(nameof(telemetryService));
     _logger      = logger ?? throw new ArgumentNullException(nameof(logger));
     _stringCache = new StringCache();
 }
        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.");
            }
        }
示例#3
0
        public Db2AzureSearchCommand(
            INewPackageRegistrationProducer producer,
            IPackageEntityIndexActionBuilder indexActionBuilder,
            IBlobContainerBuilder blobContainerBuilder,
            IIndexBuilder indexBuilder,
            Func <IBatchPusher> batchPusherFactory,
            ICatalogClient catalogClient,
            IStorageFactory storageFactory,
            IOwnerDataClient ownerDataClient,
            IDownloadDataClient downloadDataClient,
            IVerifiedPackagesDataClient verifiedPackagesDataClient,
            IPopularityTransferDataClient popularityTransferDataClient,
            IOptionsSnapshot <Db2AzureSearchConfiguration> options,
            IOptionsSnapshot <Db2AzureSearchDevelopmentConfiguration> developmentOptions,
            ILogger <Db2AzureSearchCommand> logger)
        {
            _producer                     = producer ?? throw new ArgumentNullException(nameof(producer));
            _indexActionBuilder           = indexActionBuilder ?? throw new ArgumentNullException(nameof(indexActionBuilder));
            _blobContainerBuilder         = blobContainerBuilder ?? throw new ArgumentNullException(nameof(blobContainerBuilder));
            _indexBuilder                 = indexBuilder ?? throw new ArgumentNullException(nameof(indexBuilder));
            _batchPusherFactory           = batchPusherFactory ?? throw new ArgumentNullException(nameof(batchPusherFactory));
            _catalogClient                = catalogClient ?? throw new ArgumentNullException(nameof(catalogClient));
            _storageFactory               = storageFactory ?? throw new ArgumentNullException(nameof(storageFactory));
            _ownerDataClient              = ownerDataClient ?? throw new ArgumentNullException(nameof(ownerDataClient));
            _downloadDataClient           = downloadDataClient ?? throw new ArgumentNullException(nameof(downloadDataClient));
            _verifiedPackagesDataClient   = verifiedPackagesDataClient ?? throw new ArgumentNullException(nameof(verifiedPackagesDataClient));
            _popularityTransferDataClient = popularityTransferDataClient ?? throw new ArgumentNullException(nameof(popularityTransferDataClient));
            _options            = options ?? throw new ArgumentNullException(nameof(options));
            _developmentOptions = developmentOptions ?? throw new ArgumentNullException(nameof(developmentOptions));
            _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.");
            }
        }