Example #1
0
    public void Append(ICountableLookup lookup, IProcess caller, IReadOnlySlimRow[] filterRows)
    {
        var process = ProcessCreator.Invoke(filterRows);

        var rows     = process.TakeRowsAndReleaseOwnership(caller);
        var rowCount = 0;

        foreach (var row in rows)
        {
            rowCount++;

            string key = null;
            try
            {
                key = KeyGenerator(row);
            }
            catch (Exception ex)
            {
                throw KeyGeneratorException.Wrap(caller, row, ex);
            }

            if (string.IsNullOrEmpty(key))
            {
                continue;
            }

            lookup.AddRow(key, row);
        }

        caller?.Context.Log(LogSeverity.Debug, caller, "fetched {RowCount} rows, lookup size is {LookupSize}",
                            rowCount, lookup.Count);
    }
Example #2
0
    public void Append(ICountableLookup lookup, IProcess caller)
    {
        var allRows  = Process.TakeRowsAndReleaseOwnership(caller);
        var rowCount = 0;

        foreach (var row in allRows)
        {
            rowCount++;

            string key = null;
            try
            {
                key = KeyGenerator(row);
            }
            catch (Exception ex)
            {
                throw KeyGeneratorException.Wrap(caller, row, ex);
            }

            lookup.AddRow(key, row);
        }

        caller?.Context.Log(LogSeverity.Debug, caller, "fetched {RowCount} rows, lookup size is {LookupSize}",
                            rowCount, lookup.Count);
    }