Commit 97993162 authored by goroutine's avatar goroutine Committed by GitHub

Merge pull request #23 from disksing/disksing/update-cf

remove seekKey for iterator creation (with cf).
parents e340fdda 9e3c0af4
...@@ -159,23 +159,18 @@ impl<'a> DBIterator<'a> { ...@@ -159,23 +159,18 @@ impl<'a> DBIterator<'a> {
fn new_cf(db: &'a DB, fn new_cf(db: &'a DB,
cf_handle: DBCFHandle, cf_handle: DBCFHandle,
readopts: &ReadOptions, readopts: &ReadOptions)
key: SeekKey) -> DBIterator<'a> {
-> Result<DBIterator<'a>, String> {
unsafe { unsafe {
let iterator = let iterator =
rocksdb_ffi::rocksdb_create_iterator_cf(db.inner, rocksdb_ffi::rocksdb_create_iterator_cf(db.inner,
readopts.inner, readopts.inner,
cf_handle); cf_handle);
let mut rv = DBIterator { DBIterator {
db: db, db: db,
inner: iterator, inner: iterator,
}; }
rv.seek(key);
Ok(rv)
} }
} }
} }
...@@ -607,12 +602,9 @@ impl DB { ...@@ -607,12 +602,9 @@ impl DB {
DBIterator::new(&self, opt) DBIterator::new(&self, opt)
} }
pub fn iter_cf(&self, pub fn iter_cf(&self, cf_handle: DBCFHandle) -> DBIterator {
cf_handle: DBCFHandle,
key: SeekKey)
-> Result<DBIterator, String> {
let opts = ReadOptions::new(); let opts = ReadOptions::new();
DBIterator::new_cf(&self, cf_handle, &opts, key) DBIterator::new_cf(&self, cf_handle, &opts)
} }
pub fn snapshot(&self) -> Snapshot { pub fn snapshot(&self) -> Snapshot {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment