Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Python Rocksdb
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
public
Python Rocksdb
Commits
ccfa2b52
Commit
ccfa2b52
authored
11 years ago
by
hofmockel
Browse files
Options
Downloads
Patches
Plain Diff
Iterator notifies errors via 'it.status()'
parent
0d20a256
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
rocksdb/_rocksdb.pyx
+8
-0
8 additions, 0 deletions
rocksdb/_rocksdb.pyx
with
8 additions
and
0 deletions
rocksdb/_rocksdb.pyx
+
8
−
0
View file @
ccfa2b52
...
...
@@ -1259,6 +1259,7 @@ cdef class BaseIterator(object):
cdef
object
ret
=
self
.
get_ob
()
with
nogil
:
self
.
ptr
.
Next
()
check_status
(
self
.
ptr
.
status
())
return
ret
def
__reversed__
(
self
):
...
...
@@ -1267,15 +1268,18 @@ cdef class BaseIterator(object):
cpdef
seek_to_first
(
self
):
with
nogil
:
self
.
ptr
.
SeekToFirst
()
check_status
(
self
.
ptr
.
status
())
cpdef
seek_to_last
(
self
):
with
nogil
:
self
.
ptr
.
SeekToLast
()
check_status
(
self
.
ptr
.
status
())
cpdef
seek
(
self
,
key
):
cdef
Slice
c_key
=
bytes_to_slice
(
key
)
with
nogil
:
self
.
ptr
.
Seek
(
c_key
)
check_status
(
self
.
ptr
.
status
())
cdef
object
get_ob
(
self
):
return
None
...
...
@@ -1286,6 +1290,7 @@ cdef class KeysIterator(BaseIterator):
cdef
Slice
c_key
with
nogil
:
c_key
=
self
.
ptr
.
key
()
check_status
(
self
.
ptr
.
status
())
return
slice_to_bytes
(
c_key
)
@cython.internal
...
...
@@ -1294,6 +1299,7 @@ cdef class ValuesIterator(BaseIterator):
cdef
Slice
c_value
with
nogil
:
c_value
=
self
.
ptr
.
value
()
check_status
(
self
.
ptr
.
status
())
return
slice_to_bytes
(
c_value
)
@cython.internal
...
...
@@ -1304,6 +1310,7 @@ cdef class ItemsIterator(BaseIterator):
with
nogil
:
c_key
=
self
.
ptr
.
key
()
c_value
=
self
.
ptr
.
value
()
check_status
(
self
.
ptr
.
status
())
return
(
slice_to_bytes
(
c_key
),
slice_to_bytes
(
c_value
))
@cython.internal
...
...
@@ -1334,4 +1341,5 @@ cdef class ReversedIterator(object):
cdef
object
ret
=
self
.
it
.
get_ob
()
self
.
it
.
ptr
.
Prev
()
check_status
(
self
.
it
.
ptr
.
status
())
return
ret
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment