Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
R
rust-rocksdb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangzongwu
rust-rocksdb
Commits
ce2469df
Commit
ce2469df
authored
Dec 08, 2015
by
Tyler Neely
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #37 from benjumanji/cf_handle_interator
Change iterator to take handle
parents
b4c3f3ab
d531fa7f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
9 deletions
+4
-9
rocksdb.rs
src/rocksdb.rs
+4
-9
No files found.
src/rocksdb.rs
View file @
ce2469df
...
...
@@ -125,19 +125,14 @@ impl DBIterator {
}
fn
new_cf
(
db
:
&
DB
,
cf_
name
:
&
str
,
cf_
handle
:
DBCFHandle
,
readopts
:
&
ReadOptions
)
->
Result
<
DBIterator
,
String
>
{
let
cf
=
db
.cfs
.get
(
cf_name
);
if
cf
.is_none
()
{
return
Err
(
format!
(
"Invalid column family: {}"
,
cf_name
)
.to_string
());
}
unsafe
{
let
iterator
=
rocksdb_ffi
::
rocksdb_create_iterator_cf
(
db
.inner
,
readopts
.inner
,
*
cf
.unwrap
()
);
cf_handle
);
rocksdb_ffi
::
rocksdb_iter_seek_to_first
(
iterator
);
Ok
(
DBIterator
{
inner
:
iterator
,
...
...
@@ -522,9 +517,9 @@ impl DB {
DBIterator
::
new
(
&
self
,
&
opts
)
}
pub
fn
iterator_cf
(
&
self
,
cf
:
&
str
)
->
Result
<
DBIterator
,
String
>
{
pub
fn
iterator_cf
(
&
self
,
cf
_handle
:
DBCFHandle
)
->
Result
<
DBIterator
,
String
>
{
let
opts
=
ReadOptions
::
new
();
DBIterator
::
new_cf
(
&
self
,
cf
,
&
opts
)
DBIterator
::
new_cf
(
&
self
,
cf
_handle
,
&
opts
)
}
pub
fn
snapshot
(
&
self
)
->
Snapshot
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment