예제 #1
0
 internal LogBuffer(IConfiguration configuration, IBulkWriter <TLog> bulkWriter)
 {
     this.configuration = configuration;
     this.bulkWriter    = bulkWriter;
     padlock            = new object();
     logs = new Dictionary <string, TLog>();
 }
예제 #2
0
        public IEtlPipeline WriteTo(IBulkWriter <TOut> bulkWriter)
        {
            var step = new BulkWriterEtlPipelineStep <TOut>(this, bulkWriter);

            PipelineContext.AddStep(step);

            return(PipelineContext.Pipeline);
        }
 public DataLockStatusChangedEventBatchProcessor(
     IBatchedDataCache <PriceEpisodeStatusChange> cache,
     IPaymentLogger logger,
     IBulkWriter <LegacyDataLockEvent> dataLockEventWriter,
     IBulkWriter <LegacyDataLockEventCommitmentVersion> dataLockEventCommitmentVersionWriter,
     IBulkWriter <LegacyDataLockEventError> dataLockEventErrorWriter,
     IBulkWriter <LegacyDataLockEventPeriod> dataLockEventPeriodWriter)
 {
     this.cache  = cache;
     this.logger = logger;
     this.dataLockEventWriter = dataLockEventWriter;
     this.dataLockEventCommitmentVersionWriter = dataLockEventCommitmentVersionWriter;
     this.dataLockEventErrorWriter             = dataLockEventErrorWriter;
     this.dataLockEventPeriodWriter            = dataLockEventPeriodWriter;
 }
예제 #4
0
        public ProviderAdjustmentRepository(
            IBulkWriter <ProviderAdjustment> bulkWriter,
            IPaymentsDataContext dataContext,
            IPaymentLogger logger,
            IConfigurationHelper configHelper,
            IMapper mapper)
        {
            this.bulkWriter  = bulkWriter;
            this.dataContext = dataContext;
            var certificateThumbprint = configHelper.GetSetting("EasCertificateThumbprint");

            var handler = new HttpClientHandler();

            handler.ClientCertificateOptions = ClientCertificateOption.Manual;
            handler.ServerCertificateCustomValidationCallback =
                (httpRequestMessage, certificate, cetChain, policyErrors) =>
            {
                var thumbprintMatches = certificate.GetCertHashString()?.Equals(certificateThumbprint);
                if (thumbprintMatches.HasValue && thumbprintMatches.Value)
                {
                    return(true);
                }

                if (policyErrors == SslPolicyErrors.None)
                {
                    return(true);
                }

                return(false);
            };

            client = new HttpClient(handler)
            {
                BaseAddress = new Uri(configHelper.GetSetting("EasApiEndpoint"))
            };


            apiClientId = configHelper.GetSetting("EasApiClientId");
            apiTenantId = configHelper.GetSetting("EasApiTenantId");
            apiScope    = configHelper.GetSetting("EasApiScope");
            apiPassword = configHelper.GetSetting("EasApiPassword");


            pageSize    = configHelper.GetSettingOrDefault("EasPageSize", 10000);
            this.mapper = mapper;
            this.logger = logger;
        }
예제 #5
0
 public DataLockStatusChangedEventBatchProcessor(
     IBatchedDataCache <DataLockStatusChanged> cache,
     IPaymentLogger logger,
     IBulkWriter <LegacyDataLockEvent> dataLockEventWriter,
     IBulkWriter <LegacyDataLockEventCommitmentVersion> dataLockEventCommitmentVersionWriter,
     IBulkWriter <LegacyDataLockEventError> dataLockEventErrorWriter,
     IBulkWriter <LegacyDataLockEventPeriod> dataLockEventPeriodWriter,
     IApprenticeshipRepository apprenticeshipRepository)
 {
     this.cache  = cache;
     this.logger = logger;
     this.dataLockEventWriter = dataLockEventWriter;
     this.dataLockEventCommitmentVersionWriter = dataLockEventCommitmentVersionWriter;
     this.dataLockEventErrorWriter             = dataLockEventErrorWriter;
     this.dataLockEventPeriodWriter            = dataLockEventPeriodWriter;
     this.apprenticeshipRepository             = apprenticeshipRepository;
 }
예제 #6
0
 public JobContextMessageHandler(IPaymentLogger logger,
                                 IFileService azureFileService,
                                 IJsonSerializationService serializationService,
                                 IEndpointInstanceFactory factory,
                                 IEarningsJobClientFactory jobClientFactory,
                                 ITelemetry telemetry,
                                 IBulkWriter <SubmittedLearnerAimModel> submittedAimWriter,
                                 ISubmittedLearnerAimBuilder submittedLearnerAimBuilder,
                                 ISubmittedLearnerAimRepository submittedLearnerAimRepository,
                                 IJobStatusService jobStatusService)
 {
     this.logger                        = logger ?? throw new ArgumentNullException(nameof(logger));
     this.azureFileService              = azureFileService ?? throw new ArgumentNullException(nameof(azureFileService));
     this.serializationService          = serializationService ?? throw new ArgumentNullException(nameof(serializationService));
     this.factory                       = factory ?? throw new ArgumentNullException(nameof(factory));
     this.jobClientFactory              = jobClientFactory ?? throw new ArgumentNullException(nameof(jobClientFactory));
     this.telemetry                     = telemetry ?? throw new ArgumentNullException(nameof(telemetry));
     this.submittedAimWriter            = submittedAimWriter;
     this.submittedLearnerAimBuilder    = submittedLearnerAimBuilder;
     this.submittedLearnerAimRepository = submittedLearnerAimRepository;
     this.jobStatusService              = jobStatusService;
 }
예제 #7
0
 public BatchProcessor(IBatchedDataCache <T> cache, IPaymentLogger logger, IBulkWriter <T> bulkWriter)
 {
     this.cache      = cache;
     this.logger     = logger;
     this.bulkWriter = bulkWriter;
 }
예제 #8
0
        public BulkExporter(IBulkWriter writer)
        {
            _writer = writer;

            // TODO: Need to emit a version identifier
        }
 public BulkWriterEtlPipelineStep(EtlPipelineStepBase <TEntity> previousStep, IBulkWriter <TEntity> bulkWriter) : base(previousStep)
 {
     _bulkWriter = bulkWriter;
 }
예제 #10
0
 public static void WriteSymbolKind(this IBulkWriter writer, NativeSymbolKind kind) => writer.WriteInt32((int)kind);
예제 #11
0
 public static Task WriteToServerAsync(this IBulkWriter writer, string destinationTable, params string[] fields)
 {
     return(writer.WriteToServerAsync(destinationTable, null, CancellationToken.None, fields));
 }
예제 #12
0
 public static void WriteToServer(this IBulkWriter writer, string destinationTable, params string[] fields)
 {
     writer.WriteToServer(destinationTable, null, fields);
 }
예제 #13
0
        private static void WriteCore(IBulkWriter writer, INativeSymbolLookup lookup)
        {
            var exporter = new BulkExporter(writer);

            exporter.Write(lookup);
        }