public void AddRow(string key, IReadOnlySlimRow row) { if (string.IsNullOrEmpty(key)) { return; } Count++; if (_dictionary.TryGetValue(key, out var entry)) { if (entry is List <IReadOnlySlimRow> list) { list.Add(row); } else { _dictionary[key] = new List <IReadOnlySlimRow>() { entry as IReadOnlySlimRow, row, }; } } else { _dictionary[key] = row; } }
public ColumnRenameException(IProcess process, IReadOnlySlimRow row, string currentName, string newName) : base(process, "specified target column already exists") { Data.Add("CurrentName", currentName); Data.Add("NewName", newName); Data.Add("Row", row.ToDebugString(true)); }
public override void TransformAggregate(IReadOnlySlimRow row, ContinuousAggregate aggregate) { foreach (var aggregator in Aggregators) { aggregator.Invoke(aggregate, row); } }
public SlimRow(IReadOnlySlimRow initialValues) { _values = initialValues is SlimRow slimRow ? new Dictionary <string, object>(slimRow._values, StringComparer.OrdinalIgnoreCase) : initialValues is DictionaryRow dictionaryRow ? new Dictionary <string, object>(dictionaryRow._values, StringComparer.OrdinalIgnoreCase) : new Dictionary <string, object>(initialValues.Values, StringComparer.OrdinalIgnoreCase); }
public InvalidValueException(IProcess process, IReadOnlySlimRow row, string column) : base(process, "invalid value found") { var value = row[column]; Data.Add("Column", column); Data.Add("Value", value != null ? value.ToString() + " (" + value.GetType().GetFriendlyTypeName() + ")" : "NULL"); Data.Add("Row", row.ToDebugString(true)); }
public void AddRow(string key, IReadOnlySlimRow row) { if (string.IsNullOrEmpty(key)) return; Count++; _dictionary.TryGetValue(key, out var count); _dictionary[key] = count + 1; }
public bool Equals(IReadOnlySlimRow leftRow, IReadOnlySlimRow rightRow) { if (ComparerDelegate == null) { throw new ArgumentException(nameof(ComparerDelegate) + " can not be null"); } return(ComparerDelegate.Invoke(leftRow, rightRow)); }
public static ProcessExecutionException Wrap(IProcess process, IReadOnlySlimRow row, Exception ex) { if (ex is ProcessExecutionException pex && (pex.Data["Row"] is string rowString) && string.Equals(rowString, row.ToDebugString(), StringComparison.Ordinal)) { return(pex); } return(new ProcessExecutionException(process, row, ex)); }
public string CreateRowStatement(NamedConnectionString connectionString, IReadOnlySlimRow row, WriteToTableMutator operation) { var startIndex = operation.ParameterCount; foreach (var column in _tableDefinition.Columns) { operation.CreateParameter(column, row[column.RowColumn]); } var statement = "(" + string.Join(", ", _tableDefinition.Columns.Select(_ => "@" + startIndex++.ToString("D", CultureInfo.InvariantCulture))) + ")"; return(statement); }
public IRow CreateRow(IProcess process, IReadOnlySlimRow source) { var row = (IRow)Activator.CreateInstance(RowType); row.Init(this, process, Interlocked.Increment(ref _nextRowUid), source.Values); row.Tag = source.Tag; foreach (var listener in Listeners) { listener.OnRowCreated(row, process); } return(row); }
public static EtlException Wrap(IProcess process, IReadOnlySlimRow row, Exception ex) { if (ex is KeyGeneratorException eex) { var str = row.ToDebugString(true); if ((eex.Data["Row"] is string rowString) && string.Equals(rowString, str, StringComparison.Ordinal)) { return(eex); } else { eex.Data["Row"] = str; return(eex); } }
public bool Equals(IReadOnlySlimRow leftRow, IReadOnlySlimRow rightRow) { if (leftRow == rightRow) { return(true); } if (leftRow == null || rightRow == null) { return(false); } if (Columns != null) { if (ColumnsToIgnore != null) { throw new ArgumentException(nameof(ColumnsToIgnore) + " can not be set if " + nameof(Columns) + " is set"); } foreach (var column in Columns) { if (!DefaultValueComparer.ValuesAreEqual(leftRow[column], rightRow[column])) { return(false); } } } else { var columnsToIgnore = ColumnsToIgnore != null ? new HashSet <string>(ColumnsToIgnore) : null; foreach (var kvp in leftRow.Values) { if (columnsToIgnore?.Contains(kvp.Key) == true) { continue; } if (!DefaultValueComparer.ValuesAreEqual(kvp.Value, rightRow[kvp.Key])) { return(false); } } foreach (var kvp in rightRow.Values) { if (columnsToIgnore?.Contains(kvp.Key) == true) { continue; } if (!DefaultValueComparer.ValuesAreEqual(kvp.Value, leftRow[kvp.Key])) { return(false); } } } return(true); }
public RowContainsErrorException(IProcess process, IReadOnlySlimRow row) : base(process, "error found in a row") { Data.Add("Row", row.ToDebugString(true)); }
public NoMatchException(IProcess process, IReadOnlySlimRow row, string key) : base(process, "no match") { Data.Add("Row", row.ToDebugString(true)); Data.Add("Key", key); }
public void AddRow(IReadOnlySlimRow row) { _queue?.Enqueue(row); }
public abstract void TransformAggregate(IReadOnlySlimRow row, ContinuousAggregate aggregate);
public ProcessExecutionException(IProcess process, IReadOnlySlimRow row, Exception innerException) : this(process, "error raised during the execution of a process", innerException) { Data.Add("Row", row.ToDebugString()); }
public JoinMatchCustomActionDelegateException(IProcess process, Exception innerException, string delegateName, IReadOnlySlimRow row, IReadOnlySlimRow match) : base(process, "error during the execution of a " + delegateName + " delegate", innerException) { Data.Add("Row", row.ToDebugString(true)); Data.Add("Match", match.ToDebugString()); }
public void Copy(IReadOnlySlimRow sourceRow, List <KeyValuePair <string, object> > targetValues) { targetValues.Add(new KeyValuePair <string, object>(ToColumn, sourceRow[FromColumn])); }
public DuplicateKeyException(IProcess process, IReadOnlySlimRow row, string key) : base(process, "duplicate keys found") { Data.Add("Key", key); Data.Add("Row", row.ToDebugString(true)); }
public ProcessExecutionException(IProcess process, IReadOnlySlimRow row, string message, Exception innerException) : base(process, message, innerException) { Data.Add("Row", row.ToDebugString()); }
public MatchException(IProcess process, IReadOnlySlimRow row) : base(process, "match") { Data.Add("Row", row.ToDebugString(true)); }
public InvalidValuesException(IProcess process, IReadOnlySlimRow row) : base(process, "invalid values found") { Data.Add("Row", row.ToDebugString(true)); }
public KeyGeneratorException(IProcess process, IReadOnlySlimRow row, Exception innerException) : base(process, "error during generating key for a row", innerException) { Data.Add("Row", row.ToDebugString(true)); }
public TooManyMatchActionDelegateException(IProcess process, IReadOnlySlimRow row, Exception innerException) : base(process, "error during the execution of a " + nameof(TooManyMatchAction) + "." + nameof(TooManyMatchAction.CustomAction) + " delegate", innerException) { Data.Add("Row", row.ToDebugString(true)); }