mirror of
https://github.com/ceph/ceph
synced 2025-01-20 01:51:34 +00:00
pybind: make the binding aware about rados_nobjects_list_next2().
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
This commit is contained in:
parent
05dca8aa33
commit
da5d4c813f
@ -191,6 +191,13 @@ cdef extern from "rados/librados.h" nogil:
|
||||
|
||||
int rados_nobjects_list_open(rados_ioctx_t io, rados_list_ctx_t *ctx)
|
||||
int rados_nobjects_list_next(rados_list_ctx_t ctx, const char **entry, const char **key, const char **nspace)
|
||||
int rados_nobjects_list_next2(rados_list_ctx_t ctx,
|
||||
const char **entry,
|
||||
const char **key,
|
||||
const char **nspace,
|
||||
size_t *entry_size,
|
||||
size_t *key_size,
|
||||
size_t *nspace)
|
||||
void rados_nobjects_list_close(rados_list_ctx_t ctx)
|
||||
|
||||
int rados_ioctx_pool_requires_alignment2(rados_ioctx_t io, int * requires)
|
||||
|
@ -267,6 +267,9 @@ cdef nogil:
|
||||
pass
|
||||
int rados_nobjects_list_next(rados_list_ctx_t ctx, const char **entry, const char **key, const char **nspace):
|
||||
pass
|
||||
int rados_nobjects_list_next2(rados_list_ctx_t ctx, const char **entry, const char **key, const char **nspace,
|
||||
size_t *entry_size, size_t *key_size, size_t *nspace_size):
|
||||
pass
|
||||
void rados_nobjects_list_close(rados_list_ctx_t ctx):
|
||||
pass
|
||||
|
||||
|
@ -1420,16 +1420,20 @@ cdef class ObjectIterator(object):
|
||||
const char *key_ = NULL
|
||||
const char *locator_ = NULL
|
||||
const char *nspace_ = NULL
|
||||
size_t key_size_ = 0
|
||||
size_t locator_size_ = 0
|
||||
size_t nspace_size_ = 0
|
||||
|
||||
with nogil:
|
||||
ret = rados_nobjects_list_next(self.ctx, &key_, &locator_, &nspace_)
|
||||
ret = rados_nobjects_list_next2(self.ctx, &key_, &locator_, &nspace_,
|
||||
&key_size_, &locator_size_, &nspace_size_)
|
||||
|
||||
if ret < 0:
|
||||
raise StopIteration()
|
||||
|
||||
key = decode_cstr(key_)
|
||||
locator = decode_cstr(locator_) if locator_ != NULL else None
|
||||
nspace = decode_cstr(nspace_) if nspace_ != NULL else None
|
||||
key = decode_cstr(key_[:key_size_])
|
||||
locator = decode_cstr(locator_[:locator_size_]) if locator_ != NULL else None
|
||||
nspace = decode_cstr(nspace_[:nspace_size_]) if nspace_ != NULL else None
|
||||
return Object(self.ioctx, key, locator, nspace)
|
||||
|
||||
def __dealloc__(self):
|
||||
|
Loading…
Reference in New Issue
Block a user