This is an attempt to rewrite nbdkit-readahead-filter with a different
approach. Instead of the filter reading ahead and returning that
data, the filter now simply issues .cache() (ie. prefetch) calls.
This relies on either the underlying plugin to do the right thing, or
failing that you have to inject nbdkit-cache-filter below this filter
which will do the caching on behalf of the plugin.
The patch is marked incomplete because I didn't think about the window
size stuff yet.
So some problems remain:
- We rely on being able to make parallel requests into the underlying
plugin, which means that the plugin (and filters) must be using the
PARALLEL thread model.
- I didn't test it much beyond the test suite. Does it make
realistic workloads any faster?
- In general it's probably better for the client (eg. nbdcopy) to be
issuing prefetches, since it knows the access pattern.
Rich.