generated from al8n/template-rs
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Refactor the project to make all WALs based on the generic implementation. - Support different memtables based on [`crossbeam-skiplist`](https://github.com/crossbeam-rs/crossbeam) or [`skl`](https://github.com/al8n/skl) - More user-friendly APIs
- Loading branch information
Showing
81 changed files
with
12,494 additions
and
9,909 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,28 @@ | ||
fn main() {} | ||
use orderwal::{ | ||
base::{OrderWal, Reader, Writer}, | ||
Builder, | ||
}; | ||
|
||
fn main() { | ||
let dir = tempfile::tempdir().unwrap(); | ||
let path = dir.path().join("not_sized.wal"); | ||
|
||
let mut wal = unsafe { | ||
Builder::new() | ||
.with_capacity(1024 * 1024) | ||
.with_create_new(true) | ||
.with_read(true) | ||
.with_write(true) | ||
.map_mut::<OrderWal<str, [u8]>, _>(&path) | ||
.unwrap() | ||
}; | ||
|
||
wal.insert("a", b"a1".as_slice()).unwrap(); | ||
wal.insert("c", b"c1".as_slice()).unwrap(); | ||
|
||
let a = wal.get("a").unwrap(); | ||
let c = wal.get("c").unwrap(); | ||
|
||
assert_eq!(a.value(), b"a1"); | ||
assert_eq!(c.value(), b"c1"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
use orderwal::{ | ||
multiple_version::{OrderWal, Reader, Writer}, | ||
Builder, | ||
}; | ||
|
||
fn main() { | ||
let dir = tempfile::tempdir().unwrap(); | ||
let path = dir.path().join("not_sized.wal"); | ||
|
||
let mut wal = unsafe { | ||
Builder::new() | ||
.with_capacity(1024 * 1024) | ||
.with_create_new(true) | ||
.with_read(true) | ||
.with_write(true) | ||
.map_mut::<OrderWal<str, [u8]>, _>(&path) | ||
.unwrap() | ||
}; | ||
|
||
wal.insert(1, "a", b"a1".as_slice()).unwrap(); | ||
wal.insert(3, "a", b"a3".as_slice()).unwrap(); | ||
wal.insert(1, "c", b"c1".as_slice()).unwrap(); | ||
wal.insert(3, "c", b"c3".as_slice()).unwrap(); | ||
|
||
let a = wal.get(2, "a").unwrap(); | ||
let c = wal.get(2, "c").unwrap(); | ||
|
||
assert_eq!(a.value(), b"a1"); | ||
assert_eq!(c.value(), b"c1"); | ||
|
||
let a = wal.get(3, "a").unwrap(); | ||
let c = wal.get(3, "c").unwrap(); | ||
|
||
assert_eq!(a.value(), b"a3"); | ||
assert_eq!(c.value(), b"c3"); | ||
} |
Oops, something went wrong.