CompressedInput is a base for creating input components that processes multiple gzip or zstd-compressed logs coming from arbitrary sources. This class implements an internal queue of files (expressed by filenames) and instantiates a number of workers to process them. Subclasses can enqueue a file f
| 53 | // a file given its filename and returns a io.ReadCloser instance for |
| 54 | // that file. |
| 55 | type CompressedInput struct { |
| 56 | // atomically-accessed, keep on top for 64-bit alignment. |
| 57 | stopping int64 |
| 58 | numProcessedLines int64 |
| 59 | |
| 60 | Opener func(fn string) (io.ReadCloser, int64, time.Time, *url.URL, error) |
| 61 | Sizer func(fn string) (int64, error) |
| 62 | Done chan bool |
| 63 | |
| 64 | files chan string |
| 65 | pool sync.Pool |
| 66 | data chan<- *baker.Data |
| 67 | stopNow chan struct{} |
| 68 | |
| 69 | stats *inputStats |
| 70 | } |
| 71 | |
| 72 | type inputStats struct { |
| 73 | // atomically-accessed, keep on top for 64-bit alignment. |
nothing calls this directly
no outgoing calls
no test coverage detected