Crates.io | faster_kvs |
lib.rs | faster_kvs |
version | 0.1.0 |
source | src |
created_at | 2019-02-28 13:21:07.036378 |
updated_at | 2019-02-28 13:21:07.036378 |
description | Rust wrapper for FASTER by Microsoft Research |
homepage | |
repository | https://github.com/Max-Meldrum/faster-rs |
max_upload_size | |
id | 117773 |
size | 14,914 |
Includes experimental C interface for FASTER. It currently assumes the KEY,VALUE types are u64. This wrapper is only focusing on Linux support.
It is probably a good idea to make sure you can compile the C++ version before you start playing around with this wrapper.
Down below are some example operations.
extern crate faster_kvs;
use faster_kvs::*;
const TABLE_SIZE: u64 = 1 << 14;
const LOG_SIZE: u64 = 17179869184;
fn main() {
if let Ok(store) = FasterKv::new(TABLE_SIZE, LOG_SIZE, String::from("storage_dir")) {
let key: u64 = 1;
let value: u64 = 1000;
// Upsert
store.upsert(key, value);
// Read-Modify-Write
let incr: u64 = 50;
let rmw = store.rmw(key, incr);
assert_eq!(rmw, status::OK);
// Read
let (status, recv) = store.read(key);
assert_eq!(read, status::OK);
assert_eq!(recv.recv().unwrap(), value);
let bad_key: u64 = 2;
let bad_read = store.read(bad_key);
assert_eq!(bad_read, status::NOT_FOUND);
}
}