Skip to content

Commit

Permalink
add shared buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
hidva committed Apr 21, 2021
1 parent 778887c commit c74ced1
Show file tree
Hide file tree
Showing 4 changed files with 512 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -53,11 +53,11 @@
kuiba=!# commit;
ROLLBACK
```
- [ ] Implement PG-style shared buffer: `SharedBuf<K: Copy, V, E: EvictPolicy>`.
- [x] Implement PG-style shared buffer: `SharedBuf<K: Copy, V, E: EvictPolicy>`.

`SharedBuf<TableId, SuperVersion, LRUPolicy>` will be used to save the mapping between the table and its SuperVersion. In RocksDB, SuperVersion of ColumnFamily is memory resident. but OLAP system may have many tables, we should support swapping the SuperVersion of some infrequently used tables out to disk.

`SharedBuf<PageId, Page, FIFOPolicy>` will be used to save the xmin/xmax/hints page for table file.
`SharedBuf<TableId, SharedBuf<PageId, Page, FIFOPolicy>, LRUPolicy>` will be used to save the xmin/xmax/hints page for table file.

- [ ] Add columnar storage

Expand Down
2 changes: 1 addition & 1 deletion build.rs
Expand Up @@ -75,7 +75,7 @@ fn load_gucs() -> Gucs {
"BOOL" => gucs.bool_gucs.push(guc),
"STR" => gucs.str_gucs.push(guc),
"REAL" => gucs.real_gucs.push(guc),
_ => panic!(format!("Unknown vartype. vartype={}", vartype)),
_ => panic!("Unknown vartype. vartype={}", vartype),
}
}
gucs
Expand Down
4 changes: 4 additions & 0 deletions src/utils.rs
Expand Up @@ -31,6 +31,10 @@ use thread_local::ThreadLocal;

pub mod err;
pub mod fmgr;
mod sb;

pub use sb::new_fifo_sb;
pub use sb::SharedBuffer;

pub struct Worker {
pub cache: &'static RefCell<WorkerCache>, // thread local
Expand Down

0 comments on commit c74ced1

Please sign in to comment.