Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implement a new reader for on-disk files, that reads the data out of the file
rather than mmapping it.
It's a bit simple right now, so it reloads each line from the file whenever it
wants to display it. It would be better to go through some kind of LRU block
cache for loading chunks of the file. The cache can be flushed whenever we
detect a reload is necessary.
The heuristic for append-vs-reload is whether the last 4k of the file has
changed or not. Also, any time we try to parse a line and fine a newline
in the middle of the line, we trigger a full reload.
This should help with #8 and #9, as we now watch the file and load new contents
if the file is appended to, or reload the file if the contents change or the
file is truncated.
The mmap implementation is retained in case it will be useful, but for now is
unused.