コード例 #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);
    }
コード例 #2
0
        public void Append(ICountableLookup lookup, IProcess caller, IReadOnlySlimRow[] filterRows)
        {
            var process = ProcessCreator.Invoke(filterRows);

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

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

                string key = null;
                try
                {
                    key = KeyGenerator(row);
                }
                catch (EtlException) { throw; }
                catch (Exception)
                {
                    var exception = new ProcessExecutionException(caller, row, nameof(RowLookupBuilder) + " failed");
                    throw exception;
                }

                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);
        }