示例#1
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 (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)
        {
            var allRows  = Process.Evaluate(caller).TakeRowsAndReleaseOwnership();
            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);
        }