Ejemplo n.º 1
0
        /// <summary>
        /// Process single ETL operation
        /// </summary>
        /// <returns>Information regarding ETC process</returns>
        public OperationResult Process()
        {
            var extracted   = _extractor.Extract();
            var cleansed    = _cleanser.Cleanse(extracted);
            var transformed = _transformer.Transform(cleansed);

            return(_loader.Load(transformed));
        }
Ejemplo n.º 2
0
        public void Receive(byte[] content)
        {
            Stream input = new MemoryStream(content);
            NetworkBinaryReader reader = new NetworkBinaryReader(input);

            string dataString = reader.ReadUTF();

            R data = decoder.Transform(dataString);

            messageQueue.Post(() => listener(data));
        }
Ejemplo n.º 3
0
        private async Task SetUpData(string filePath)
        {
            string[] file = await _fileLoader.ReadFile(filePath);

            _userInterface.ShowLoadingFileMessage(filePath);

            _userInterface.ShowTransformingDataMessage();
            PrecipitationResults result = _dataTransformer.Transform(file);

            await _precipitationRepository.Add(result.GridReferences);

            _userInterface.ShowCreatingDatabaseMessage();
        }
Ejemplo n.º 4
0
        public void WriteToServer(IEnumerable <TData> records, string tableName)
        {
            Check.NotNullOrEmpty(records, nameof(records));
            Check.NotNullOrWhiteSpace(tableName, nameof(tableName));

            // Transform records
            TBulkData bulkData = _dataTransformer.Transform(records);

            // Insert Data
            _bulkInsert.Write(
                records: bulkData,
                tableName: tableName
                );

            // Dipose bulkData if needed
            (bulkData as IDisposable)?.Dispose();
        }
Ejemplo n.º 5
0
 protected override string Transform(string sourceData)
 {
     return(_transformer.Transform(sourceData));
 }
Ejemplo n.º 6
0
        private IList <ClosedOperation <Trade> > GetClosedTrades(ReportOptions reportOptions, IList <Trade> trades)
        {
            var closedTrades = tradeTransformer.Transform(trades);

            return(closedTrades.Where(x => x.CloseTrade.DateTime.Year == reportOptions.Year).ToList());
        }