tikv / agatedb

A persistent key-value storage in rust.
Apache License 2.0
835 stars 77 forks source link

[DNM] cache: add block cache for table #185

Open wangnengjie opened 2 years ago

wangnengjie commented 2 years ago

DO NOT MERGE! This is just an example impl for block cache. The design of LRU is copied from leveldb. (I'm a Rust beginner. So the code is quite ugly.) Currently, as agatedb opens every table in mmap mode, the block cache is nearly useless.(sorry I misunderstand mmap) I'll add some test for block cache later. relate issues: https://github.com/tikv/agatedb/issues/153 https://github.com/tikv/agatedb/issues/164