public LoadProcess(XElement config, CancellationTokenSource cancellationTokenSource, ILogger logger, IRowLogger rowlogger = null) { if (config == null) { throw new ArgumentNullException("Missing Config"); } _logger = logger; _config = config; _cancellationTokenSource = cancellationTokenSource; _rowlogger = rowlogger; var catalog = new AggregateCatalog(); catalog.Catalogs.Add(new AssemblyCatalog(typeof(LoadProcess).Assembly)); catalog.Catalogs.Add(new DirectoryCatalog("Engine")); _container = new CompositionContainer(catalog); var globalDictionaryBuilder = new GlobalDictionaryBuilder(); _globalData = new GlobalData(globalDictionaryBuilder.Build(_config)); }
public void Initialise(XElement config, CancellationTokenSource cancellationTokenSource, ILogger logger, IRowLogger rowlogger) { if (config == null) { throw new ConfigException("Missing Config"); } _storedProcedure = config.Attribute("procedure")?.Value; if (string.IsNullOrWhiteSpace(_storedProcedure)) { throw new ConfigException("Missing stored procedure name"); } _connStr = config.Attribute("connection")?.Value; _parameters = PropertyMapper.Map(config); }
public void Initialise(XElement config, CancellationTokenSource cancellationTokenSource, ILogger logger, IRowLogger rowlogger) { if (config == null) { throw new ArgumentNullException("Missing Config"); } _config = config; _logger = logger; _rowloggers = new List <IRowLogger>() { new RowLogger() }; if (rowlogger != null) { _rowloggers.Add(rowlogger); } _cancellationTokenSource = cancellationTokenSource; _pipeCount = Convert.ToInt32(_config.Element("pipe")?.Attribute("pipes")?.Value); int maxQueue = 50000; if (_config.Element("pipe")?.Attribute("queuesize") != null) { maxQueue = Convert.ToInt32(_config.Element("pipe")?.Attribute("queuesize").Value); } _inputQueue = new BlockingCollection <Dictionary <string, object> >(maxQueue); }
public void Initialise(XElement config, CancellationTokenSource cancellationTokenSource, ILogger logger, IRowLogger rowlogger) { if (config == null) { throw new ConfigException("Missing Config"); } _tableName = config.Attribute("table")?.Value; if (string.IsNullOrWhiteSpace(_tableName)) { throw new ConfigException("Missing table"); } _destinationTableName = config.Attribute("destinationtable")?.Value; if (string.IsNullOrWhiteSpace(_destinationTableName)) { _destinationTableName = _tableName; } if (!string.IsNullOrWhiteSpace(config.Attribute("batchsize")?.Value) && !int.TryParse(config.Attribute("batchsize")?.Value, out _batchSize)) { throw new ConfigException("Invalid batch size"); } _connStr = config.Attribute("connection")?.Value; _logger = logger; }