void skip(size_t n) {
pos += n;
}
+
+ // For the sake of simplicity, we invalidate completed rather than
+ // for the provided extent
+ void invalidate_cache(uint64_t offset, uint64_t length) {
+ if (offset >= bl_off && offset < get_buf_end()) {
+ bl.clear();
+ bl_off = 0;
+ }
+ }
};
struct FileReader {
// of this file. If the length is 0, then it refers to the end of file.
// If the system is not caching the file contents, then this is a noop.
rocksdb::Status InvalidateCache(size_t offset, size_t length) override {
+ h->buf.invalidate_cache(offset, length);
fs->invalidate_cache(h->file, offset, length);
return rocksdb::Status::OK();
}
// of this file. If the length is 0, then it refers to the end of file.
// If the system is not caching the file contents, then this is a noop.
rocksdb::Status InvalidateCache(size_t offset, size_t length) override {
+ h->buf.invalidate_cache(offset, length);
fs->invalidate_cache(h->file, offset, length);
return rocksdb::Status::OK();
}