Process implements baker.Filter.
(l baker.Record, next func(baker.Record))
| 88 | |
| 89 | // Process implements baker.Filter. |
| 90 | func (f *TimestampRange) Process(l baker.Record, next func(baker.Record)) { |
| 91 | // Convert the record timestamp to unix time (int64) |
| 92 | ts, err := strconv.ParseInt(string(l.Get(f.fidx)), 10, 64) |
| 93 | if err != nil { |
| 94 | atomic.AddInt64(&f.numFilteredLines, 1) |
| 95 | return |
| 96 | } |
| 97 | |
| 98 | // Discard records having an out-of-bounds timestamp. |
| 99 | if ts < f.startDate || ts >= f.endDate { |
| 100 | atomic.AddInt64(&f.numFilteredLines, 1) |
| 101 | return |
| 102 | } |
| 103 | |
| 104 | next(l) |
| 105 | } |