From b1a1788c651373d1bda26ff14b9f282f2c92c247 Mon Sep 17 00:00:00 2001 From: Anirudha Bose Date: Sat, 28 May 2016 02:57:31 +0530 Subject: [PATCH] Fix build and libs path in rados/setup.py * Remove rados.c from Git tree * Remove Python 2.6, 3.2, 3.3 from classifiers * Export CEPH_LIB_DIR to setup.py files in pybind Signed-off-by: Anirudha Bose --- src/pybind/Makefile.am | 1 + src/pybind/rados/rados.c | 57851 ------------------------------------ src/pybind/rados/setup.py | 34 +- 3 files changed, 18 insertions(+), 57868 deletions(-) delete mode 100644 src/pybind/rados/rados.c diff --git a/src/pybind/Makefile.am b/src/pybind/Makefile.am index 9f779dd5f8ef47..b3ecd7a46b8c1d 100644 --- a/src/pybind/Makefile.am +++ b/src/pybind/Makefile.am @@ -13,6 +13,7 @@ PY_DISTUTILS = \ CFLAGS="-iquote \${abs_srcdir}/include ${AM_CFLAGS} ${PYTHON_CFLAGS}" \ LDFLAGS="-L\${abs_builddir}/.libs $(subst -pie,,${AM_LDFLAGS}) ${PYTHON_LDFLAGS}" \ CYTHON_BUILD_DIR=$(CYTHON_BUILD_DIR) \ + CEPH_LIB_DIR="$(abs_builddir)/.libs" \ ${PYTHON} ./setup.py if WITH_RADOS diff --git a/src/pybind/rados/rados.c b/src/pybind/rados/rados.c deleted file mode 100644 index 549edd97ab248e..00000000000000 --- a/src/pybind/rados/rados.c +++ /dev/null @@ -1,57851 +0,0 @@ -/* Generated by Cython 0.24 */ - -/* BEGIN: Cython Metadata -{ - "distutils": { - "depends": [ - "/usr/include/python2.7/Python.h", - "/usr/include/python2.7/pythread.h" - ], - "extra_compile_args": [ - "-fno-strict-aliasing", - "-Wdate-time", - "-D_FORTIFY_SOURCE=2", - "-g", - "-fstack-protector-strong", - "-Wformat", - "-Werror=format-security", - "-DNDEBUG", - "-g", - "-fwrapv", - "-O2", - "-Wall", - "-Wstrict-prototypes", - "-lpython2.7", - "-lpthread", - "-ldl", - "-lutil", - "-lm", - "-Xlinker", - "-export-dynamic", - "-Wl,-O1", - "-Wl,-Bsymbolic-functions" - ], - "include_dirs": [ - "/usr/include/python2.7", - "/usr/include/x86_64-linux-gnu/python2.7" - ], - "libraries": [ - "rados", - "python2.7", - "pthread", - "dl", - "util", - "m" - ], - "library_dirs": [ - "/usr/lib/python2.7/config-x86_64-linux-gnu", - "/usr/lib" - ] - } -} -END: Cython Metadata */ - -#define PY_SSIZE_T_CLEAN -#include "Python.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) - #error Cython requires Python 2.6+ or Python 3.2+. -#else -#define CYTHON_ABI "0_24" -#include -#ifndef offsetof - #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) -#endif -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#endif -#ifndef DL_IMPORT - #define DL_IMPORT(t) t -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif -#ifndef Py_HUGE_VAL - #define Py_HUGE_VAL HUGE_VAL -#endif -#ifdef PYPY_VERSION - #define CYTHON_COMPILING_IN_PYPY 1 - #define CYTHON_COMPILING_IN_CPYTHON 0 -#else - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 1 -#endif -#if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 - #define CYTHON_USE_PYLONG_INTERNALS 1 -#endif -#if CYTHON_USE_PYLONG_INTERNALS - #include "longintrepr.h" - #undef SHIFT - #undef BASE - #undef MASK -#endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) - #define Py_OptimizeFlag 0 -#endif -#define __PYX_BUILD_PY_SSIZE_T "n" -#define CYTHON_FORMAT_SSIZE_T "z" -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) - #define __Pyx_DefaultClassType PyClass_Type -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) - #define __Pyx_DefaultClassType PyType_Type -#endif -#ifndef Py_TPFLAGS_CHECKTYPES - #define Py_TPFLAGS_CHECKTYPES 0 -#endif -#ifndef Py_TPFLAGS_HAVE_INDEX - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif -#ifndef Py_TPFLAGS_HAVE_NEWBUFFER - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif -#ifndef Py_TPFLAGS_HAVE_FINALIZE - #define Py_TPFLAGS_HAVE_FINALIZE 0 -#endif -#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ - 0 : _PyUnicode_Ready((PyObject *)(op))) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) - #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) - #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) - #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) -#else - #define CYTHON_PEP393_ENABLED 0 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) - #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) -#endif -#if CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) -#else - #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ - PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) - #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) - #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) - #define PyObject_Malloc(s) PyMem_Malloc(s) - #define PyObject_Free(p) PyMem_Free(p) - #define PyObject_Realloc(p) PyMem_Realloc(p) -#endif -#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) -#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) -#else - #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) -#endif -#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) - #define PyObject_ASCII(o) PyObject_Repr(o) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) -#endif -#ifndef PySet_CheckExact - #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) -#endif -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define PyNumber_Int PyNumber_Long -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif -#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY - #ifndef PyUnicode_InternFromString - #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) - #endif -#endif -#if PY_VERSION_HEX < 0x030200A4 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t PyInt_AsLong -#else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) -#else - #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) -#endif -#if PY_VERSION_HEX >= 0x030500B1 -#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods -#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) -#elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -typedef struct { - unaryfunc am_await; - unaryfunc am_aiter; - unaryfunc am_anext; -} __Pyx_PyAsyncMethodsStruct; -#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) -#else -#define __Pyx_PyType_AsAsync(obj) NULL -#endif -#ifndef CYTHON_RESTRICT - #if defined(__GNUC__) - #define CYTHON_RESTRICT __restrict__ - #elif defined(_MSC_VER) && _MSC_VER >= 1400 - #define CYTHON_RESTRICT __restrict - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_RESTRICT restrict - #else - #define CYTHON_RESTRICT - #endif -#endif -#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) - -#ifndef CYTHON_INLINE - #if defined(__GNUC__) - #define CYTHON_INLINE __inline__ - #elif defined(_MSC_VER) - #define CYTHON_INLINE __inline - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_INLINE inline - #else - #define CYTHON_INLINE - #endif -#endif - -#if defined(WIN32) || defined(MS_WINDOWS) - #define _USE_MATH_DEFINES -#endif -#include -#ifdef NAN -#define __PYX_NAN() ((float) NAN) -#else -static CYTHON_INLINE float __PYX_NAN() { - float value; - memset(&value, 0xFF, sizeof(value)); - return value; -} -#endif - - -#define __PYX_ERR(f_index, lineno, Ln_error) \ -{ \ - __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ -} - -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif - -#ifndef __PYX_EXTERN_C - #ifdef __cplusplus - #define __PYX_EXTERN_C extern "C" - #else - #define __PYX_EXTERN_C extern - #endif -#endif - -#define __PYX_HAVE__rados -#define __PYX_HAVE_API__rados -#include "rados/librados.h" -#include "string.h" -#include "stdio.h" -#include "pythread.h" -#include "errno.h" -#include "stdint.h" -#include "stdlib.h" -#include "time.h" -#include "sys/time.h" -#include "rados/rados_types.h" -#ifdef _OPENMP -#include -#endif /* _OPENMP */ - -#ifdef PYREX_WITHOUT_ASSERTIONS -#define CYTHON_WITHOUT_ASSERTIONS -#endif - -#ifndef CYTHON_UNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif -#ifndef CYTHON_NCP_UNUSED -# if CYTHON_COMPILING_IN_CPYTHON -# define CYTHON_NCP_UNUSED -# else -# define CYTHON_NCP_UNUSED CYTHON_UNUSED -# endif -#endif -typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; - const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; - -#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 -#define __PYX_DEFAULT_STRING_ENCODING "" -#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString -#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#define __Pyx_uchar_cast(c) ((unsigned char)c) -#define __Pyx_long_cast(x) ((long)x) -#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ - (sizeof(type) < sizeof(Py_ssize_t)) ||\ - (sizeof(type) > sizeof(Py_ssize_t) &&\ - likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX) &&\ - (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ - v == (type)PY_SSIZE_T_MIN))) ||\ - (sizeof(type) == sizeof(Py_ssize_t) &&\ - (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX))) ) -#if defined (__cplusplus) && __cplusplus >= 201103L - #include - #define __Pyx_sst_abs(value) std::abs(value) -#elif SIZEOF_INT >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) abs(value) -#elif SIZEOF_LONG >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) labs(value) -#elif defined (_MSC_VER) && defined (_M_X64) - #define __Pyx_sst_abs(value) _abs64(value) -#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define __Pyx_sst_abs(value) llabs(value) -#elif defined (__GNUC__) - #define __Pyx_sst_abs(value) __builtin_llabs(value) -#else - #define __Pyx_sst_abs(value) ((value<0) ? -value : value) -#endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); -#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) -#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) -#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) -#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) -#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) -#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) -#if PY_MAJOR_VERSION < 3 -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) -{ - const Py_UNICODE *u_end = u; - while (*u_end++) ; - return (size_t)(u_end - u - 1); -} -#else -#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen -#endif -#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) -#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode -#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) -#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) -#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -#if CYTHON_COMPILING_IN_CPYTHON -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) -#else -#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) -#endif -#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) -#if PY_MAJOR_VERSION >= 3 -#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) -#else -#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) -#endif -#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII -static int __Pyx_sys_getdefaultencoding_not_ascii; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - PyObject* ascii_chars_u = NULL; - PyObject* ascii_chars_b = NULL; - const char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - if (strcmp(default_encoding_c, "ascii") == 0) { - __Pyx_sys_getdefaultencoding_not_ascii = 0; - } else { - char ascii_chars[128]; - int c; - for (c = 0; c < 128; c++) { - ascii_chars[c] = c; - } - __Pyx_sys_getdefaultencoding_not_ascii = 1; - ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); - if (!ascii_chars_u) goto bad; - ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); - if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { - PyErr_Format( - PyExc_ValueError, - "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", - default_encoding_c); - goto bad; - } - Py_DECREF(ascii_chars_u); - Py_DECREF(ascii_chars_b); - } - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return -1; -} -#endif -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) -#else -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -static char* __PYX_DEFAULT_STRING_ENCODING; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); - if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; - strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - return -1; -} -#endif -#endif - - -/* Test for GCC > 2.95 */ -#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) - #define likely(x) __builtin_expect(!!(x), 1) - #define unlikely(x) __builtin_expect(!!(x), 0) -#else /* !__GNUC__ or GCC < 2.95 */ - #define likely(x) (x) - #define unlikely(x) (x) -#endif /* __GNUC__ */ - -static PyObject *__pyx_m; -static PyObject *__pyx_d; -static PyObject *__pyx_b; -static PyObject *__pyx_empty_tuple; -static PyObject *__pyx_empty_bytes; -static PyObject *__pyx_empty_unicode; -static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm= __FILE__; -static const char *__pyx_filename; - - -static const char *__pyx_f[] = { - "rados.pyx", - "rados.pxd", - "type.pxd", - "bool.pxd", - "complex.pxd", -}; - -/*--- Type declarations ---*/ -struct __pyx_obj_5rados_Rados; -struct __pyx_obj_5rados_Ioctx; -struct __pyx_obj_5rados_OmapIterator; -struct __pyx_obj_5rados_ObjectIterator; -struct __pyx_obj_5rados_XattrIterator; -struct __pyx_obj_5rados_SnapIterator; -struct __pyx_obj_5rados_Snap; -struct __pyx_obj_5rados_Completion; -struct __pyx_obj_5rados_WriteOp; -struct __pyx_obj_5rados_ReadOp; -struct __pyx_obj_5rados___pyx_scope_struct__requires; -struct __pyx_obj_5rados___pyx_scope_struct_1_check_type; -struct __pyx_obj_5rados___pyx_scope_struct_2_genexpr; -struct __pyx_obj_5rados___pyx_scope_struct_3_genexpr; -struct __pyx_obj_5rados___pyx_scope_struct_4_wrapper; -struct __pyx_obj_5rados___pyx_scope_struct_5_validate_func; -struct __pyx_obj_5rados___pyx_scope_struct_6_genexpr; -struct __pyx_obj_5rados___pyx_scope_struct_7_aio_read; -struct __pyx_obj_5rados___pyx_scope_struct_8_set_object_locator; -struct __pyx_obj_5rados___pyx_scope_struct_9_set_object_namespace; - -/* "rados.pxd":14 - * - * - * cdef class Rados(object): # <<<<<<<<<<<<<< - * cdef: - * rados_t cluster - */ -struct __pyx_obj_5rados_Rados { - PyObject_HEAD - rados_t cluster; - PyObject *state; - PyObject *monitor_callback; - PyObject *parsed_args; - PyObject *conf_defaults; - PyObject *conffile; - PyObject *rados_id; -}; - - -/* "rados.pxd":25 - * - * - * cdef class Ioctx(object): # <<<<<<<<<<<<<< - * cdef: - * rados_ioctx_t io - */ -struct __pyx_obj_5rados_Ioctx { - PyObject_HEAD - rados_ioctx_t io; - char *name; - PyObject *state; - PyObject *locator_key; - PyObject *nspace; - PyObject *safe_completions; - PyObject *complete_completions; - PyObject *lock; -}; - - -/* "rados.pyx":1307 - * - * - * cdef class OmapIterator(object): # <<<<<<<<<<<<<< - * """Omap iterator""" - * - */ -struct __pyx_obj_5rados_OmapIterator { - PyObject_HEAD - struct __pyx_obj_5rados_Ioctx *ioctx; - rados_omap_iter_t ctx; -}; - - -/* "rados.pyx":1347 - * - * - * cdef class ObjectIterator(object): # <<<<<<<<<<<<<< - * """rados.Ioctx Object iterator""" - * - */ -struct __pyx_obj_5rados_ObjectIterator { - PyObject_HEAD - rados_list_ctx_t ctx; - PyObject *ioctx; -}; - - -/* "rados.pyx":1394 - * - * - * cdef class XattrIterator(object): # <<<<<<<<<<<<<< - * """Extended attribute iterator""" - * - */ -struct __pyx_obj_5rados_XattrIterator { - PyObject_HEAD - rados_xattrs_iter_t it; - char *_oid; - struct __pyx_obj_5rados_Ioctx *ioctx; - PyObject *oid; -}; - - -/* "rados.pyx":1444 - * - * - * cdef class SnapIterator(object): # <<<<<<<<<<<<<< - * """Snapshot iterator""" - * - */ -struct __pyx_obj_5rados_SnapIterator { - PyObject_HEAD - struct __pyx_obj_5rados_Ioctx *ioctx; - rados_snap_t *snaps; - int max_snap; - int cur_snap; -}; - - -/* "rados.pyx":1511 - * - * - * cdef class Snap(object): # <<<<<<<<<<<<<< - * """Snapshot object""" - * cdef public Ioctx ioctx - */ -struct __pyx_obj_5rados_Snap { - PyObject_HEAD - struct __pyx_obj_5rados_Ioctx *ioctx; - PyObject *name; - rados_snap_t snap_id; -}; - - -/* "rados.pyx":1545 - * - * - * cdef class Completion(object): # <<<<<<<<<<<<<< - * """completion object""" - * - */ -struct __pyx_obj_5rados_Completion { - PyObject_HEAD - struct __pyx_obj_5rados_Ioctx *ioctx; - PyObject *oncomplete; - PyObject *onsafe; - rados_callback_t complete_cb; - rados_callback_t safe_cb; - rados_completion_t rados_comp; - PyObject *buf; -}; - - -/* "rados.pyx":1680 - * - * - * cdef class WriteOp(object): # <<<<<<<<<<<<<< - * cdef rados_write_op_t write_op - * - */ -struct __pyx_obj_5rados_WriteOp { - PyObject_HEAD - rados_write_op_t write_op; -}; - - -/* "rados.pyx":1697 - * - * - * cdef class ReadOp(object): # <<<<<<<<<<<<<< - * cdef rados_read_op_t read_op - * - */ -struct __pyx_obj_5rados_ReadOp { - PyObject_HEAD - rados_read_op_t read_op; -}; - - -/* "rados.pyx":394 - * # validate argument types of an instance method - * # kwargs is an un-ordered dict, so use args instead - * def requires(*types): # <<<<<<<<<<<<<< - * def is_type_of(v, t): - * if t is None: - */ -struct __pyx_obj_5rados___pyx_scope_struct__requires { - PyObject_HEAD - PyObject *__pyx_v_check_type; - PyObject *__pyx_v_is_type_of; - PyObject *__pyx_v_types; -}; - - -/* "rados.pyx":401 - * return isinstance(v, t) - * - * def check_type(val, arg_name, arg_type): # <<<<<<<<<<<<<< - * if isinstance(arg_type, tuple): - * if any(is_type_of(val, t) for t in arg_type): - */ -struct __pyx_obj_5rados___pyx_scope_struct_1_check_type { - PyObject_HEAD - struct __pyx_obj_5rados___pyx_scope_struct__requires *__pyx_outer_scope; - PyObject *__pyx_v_arg_type; - PyObject *__pyx_v_val; -}; - - -/* "rados.pyx":403 - * def check_type(val, arg_name, arg_type): - * if isinstance(arg_type, tuple): - * if any(is_type_of(val, t) for t in arg_type): # <<<<<<<<<<<<<< - * return - * type_names = ' or '.join('None' if t is None else t.__name__ - */ -struct __pyx_obj_5rados___pyx_scope_struct_2_genexpr { - PyObject_HEAD - struct __pyx_obj_5rados___pyx_scope_struct_1_check_type *__pyx_outer_scope; - PyObject *__pyx_v_t; -}; - - -/* "rados.pyx":405 - * if any(is_type_of(val, t) for t in arg_type): - * return - * type_names = ' or '.join('None' if t is None else t.__name__ # <<<<<<<<<<<<<< - * for t in arg_type) - * raise TypeError('%s must be %s' % (arg_name, type_names)) - */ -struct __pyx_obj_5rados___pyx_scope_struct_3_genexpr { - PyObject_HEAD - struct __pyx_obj_5rados___pyx_scope_struct_1_check_type *__pyx_outer_scope; - PyObject *__pyx_v_t; - PyObject *__pyx_t_0; - Py_ssize_t __pyx_t_1; - PyObject *(*__pyx_t_2)(PyObject *); -}; - - -/* "rados.pyx":414 - * raise TypeError('%s must be %s' % (arg_name, arg_type.__name__)) - * - * def wrapper(f): # <<<<<<<<<<<<<< - * # FIXME(sileht): this stop with - * # AttributeError: 'method_descriptor' object has no attribute '__module__' - */ -struct __pyx_obj_5rados___pyx_scope_struct_4_wrapper { - PyObject_HEAD - struct __pyx_obj_5rados___pyx_scope_struct__requires *__pyx_outer_scope; - PyObject *__pyx_v_f; -}; - - -/* "rados.pyx":418 - * # AttributeError: 'method_descriptor' object has no attribute '__module__' - * # @wraps(f) - * def validate_func(*args, **kwargs): # <<<<<<<<<<<<<< - * # ignore the `self` arg - * pos_args = zip(args[1:], types) - */ -struct __pyx_obj_5rados___pyx_scope_struct_5_validate_func { - PyObject_HEAD - struct __pyx_obj_5rados___pyx_scope_struct_4_wrapper *__pyx_outer_scope; - PyObject *__pyx_v_kwargs; -}; - - -/* "rados.pyx":421 - * # ignore the `self` arg - * pos_args = zip(args[1:], types) - * named_args = ((kwargs[name], (name, spec)) for name, spec in types # <<<<<<<<<<<<<< - * if name in kwargs) - * for arg_val, (arg_name, arg_type) in chain(pos_args, named_args): - */ -struct __pyx_obj_5rados___pyx_scope_struct_6_genexpr { - PyObject_HEAD - struct __pyx_obj_5rados___pyx_scope_struct_5_validate_func *__pyx_outer_scope; - PyObject *__pyx_v_name; - PyObject *__pyx_v_spec; - PyObject *__pyx_t_0; - Py_ssize_t __pyx_t_1; -}; - - -/* "rados.pyx":1939 - * raise make_ex(ret, "error flushing") - * - * def aio_read(self, object_name, length, offset, oncomplete): # <<<<<<<<<<<<<< - * """ - * Asychronously read data from an object - */ -struct __pyx_obj_5rados___pyx_scope_struct_7_aio_read { - PyObject_HEAD - PyObject *__pyx_v_length; - PyObject *__pyx_v_oncomplete; -}; - - -/* "rados.pyx":3090 - * - * - * def set_object_locator(func): # <<<<<<<<<<<<<< - * def retfunc(self, *args, **kwargs): - * if self.locator_key is not None: - */ -struct __pyx_obj_5rados___pyx_scope_struct_8_set_object_locator { - PyObject_HEAD - PyObject *__pyx_v_func; -}; - - -/* "rados.pyx":3103 - * - * - * def set_object_namespace(func): # <<<<<<<<<<<<<< - * def retfunc(self, *args, **kwargs): - * if self.nspace is None: - */ -struct __pyx_obj_5rados___pyx_scope_struct_9_set_object_namespace { - PyObject_HEAD - PyObject *__pyx_v_func; -}; - - -/* --- Runtime support code (head) --- */ -/* Refnanny.proto */ -#ifndef CYTHON_REFNANNY - #define CYTHON_REFNANNY 0 -#endif -#if CYTHON_REFNANNY - typedef struct { - void (*INCREF)(void*, PyObject*, int); - void (*DECREF)(void*, PyObject*, int); - void (*GOTREF)(void*, PyObject*, int); - void (*GIVEREF)(void*, PyObject*, int); - void* (*SetupContext)(const char*, int, const char*); - void (*FinishContext)(void**); - } __Pyx_RefNannyAPIStruct; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); - #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; -#ifdef WITH_THREAD - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - if (acquire_gil) {\ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ - PyGILState_Release(__pyx_gilstate_save);\ - } else {\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ - } -#else - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) -#endif - #define __Pyx_RefNannyFinishContext()\ - __Pyx_RefNanny->FinishContext(&__pyx_refnanny) - #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) - #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) - #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) - #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) -#else - #define __Pyx_RefNannyDeclarations - #define __Pyx_RefNannySetupContext(name, acquire_gil) - #define __Pyx_RefNannyFinishContext() - #define __Pyx_INCREF(r) Py_INCREF(r) - #define __Pyx_DECREF(r) Py_DECREF(r) - #define __Pyx_GOTREF(r) - #define __Pyx_GIVEREF(r) - #define __Pyx_XINCREF(r) Py_XINCREF(r) - #define __Pyx_XDECREF(r) Py_XDECREF(r) - #define __Pyx_XGOTREF(r) - #define __Pyx_XGIVEREF(r) -#endif -#define __Pyx_XDECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_XDECREF(tmp);\ - } while (0) -#define __Pyx_DECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_DECREF(tmp);\ - } while (0) -#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) -#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) - -/* PyObjectGetAttrStr.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro)) - return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif - return PyObject_GetAttr(obj, attr_name); -} -#else -#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) -#endif - -/* GetBuiltinName.proto */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name); - -/* PySequenceContains.proto */ -static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { - int result = PySequence_Contains(seq, item); - return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); -} - -/* PyObjectCall.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); -#else -#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) -#endif - -/* PyObjectCallMethO.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); -#endif - -/* PyObjectCallOneArg.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); - -/* GetModuleGlobalName.proto */ -static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); - -/* KeywordStringCheck.proto */ -static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); - -/* RaiseArgTupleInvalid.proto */ -static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, - Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); - -/* RaiseDoubleKeywords.proto */ -static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); - -/* ParseKeywords.proto */ -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ - PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ - const char* function_name); - -/* None.proto */ -static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname); - -/* StringJoin.proto */ -#if PY_MAJOR_VERSION < 3 -#define __Pyx_PyString_Join __Pyx_PyBytes_Join -#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v)) -#else -#define __Pyx_PyString_Join PyUnicode_Join -#define __Pyx_PyBaseString_Join PyUnicode_Join -#endif -#if CYTHON_COMPILING_IN_CPYTHON - #if PY_MAJOR_VERSION < 3 - #define __Pyx_PyBytes_Join _PyString_Join - #else - #define __Pyx_PyBytes_Join _PyBytes_Join - #endif -#else -static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); -#endif - -/* PyThreadStateGet.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; -#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET(); -#else -#define __Pyx_PyThreadState_declare -#define __Pyx_PyThreadState_assign -#endif - -/* PyErrFetchRestore.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#else -#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) -#endif - -/* RaiseException.proto */ -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); - -/* RaiseTooManyValuesToUnpack.proto */ -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); - -/* RaiseNeedMoreValuesToUnpack.proto */ -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); - -/* IterFinish.proto */ -static CYTHON_INLINE int __Pyx_IterFinish(void); - -/* UnpackItemEndCheck.proto */ -static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); - -/* PyDictContains.proto */ -static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) { - int result = PyDict_Contains(dict, item); - return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); -} - -/* DictGetItem.proto */ -#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY -static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { - PyObject *value; - value = PyDict_GetItemWithError(d, key); - if (unlikely(!value)) { - if (!PyErr_Occurred()) { - PyObject* args = PyTuple_Pack(1, key); - if (likely(args)) - PyErr_SetObject(PyExc_KeyError, args); - Py_XDECREF(args); - } - return NULL; - } - Py_INCREF(value); - return value; -} -#else - #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) -#endif - -/* SliceTupleAndList.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop); -static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop); -#else -#define __Pyx_PyList_GetSlice(seq, start, stop) PySequence_GetSlice(seq, start, stop) -#define __Pyx_PyTuple_GetSlice(seq, start, stop) PySequence_GetSlice(seq, start, stop) -#endif - -/* FetchCommonType.proto */ -static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); - -/* CythonFunction.proto */ -#define __Pyx_CyFunction_USED 1 -#include -#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 -#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 -#define __Pyx_CYFUNCTION_CCLASS 0x04 -#define __Pyx_CyFunction_GetClosure(f)\ - (((__pyx_CyFunctionObject *) (f))->func_closure) -#define __Pyx_CyFunction_GetClassObj(f)\ - (((__pyx_CyFunctionObject *) (f))->func_classobj) -#define __Pyx_CyFunction_Defaults(type, f)\ - ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) -#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ - ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) -typedef struct { - PyCFunctionObject func; -#if PY_VERSION_HEX < 0x030500A0 - PyObject *func_weakreflist; -#endif - PyObject *func_dict; - PyObject *func_name; - PyObject *func_qualname; - PyObject *func_doc; - PyObject *func_globals; - PyObject *func_code; - PyObject *func_closure; - PyObject *func_classobj; - void *defaults; - int defaults_pyobjects; - int flags; - PyObject *defaults_tuple; - PyObject *defaults_kwdict; - PyObject *(*defaults_getter)(PyObject *); - PyObject *func_annotations; -} __pyx_CyFunctionObject; -static PyTypeObject *__pyx_CyFunctionType = 0; -#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ - __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) -static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, - int flags, PyObject* qualname, - PyObject *self, - PyObject *module, PyObject *globals, - PyObject* code); -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, - size_t size, - int pyobjects); -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, - PyObject *tuple); -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, - PyObject *dict); -static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, - PyObject *dict); -static int __pyx_CyFunction_init(void); - -/* ListCompAppend.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { - PyListObject* L = (PyListObject*) list; - Py_ssize_t len = Py_SIZE(list); - if (likely(L->allocated > len)) { - Py_INCREF(x); - PyList_SET_ITEM(list, len, x); - Py_SIZE(list) = len+1; - return 0; - } - return PyList_Append(list, x); -} -#else -#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) -#endif - -/* GetItemInt.proto */ -#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ - (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ - __Pyx_GetItemInt_Generic(o, to_py_func(i)))) -#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ - (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); -#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ - (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, - int is_list, int wraparound, int boundscheck); - -/* WriteUnraisableException.proto */ -static void __Pyx_WriteUnraisable(const char *name, int clineno, - int lineno, const char *filename, - int full_traceback, int nogil); - -/* ForceInitThreads.proto */ -#ifndef __PYX_FORCE_INIT_THREADS - #define __PYX_FORCE_INIT_THREADS 0 -#endif - -/* PyObjectSetAttrStr.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL) -static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_setattro)) - return tp->tp_setattro(obj, attr_name, value); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_setattr)) - return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); -#endif - return PyObject_SetAttr(obj, attr_name, value); -} -#else -#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) -#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) -#endif - -/* PyObjectCallNoArg.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); -#else -#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) -#endif - -/* IncludeStringH.proto */ -#include - -/* BytesEquals.proto */ -static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); - -/* UnicodeEquals.proto */ -static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); - -/* StrEquals.proto */ -#if PY_MAJOR_VERSION >= 3 -#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals -#else -#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals -#endif - -/* GetException.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) -static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#else -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); -#endif - -/* SwapException.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#else -static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); -#endif - -/* SaveResetException.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); -#else -#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) -#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) -#endif - -/* CallableCheck.proto */ -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyCallable_Check(obj) ((obj)->ob_type->tp_call != NULL) -#else -#define __Pyx_PyCallable_Check(obj) PyCallable_Check(obj) -#endif - -/* ArgTypeTest.proto */ -static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact); - -/* ExtTypeTest.proto */ -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); - -/* PyObjectLookupSpecial.proto */ -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 -static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) { - PyObject *res; - PyTypeObject *tp = Py_TYPE(obj); -#if PY_MAJOR_VERSION < 3 - if (unlikely(PyInstance_Check(obj))) - return __Pyx_PyObject_GetAttrStr(obj, attr_name); -#endif - res = _PyType_Lookup(tp, attr_name); - if (likely(res)) { - descrgetfunc f = Py_TYPE(res)->tp_descr_get; - if (!f) { - Py_INCREF(res); - } else { - res = f(res, obj, (PyObject *)tp); - } - } else { - PyErr_SetObject(PyExc_AttributeError, attr_name); - } - return res; -} -#else -#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) -#endif - -/* ListAppend.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { - PyListObject* L = (PyListObject*) list; - Py_ssize_t len = Py_SIZE(list); - if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { - Py_INCREF(x); - PyList_SET_ITEM(list, len, x); - Py_SIZE(list) = len+1; - return 0; - } - return PyList_Append(list, x); -} -#else -#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) -#endif - -/* PyObjectCallMethod1.proto */ -static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); - -/* append.proto */ -static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); - -/* PyIntBinop.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, int inplace); -#else -#define __Pyx_PyInt_EqObjC(op1, op2, intval, inplace)\ - PyObject_RichCompare(op1, op2, Py_EQ) - #endif - -/* Import.proto */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); - -/* ImportFrom.proto */ -static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); - -/* decode_c_string.proto */ -static CYTHON_INLINE PyObject* __Pyx_decode_c_string( - const char* cstring, Py_ssize_t start, Py_ssize_t stop, - const char* encoding, const char* errors, - PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); - -/* CalculateMetaclass.proto */ -static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); - -/* Py3ClassCreate.proto */ -static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, - PyObject *mkw, PyObject *modname, PyObject *doc); -static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, - PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); - -/* GetNameInClass.proto */ -static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name); - -/* CodeObjectCache.proto */ -typedef struct { - PyCodeObject* code_object; - int code_line; -} __Pyx_CodeObjectCacheEntry; -struct __Pyx_CodeObjectCache { - int count; - int max_count; - __Pyx_CodeObjectCacheEntry* entries; -}; -static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); -static PyCodeObject *__pyx_find_code_object(int code_line); -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); - -/* AddTraceback.proto */ -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_time_t(time_t value); - -/* CIntFromPy.proto */ -static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *); - -/* CIntFromPy.proto */ -static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); - -/* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); - -/* CIntFromPy.proto */ -static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *); - -/* CIntFromPy.proto */ -static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *); - -/* CIntFromPy.proto */ -static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *); - -/* CIntFromPy.proto */ -static CYTHON_INLINE time_t __Pyx_PyInt_As_time_t(PyObject *); - -/* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); - -/* CoroutineBase.proto */ -typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyObject *); -typedef struct { - PyObject_HEAD - __pyx_coroutine_body_t body; - PyObject *closure; - PyObject *exc_type; - PyObject *exc_value; - PyObject *exc_traceback; - PyObject *gi_weakreflist; - PyObject *classobj; - PyObject *yieldfrom; - PyObject *gi_name; - PyObject *gi_qualname; - int resume_label; - char is_running; -} __pyx_CoroutineObject; -static __pyx_CoroutineObject *__Pyx__Coroutine_New(PyTypeObject *type, __pyx_coroutine_body_t body, - PyObject *closure, PyObject *name, PyObject *qualname); -static int __Pyx_Coroutine_clear(PyObject *self); -#if 1 || PY_VERSION_HEX < 0x030300B0 -static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue); -#else -#define __Pyx_PyGen_FetchStopIterationValue(pvalue) PyGen_FetchStopIterationValue(pvalue) -#endif - -/* PatchModuleWithCoroutine.proto */ -static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code); - -/* PatchGeneratorABC.proto */ -static int __Pyx_patch_abc(void); - -/* Generator.proto */ -#define __Pyx_Generator_USED -static PyTypeObject *__pyx_GeneratorType = 0; -#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType) -#define __Pyx_Generator_New(body, closure, name, qualname)\ - __Pyx__Coroutine_New(__pyx_GeneratorType, body, closure, name, qualname) -static PyObject *__Pyx_Generator_Next(PyObject *self); -static int __pyx_Generator_init(void); - -/* CheckBinaryVersion.proto */ -static int __Pyx_check_binary_version(void); - -/* PyIdentifierFromString.proto */ -#if !defined(__Pyx_PyIdentifier_FromString) -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) -#else - #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) -#endif -#endif - -/* ModuleImport.proto */ -static PyObject *__Pyx_ImportModule(const char *name); - -/* TypeImport.proto */ -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); - -/* InitStrings.proto */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); - - -/* Module declarations from 'cpython.version' */ - -/* Module declarations from '__builtin__' */ - -/* Module declarations from 'cpython.type' */ -static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; - -/* Module declarations from 'libc.string' */ - -/* Module declarations from 'libc.stdio' */ - -/* Module declarations from 'cpython.object' */ - -/* Module declarations from 'cpython.ref' */ - -/* Module declarations from 'cpython.exc' */ - -/* Module declarations from 'cpython.module' */ - -/* Module declarations from 'cpython.mem' */ - -/* Module declarations from 'cpython.tuple' */ - -/* Module declarations from 'cpython.list' */ - -/* Module declarations from 'cpython.sequence' */ - -/* Module declarations from 'cpython.mapping' */ - -/* Module declarations from 'cpython.iterator' */ - -/* Module declarations from 'cpython.number' */ - -/* Module declarations from 'cpython.int' */ - -/* Module declarations from '__builtin__' */ - -/* Module declarations from 'cpython.bool' */ -static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0; - -/* Module declarations from 'cpython.long' */ - -/* Module declarations from 'cpython.float' */ - -/* Module declarations from '__builtin__' */ - -/* Module declarations from 'cpython.complex' */ -static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0; - -/* Module declarations from 'cpython.string' */ - -/* Module declarations from 'cpython.unicode' */ - -/* Module declarations from 'cpython.dict' */ - -/* Module declarations from 'cpython.instance' */ - -/* Module declarations from 'cpython.function' */ - -/* Module declarations from 'cpython.method' */ - -/* Module declarations from 'cpython.weakref' */ - -/* Module declarations from 'cpython.getargs' */ - -/* Module declarations from 'cpython.pythread' */ - -/* Module declarations from 'cpython.pystate' */ - -/* Module declarations from 'cpython.cobject' */ - -/* Module declarations from 'cpython.oldbuffer' */ - -/* Module declarations from 'cpython.set' */ - -/* Module declarations from 'cpython.buffer' */ - -/* Module declarations from 'cpython.bytes' */ - -/* Module declarations from 'cpython.pycapsule' */ - -/* Module declarations from 'cpython' */ - -/* Module declarations from 'libc' */ - -/* Module declarations from 'libc.errno' */ - -/* Module declarations from 'libc.stdint' */ - -/* Module declarations from 'libc.stdlib' */ - -/* Module declarations from 'rados' */ -static PyTypeObject *__pyx_ptype_5rados_Rados = 0; -static PyTypeObject *__pyx_ptype_5rados_Ioctx = 0; -static PyTypeObject *__pyx_ptype_5rados_OmapIterator = 0; -static PyTypeObject *__pyx_ptype_5rados_ObjectIterator = 0; -static PyTypeObject *__pyx_ptype_5rados_XattrIterator = 0; -static PyTypeObject *__pyx_ptype_5rados_SnapIterator = 0; -static PyTypeObject *__pyx_ptype_5rados_Snap = 0; -static PyTypeObject *__pyx_ptype_5rados_Completion = 0; -static PyTypeObject *__pyx_ptype_5rados_WriteOp = 0; -static PyTypeObject *__pyx_ptype_5rados_ReadOp = 0; -static PyTypeObject *__pyx_ptype_5rados___pyx_scope_struct__requires = 0; -static PyTypeObject *__pyx_ptype_5rados___pyx_scope_struct_1_check_type = 0; -static PyTypeObject *__pyx_ptype_5rados___pyx_scope_struct_2_genexpr = 0; -static PyTypeObject *__pyx_ptype_5rados___pyx_scope_struct_3_genexpr = 0; -static PyTypeObject *__pyx_ptype_5rados___pyx_scope_struct_4_wrapper = 0; -static PyTypeObject *__pyx_ptype_5rados___pyx_scope_struct_5_validate_func = 0; -static PyTypeObject *__pyx_ptype_5rados___pyx_scope_struct_6_genexpr = 0; -static PyTypeObject *__pyx_ptype_5rados___pyx_scope_struct_7_aio_read = 0; -static PyTypeObject *__pyx_ptype_5rados___pyx_scope_struct_8_set_object_locator = 0; -static PyTypeObject *__pyx_ptype_5rados___pyx_scope_struct_9_set_object_namespace = 0; -static PyObject *__pyx_v_5rados_errno_to_exception = 0; -static PyObject *__pyx_f_5rados_make_ex(PyObject *, PyObject *); /*proto*/ -static char *__pyx_f_5rados_opt_str(PyObject *); /*proto*/ -static void *__pyx_f_5rados_realloc_chk(void *, size_t); /*proto*/ -static size_t *__pyx_f_5rados_to_csize_t_array(PyObject *); /*proto*/ -static char **__pyx_f_5rados_to_bytes_array(PyObject *); /*proto*/ -static int __pyx_f_5rados___monitor_callback(void *, char const *, char const *, uint64_t, uint64_t, uint64_t, char const *, char const *); /*proto*/ -static int __pyx_f_5rados___aio_safe_cb(rados_completion_t, void *); /*proto*/ -static int __pyx_f_5rados___aio_complete_cb(rados_completion_t, void *); /*proto*/ -#define __Pyx_MODULE_NAME "rados" -int __pyx_module_is_main_rados = 0; - -/* Implementation of 'rados' */ -static PyObject *__pyx_builtin_Exception; -static PyObject *__pyx_builtin_object; -static PyObject *__pyx_builtin_TypeError; -static PyObject *__pyx_builtin_zip; -static PyObject *__pyx_builtin_MemoryError; -static PyObject *__pyx_builtin_xrange; -static PyObject *__pyx_builtin_StopIteration; -static const char __pyx_k_c[] = "c"; -static const char __pyx_k_f[] = "f"; -static const char __pyx_k_s[] = "s"; -static const char __pyx_k_t[] = "t"; -static const char __pyx_k_v[] = "v"; -static const char __pyx_k_kb[] = "kb"; -static const char __pyx_k_or[] = " or "; -static const char __pyx_k__13[] = ""; -static const char __pyx_k__28[] = "\000"; -static const char __pyx_k_arg[] = "arg"; -static const char __pyx_k_cls[] = "cls"; -static const char __pyx_k_cmd[] = "cmd"; -static const char __pyx_k_doc[] = "__doc__"; -static const char __pyx_k_err[] = "err"; -static const char __pyx_k_key[] = "key"; -static const char __pyx_k_msg[] = "msg"; -static const char __pyx_k_oid[] = "oid"; -static const char __pyx_k_opt[] = "opt"; -static const char __pyx_k_ret[] = "ret"; -static const char __pyx_k_sec[] = "sec"; -static const char __pyx_k_str[] = "__str__"; -static const char __pyx_k_sys[] = "sys"; -static const char __pyx_k_tag[] = "tag"; -static const char __pyx_k_val[] = "val"; -static const char __pyx_k_var[] = "var"; -static const char __pyx_k_zip[] = "zip"; -static const char __pyx_k_Lock[] = "Lock"; -static const char __pyx_k_None[] = "None"; -static const char __pyx_k_args[] = "args"; -static const char __pyx_k_auid[] = "auid"; -static const char __pyx_k_conf[] = "conf"; -static const char __pyx_k_cstr[] = "cstr"; -static const char __pyx_k_data[] = "data"; -static const char __pyx_k_desc[] = "desc"; -static const char __pyx_k_exit[] = "__exit__"; -static const char __pyx_k_flag[] = "flag"; -static const char __pyx_k_func[] = "func"; -static const char __pyx_k_info[] = "info"; -static const char __pyx_k_init[] = "__init__"; -static const char __pyx_k_join[] = "join"; -static const char __pyx_k_keys[] = "keys"; -static const char __pyx_k_main[] = "__main__"; -static const char __pyx_k_name[] = "__name__"; -static const char __pyx_k_open[] = "open"; -static const char __pyx_k_path[] = "path"; -static const char __pyx_k_pgid[] = "pgid"; -static const char __pyx_k_read[] = "read"; -static const char __pyx_k_safe[] = "_safe"; -static const char __pyx_k_seek[] = "seek"; -static const char __pyx_k_self[] = "self"; -static const char __pyx_k_send[] = "send"; -static const char __pyx_k_size[] = "size"; -static const char __pyx_k_stat[] = "stat"; -static const char __pyx_k_test[] = "__test__"; -static const char __pyx_k_time[] = "time"; -static const char __pyx_k_type[] = "type_"; -static const char __pyx_k_warn[] = "warn"; -static const char __pyx_k_Error[] = "Error"; -static const char __pyx_k_OpCtx[] = "OpCtx"; -static const char __pyx_k_chain[] = "chain"; -static const char __pyx_k_close[] = "close"; -static const char __pyx_k_d_d_d[] = "%d.%d.%d"; -static const char __pyx_k_debug[] = "debug"; -static const char __pyx_k_enter[] = "__enter__"; -static const char __pyx_k_error[] = "error"; -static const char __pyx_k_extra[] = "extra"; -static const char __pyx_k_flags[] = "flags"; -static const char __pyx_k_inbuf[] = "inbuf"; -static const char __pyx_k_ioctx[] = "ioctx"; -static const char __pyx_k_items[] = "items"; -static const char __pyx_k_level[] = "level"; -static const char __pyx_k_major[] = "major"; -static const char __pyx_k_minor[] = "minor"; -static const char __pyx_k_mtime[] = "mtime"; -static const char __pyx_k_osdid[] = "osdid"; -static const char __pyx_k_rados[] = "rados"; -static const char __pyx_k_range[] = "range"; -static const char __pyx_k_setup[] = "__setup"; -static const char __pyx_k_split[] = "split"; -static const char __pyx_k_state[] = "state"; -static const char __pyx_k_throw[] = "throw"; -static const char __pyx_k_trunc[] = "trunc"; -static const char __pyx_k_types[] = "types"; -static const char __pyx_k_utf_8[] = "utf-8"; -static const char __pyx_k_value[] = "value"; -static const char __pyx_k_wraps[] = "wraps"; -static const char __pyx_k_write[] = "write"; -static const char __pyx_k_NoData[] = "NoData"; -static const char __pyx_k_Object[] = "Object"; -static const char __pyx_k_append[] = "append"; -static const char __pyx_k_client[] = "client."; -static const char __pyx_k_closed[] = "closed"; -static const char __pyx_k_cookie[] = "cookie"; -static const char __pyx_k_create[] = "create"; -static const char __pyx_k_decode[] = "decode"; -static const char __pyx_k_encode[] = "encode"; -static const char __pyx_k_exists[] = "exists"; -static const char __pyx_k_import[] = "__import__"; -static const char __pyx_k_kwargs[] = "kwargs"; -static const char __pyx_k_length[] = "length"; -static const char __pyx_k_method[] = "method"; -static const char __pyx_k_module[] = "__module__"; -static const char __pyx_k_mon_id[] = "mon_id"; -static const char __pyx_k_name_2[] = "name"; -static const char __pyx_k_nspace[] = "nspace"; -static const char __pyx_k_num_kb[] = "num_kb"; -static const char __pyx_k_num_rd[] = "num_rd"; -static const char __pyx_k_num_wr[] = "num_wr"; -static const char __pyx_k_object[] = "object"; -static const char __pyx_k_offset[] = "offset"; -static const char __pyx_k_onsafe[] = "onsafe"; -static const char __pyx_k_option[] = "option"; -static const char __pyx_k_remove[] = "remove"; -static const char __pyx_k_retval[] = "retval"; -static const char __pyx_k_rstrip[] = "rstrip"; -static const char __pyx_k_target[] = "target"; -static const char __pyx_k_type_2[] = "type"; -static const char __pyx_k_unlock[] = "unlock"; -static const char __pyx_k_values[] = "values"; -static const char __pyx_k_xrange[] = "xrange"; -static const char __pyx_k_IOError[] = "IOError"; -static const char __pyx_k_NoSpace[] = "NoSpace"; -static const char __pyx_k_Version[] = "Version"; -static const char __pyx_k_arg_val[] = "arg_val"; -static const char __pyx_k_cleanup[] = "_cleanup"; -static const char __pyx_k_cluster[] = "cluster"; -static const char __pyx_k_connect[] = "connect"; -static const char __pyx_k_default[] = "--default--"; -static const char __pyx_k_execute[] = "execute"; -static const char __pyx_k_genexpr[] = "genexpr"; -static const char __pyx_k_kb_used[] = "kb_used"; -static const char __pyx_k_loc_key[] = "loc_key"; -static const char __pyx_k_partial[] = "partial"; -static const char __pyx_k_pool_id[] = "pool_id"; -static const char __pyx_k_prepare[] = "__prepare__"; -static const char __pyx_k_python2[] = "_python2"; -static const char __pyx_k_read_op[] = "read_op"; -static const char __pyx_k_release[] = "release"; -static const char __pyx_k_removed[] = "removed"; -static const char __pyx_k_retfunc[] = "retfunc"; -static const char __pyx_k_snap_id[] = "snap_id"; -static const char __pyx_k_timeout[] = "timeout"; -static const char __pyx_k_warning[] = "warning"; -static const char __pyx_k_wrapper[] = "wrapper"; -static const char __pyx_k_TimedOut[] = "TimedOut"; -static const char __pyx_k_arg_name[] = "arg_name"; -static const char __pyx_k_arg_type[] = "arg_type"; -static const char __pyx_k_callback[] = "callback"; -static const char __pyx_k_complete[] = "_complete"; -static const char __pyx_k_conf_get[] = "conf_get"; -static const char __pyx_k_conf_set[] = "conf_set"; -static const char __pyx_k_conffile[] = "conffile"; -static const char __pyx_k_datetime[] = "datetime"; -static const char __pyx_k_duration[] = "duration"; -static const char __pyx_k_encoding[] = "encoding"; -static const char __pyx_k_kb_avail[] = "kb_avail"; -static const char __pyx_k_list_str[] = "list_str"; -static const char __pyx_k_pos_args[] = "pos_args"; -static const char __pyx_k_position[] = "position"; -static const char __pyx_k_qualname[] = "__qualname__"; -static const char __pyx_k_rados_id[] = "rados_id"; -static const char __pyx_k_requires[] = "requires"; -static const char __pyx_k_rm_xattr[] = "rm_xattr"; -static const char __pyx_k_set_omap[] = "set_omap"; -static const char __pyx_k_set_read[] = "set_read"; -static const char __pyx_k_shutdown[] = "shutdown"; -static const char __pyx_k_str_type[] = "str_type"; -static const char __pyx_k_to_write[] = "to_write"; -static const char __pyx_k_write_op[] = "write_op"; -static const char __pyx_k_CEPH_ARGS[] = "CEPH_ARGS"; -static const char __pyx_k_Exception[] = "Exception"; -static const char __pyx_k_ReadOpCtx[] = "ReadOpCtx"; -static const char __pyx_k_TypeError[] = "TypeError"; -static const char __pyx_k_connected[] = "connected"; -static const char __pyx_k_cstr_list[] = "cstr_list"; -static const char __pyx_k_functools[] = "functools"; -static const char __pyx_k_get_xattr[] = "get_xattr"; -static const char __pyx_k_itertools[] = "itertools"; -static const char __pyx_k_localtime[] = "localtime"; -static const char __pyx_k_metaclass[] = "__metaclass__"; -static const char __pyx_k_num_bytes[] = "num_bytes"; -static const char __pyx_k_num_rd_kb[] = "num_rd_kb"; -static const char __pyx_k_num_wr_kb[] = "num_wr_kb"; -static const char __pyx_k_pool_name[] = "pool_name"; -static const char __pyx_k_set_xattr[] = "set_xattr"; -static const char __pyx_k_snap_name[] = "snap_name"; -static const char __pyx_k_threading[] = "threading"; -static const char __pyx_k_to_append[] = "to_append"; -static const char __pyx_k_traceback[] = "traceback"; -static const char __pyx_k_ADMIN_AUID[] = "ADMIN_AUID"; -static const char __pyx_k_LogicError[] = "LogicError"; -static const char __pyx_k_MonitorLog[] = "MonitorLog"; -static const char __pyx_k_ObjectBusy[] = "ObjectBusy"; -static const char __pyx_k_WriteOpCtx[] = "WriteOpCtx"; -static const char __pyx_k_check_type[] = "check_type"; -static const char __pyx_k_clear_omap[] = "clear_omap"; -static const char __pyx_k_crush_rule[] = "crush_rule"; -static const char __pyx_k_get_xattrs[] = "get_xattrs"; -static const char __pyx_k_hexversion[] = "hexversion"; -static const char __pyx_k_ioctx_name[] = "ioctx_name"; -static const char __pyx_k_is_type_of[] = "is_type_of"; -static const char __pyx_k_max_return[] = "max_return"; -static const char __pyx_k_named_args[] = "named_args"; -static const char __pyx_k_old_nspace[] = "old_nspace"; -static const char __pyx_k_oncomplete[] = "oncomplete"; -static const char __pyx_k_open_ioctx[] = "open_ioctx"; -static const char __pyx_k_type_names[] = "type_names"; -static const char __pyx_k_write_full[] = "write_full"; -static const char __pyx_k_xattr_name[] = "xattr_name"; -static const char __pyx_k_MemoryError[] = "MemoryError"; -static const char __pyx_k_Object_read[] = "Object.read"; -static const char __pyx_k_Object_seek[] = "Object.seek"; -static const char __pyx_k_Object_stat[] = "Object.stat"; -static const char __pyx_k_clustername[] = "clustername"; -static const char __pyx_k_configuring[] = "configuring"; -static const char __pyx_k_create_pool[] = "create_pool"; -static const char __pyx_k_create_snap[] = "create_snap"; -static const char __pyx_k_decode_cstr[] = "decode_cstr"; -static const char __pyx_k_delete_pool[] = "delete_pool"; -static const char __pyx_k_locator_key[] = "locator_key"; -static const char __pyx_k_lock_shared[] = "lock_shared"; -static const char __pyx_k_lookup_snap[] = "lookup_snap"; -static const char __pyx_k_monitor_log[] = "monitor_log"; -static const char __pyx_k_num_objects[] = "num_objects"; -static const char __pyx_k_object_name[] = "object_name"; -static const char __pyx_k_old_locator[] = "old_locator"; -static const char __pyx_k_pool_exists[] = "pool_exists"; -static const char __pyx_k_pool_lookup[] = "pool_lookup"; -static const char __pyx_k_remove_snap[] = "remove_snap"; -static const char __pyx_k_s_must_be_s[] = "%s must be %s"; -static const char __pyx_k_start_after[] = "start_after"; -static const char __pyx_k_xattr_value[] = "xattr_value"; -static const char __pyx_k_ObjectExists[] = "ObjectExists"; -static const char __pyx_k_Object___str[] = "Object.__str__"; -static const char __pyx_k_Object_write[] = "Object.write"; -static const char __pyx_k_OpCtx___exit[] = "OpCtx.__exit__"; -static const char __pyx_k_client_admin[] = "client.admin"; -static const char __pyx_k_completion_v[] = "completion_v"; -static const char __pyx_k_error_code_d[] = ": error code %d"; -static const char __pyx_k_oncomplete_2[] = "oncomplete_"; -static const char __pyx_k_return_value[] = "return_value"; -static const char __pyx_k_Object___init[] = "Object.__init__"; -static const char __pyx_k_Object_remove[] = "Object.remove"; -static const char __pyx_k_OpCtx___enter[] = "OpCtx.__enter__"; -static const char __pyx_k_StopIteration[] = "StopIteration"; -static const char __pyx_k_The_pool_is_s[] = "The pool is %s"; -static const char __pyx_k_Version___str[] = "Version.__str__"; -static const char __pyx_k_conf_defaults[] = "conf_defaults"; -static const char __pyx_k_filter_prefix[] = "filter_prefix"; -static const char __pyx_k_fromtimestamp[] = "fromtimestamp"; -static const char __pyx_k_get_namespace[] = "get_namespace"; -static const char __pyx_k_get_omap_keys[] = "get_omap_keys"; -static const char __pyx_k_get_omap_vals[] = "get_omap_vals"; -static const char __pyx_k_malloc_failed[] = "malloc failed"; -static const char __pyx_k_remove_object[] = "remove_object"; -static const char __pyx_k_require_state[] = "require_state"; -static const char __pyx_k_set_namespace[] = "set_namespace"; -static const char __pyx_k_snap_rollback[] = "snap_rollback"; -static const char __pyx_k_validate_func[] = "validate_func"; -static const char __pyx_k_ANONYMOUS_AUID[] = "ANONYMOUS_AUID"; -static const char __pyx_k_MONITOR_LEVELS[] = "MONITOR_LEVELS"; -static const char __pyx_k_ObjectNotFound[] = "ObjectNotFound"; -static const char __pyx_k_Version___init[] = "Version.__init__"; -static const char __pyx_k_client_address[] = "client_address"; -static const char __pyx_k_completion_v_2[] = "_completion_v"; -static const char __pyx_k_conf_read_file[] = "conf_read_file"; -static const char __pyx_k_error_flushing[] = "error flushing"; -static const char __pyx_k_expire_seconds[] = "expire_seconds"; -static const char __pyx_k_get_completion[] = "__get_completion"; -static const char __pyx_k_lock_exclusive[] = "lock_exclusive"; -static const char __pyx_k_realloc_failed[] = "realloc failed"; -static const char __pyx_k_InvalidArgument[] = "InvalidArgument"; -static const char __pyx_k_IoctxStateError[] = "IoctxStateError"; -static const char __pyx_k_Object_rm_xattr[] = "Object.rm_xattr"; -static const char __pyx_k_PermissionError[] = "PermissionError"; -static const char __pyx_k_RadosStateError[] = "RadosStateError"; -static const char __pyx_k_The_object_is_s[] = "The object is %s"; -static const char __pyx_k_error_reading_s[] = "error reading %s"; -static const char __pyx_k_get_locator_key[] = "get_locator_key"; -static const char __pyx_k_operate_read_op[] = "operate_read_op"; -static const char __pyx_k_set_locator_key[] = "set_locator_key"; -static const char __pyx_k_string_to_write[] = "string_to_write"; -static const char __pyx_k_Failed_to_stat_r[] = "Failed to stat %r"; -static const char __pyx_k_ObjectStateError[] = "ObjectStateError"; -static const char __pyx_k_Object_get_xattr[] = "Object.get_xattr"; -static const char __pyx_k_Object_set_xattr[] = "Object.set_xattr"; -static const char __pyx_k_error_removing_s[] = "error removing %s"; -static const char __pyx_k_get_return_value[] = "get_return_value"; -static const char __pyx_k_operate_write_op[] = "operate_write_op"; -static const char __pyx_k_remove_omap_keys[] = "remove_omap_keys"; -static const char __pyx_k_track_completion[] = "__track_completion"; -static const char __pyx_k_MonitorLog___init[] = "MonitorLog.__init__"; -static const char __pyx_k_Object_get_xattrs[] = "Object.get_xattrs"; -static const char __pyx_k_num_object_clones[] = "num_object_clones"; -static const char __pyx_k_num_object_copies[] = "num_object_copies"; -static const char __pyx_k_Failed_to_remove_s[] = "Failed to remove '%s'"; -static const char __pyx_k_LIBRADOS_SNAP_HEAD[] = "LIBRADOS_SNAP_HEAD"; -static const char __pyx_k_get_pool_base_tier[] = "get_pool_base_tier"; -static const char __pyx_k_require_ioctx_open[] = "require_ioctx_open"; -static const char __pyx_k_s_must_be_a_string[] = "%s must be a string"; -static const char __pyx_k_set_object_locator[] = "set_object_locator"; -static const char __pyx_k_Version_information[] = " Version information "; -static const char __pyx_k_num_objects_unfound[] = "num_objects_unfound"; -static const char __pyx_k_pool_reverse_lookup[] = "pool_reverse_lookup"; -static const char __pyx_k_Failed_to_rollback_s[] = "Failed to rollback %s"; -static const char __pyx_k_IncompleteWriteError[] = "IncompleteWriteError"; -static const char __pyx_k_LIBRADOS_ALL_NSPACES[] = "LIBRADOS_ALL_NSPACES"; -static const char __pyx_k_error_opening_pool_s[] = "error opening pool '%s'"; -static const char __pyx_k_get_inconsistent_pgs[] = "get_inconsistent_pgs"; -static const char __pyx_k_get_pool_base_tier_d[] = "get_pool_base_tier(%d)"; -static const char __pyx_k_num_objects_degraded[] = "num_objects_degraded"; -static const char __pyx_k_set_object_namespace[] = "set_object_namespace"; -static const char __pyx_k_Failed_to_get_xattr_r[] = "Failed to get xattr %r"; -static const char __pyx_k_Failed_to_set_xattr_r[] = "Failed to set xattr %r"; -static const char __pyx_k_LIBRADOS_OP_FLAG_EXCL[] = "LIBRADOS_OP_FLAG_EXCL"; -static const char __pyx_k_PermissionDeniedError[] = "PermissionDeniedError"; -static const char __pyx_k_error_creating_pool_s[] = "error creating pool '%s'"; -static const char __pyx_k_error_deleting_pool_s[] = "error deleting pool '%s'"; -static const char __pyx_k_get_omap_vals_by_keys[] = "get_omap_vals_by_keys"; -static const char __pyx_k_invalid_monitor_level[] = "invalid monitor level "; -static const char __pyx_k_require_object_exists[] = "require_object_exists"; -static const char __pyx_k_error_calling_conf_get[] = "error calling conf_get"; -static const char __pyx_k_error_calling_conf_set[] = "error calling conf_set"; -static const char __pyx_k_error_writing_object_s[] = "error writing object %s"; -static const char __pyx_k_Failed_to_create_snap_s[] = "Failed to create snap %s"; -static const char __pyx_k_Failed_to_lookup_snap_s[] = "Failed to lookup snap %s"; -static const char __pyx_k_Failed_to_remove_snap_s[] = "Failed to remove snap %s"; -static const char __pyx_k_LIBRADOS_OP_FLAG_FAILOK[] = "LIBRADOS_OP_FLAG_FAILOK"; -static const char __pyx_k_error_looking_up_pool_s[] = "error looking up pool '%s'"; -static const char __pyx_k_requires_locals_wrapper[] = "requires..wrapper"; -static const char __pyx_k_class_derived_from_Error[] = " `` class, derived from `Error` "; -static const char __pyx_k_deal_with_EACCES_related[] = " deal with EACCES related. "; -static const char __pyx_k_error_appending_object_s[] = "error appending object %s"; -static const char __pyx_k_InterruptedOrTimeoutError[] = "InterruptedOrTimeoutError"; -static const char __pyx_k_LIBRADOS_OPERATION_NOFLAG[] = "LIBRADOS_OPERATION_NOFLAG"; -static const char __pyx_k_rados_snap_get_name_error[] = "rados_snap_get_name error"; -static const char __pyx_k_aio_read_locals_oncomplete[] = "aio_read..oncomplete_"; -static const char __pyx_k_error_calling_ping_monitor[] = "error calling ping_monitor"; -static const char __pyx_k_error_getting_a_completion[] = "error getting a completion"; -static const char __pyx_k_error_getting_cluster_fsid[] = "error getting cluster fsid"; -static const char __pyx_k_requires_locals_check_type[] = "requires..check_type"; -static const char __pyx_k_requires_locals_is_type_of[] = "requires..is_type_of"; -static const char __pyx_k_error_blacklisting_client_s[] = "error blacklisting client '%s'"; -static const char __pyx_k_Object_require_object_exists[] = "Object.require_object_exists"; -static const char __pyx_k_error_calling_conf_parse_env[] = "error calling conf_parse_env"; -static const char __pyx_k_error_calling_conf_read_file[] = "error calling conf_read_file"; -static const char __pyx_k_Ioctx_read_s_failed_to_read_s[] = "Ioctx.read(%s): failed to read %s"; -static const char __pyx_k_error_changing_auid_of_s_to_d[] = "error changing auid of '%s' to %d"; -static const char __pyx_k_error_iterating_over_the_omap[] = "error iterating over the omap"; -static const char __pyx_k_Failed_to_delete_key_r_xattr_r[] = "Failed to delete key %r xattr %r"; -static const char __pyx_k_LIBRADOS_OPERATION_SKIPRWLOCKS[] = "LIBRADOS_OPERATION_SKIPRWLOCKS"; -static const char __pyx_k_ObjectStateError_class_derived[] = " `ObjectStateError` class, derived from `Error` "; -static const char __pyx_k_home_ani_tryst_ceph_src_pybind[] = "/home/ani/tryst/ceph/src/pybind/rados/rados.pyx"; -static const char __pyx_k_num_objects_missing_on_primary[] = "num_objects_missing_on_primary"; -static const char __pyx_k_read_operation_context_manager[] = "read operation context manager"; -static const char __pyx_k_Error_class_derived_from_Except[] = " `Error` class, derived from `Exception` "; -static const char __pyx_k_For_watching_cluster_log_messag[] = "\n For watching cluster log messages. Instantiate an object and keep\n it around while callback is periodically called. Construct with\n 'level' to monitor 'level' messages (one of MONITOR_LEVELS).\n arg will be passed to the callback.\n\n callback will be called with:\n arg (given to __init__)\n line (the full line, including timestamp, who, level, msg)\n who (which entity issued the log message)\n timestamp_sec (sec of a struct timespec)\n timestamp_nsec (sec of a struct timespec)\n seq (sequence number)\n level (string representing the level of the log message)\n msg (the message itself)\n callback's return value is ignored\n "; -static const char __pyx_k_IOError_class_derived_from_Erro[] = " `IOError` class, derived from `Error` "; -static const char __pyx_k_IncompleteWriteError_class_deri[] = " `IncompleteWriteError` class, derived from `Error` "; -static const char __pyx_k_InterruptedOrTimeoutError_class[] = " `InterruptedOrTimeoutError` class, derived from `Error` "; -static const char __pyx_k_IoctxStateError_class_derived_f[] = " `IoctxStateError` class, derived from `Error` "; -static const char __pyx_k_Ioctx_append_s_failed_to_append[] = "Ioctx.append(%s): failed to append %s"; -static const char __pyx_k_Ioctx_write_s_failed_to_write_s[] = "Ioctx.write(%s): failed to write %s"; -static const char __pyx_k_LIBRADOS_OPERATION_IGNORE_CACHE[] = "LIBRADOS_OPERATION_IGNORE_CACHE"; -static const char __pyx_k_LIBRADOS_OP_FLAG_FADVISE_RANDOM[] = "LIBRADOS_OP_FLAG_FADVISE_RANDOM"; -static const char __pyx_k_NoData_class_derived_from_Error[] = " `NoData` class, derived from `Error` "; -static const char __pyx_k_NoSpace_class_derived_from_Erro[] = " `NoSpace` class, derived from `Error` "; -static const char __pyx_k_ObjectBusy_class_derived_from_E[] = " `ObjectBusy` class, derived from `Error` "; -static const char __pyx_k_ObjectExists_class_derived_from[] = " `ObjectExists` class, derived from `Error` "; -static const char __pyx_k_ObjectNotFound_class_derived_fr[] = " `ObjectNotFound` class, derived from `Error` "; -static const char __pyx_k_PermissionError_class_derived_f[] = " `PermissionError` class, derived from `Error` "; -static const char __pyx_k_RadosStateError_class_derived_f[] = " `RadosStateError` class, derived from `Error` "; -static const char __pyx_k_Rados_keys_and_values_must_have[] = "Rados(): keys and values must have the same number of items"; -static const char __pyx_k_This_module_is_a_thin_wrapper_a[] = "\nThis module is a thin wrapper around librados.\n\nError codes from librados are turned into exceptions that subclass\n:class:`Error`. Almost all methods may raise :class:`Error(the base class of all rados exceptions), :class:`PermissionError`\n(the base class of all rados exceptions), :class:`PermissionError`\nand :class:`IOError`, in addition to those documented for the\nmethod.\n"; -static const char __pyx_k_TimedOut_class_derived_from_Err[] = " `TimedOut` class, derived from `Error` "; -static const char __pyx_k_error_calling_rados_monitor_log[] = "error calling rados_monitor_log"; -static const char __pyx_k_error_connecting_to_the_cluster[] = "error connecting to the cluster"; -static const char __pyx_k_error_reverse_looking_up_pool_s[] = "error reverse looking up pool '%s'"; -static const char __pyx_k_write_operation_context_manager[] = "write operation context manager"; -static const char __pyx_k_Failed_to_get_rados_xattrs_for_o[] = "Failed to get rados xattrs for object %r"; -static const char __pyx_k_Failed_to_operate_read_op_for_oi[] = "Failed to operate read op for oid %s"; -static const char __pyx_k_Failed_to_operate_write_op_for_o[] = "Failed to operate write op for oid %s"; -static const char __pyx_k_Ioctx_append_s_rados_append_retu[] = "Ioctx.append(%s): rados_append returned %d, but should return zero on success."; -static const char __pyx_k_Ioctx_get_stats_s_get_stats_fail[] = "Ioctx.get_stats(%s): get_stats failed"; -static const char __pyx_k_Ioctx_rados_lock_exclusive_s_fai[] = "Ioctx.rados_lock_exclusive(%s): failed to set lock %s on %s"; -static const char __pyx_k_Ioctx_trunc_s_failed_to_truncate[] = "Ioctx.trunc(%s): failed to truncate %s"; -static const char __pyx_k_Ioctx_write_full_s_failed_to_wri[] = "Ioctx.write_full(%s): failed to write %s"; -static const char __pyx_k_Ioctx_write_full_s_rados_write_f[] = "Ioctx.write_full(%s): rados_write_full returned %d, but should return zero on success."; -static const char __pyx_k_Ioctx_write_s_rados_write_return[] = "Ioctx.write(%s): rados_write returned %d, but should return zero on success."; -static const char __pyx_k_LIBRADOS_OPERATION_BALANCE_READS[] = "LIBRADOS_OPERATION_BALANCE_READS"; -static const char __pyx_k_LIBRADOS_OPERATION_IGNORE_OVERLA[] = "LIBRADOS_OPERATION_IGNORE_OVERLAY"; -static const char __pyx_k_LIBRADOS_OPERATION_LOCALIZE_READ[] = "LIBRADOS_OPERATION_LOCALIZE_READS"; -static const char __pyx_k_LIBRADOS_OPERATION_ORDER_READS_W[] = "LIBRADOS_OPERATION_ORDER_READS_WRITES"; -static const char __pyx_k_LIBRADOS_OP_FLAG_FADVISE_DONTNEE[] = "LIBRADOS_OP_FLAG_FADVISE_DONTNEED"; -static const char __pyx_k_LIBRADOS_OP_FLAG_FADVISE_NOCACHE[] = "LIBRADOS_OP_FLAG_FADVISE_NOCACHE"; -static const char __pyx_k_LIBRADOS_OP_FLAG_FADVISE_SEQUENT[] = "LIBRADOS_OP_FLAG_FADVISE_SEQUENTIAL"; -static const char __pyx_k_LIBRADOS_OP_FLAG_FADVISE_WILLNEE[] = "LIBRADOS_OP_FLAG_FADVISE_WILLNEED"; -static const char __pyx_k_Namespace_not_set_properly_in_co[] = "Namespace not set properly in context"; -static const char __pyx_k_Rados_can_t_supply_both_rados_id[] = "Rados(): can't supply both rados_id and name"; -static const char __pyx_k_Rados_get_cluster_stats_s_get_st[] = "Rados.get_cluster_stats(%s): get_stats failed"; -static const char __pyx_k_Rados_object_wrapper_makes_the_o[] = "Rados object wrapper, makes the object look like a file"; -static const char __pyx_k_You_cannot_perform_that_operatio[] = "You cannot perform that operation on a Rados object in state %s."; -static const char __pyx_k_callback_must_be_a_callable_func[] = "callback must be a callable function or None"; -static const char __pyx_k_error_calling_conf_parse_argv_re[] = "error calling conf_parse_argv_remainder"; -static const char __pyx_k_error_calling_inconsistent_pg_li[] = "error calling inconsistent_pg_list"; -static const char __pyx_k_error_calling_rados_snap_list_fo[] = "error calling rados_snap_list for ioctx '%s'"; -static const char __pyx_k_error_iterating_over_the_extende[] = "error iterating over the extended attributes in '%s'"; -static const char __pyx_k_error_iterating_over_the_objects[] = "error iterating over the objects in ioctx '%s'"; -static const char __pyx_k_rados_Object_ioctx_s_key_s_nspac[] = "rados.Object(ioctx=%s,key=%s,nspace=%s,locator=%s)"; -static const char __pyx_k_rados_Snap_ioctx_s_name_s_snap_i[] = "rados.Snap(ioctx=%s,name=%s,snap_id=%d)"; -static const char __pyx_k_rados_initialize_failed_with_err[] = "rados_initialize failed with error code: %d"; -static const char __pyx_k_rados_ioctx_snap_get_stamp_error[] = "rados_ioctx_snap_get_stamp error"; -static const char __pyx_k_requires_locals_check_type_local[] = "requires..check_type..genexpr"; -static const char __pyx_k_requires_locals_wrapper_locals_v[] = "requires..wrapper..validate_func..genexpr"; -static const char __pyx_k_set_object_locator_locals_retfun[] = "set_object_locator..retfunc"; -static const char __pyx_k_set_object_namespace_locals_retf[] = "set_object_namespace..retfunc"; -static const char __pyx_k_requires_locals_wrapper_locals_v_2[] = "requires..wrapper..validate_func"; -static PyObject *__pyx_n_s_ADMIN_AUID; -static PyObject *__pyx_n_s_ANONYMOUS_AUID; -static PyObject *__pyx_n_s_CEPH_ARGS; -static PyObject *__pyx_n_s_Error; -static PyObject *__pyx_kp_s_Error_class_derived_from_Except; -static PyObject *__pyx_n_s_Exception; -static PyObject *__pyx_kp_s_Failed_to_create_snap_s; -static PyObject *__pyx_kp_s_Failed_to_delete_key_r_xattr_r; -static PyObject *__pyx_kp_s_Failed_to_get_rados_xattrs_for_o; -static PyObject *__pyx_kp_s_Failed_to_get_xattr_r; -static PyObject *__pyx_kp_s_Failed_to_lookup_snap_s; -static PyObject *__pyx_kp_s_Failed_to_operate_read_op_for_oi; -static PyObject *__pyx_kp_s_Failed_to_operate_write_op_for_o; -static PyObject *__pyx_kp_s_Failed_to_remove_s; -static PyObject *__pyx_kp_s_Failed_to_remove_snap_s; -static PyObject *__pyx_kp_s_Failed_to_rollback_s; -static PyObject *__pyx_kp_s_Failed_to_set_xattr_r; -static PyObject *__pyx_kp_s_Failed_to_stat_r; -static PyObject *__pyx_kp_s_For_watching_cluster_log_messag; -static PyObject *__pyx_n_s_IOError; -static PyObject *__pyx_kp_s_IOError_class_derived_from_Erro; -static PyObject *__pyx_n_s_IncompleteWriteError; -static PyObject *__pyx_kp_s_IncompleteWriteError_class_deri; -static PyObject *__pyx_n_s_InterruptedOrTimeoutError; -static PyObject *__pyx_kp_s_InterruptedOrTimeoutError_class; -static PyObject *__pyx_n_s_InvalidArgument; -static PyObject *__pyx_n_s_IoctxStateError; -static PyObject *__pyx_kp_s_IoctxStateError_class_derived_f; -static PyObject *__pyx_kp_s_Ioctx_append_s_failed_to_append; -static PyObject *__pyx_kp_s_Ioctx_append_s_rados_append_retu; -static PyObject *__pyx_kp_s_Ioctx_get_stats_s_get_stats_fail; -static PyObject *__pyx_kp_s_Ioctx_rados_lock_exclusive_s_fai; -static PyObject *__pyx_kp_s_Ioctx_read_s_failed_to_read_s; -static PyObject *__pyx_kp_s_Ioctx_trunc_s_failed_to_truncate; -static PyObject *__pyx_kp_s_Ioctx_write_full_s_failed_to_wri; -static PyObject *__pyx_kp_s_Ioctx_write_full_s_rados_write_f; -static PyObject *__pyx_kp_s_Ioctx_write_s_failed_to_write_s; -static PyObject *__pyx_kp_s_Ioctx_write_s_rados_write_return; -static PyObject *__pyx_n_s_LIBRADOS_ALL_NSPACES; -static PyObject *__pyx_n_s_LIBRADOS_OPERATION_BALANCE_READS; -static PyObject *__pyx_n_s_LIBRADOS_OPERATION_IGNORE_CACHE; -static PyObject *__pyx_n_s_LIBRADOS_OPERATION_IGNORE_OVERLA; -static PyObject *__pyx_n_s_LIBRADOS_OPERATION_LOCALIZE_READ; -static PyObject *__pyx_n_s_LIBRADOS_OPERATION_NOFLAG; -static PyObject *__pyx_n_s_LIBRADOS_OPERATION_ORDER_READS_W; -static PyObject *__pyx_n_s_LIBRADOS_OPERATION_SKIPRWLOCKS; -static PyObject *__pyx_n_s_LIBRADOS_OP_FLAG_EXCL; -static PyObject *__pyx_n_s_LIBRADOS_OP_FLAG_FADVISE_DONTNEE; -static PyObject *__pyx_n_s_LIBRADOS_OP_FLAG_FADVISE_NOCACHE; -static PyObject *__pyx_n_s_LIBRADOS_OP_FLAG_FADVISE_RANDOM; -static PyObject *__pyx_n_s_LIBRADOS_OP_FLAG_FADVISE_SEQUENT; -static PyObject *__pyx_n_s_LIBRADOS_OP_FLAG_FADVISE_WILLNEE; -static PyObject *__pyx_n_s_LIBRADOS_OP_FLAG_FAILOK; -static PyObject *__pyx_n_s_LIBRADOS_SNAP_HEAD; -static PyObject *__pyx_n_s_Lock; -static PyObject *__pyx_n_s_LogicError; -static PyObject *__pyx_n_s_MONITOR_LEVELS; -static PyObject *__pyx_n_s_MemoryError; -static PyObject *__pyx_n_s_MonitorLog; -static PyObject *__pyx_n_s_MonitorLog___init; -static PyObject *__pyx_kp_s_Namespace_not_set_properly_in_co; -static PyObject *__pyx_n_s_NoData; -static PyObject *__pyx_kp_s_NoData_class_derived_from_Error; -static PyObject *__pyx_n_s_NoSpace; -static PyObject *__pyx_kp_s_NoSpace_class_derived_from_Erro; -static PyObject *__pyx_n_s_None; -static PyObject *__pyx_n_s_Object; -static PyObject *__pyx_n_s_ObjectBusy; -static PyObject *__pyx_kp_s_ObjectBusy_class_derived_from_E; -static PyObject *__pyx_n_s_ObjectExists; -static PyObject *__pyx_kp_s_ObjectExists_class_derived_from; -static PyObject *__pyx_n_s_ObjectNotFound; -static PyObject *__pyx_kp_s_ObjectNotFound_class_derived_fr; -static PyObject *__pyx_n_s_ObjectStateError; -static PyObject *__pyx_kp_s_ObjectStateError_class_derived; -static PyObject *__pyx_n_s_Object___init; -static PyObject *__pyx_n_s_Object___str; -static PyObject *__pyx_n_s_Object_get_xattr; -static PyObject *__pyx_n_s_Object_get_xattrs; -static PyObject *__pyx_n_s_Object_read; -static PyObject *__pyx_n_s_Object_remove; -static PyObject *__pyx_n_s_Object_require_object_exists; -static PyObject *__pyx_n_s_Object_rm_xattr; -static PyObject *__pyx_n_s_Object_seek; -static PyObject *__pyx_n_s_Object_set_xattr; -static PyObject *__pyx_n_s_Object_stat; -static PyObject *__pyx_n_s_Object_write; -static PyObject *__pyx_n_s_OpCtx; -static PyObject *__pyx_n_s_OpCtx___enter; -static PyObject *__pyx_n_s_OpCtx___exit; -static PyObject *__pyx_n_s_PermissionDeniedError; -static PyObject *__pyx_n_s_PermissionError; -static PyObject *__pyx_kp_s_PermissionError_class_derived_f; -static PyObject *__pyx_n_s_RadosStateError; -static PyObject *__pyx_kp_s_RadosStateError_class_derived_f; -static PyObject *__pyx_kp_s_Rados_can_t_supply_both_rados_id; -static PyObject *__pyx_kp_s_Rados_get_cluster_stats_s_get_st; -static PyObject *__pyx_kp_s_Rados_keys_and_values_must_have; -static PyObject *__pyx_kp_s_Rados_object_wrapper_makes_the_o; -static PyObject *__pyx_n_s_ReadOpCtx; -static PyObject *__pyx_n_s_StopIteration; -static PyObject *__pyx_kp_s_The_object_is_s; -static PyObject *__pyx_kp_s_The_pool_is_s; -static PyObject *__pyx_n_s_TimedOut; -static PyObject *__pyx_kp_s_TimedOut_class_derived_from_Err; -static PyObject *__pyx_n_s_TypeError; -static PyObject *__pyx_n_s_Version; -static PyObject *__pyx_n_s_Version___init; -static PyObject *__pyx_n_s_Version___str; -static PyObject *__pyx_kp_s_Version_information; -static PyObject *__pyx_n_s_WriteOpCtx; -static PyObject *__pyx_kp_s_You_cannot_perform_that_operatio; -static PyObject *__pyx_kp_s__13; -static PyObject *__pyx_kp_s__28; -static PyObject *__pyx_n_s_aio_read_locals_oncomplete; -static PyObject *__pyx_n_s_append; -static PyObject *__pyx_n_s_arg; -static PyObject *__pyx_n_s_arg_name; -static PyObject *__pyx_n_s_arg_type; -static PyObject *__pyx_n_s_arg_val; -static PyObject *__pyx_n_s_args; -static PyObject *__pyx_n_s_auid; -static PyObject *__pyx_n_s_c; -static PyObject *__pyx_n_s_callback; -static PyObject *__pyx_kp_s_callback_must_be_a_callable_func; -static PyObject *__pyx_n_s_chain; -static PyObject *__pyx_n_s_check_type; -static PyObject *__pyx_kp_s_class_derived_from_Error; -static PyObject *__pyx_n_s_cleanup; -static PyObject *__pyx_n_s_clear_omap; -static PyObject *__pyx_kp_s_client; -static PyObject *__pyx_n_s_client_address; -static PyObject *__pyx_kp_s_client_admin; -static PyObject *__pyx_n_s_close; -static PyObject *__pyx_n_s_closed; -static PyObject *__pyx_n_s_cls; -static PyObject *__pyx_n_s_cluster; -static PyObject *__pyx_n_s_clustername; -static PyObject *__pyx_n_s_cmd; -static PyObject *__pyx_n_s_complete; -static PyObject *__pyx_n_s_completion_v; -static PyObject *__pyx_n_s_completion_v_2; -static PyObject *__pyx_n_s_conf; -static PyObject *__pyx_n_s_conf_defaults; -static PyObject *__pyx_n_s_conf_get; -static PyObject *__pyx_n_s_conf_read_file; -static PyObject *__pyx_n_s_conf_set; -static PyObject *__pyx_n_s_conffile; -static PyObject *__pyx_n_s_configuring; -static PyObject *__pyx_n_s_connect; -static PyObject *__pyx_n_s_connected; -static PyObject *__pyx_n_s_cookie; -static PyObject *__pyx_n_s_create; -static PyObject *__pyx_n_s_create_pool; -static PyObject *__pyx_n_s_create_snap; -static PyObject *__pyx_n_s_crush_rule; -static PyObject *__pyx_n_s_cstr; -static PyObject *__pyx_n_s_cstr_list; -static PyObject *__pyx_kp_s_d_d_d; -static PyObject *__pyx_n_s_data; -static PyObject *__pyx_n_s_datetime; -static PyObject *__pyx_kp_s_deal_with_EACCES_related; -static PyObject *__pyx_n_s_debug; -static PyObject *__pyx_n_s_decode; -static PyObject *__pyx_n_s_decode_cstr; -static PyObject *__pyx_kp_s_default; -static PyObject *__pyx_n_s_delete_pool; -static PyObject *__pyx_n_s_desc; -static PyObject *__pyx_n_s_doc; -static PyObject *__pyx_n_s_duration; -static PyObject *__pyx_n_s_encode; -static PyObject *__pyx_n_s_encoding; -static PyObject *__pyx_n_s_enter; -static PyObject *__pyx_n_s_err; -static PyObject *__pyx_n_s_error; -static PyObject *__pyx_kp_s_error_appending_object_s; -static PyObject *__pyx_kp_s_error_blacklisting_client_s; -static PyObject *__pyx_kp_s_error_calling_conf_get; -static PyObject *__pyx_kp_s_error_calling_conf_parse_argv_re; -static PyObject *__pyx_kp_s_error_calling_conf_parse_env; -static PyObject *__pyx_kp_s_error_calling_conf_read_file; -static PyObject *__pyx_kp_s_error_calling_conf_set; -static PyObject *__pyx_kp_s_error_calling_inconsistent_pg_li; -static PyObject *__pyx_kp_s_error_calling_ping_monitor; -static PyObject *__pyx_kp_s_error_calling_rados_monitor_log; -static PyObject *__pyx_kp_s_error_calling_rados_snap_list_fo; -static PyObject *__pyx_kp_s_error_changing_auid_of_s_to_d; -static PyObject *__pyx_kp_s_error_code_d; -static PyObject *__pyx_kp_s_error_connecting_to_the_cluster; -static PyObject *__pyx_kp_s_error_creating_pool_s; -static PyObject *__pyx_kp_s_error_deleting_pool_s; -static PyObject *__pyx_kp_s_error_flushing; -static PyObject *__pyx_kp_s_error_getting_a_completion; -static PyObject *__pyx_kp_s_error_getting_cluster_fsid; -static PyObject *__pyx_kp_s_error_iterating_over_the_extende; -static PyObject *__pyx_kp_s_error_iterating_over_the_objects; -static PyObject *__pyx_kp_s_error_iterating_over_the_omap; -static PyObject *__pyx_kp_s_error_looking_up_pool_s; -static PyObject *__pyx_kp_s_error_opening_pool_s; -static PyObject *__pyx_kp_s_error_reading_s; -static PyObject *__pyx_kp_s_error_removing_s; -static PyObject *__pyx_kp_s_error_reverse_looking_up_pool_s; -static PyObject *__pyx_kp_s_error_writing_object_s; -static PyObject *__pyx_n_s_execute; -static PyObject *__pyx_n_s_exists; -static PyObject *__pyx_n_s_exit; -static PyObject *__pyx_n_s_expire_seconds; -static PyObject *__pyx_n_s_extra; -static PyObject *__pyx_n_s_f; -static PyObject *__pyx_n_s_filter_prefix; -static PyObject *__pyx_n_s_flag; -static PyObject *__pyx_n_s_flags; -static PyObject *__pyx_n_s_fromtimestamp; -static PyObject *__pyx_n_s_func; -static PyObject *__pyx_n_s_functools; -static PyObject *__pyx_n_s_genexpr; -static PyObject *__pyx_n_s_get_completion; -static PyObject *__pyx_n_s_get_inconsistent_pgs; -static PyObject *__pyx_n_s_get_locator_key; -static PyObject *__pyx_n_s_get_namespace; -static PyObject *__pyx_n_s_get_omap_keys; -static PyObject *__pyx_n_s_get_omap_vals; -static PyObject *__pyx_n_s_get_omap_vals_by_keys; -static PyObject *__pyx_n_s_get_pool_base_tier; -static PyObject *__pyx_kp_s_get_pool_base_tier_d; -static PyObject *__pyx_n_s_get_return_value; -static PyObject *__pyx_n_s_get_xattr; -static PyObject *__pyx_n_s_get_xattrs; -static PyObject *__pyx_n_s_hexversion; -static PyObject *__pyx_kp_s_home_ani_tryst_ceph_src_pybind; -static PyObject *__pyx_n_s_import; -static PyObject *__pyx_n_s_inbuf; -static PyObject *__pyx_n_s_info; -static PyObject *__pyx_n_s_init; -static PyObject *__pyx_kp_s_invalid_monitor_level; -static PyObject *__pyx_n_s_ioctx; -static PyObject *__pyx_n_s_ioctx_name; -static PyObject *__pyx_n_s_is_type_of; -static PyObject *__pyx_n_s_items; -static PyObject *__pyx_n_s_itertools; -static PyObject *__pyx_n_s_join; -static PyObject *__pyx_n_s_kb; -static PyObject *__pyx_n_s_kb_avail; -static PyObject *__pyx_n_s_kb_used; -static PyObject *__pyx_n_s_key; -static PyObject *__pyx_n_s_keys; -static PyObject *__pyx_n_s_kwargs; -static PyObject *__pyx_n_s_length; -static PyObject *__pyx_n_s_level; -static PyObject *__pyx_n_s_list_str; -static PyObject *__pyx_n_s_loc_key; -static PyObject *__pyx_n_s_localtime; -static PyObject *__pyx_n_s_locator_key; -static PyObject *__pyx_n_s_lock_exclusive; -static PyObject *__pyx_n_s_lock_shared; -static PyObject *__pyx_n_s_lookup_snap; -static PyObject *__pyx_n_s_main; -static PyObject *__pyx_n_s_major; -static PyObject *__pyx_kp_s_malloc_failed; -static PyObject *__pyx_n_s_max_return; -static PyObject *__pyx_n_s_metaclass; -static PyObject *__pyx_n_s_method; -static PyObject *__pyx_n_s_minor; -static PyObject *__pyx_n_s_module; -static PyObject *__pyx_n_s_mon_id; -static PyObject *__pyx_n_s_monitor_log; -static PyObject *__pyx_n_s_msg; -static PyObject *__pyx_n_s_mtime; -static PyObject *__pyx_n_s_name; -static PyObject *__pyx_n_s_name_2; -static PyObject *__pyx_n_s_named_args; -static PyObject *__pyx_n_s_nspace; -static PyObject *__pyx_n_s_num_bytes; -static PyObject *__pyx_n_s_num_kb; -static PyObject *__pyx_n_s_num_object_clones; -static PyObject *__pyx_n_s_num_object_copies; -static PyObject *__pyx_n_s_num_objects; -static PyObject *__pyx_n_s_num_objects_degraded; -static PyObject *__pyx_n_s_num_objects_missing_on_primary; -static PyObject *__pyx_n_s_num_objects_unfound; -static PyObject *__pyx_n_s_num_rd; -static PyObject *__pyx_n_s_num_rd_kb; -static PyObject *__pyx_n_s_num_wr; -static PyObject *__pyx_n_s_num_wr_kb; -static PyObject *__pyx_n_s_object; -static PyObject *__pyx_n_s_object_name; -static PyObject *__pyx_n_s_offset; -static PyObject *__pyx_n_s_oid; -static PyObject *__pyx_n_s_old_locator; -static PyObject *__pyx_n_s_old_nspace; -static PyObject *__pyx_n_s_oncomplete; -static PyObject *__pyx_n_s_oncomplete_2; -static PyObject *__pyx_n_s_onsafe; -static PyObject *__pyx_n_s_open; -static PyObject *__pyx_n_s_open_ioctx; -static PyObject *__pyx_n_s_operate_read_op; -static PyObject *__pyx_n_s_operate_write_op; -static PyObject *__pyx_n_s_opt; -static PyObject *__pyx_n_s_option; -static PyObject *__pyx_kp_s_or; -static PyObject *__pyx_n_s_osdid; -static PyObject *__pyx_n_s_partial; -static PyObject *__pyx_n_s_path; -static PyObject *__pyx_n_s_pgid; -static PyObject *__pyx_n_s_pool_exists; -static PyObject *__pyx_n_s_pool_id; -static PyObject *__pyx_n_s_pool_lookup; -static PyObject *__pyx_n_s_pool_name; -static PyObject *__pyx_n_s_pool_reverse_lookup; -static PyObject *__pyx_n_s_pos_args; -static PyObject *__pyx_n_s_position; -static PyObject *__pyx_n_s_prepare; -static PyObject *__pyx_n_s_python2; -static PyObject *__pyx_n_s_qualname; -static PyObject *__pyx_n_s_rados; -static PyObject *__pyx_kp_s_rados_Object_ioctx_s_key_s_nspac; -static PyObject *__pyx_kp_s_rados_Snap_ioctx_s_name_s_snap_i; -static PyObject *__pyx_n_s_rados_id; -static PyObject *__pyx_kp_s_rados_initialize_failed_with_err; -static PyObject *__pyx_kp_s_rados_ioctx_snap_get_stamp_error; -static PyObject *__pyx_kp_s_rados_snap_get_name_error; -static PyObject *__pyx_n_s_range; -static PyObject *__pyx_n_s_read; -static PyObject *__pyx_n_s_read_op; -static PyObject *__pyx_kp_s_read_operation_context_manager; -static PyObject *__pyx_kp_s_realloc_failed; -static PyObject *__pyx_n_s_release; -static PyObject *__pyx_n_s_remove; -static PyObject *__pyx_n_s_remove_object; -static PyObject *__pyx_n_s_remove_omap_keys; -static PyObject *__pyx_n_s_remove_snap; -static PyObject *__pyx_n_s_removed; -static PyObject *__pyx_n_s_require_ioctx_open; -static PyObject *__pyx_n_s_require_object_exists; -static PyObject *__pyx_n_s_require_state; -static PyObject *__pyx_n_s_requires; -static PyObject *__pyx_n_s_requires_locals_check_type; -static PyObject *__pyx_n_s_requires_locals_check_type_local; -static PyObject *__pyx_n_s_requires_locals_is_type_of; -static PyObject *__pyx_n_s_requires_locals_wrapper; -static PyObject *__pyx_n_s_requires_locals_wrapper_locals_v; -static PyObject *__pyx_n_s_requires_locals_wrapper_locals_v_2; -static PyObject *__pyx_n_s_ret; -static PyObject *__pyx_n_s_retfunc; -static PyObject *__pyx_n_s_return_value; -static PyObject *__pyx_n_s_retval; -static PyObject *__pyx_n_s_rm_xattr; -static PyObject *__pyx_n_s_rstrip; -static PyObject *__pyx_n_s_s; -static PyObject *__pyx_kp_s_s_must_be_a_string; -static PyObject *__pyx_kp_s_s_must_be_s; -static PyObject *__pyx_n_s_safe; -static PyObject *__pyx_n_s_sec; -static PyObject *__pyx_n_s_seek; -static PyObject *__pyx_n_s_self; -static PyObject *__pyx_n_s_send; -static PyObject *__pyx_n_s_set_locator_key; -static PyObject *__pyx_n_s_set_namespace; -static PyObject *__pyx_n_s_set_object_locator; -static PyObject *__pyx_n_s_set_object_locator_locals_retfun; -static PyObject *__pyx_n_s_set_object_namespace; -static PyObject *__pyx_n_s_set_object_namespace_locals_retf; -static PyObject *__pyx_n_s_set_omap; -static PyObject *__pyx_n_s_set_read; -static PyObject *__pyx_n_s_set_xattr; -static PyObject *__pyx_n_s_setup; -static PyObject *__pyx_n_s_shutdown; -static PyObject *__pyx_n_s_size; -static PyObject *__pyx_n_s_snap_id; -static PyObject *__pyx_n_s_snap_name; -static PyObject *__pyx_n_s_snap_rollback; -static PyObject *__pyx_n_s_split; -static PyObject *__pyx_n_s_start_after; -static PyObject *__pyx_n_s_stat; -static PyObject *__pyx_n_s_state; -static PyObject *__pyx_n_s_str; -static PyObject *__pyx_n_s_str_type; -static PyObject *__pyx_n_s_string_to_write; -static PyObject *__pyx_n_s_sys; -static PyObject *__pyx_n_s_t; -static PyObject *__pyx_n_s_tag; -static PyObject *__pyx_n_s_target; -static PyObject *__pyx_n_s_test; -static PyObject *__pyx_n_s_threading; -static PyObject *__pyx_n_s_throw; -static PyObject *__pyx_n_s_time; -static PyObject *__pyx_n_s_timeout; -static PyObject *__pyx_n_s_to_append; -static PyObject *__pyx_n_s_to_write; -static PyObject *__pyx_n_s_traceback; -static PyObject *__pyx_n_s_track_completion; -static PyObject *__pyx_n_s_trunc; -static PyObject *__pyx_n_s_type; -static PyObject *__pyx_n_s_type_2; -static PyObject *__pyx_n_s_type_names; -static PyObject *__pyx_n_s_types; -static PyObject *__pyx_n_s_unlock; -static PyObject *__pyx_kp_s_utf_8; -static PyObject *__pyx_n_s_v; -static PyObject *__pyx_n_s_val; -static PyObject *__pyx_n_s_validate_func; -static PyObject *__pyx_n_s_value; -static PyObject *__pyx_n_s_values; -static PyObject *__pyx_n_s_var; -static PyObject *__pyx_n_s_warn; -static PyObject *__pyx_n_s_warning; -static PyObject *__pyx_n_s_wrapper; -static PyObject *__pyx_n_s_wraps; -static PyObject *__pyx_n_s_write; -static PyObject *__pyx_n_s_write_full; -static PyObject *__pyx_n_s_write_op; -static PyObject *__pyx_kp_s_write_operation_context_manager; -static PyObject *__pyx_n_s_xattr_name; -static PyObject *__pyx_n_s_xattr_value; -static PyObject *__pyx_n_s_xrange; -static PyObject *__pyx_n_s_zip; -static PyObject *__pyx_pf_5rados_opt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls); /* proto */ -static PyObject *__pyx_pf_5rados_8requires_is_type_of(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v, PyObject *__pyx_v_t); /* proto */ -static PyObject *__pyx_pf_5rados_8requires_10check_type_genexpr(PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_pf_5rados_8requires_10check_type_3genexpr(PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_pf_5rados_8requires_2check_type(PyObject *__pyx_self, PyObject *__pyx_v_val, PyObject *__pyx_v_arg_name, PyObject *__pyx_v_arg_type); /* proto */ -static PyObject *__pyx_pf_5rados_8requires_7wrapper_13validate_func_genexpr(PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_pf_5rados_8requires_7wrapper_validate_func(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ -static PyObject *__pyx_pf_5rados_8requires_4wrapper(PyObject *__pyx_self, PyObject *__pyx_v_f); /* proto */ -static PyObject *__pyx_pf_5rados_2requires(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_types); /* proto */ -static PyObject *__pyx_pf_5rados_4cstr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_val, PyObject *__pyx_v_name, PyObject *__pyx_v_encoding, PyObject *__pyx_v_opt); /* proto */ -static PyObject *__pyx_pf_5rados_6cstr_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_list_str, PyObject *__pyx_v_name, CYTHON_UNUSED PyObject *__pyx_v_encoding); /* proto */ -static PyObject *__pyx_pf_5rados_8decode_cstr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_val, PyObject *__pyx_v_encoding); /* proto */ -static PyObject *__pyx_pf_5rados_7Version___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_major, PyObject *__pyx_v_minor, PyObject *__pyx_v_extra); /* proto */ -static PyObject *__pyx_pf_5rados_7Version_2__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static int __pyx_pf_5rados_5Rados___init__(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ -static PyObject *__pyx_pf_5rados_5Rados_2__setup(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_rados_id, PyObject *__pyx_v_name, PyObject *__pyx_v_clustername, PyObject *__pyx_v_conf_defaults, PyObject *__pyx_v_conffile, PyObject *__pyx_v_conf, PyObject *__pyx_v_flags); /* proto */ -static PyObject *__pyx_pf_5rados_5Rados_4require_state(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_args); /* proto */ -static PyObject *__pyx_pf_5rados_5Rados_6shutdown(struct __pyx_obj_5rados_Rados *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_5Rados_8__enter__(struct __pyx_obj_5rados_Rados *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_5Rados_10__exit__(struct __pyx_obj_5rados_Rados *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_type_, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_traceback); /* proto */ -static PyObject *__pyx_pf_5rados_5Rados_12version(CYTHON_UNUSED struct __pyx_obj_5rados_Rados *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_5Rados_14conf_read_file(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_path); /* proto */ -static PyObject *__pyx_pf_5rados_5Rados_16conf_parse_argv(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_args); /* proto */ -static PyObject *__pyx_pf_5rados_5Rados_18conf_parse_env(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_var); /* proto */ -static PyObject *__pyx_pf_5rados_5Rados_20conf_get(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_option); /* proto */ -static PyObject *__pyx_pf_5rados_5Rados_22conf_set(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_option, PyObject *__pyx_v_val); /* proto */ -static PyObject *__pyx_pf_5rados_5Rados_24ping_monitor(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_mon_id); /* proto */ -static PyObject *__pyx_pf_5rados_5Rados_26connect(struct __pyx_obj_5rados_Rados *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_timeout); /* proto */ -static PyObject *__pyx_pf_5rados_5Rados_28get_cluster_stats(struct __pyx_obj_5rados_Rados *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_5Rados_30pool_exists(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_pool_name); /* proto */ -static PyObject *__pyx_pf_5rados_5Rados_32pool_lookup(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_pool_name); /* proto */ -static PyObject *__pyx_pf_5rados_5Rados_34pool_reverse_lookup(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_pool_id); /* proto */ -static PyObject *__pyx_pf_5rados_5Rados_36create_pool(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_pool_name, PyObject *__pyx_v_auid, PyObject *__pyx_v_crush_rule); /* proto */ -static PyObject *__pyx_pf_5rados_5Rados_38get_pool_base_tier(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_pool_id); /* proto */ -static PyObject *__pyx_pf_5rados_5Rados_40delete_pool(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_pool_name); /* proto */ -static PyObject *__pyx_pf_5rados_5Rados_42get_inconsistent_pgs(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_pool_id); /* proto */ -static PyObject *__pyx_pf_5rados_5Rados_44list_pools(struct __pyx_obj_5rados_Rados *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_5Rados_46get_fsid(struct __pyx_obj_5rados_Rados *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_5Rados_48open_ioctx(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_ioctx_name); /* proto */ -static PyObject *__pyx_pf_5rados_5Rados_50mon_command(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_cmd, PyObject *__pyx_v_inbuf, CYTHON_UNUSED PyObject *__pyx_v_timeout, PyObject *__pyx_v_target); /* proto */ -static PyObject *__pyx_pf_5rados_5Rados_52osd_command(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_osdid, PyObject *__pyx_v_cmd, PyObject *__pyx_v_inbuf, CYTHON_UNUSED PyObject *__pyx_v_timeout); /* proto */ -static PyObject *__pyx_pf_5rados_5Rados_54pg_command(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_pgid, PyObject *__pyx_v_cmd, PyObject *__pyx_v_inbuf, CYTHON_UNUSED PyObject *__pyx_v_timeout); /* proto */ -static PyObject *__pyx_pf_5rados_5Rados_56wait_for_latest_osdmap(struct __pyx_obj_5rados_Rados *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_5Rados_58blacklist_add(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_client_address, PyObject *__pyx_v_expire_seconds); /* proto */ -static PyObject *__pyx_pf_5rados_5Rados_60monitor_log(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_level, PyObject *__pyx_v_callback, PyObject *__pyx_v_arg); /* proto */ -static PyObject *__pyx_pf_5rados_5Rados_5state___get__(struct __pyx_obj_5rados_Rados *__pyx_v_self); /* proto */ -static int __pyx_pf_5rados_5Rados_5state_2__set__(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_5rados_5Rados_5state_4__del__(struct __pyx_obj_5rados_Rados *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_5Rados_16monitor_callback___get__(struct __pyx_obj_5rados_Rados *__pyx_v_self); /* proto */ -static int __pyx_pf_5rados_5Rados_16monitor_callback_2__set__(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_5rados_5Rados_16monitor_callback_4__del__(struct __pyx_obj_5rados_Rados *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_5Rados_11parsed_args___get__(struct __pyx_obj_5rados_Rados *__pyx_v_self); /* proto */ -static int __pyx_pf_5rados_5Rados_11parsed_args_2__set__(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_5rados_5Rados_11parsed_args_4__del__(struct __pyx_obj_5rados_Rados *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_5Rados_13conf_defaults___get__(struct __pyx_obj_5rados_Rados *__pyx_v_self); /* proto */ -static int __pyx_pf_5rados_5Rados_13conf_defaults_2__set__(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_5rados_5Rados_13conf_defaults_4__del__(struct __pyx_obj_5rados_Rados *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_5Rados_8conffile___get__(struct __pyx_obj_5rados_Rados *__pyx_v_self); /* proto */ -static int __pyx_pf_5rados_5Rados_8conffile_2__set__(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_5rados_5Rados_8conffile_4__del__(struct __pyx_obj_5rados_Rados *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_5Rados_8rados_id___get__(struct __pyx_obj_5rados_Rados *__pyx_v_self); /* proto */ -static int __pyx_pf_5rados_5Rados_8rados_id_2__set__(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_5rados_5Rados_8rados_id_4__del__(struct __pyx_obj_5rados_Rados *__pyx_v_self); /* proto */ -static int __pyx_pf_5rados_12OmapIterator___cinit__(struct __pyx_obj_5rados_OmapIterator *__pyx_v_self, struct __pyx_obj_5rados_Ioctx *__pyx_v_ioctx); /* proto */ -static PyObject *__pyx_pf_5rados_12OmapIterator_2__iter__(struct __pyx_obj_5rados_OmapIterator *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_12OmapIterator_4__next__(struct __pyx_obj_5rados_OmapIterator *__pyx_v_self); /* proto */ -static void __pyx_pf_5rados_12OmapIterator_6__dealloc__(struct __pyx_obj_5rados_OmapIterator *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_12OmapIterator_5ioctx___get__(struct __pyx_obj_5rados_OmapIterator *__pyx_v_self); /* proto */ -static int __pyx_pf_5rados_12OmapIterator_5ioctx_2__set__(struct __pyx_obj_5rados_OmapIterator *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_5rados_12OmapIterator_5ioctx_4__del__(struct __pyx_obj_5rados_OmapIterator *__pyx_v_self); /* proto */ -static int __pyx_pf_5rados_14ObjectIterator___cinit__(struct __pyx_obj_5rados_ObjectIterator *__pyx_v_self, struct __pyx_obj_5rados_Ioctx *__pyx_v_ioctx); /* proto */ -static PyObject *__pyx_pf_5rados_14ObjectIterator_2__iter__(struct __pyx_obj_5rados_ObjectIterator *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_14ObjectIterator_4__next__(struct __pyx_obj_5rados_ObjectIterator *__pyx_v_self); /* proto */ -static void __pyx_pf_5rados_14ObjectIterator_6__dealloc__(struct __pyx_obj_5rados_ObjectIterator *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_14ObjectIterator_5ioctx___get__(struct __pyx_obj_5rados_ObjectIterator *__pyx_v_self); /* proto */ -static int __pyx_pf_5rados_14ObjectIterator_5ioctx_2__set__(struct __pyx_obj_5rados_ObjectIterator *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_5rados_14ObjectIterator_5ioctx_4__del__(struct __pyx_obj_5rados_ObjectIterator *__pyx_v_self); /* proto */ -static int __pyx_pf_5rados_13XattrIterator___cinit__(struct __pyx_obj_5rados_XattrIterator *__pyx_v_self, struct __pyx_obj_5rados_Ioctx *__pyx_v_ioctx, PyObject *__pyx_v_oid); /* proto */ -static PyObject *__pyx_pf_5rados_13XattrIterator_2__iter__(struct __pyx_obj_5rados_XattrIterator *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_13XattrIterator_4__next__(struct __pyx_obj_5rados_XattrIterator *__pyx_v_self); /* proto */ -static void __pyx_pf_5rados_13XattrIterator_6__dealloc__(struct __pyx_obj_5rados_XattrIterator *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_13XattrIterator_5ioctx___get__(struct __pyx_obj_5rados_XattrIterator *__pyx_v_self); /* proto */ -static int __pyx_pf_5rados_13XattrIterator_5ioctx_2__set__(struct __pyx_obj_5rados_XattrIterator *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_5rados_13XattrIterator_5ioctx_4__del__(struct __pyx_obj_5rados_XattrIterator *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_13XattrIterator_3oid___get__(struct __pyx_obj_5rados_XattrIterator *__pyx_v_self); /* proto */ -static int __pyx_pf_5rados_13XattrIterator_3oid_2__set__(struct __pyx_obj_5rados_XattrIterator *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_5rados_13XattrIterator_3oid_4__del__(struct __pyx_obj_5rados_XattrIterator *__pyx_v_self); /* proto */ -static int __pyx_pf_5rados_12SnapIterator___cinit__(struct __pyx_obj_5rados_SnapIterator *__pyx_v_self, struct __pyx_obj_5rados_Ioctx *__pyx_v_ioctx); /* proto */ -static PyObject *__pyx_pf_5rados_12SnapIterator_2__iter__(struct __pyx_obj_5rados_SnapIterator *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_12SnapIterator_4__next__(struct __pyx_obj_5rados_SnapIterator *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_12SnapIterator_5ioctx___get__(struct __pyx_obj_5rados_SnapIterator *__pyx_v_self); /* proto */ -static int __pyx_pf_5rados_12SnapIterator_5ioctx_2__set__(struct __pyx_obj_5rados_SnapIterator *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_5rados_12SnapIterator_5ioctx_4__del__(struct __pyx_obj_5rados_SnapIterator *__pyx_v_self); /* proto */ -static int __pyx_pf_5rados_4Snap___cinit__(struct __pyx_obj_5rados_Snap *__pyx_v_self, struct __pyx_obj_5rados_Ioctx *__pyx_v_ioctx, PyObject *__pyx_v_name, rados_snap_t __pyx_v_snap_id); /* proto */ -static PyObject *__pyx_pf_5rados_4Snap_2__str__(struct __pyx_obj_5rados_Snap *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_4Snap_4get_timestamp(struct __pyx_obj_5rados_Snap *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_4Snap_5ioctx___get__(struct __pyx_obj_5rados_Snap *__pyx_v_self); /* proto */ -static int __pyx_pf_5rados_4Snap_5ioctx_2__set__(struct __pyx_obj_5rados_Snap *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_5rados_4Snap_5ioctx_4__del__(struct __pyx_obj_5rados_Snap *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_4Snap_4name___get__(struct __pyx_obj_5rados_Snap *__pyx_v_self); /* proto */ -static int __pyx_pf_5rados_4Snap_4name_2__set__(struct __pyx_obj_5rados_Snap *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_5rados_4Snap_4name_4__del__(struct __pyx_obj_5rados_Snap *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_4Snap_7snap_id___get__(struct __pyx_obj_5rados_Snap *__pyx_v_self); /* proto */ -static int __pyx_pf_5rados_4Snap_7snap_id_2__set__(struct __pyx_obj_5rados_Snap *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_5rados_10Completion___cinit__(struct __pyx_obj_5rados_Completion *__pyx_v_self, struct __pyx_obj_5rados_Ioctx *__pyx_v_ioctx, PyObject *__pyx_v_oncomplete, PyObject *__pyx_v_onsafe); /* proto */ -static PyObject *__pyx_pf_5rados_10Completion_2is_safe(struct __pyx_obj_5rados_Completion *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_10Completion_4is_complete(struct __pyx_obj_5rados_Completion *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_10Completion_6wait_for_safe(struct __pyx_obj_5rados_Completion *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_10Completion_8wait_for_complete(struct __pyx_obj_5rados_Completion *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_10Completion_10wait_for_safe_and_cb(struct __pyx_obj_5rados_Completion *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_10Completion_12wait_for_complete_and_cb(struct __pyx_obj_5rados_Completion *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_10Completion_14get_return_value(struct __pyx_obj_5rados_Completion *__pyx_v_self); /* proto */ -static void __pyx_pf_5rados_10Completion_16__dealloc__(struct __pyx_obj_5rados_Completion *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_10Completion_18_complete(struct __pyx_obj_5rados_Completion *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_10Completion_20_safe(struct __pyx_obj_5rados_Completion *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_10Completion_22_cleanup(struct __pyx_obj_5rados_Completion *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_10Completion_5ioctx___get__(struct __pyx_obj_5rados_Completion *__pyx_v_self); /* proto */ -static int __pyx_pf_5rados_10Completion_5ioctx_2__set__(struct __pyx_obj_5rados_Completion *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_5rados_10Completion_5ioctx_4__del__(struct __pyx_obj_5rados_Completion *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_10Completion_10oncomplete___get__(struct __pyx_obj_5rados_Completion *__pyx_v_self); /* proto */ -static int __pyx_pf_5rados_10Completion_10oncomplete_2__set__(struct __pyx_obj_5rados_Completion *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_5rados_10Completion_10oncomplete_4__del__(struct __pyx_obj_5rados_Completion *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_10Completion_6onsafe___get__(struct __pyx_obj_5rados_Completion *__pyx_v_self); /* proto */ -static int __pyx_pf_5rados_10Completion_6onsafe_2__set__(struct __pyx_obj_5rados_Completion *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_5rados_10Completion_6onsafe_4__del__(struct __pyx_obj_5rados_Completion *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_5OpCtx___enter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_5OpCtx_2__exit__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_type, CYTHON_UNUSED PyObject *__pyx_v_msg, CYTHON_UNUSED PyObject *__pyx_v_traceback); /* proto */ -static PyObject *__pyx_pf_5rados_7WriteOp_create(struct __pyx_obj_5rados_WriteOp *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_7WriteOp_2release(struct __pyx_obj_5rados_WriteOp *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_6ReadOp_create(struct __pyx_obj_5rados_ReadOp *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_6ReadOp_2release(struct __pyx_obj_5rados_ReadOp *__pyx_v_self); /* proto */ -static int __pyx_pf_5rados_5Ioctx___init__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_2__enter__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_4__exit__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_type_, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_traceback); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_6__del__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_8__track_completion(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_completion_obj); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_10__get_completion(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_oncomplete, PyObject *__pyx_v_onsafe); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_12aio_write(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_object_name, PyObject *__pyx_v_to_write, PyObject *__pyx_v_offset, PyObject *__pyx_v_oncomplete, PyObject *__pyx_v_onsafe); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_14aio_write_full(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_object_name, PyObject *__pyx_v_to_write, PyObject *__pyx_v_oncomplete, PyObject *__pyx_v_onsafe); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_16aio_append(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_object_name, PyObject *__pyx_v_to_append, PyObject *__pyx_v_oncomplete, PyObject *__pyx_v_onsafe); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_18aio_flush(struct __pyx_obj_5rados_Ioctx *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_8aio_read_oncomplete_(PyObject *__pyx_self, PyObject *__pyx_v_completion_v); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_20aio_read(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_object_name, PyObject *__pyx_v_length, PyObject *__pyx_v_offset, PyObject *__pyx_v_oncomplete); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_22aio_remove(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_object_name, PyObject *__pyx_v_oncomplete, PyObject *__pyx_v_onsafe); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_24require_ioctx_open(struct __pyx_obj_5rados_Ioctx *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_26change_auid(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_auid); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_28set_locator_key(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_loc_key); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_30get_locator_key(struct __pyx_obj_5rados_Ioctx *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_32set_read(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_snap_id); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_34set_namespace(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_nspace); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_36get_namespace(struct __pyx_obj_5rados_Ioctx *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_38close(struct __pyx_obj_5rados_Ioctx *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_40write(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_data, PyObject *__pyx_v_offset); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_42write_full(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_data); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_44append(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_data); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_46read(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_length, PyObject *__pyx_v_offset); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_48execute(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_cls, PyObject *__pyx_v_method, PyObject *__pyx_v_data, PyObject *__pyx_v_length); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_50get_stats(struct __pyx_obj_5rados_Ioctx *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_52remove_object(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_54trunc(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_size); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_56stat(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_58get_xattr(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_xattr_name); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_60get_xattrs(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_oid); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_62set_xattr(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_xattr_name, PyObject *__pyx_v_xattr_value); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_64rm_xattr(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_xattr_name); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_66list_objects(struct __pyx_obj_5rados_Ioctx *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_68list_snaps(struct __pyx_obj_5rados_Ioctx *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_70create_snap(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_snap_name); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_72remove_snap(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_snap_name); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_74lookup_snap(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_snap_name); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_76snap_rollback(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_oid, PyObject *__pyx_v_snap_name); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_78get_last_version(struct __pyx_obj_5rados_Ioctx *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_80create_write_op(CYTHON_UNUSED struct __pyx_obj_5rados_Ioctx *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_82create_read_op(CYTHON_UNUSED struct __pyx_obj_5rados_Ioctx *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_84release_write_op(CYTHON_UNUSED struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_write_op); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_86release_read_op(CYTHON_UNUSED struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_read_op); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_88set_omap(CYTHON_UNUSED struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_write_op, PyObject *__pyx_v_keys, PyObject *__pyx_v_values); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_90operate_write_op(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_write_op, PyObject *__pyx_v_oid, PyObject *__pyx_v_mtime, PyObject *__pyx_v_flags); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_92operate_read_op(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_read_op, PyObject *__pyx_v_oid, PyObject *__pyx_v_flag); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_94get_omap_vals(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_read_op, PyObject *__pyx_v_start_after, PyObject *__pyx_v_filter_prefix, PyObject *__pyx_v_max_return); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_96get_omap_keys(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_read_op, PyObject *__pyx_v_start_after, PyObject *__pyx_v_max_return); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_98get_omap_vals_by_keys(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_read_op, PyObject *__pyx_v_keys); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_100remove_omap_keys(CYTHON_UNUSED struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_write_op, PyObject *__pyx_v_keys); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_102clear_omap(CYTHON_UNUSED struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_write_op); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_104lock_exclusive(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_name, PyObject *__pyx_v_cookie, PyObject *__pyx_v_desc, PyObject *__pyx_v_duration, PyObject *__pyx_v_flags); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_106lock_shared(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_name, PyObject *__pyx_v_cookie, PyObject *__pyx_v_tag, PyObject *__pyx_v_desc, PyObject *__pyx_v_duration, PyObject *__pyx_v_flags); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_108unlock(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_name, PyObject *__pyx_v_cookie); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_4name___get__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self); /* proto */ -static int __pyx_pf_5rados_5Ioctx_4name_2__set__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_5state___get__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self); /* proto */ -static int __pyx_pf_5rados_5Ioctx_5state_2__set__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_5rados_5Ioctx_5state_4__del__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_11locator_key___get__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self); /* proto */ -static int __pyx_pf_5rados_5Ioctx_11locator_key_2__set__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_5rados_5Ioctx_11locator_key_4__del__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_6nspace___get__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self); /* proto */ -static int __pyx_pf_5rados_5Ioctx_6nspace_2__set__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_5rados_5Ioctx_6nspace_4__del__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_16safe_completions___get__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self); /* proto */ -static int __pyx_pf_5rados_5Ioctx_16safe_completions_2__set__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_5rados_5Ioctx_16safe_completions_4__del__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_20complete_completions___get__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self); /* proto */ -static int __pyx_pf_5rados_5Ioctx_20complete_completions_2__set__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_5rados_5Ioctx_20complete_completions_4__del__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_5Ioctx_4lock___get__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self); /* proto */ -static int __pyx_pf_5rados_5Ioctx_4lock_2__set__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_5rados_5Ioctx_4lock_4__del__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_18set_object_locator_retfunc(PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ -static PyObject *__pyx_pf_5rados_10set_object_locator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func); /* proto */ -static PyObject *__pyx_pf_5rados_20set_object_namespace_retfunc(PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ -static PyObject *__pyx_pf_5rados_12set_object_namespace(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func); /* proto */ -static PyObject *__pyx_pf_5rados_6Object___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_ioctx, PyObject *__pyx_v_key, PyObject *__pyx_v_locator_key, PyObject *__pyx_v_nspace); /* proto */ -static PyObject *__pyx_pf_5rados_6Object_2__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_6Object_4require_object_exists(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_6Object_6read(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_length); /* proto */ -static PyObject *__pyx_pf_5rados_6Object_8write(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_string_to_write); /* proto */ -static PyObject *__pyx_pf_5rados_6Object_10remove(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_6Object_12stat(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_6Object_14seek(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_position); /* proto */ -static PyObject *__pyx_pf_5rados_6Object_16get_xattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_xattr_name); /* proto */ -static PyObject *__pyx_pf_5rados_6Object_18get_xattrs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_5rados_6Object_20set_xattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_xattr_name, PyObject *__pyx_v_xattr_value); /* proto */ -static PyObject *__pyx_pf_5rados_6Object_22rm_xattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_xattr_name); /* proto */ -static PyObject *__pyx_pf_5rados_10MonitorLog___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_cluster, PyObject *__pyx_v_level, PyObject *__pyx_v_callback, PyObject *__pyx_v_arg); /* proto */ -static PyObject *__pyx_tp_new_5rados_Rados(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_5rados_Ioctx(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_5rados_OmapIterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_5rados_ObjectIterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_5rados_XattrIterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_5rados_SnapIterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_5rados_Snap(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_5rados_Completion(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_5rados_WriteOp(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_5rados_ReadOp(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_5rados___pyx_scope_struct__requires(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_5rados___pyx_scope_struct_1_check_type(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_5rados___pyx_scope_struct_2_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_5rados___pyx_scope_struct_3_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_5rados___pyx_scope_struct_4_wrapper(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_5rados___pyx_scope_struct_5_validate_func(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_5rados___pyx_scope_struct_6_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_5rados___pyx_scope_struct_7_aio_read(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_5rados___pyx_scope_struct_8_set_object_locator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_5rados___pyx_scope_struct_9_set_object_namespace(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_int_0; -static PyObject *__pyx_int_8192; -static PyObject *__pyx_int_1048576; -static PyObject *__pyx_int_50331648; -static PyObject *__pyx_int_4294967296; -static PyObject *__pyx_int_18446744073709551615; -static PyObject *__pyx_k__49; -static PyObject *__pyx_k__50; -static PyObject *__pyx_tuple_; -static PyObject *__pyx_tuple__3; -static PyObject *__pyx_tuple__5; -static PyObject *__pyx_tuple__7; -static PyObject *__pyx_tuple__9; -static PyObject *__pyx_tuple__10; -static PyObject *__pyx_tuple__11; -static PyObject *__pyx_tuple__12; -static PyObject *__pyx_tuple__14; -static PyObject *__pyx_tuple__15; -static PyObject *__pyx_tuple__16; -static PyObject *__pyx_tuple__17; -static PyObject *__pyx_tuple__18; -static PyObject *__pyx_tuple__19; -static PyObject *__pyx_tuple__20; -static PyObject *__pyx_tuple__21; -static PyObject *__pyx_tuple__22; -static PyObject *__pyx_tuple__23; -static PyObject *__pyx_tuple__24; -static PyObject *__pyx_tuple__25; -static PyObject *__pyx_tuple__26; -static PyObject *__pyx_tuple__27; -static PyObject *__pyx_tuple__29; -static PyObject *__pyx_tuple__30; -static PyObject *__pyx_tuple__31; -static PyObject *__pyx_tuple__32; -static PyObject *__pyx_tuple__33; -static PyObject *__pyx_tuple__34; -static PyObject *__pyx_tuple__35; -static PyObject *__pyx_tuple__36; -static PyObject *__pyx_tuple__37; -static PyObject *__pyx_tuple__38; -static PyObject *__pyx_tuple__39; -static PyObject *__pyx_tuple__40; -static PyObject *__pyx_tuple__41; -static PyObject *__pyx_tuple__42; -static PyObject *__pyx_tuple__43; -static PyObject *__pyx_tuple__44; -static PyObject *__pyx_tuple__45; -static PyObject *__pyx_tuple__46; -static PyObject *__pyx_tuple__48; -static PyObject *__pyx_tuple__51; -static PyObject *__pyx_tuple__53; -static PyObject *__pyx_tuple__54; -static PyObject *__pyx_tuple__56; -static PyObject *__pyx_tuple__58; -static PyObject *__pyx_tuple__60; -static PyObject *__pyx_tuple__62; -static PyObject *__pyx_tuple__64; -static PyObject *__pyx_tuple__66; -static PyObject *__pyx_tuple__68; -static PyObject *__pyx_tuple__70; -static PyObject *__pyx_tuple__72; -static PyObject *__pyx_tuple__74; -static PyObject *__pyx_tuple__76; -static PyObject *__pyx_tuple__78; -static PyObject *__pyx_tuple__80; -static PyObject *__pyx_tuple__81; -static PyObject *__pyx_tuple__83; -static PyObject *__pyx_tuple__85; -static PyObject *__pyx_tuple__87; -static PyObject *__pyx_tuple__88; -static PyObject *__pyx_tuple__90; -static PyObject *__pyx_tuple__92; -static PyObject *__pyx_tuple__94; -static PyObject *__pyx_tuple__96; -static PyObject *__pyx_tuple__98; -static PyObject *__pyx_codeobj__2; -static PyObject *__pyx_codeobj__4; -static PyObject *__pyx_codeobj__6; -static PyObject *__pyx_codeobj__8; -static PyObject *__pyx_tuple__100; -static PyObject *__pyx_tuple__102; -static PyObject *__pyx_tuple__104; -static PyObject *__pyx_codeobj__47; -static PyObject *__pyx_codeobj__52; -static PyObject *__pyx_codeobj__55; -static PyObject *__pyx_codeobj__57; -static PyObject *__pyx_codeobj__59; -static PyObject *__pyx_codeobj__61; -static PyObject *__pyx_codeobj__63; -static PyObject *__pyx_codeobj__65; -static PyObject *__pyx_codeobj__67; -static PyObject *__pyx_codeobj__69; -static PyObject *__pyx_codeobj__71; -static PyObject *__pyx_codeobj__73; -static PyObject *__pyx_codeobj__75; -static PyObject *__pyx_codeobj__77; -static PyObject *__pyx_codeobj__79; -static PyObject *__pyx_codeobj__82; -static PyObject *__pyx_codeobj__84; -static PyObject *__pyx_codeobj__86; -static PyObject *__pyx_codeobj__89; -static PyObject *__pyx_codeobj__91; -static PyObject *__pyx_codeobj__93; -static PyObject *__pyx_codeobj__95; -static PyObject *__pyx_codeobj__97; -static PyObject *__pyx_codeobj__99; -static PyObject *__pyx_codeobj__101; -static PyObject *__pyx_codeobj__103; -static PyObject *__pyx_codeobj__105; - -/* "rados.pyx":369 - * - * - * cdef make_ex(ret, msg): # <<<<<<<<<<<<<< - * """ - * Translate a librados return code into an exception. - */ - -static PyObject *__pyx_f_5rados_make_ex(PyObject *__pyx_v_ret, PyObject *__pyx_v_msg) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - __Pyx_RefNannySetupContext("make_ex", 0); - __Pyx_INCREF(__pyx_v_ret); - - /* "rados.pyx":379 - * :returns: a subclass of :class:`Error` - * """ - * ret = abs(ret) # <<<<<<<<<<<<<< - * if ret in errno_to_exception: - * return errno_to_exception[ret](msg) - */ - __pyx_t_1 = PyNumber_Absolute(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":380 - * """ - * ret = abs(ret) - * if ret in errno_to_exception: # <<<<<<<<<<<<<< - * return errno_to_exception[ret](msg) - * else: - */ - __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_ret, __pyx_v_5rados_errno_to_exception, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 380, __pyx_L1_error) - __pyx_t_3 = (__pyx_t_2 != 0); - if (__pyx_t_3) { - - /* "rados.pyx":381 - * ret = abs(ret) - * if ret in errno_to_exception: - * return errno_to_exception[ret](msg) # <<<<<<<<<<<<<< - * else: - * return Error(msg + (": error code %d" % ret)) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyObject_GetItem(__pyx_v_5rados_errno_to_exception, __pyx_v_ret); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 381, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - } - } - if (!__pyx_t_5) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_msg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 381, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; - __Pyx_INCREF(__pyx_v_msg); - __Pyx_GIVEREF(__pyx_v_msg); - PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_msg); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "rados.pyx":380 - * """ - * ret = abs(ret) - * if ret in errno_to_exception: # <<<<<<<<<<<<<< - * return errno_to_exception[ret](msg) - * else: - */ - } - - /* "rados.pyx":383 - * return errno_to_exception[ret](msg) - * else: - * return Error(msg + (": error code %d" % ret)) # <<<<<<<<<<<<<< - * - * - */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 383, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_error_code_d, __pyx_v_ret); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyNumber_Add(__pyx_v_msg, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 383, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - } - } - if (!__pyx_t_6) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 383, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - } - - /* "rados.pyx":369 - * - * - * cdef make_ex(ret, msg): # <<<<<<<<<<<<<< - * """ - * Translate a librados return code into an exception. - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("rados.make_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_ret); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":388 - * # helper to specify an optional argument, where in addition to `cls`, `None` - * # is also acceptable - * def opt(cls): # <<<<<<<<<<<<<< - * return (cls, None) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_1opt(PyObject *__pyx_self, PyObject *__pyx_v_cls); /*proto*/ -static char __pyx_doc_5rados_opt[] = "opt(cls)"; -static PyMethodDef __pyx_mdef_5rados_1opt = {"opt", (PyCFunction)__pyx_pw_5rados_1opt, METH_O, __pyx_doc_5rados_opt}; -static PyObject *__pyx_pw_5rados_1opt(PyObject *__pyx_self, PyObject *__pyx_v_cls) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("opt (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_opt(__pyx_self, ((PyObject *)__pyx_v_cls)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_opt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("opt", 0); - - /* "rados.pyx":389 - * # is also acceptable - * def opt(cls): - * return (cls, None) # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_cls); - __Pyx_GIVEREF(__pyx_v_cls); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_cls); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "rados.pyx":388 - * # helper to specify an optional argument, where in addition to `cls`, `None` - * # is also acceptable - * def opt(cls): # <<<<<<<<<<<<<< - * return (cls, None) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rados.opt", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":394 - * # validate argument types of an instance method - * # kwargs is an un-ordered dict, so use args instead - * def requires(*types): # <<<<<<<<<<<<<< - * def is_type_of(v, t): - * if t is None: - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_3requires(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_2requires[] = "requires(*types)"; -static PyMethodDef __pyx_mdef_5rados_3requires = {"requires", (PyCFunction)__pyx_pw_5rados_3requires, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_2requires}; -static PyObject *__pyx_pw_5rados_3requires(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_types = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("requires (wrapper)", 0); - if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "requires", 0))) return NULL; - __Pyx_INCREF(__pyx_args); - __pyx_v_types = __pyx_args; - __pyx_r = __pyx_pf_5rados_2requires(__pyx_self, __pyx_v_types); - - /* function exit code */ - __Pyx_XDECREF(__pyx_v_types); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":395 - * # kwargs is an un-ordered dict, so use args instead - * def requires(*types): - * def is_type_of(v, t): # <<<<<<<<<<<<<< - * if t is None: - * return v is None - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_8requires_1is_type_of(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_5rados_8requires_1is_type_of = {"is_type_of", (PyCFunction)__pyx_pw_5rados_8requires_1is_type_of, METH_VARARGS|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5rados_8requires_1is_type_of(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_v = 0; - PyObject *__pyx_v_t = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("is_type_of (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_v,&__pyx_n_s_t,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("is_type_of", 1, 2, 2, 1); __PYX_ERR(0, 395, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "is_type_of") < 0)) __PYX_ERR(0, 395, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_v = values[0]; - __pyx_v_t = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("is_type_of", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 395, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.requires.is_type_of", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_8requires_is_type_of(__pyx_self, __pyx_v_v, __pyx_v_t); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_8requires_is_type_of(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v, PyObject *__pyx_v_t) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("is_type_of", 0); - - /* "rados.pyx":396 - * def requires(*types): - * def is_type_of(v, t): - * if t is None: # <<<<<<<<<<<<<< - * return v is None - * else: - */ - __pyx_t_1 = (__pyx_v_t == Py_None); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - - /* "rados.pyx":397 - * def is_type_of(v, t): - * if t is None: - * return v is None # <<<<<<<<<<<<<< - * else: - * return isinstance(v, t) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = (__pyx_v_v == Py_None); - __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - - /* "rados.pyx":396 - * def requires(*types): - * def is_type_of(v, t): - * if t is None: # <<<<<<<<<<<<<< - * return v is None - * else: - */ - } - - /* "rados.pyx":399 - * return v is None - * else: - * return isinstance(v, t) # <<<<<<<<<<<<<< - * - * def check_type(val, arg_name, arg_type): - */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyObject_IsInstance(__pyx_v_v, __pyx_v_t); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 399, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 399, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - } - - /* "rados.pyx":395 - * # kwargs is an un-ordered dict, so use args instead - * def requires(*types): - * def is_type_of(v, t): # <<<<<<<<<<<<<< - * if t is None: - * return v is None - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("rados.requires.is_type_of", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":401 - * return isinstance(v, t) - * - * def check_type(val, arg_name, arg_type): # <<<<<<<<<<<<<< - * if isinstance(arg_type, tuple): - * if any(is_type_of(val, t) for t in arg_type): - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_8requires_3check_type(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_5rados_8requires_3check_type = {"check_type", (PyCFunction)__pyx_pw_5rados_8requires_3check_type, METH_VARARGS|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5rados_8requires_3check_type(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_val = 0; - PyObject *__pyx_v_arg_name = 0; - PyObject *__pyx_v_arg_type = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("check_type (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_val,&__pyx_n_s_arg_name,&__pyx_n_s_arg_type,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arg_name)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("check_type", 1, 3, 3, 1); __PYX_ERR(0, 401, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arg_type)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("check_type", 1, 3, 3, 2); __PYX_ERR(0, 401, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "check_type") < 0)) __PYX_ERR(0, 401, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - } - __pyx_v_val = values[0]; - __pyx_v_arg_name = values[1]; - __pyx_v_arg_type = values[2]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("check_type", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 401, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.requires.check_type", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_8requires_2check_type(__pyx_self, __pyx_v_val, __pyx_v_arg_name, __pyx_v_arg_type); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} -static PyObject *__pyx_gb_5rados_8requires_10check_type_2generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ - -/* "rados.pyx":403 - * def check_type(val, arg_name, arg_type): - * if isinstance(arg_type, tuple): - * if any(is_type_of(val, t) for t in arg_type): # <<<<<<<<<<<<<< - * return - * type_names = ' or '.join('None' if t is None else t.__name__ - */ - -static PyObject *__pyx_pf_5rados_8requires_10check_type_genexpr(PyObject *__pyx_self) { - struct __pyx_obj_5rados___pyx_scope_struct_2_genexpr *__pyx_cur_scope; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_5rados___pyx_scope_struct_2_genexpr *)__pyx_tp_new_5rados___pyx_scope_struct_2_genexpr(__pyx_ptype_5rados___pyx_scope_struct_2_genexpr, __pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __Pyx_RefNannyFinishContext(); - return NULL; - } - __Pyx_GOTREF(__pyx_cur_scope); - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_5rados___pyx_scope_struct_1_check_type *) __pyx_self; - __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); - { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5rados_8requires_10check_type_2generator, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_requires_locals_check_type_local); if (unlikely(!gen)) __PYX_ERR(0, 403, __pyx_L1_error) - __Pyx_DECREF(__pyx_cur_scope); - __Pyx_RefNannyFinishContext(); - return (PyObject *) gen; - } - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("rados.requires.check_type.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_gb_5rados_8requires_10check_type_2generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */ -{ - struct __pyx_obj_5rados___pyx_scope_struct_2_genexpr *__pyx_cur_scope = ((struct __pyx_obj_5rados___pyx_scope_struct_2_genexpr *)__pyx_generator->closure); - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - PyObject *(*__pyx_t_3)(PyObject *); - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("None", 0); - switch (__pyx_generator->resume_label) { - case 0: goto __pyx_L3_first_run; - default: /* CPython raises the right error here */ - __Pyx_RefNannyFinishContext(); - return NULL; - } - __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 403, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_arg_type)) { __Pyx_RaiseClosureNameError("arg_type"); __PYX_ERR(0, 403, __pyx_L1_error) } - if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_arg_type)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_arg_type)) { - __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_arg_type; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; - __pyx_t_3 = NULL; - } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_arg_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 403, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 403, __pyx_L1_error) - } - for (;;) { - if (likely(!__pyx_t_3)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { - if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 403, __pyx_L1_error) - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 403, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 403, __pyx_L1_error) - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 403, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } - } else { - __pyx_t_4 = __pyx_t_3(__pyx_t_1); - if (unlikely(!__pyx_t_4)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 403, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_4); - } - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_t); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_t, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_val)) { __Pyx_RaiseClosureNameError("val"); __PYX_ERR(0, 403, __pyx_L1_error) } - __pyx_t_4 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_val; - __Pyx_INCREF(__pyx_t_4); - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_is_type_of)) { __Pyx_RaiseClosureNameError("is_type_of"); __PYX_ERR(0, 403, __pyx_L1_error) } - __pyx_t_5 = __pyx_pf_5rados_8requires_is_type_of(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_is_type_of, __pyx_t_4, __pyx_cur_scope->__pyx_v_t); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 403, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 403, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_6) { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_True); - __pyx_r = Py_True; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - } - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __pyx_generator->resume_label = -1; - __Pyx_Coroutine_clear((PyObject*)__pyx_generator); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} -static PyObject *__pyx_gb_5rados_8requires_10check_type_5generator1(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ - -/* "rados.pyx":405 - * if any(is_type_of(val, t) for t in arg_type): - * return - * type_names = ' or '.join('None' if t is None else t.__name__ # <<<<<<<<<<<<<< - * for t in arg_type) - * raise TypeError('%s must be %s' % (arg_name, type_names)) - */ - -static PyObject *__pyx_pf_5rados_8requires_10check_type_3genexpr(PyObject *__pyx_self) { - struct __pyx_obj_5rados___pyx_scope_struct_3_genexpr *__pyx_cur_scope; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_5rados___pyx_scope_struct_3_genexpr *)__pyx_tp_new_5rados___pyx_scope_struct_3_genexpr(__pyx_ptype_5rados___pyx_scope_struct_3_genexpr, __pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __Pyx_RefNannyFinishContext(); - return NULL; - } - __Pyx_GOTREF(__pyx_cur_scope); - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_5rados___pyx_scope_struct_1_check_type *) __pyx_self; - __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); - { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5rados_8requires_10check_type_5generator1, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_requires_locals_check_type_local); if (unlikely(!gen)) __PYX_ERR(0, 405, __pyx_L1_error) - __Pyx_DECREF(__pyx_cur_scope); - __Pyx_RefNannyFinishContext(); - return (PyObject *) gen; - } - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("rados.requires.check_type.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_gb_5rados_8requires_10check_type_5generator1(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */ -{ - struct __pyx_obj_5rados___pyx_scope_struct_3_genexpr *__pyx_cur_scope = ((struct __pyx_obj_5rados___pyx_scope_struct_3_genexpr *)__pyx_generator->closure); - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - PyObject *(*__pyx_t_3)(PyObject *); - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("None", 0); - switch (__pyx_generator->resume_label) { - case 0: goto __pyx_L3_first_run; - case 1: goto __pyx_L6_resume_from_yield; - default: /* CPython raises the right error here */ - __Pyx_RefNannyFinishContext(); - return NULL; - } - __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 405, __pyx_L1_error) - - /* "rados.pyx":406 - * return - * type_names = ' or '.join('None' if t is None else t.__name__ - * for t in arg_type) # <<<<<<<<<<<<<< - * raise TypeError('%s must be %s' % (arg_name, type_names)) - * else: - */ - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_arg_type)) { __Pyx_RaiseClosureNameError("arg_type"); __PYX_ERR(0, 406, __pyx_L1_error) } - if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_arg_type)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_arg_type)) { - __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_arg_type; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; - __pyx_t_3 = NULL; - } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_arg_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 406, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 406, __pyx_L1_error) - } - for (;;) { - if (likely(!__pyx_t_3)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { - if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 406, __pyx_L1_error) - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 406, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 406, __pyx_L1_error) - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 406, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } - } else { - __pyx_t_4 = __pyx_t_3(__pyx_t_1); - if (unlikely(!__pyx_t_4)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 406, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_4); - } - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_t); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_t, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - - /* "rados.pyx":405 - * if any(is_type_of(val, t) for t in arg_type): - * return - * type_names = ' or '.join('None' if t is None else t.__name__ # <<<<<<<<<<<<<< - * for t in arg_type) - * raise TypeError('%s must be %s' % (arg_name, type_names)) - */ - __pyx_t_5 = (__pyx_cur_scope->__pyx_v_t == Py_None); - if ((__pyx_t_5 != 0)) { - __Pyx_INCREF(__pyx_n_s_None); - __pyx_t_4 = __pyx_n_s_None; - } else { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_t, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 405, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __pyx_t_6; - __pyx_t_6 = 0; - } - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - __Pyx_XGIVEREF(__pyx_t_1); - __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; - __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; - __pyx_cur_scope->__pyx_t_2 = __pyx_t_3; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - /* return from generator, yielding value */ - __pyx_generator->resume_label = 1; - return __pyx_r; - __pyx_L6_resume_from_yield:; - __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; - __pyx_cur_scope->__pyx_t_0 = 0; - __Pyx_XGOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; - __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 405, __pyx_L1_error) - - /* "rados.pyx":406 - * return - * type_names = ' or '.join('None' if t is None else t.__name__ - * for t in arg_type) # <<<<<<<<<<<<<< - * raise TypeError('%s must be %s' % (arg_name, type_names)) - * else: - */ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":405 - * if any(is_type_of(val, t) for t in arg_type): - * return - * type_names = ' or '.join('None' if t is None else t.__name__ # <<<<<<<<<<<<<< - * for t in arg_type) - * raise TypeError('%s must be %s' % (arg_name, type_names)) - */ - - /* function exit code */ - PyErr_SetNone(PyExc_StopIteration); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_L0:; - __Pyx_XDECREF(__pyx_r); __pyx_r = 0; - __pyx_generator->resume_label = -1; - __Pyx_Coroutine_clear((PyObject*)__pyx_generator); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":401 - * return isinstance(v, t) - * - * def check_type(val, arg_name, arg_type): # <<<<<<<<<<<<<< - * if isinstance(arg_type, tuple): - * if any(is_type_of(val, t) for t in arg_type): - */ - -static PyObject *__pyx_pf_5rados_8requires_2check_type(PyObject *__pyx_self, PyObject *__pyx_v_val, PyObject *__pyx_v_arg_name, PyObject *__pyx_v_arg_type) { - struct __pyx_obj_5rados___pyx_scope_struct_1_check_type *__pyx_cur_scope; - PyObject *__pyx_v_type_names = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - __Pyx_RefNannySetupContext("check_type", 0); - __pyx_cur_scope = (struct __pyx_obj_5rados___pyx_scope_struct_1_check_type *)__pyx_tp_new_5rados___pyx_scope_struct_1_check_type(__pyx_ptype_5rados___pyx_scope_struct_1_check_type, __pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __Pyx_RefNannyFinishContext(); - return NULL; - } - __Pyx_GOTREF(__pyx_cur_scope); - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_5rados___pyx_scope_struct__requires *) __Pyx_CyFunction_GetClosure(__pyx_self); - __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); - __pyx_cur_scope->__pyx_v_val = __pyx_v_val; - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_val); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_val); - __pyx_cur_scope->__pyx_v_arg_type = __pyx_v_arg_type; - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_arg_type); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_arg_type); - - /* "rados.pyx":402 - * - * def check_type(val, arg_name, arg_type): - * if isinstance(arg_type, tuple): # <<<<<<<<<<<<<< - * if any(is_type_of(val, t) for t in arg_type): - * return - */ - __pyx_t_1 = __pyx_cur_scope->__pyx_v_arg_type; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = PyTuple_Check(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = (__pyx_t_2 != 0); - if (__pyx_t_3) { - - /* "rados.pyx":403 - * def check_type(val, arg_name, arg_type): - * if isinstance(arg_type, tuple): - * if any(is_type_of(val, t) for t in arg_type): # <<<<<<<<<<<<<< - * return - * type_names = ' or '.join('None' if t is None else t.__name__ - */ - __pyx_t_1 = __pyx_pf_5rados_8requires_10check_type_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 403, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 403, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 403, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_3) { - - /* "rados.pyx":404 - * if isinstance(arg_type, tuple): - * if any(is_type_of(val, t) for t in arg_type): - * return # <<<<<<<<<<<<<< - * type_names = ' or '.join('None' if t is None else t.__name__ - * for t in arg_type) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - - /* "rados.pyx":403 - * def check_type(val, arg_name, arg_type): - * if isinstance(arg_type, tuple): - * if any(is_type_of(val, t) for t in arg_type): # <<<<<<<<<<<<<< - * return - * type_names = ' or '.join('None' if t is None else t.__name__ - */ - } - - /* "rados.pyx":405 - * if any(is_type_of(val, t) for t in arg_type): - * return - * type_names = ' or '.join('None' if t is None else t.__name__ # <<<<<<<<<<<<<< - * for t in arg_type) - * raise TypeError('%s must be %s' % (arg_name, type_names)) - */ - __pyx_t_4 = __pyx_pf_5rados_8requires_10check_type_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 405, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s_or, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 405, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_type_names = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":407 - * type_names = ' or '.join('None' if t is None else t.__name__ - * for t in arg_type) - * raise TypeError('%s must be %s' % (arg_name, type_names)) # <<<<<<<<<<<<<< - * else: - * if is_type_of(val, arg_type): - */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 407, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_arg_name); - __Pyx_GIVEREF(__pyx_v_arg_name); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_arg_name); - __Pyx_INCREF(__pyx_v_type_names); - __Pyx_GIVEREF(__pyx_v_type_names); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_type_names); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_must_be_s, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 407, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 407, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 407, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 407, __pyx_L1_error) - - /* "rados.pyx":402 - * - * def check_type(val, arg_name, arg_type): - * if isinstance(arg_type, tuple): # <<<<<<<<<<<<<< - * if any(is_type_of(val, t) for t in arg_type): - * return - */ - } - - /* "rados.pyx":409 - * raise TypeError('%s must be %s' % (arg_name, type_names)) - * else: - * if is_type_of(val, arg_type): # <<<<<<<<<<<<<< - * return - * assert(arg_type is not None) - */ - /*else*/ { - __pyx_t_4 = __pyx_cur_scope->__pyx_v_val; - __Pyx_INCREF(__pyx_t_4); - __pyx_t_1 = __pyx_cur_scope->__pyx_v_arg_type; - __Pyx_INCREF(__pyx_t_1); - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_is_type_of)) { __Pyx_RaiseClosureNameError("is_type_of"); __PYX_ERR(0, 409, __pyx_L1_error) } - __pyx_t_5 = __pyx_pf_5rados_8requires_is_type_of(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_is_type_of, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 409, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 409, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_3) { - - /* "rados.pyx":410 - * else: - * if is_type_of(val, arg_type): - * return # <<<<<<<<<<<<<< - * assert(arg_type is not None) - * raise TypeError('%s must be %s' % (arg_name, arg_type.__name__)) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - - /* "rados.pyx":409 - * raise TypeError('%s must be %s' % (arg_name, type_names)) - * else: - * if is_type_of(val, arg_type): # <<<<<<<<<<<<<< - * return - * assert(arg_type is not None) - */ - } - - /* "rados.pyx":411 - * if is_type_of(val, arg_type): - * return - * assert(arg_type is not None) # <<<<<<<<<<<<<< - * raise TypeError('%s must be %s' % (arg_name, arg_type.__name__)) - * - */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(!Py_OptimizeFlag)) { - __pyx_t_3 = (__pyx_cur_scope->__pyx_v_arg_type != Py_None); - if (unlikely(!(__pyx_t_3 != 0))) { - PyErr_SetNone(PyExc_AssertionError); - __PYX_ERR(0, 411, __pyx_L1_error) - } - } - #endif - - /* "rados.pyx":412 - * return - * assert(arg_type is not None) - * raise TypeError('%s must be %s' % (arg_name, arg_type.__name__)) # <<<<<<<<<<<<<< - * - * def wrapper(f): - */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_arg_type, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 412, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_arg_name); - __Pyx_GIVEREF(__pyx_v_arg_name); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_arg_name); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_s_must_be_s, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 412, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 412, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 412, __pyx_L1_error) - } - - /* "rados.pyx":401 - * return isinstance(v, t) - * - * def check_type(val, arg_name, arg_type): # <<<<<<<<<<<<<< - * if isinstance(arg_type, tuple): - * if any(is_type_of(val, t) for t in arg_type): - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.requires.check_type", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_type_names); - __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":414 - * raise TypeError('%s must be %s' % (arg_name, arg_type.__name__)) - * - * def wrapper(f): # <<<<<<<<<<<<<< - * # FIXME(sileht): this stop with - * # AttributeError: 'method_descriptor' object has no attribute '__module__' - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_8requires_5wrapper(PyObject *__pyx_self, PyObject *__pyx_v_f); /*proto*/ -static PyMethodDef __pyx_mdef_5rados_8requires_5wrapper = {"wrapper", (PyCFunction)__pyx_pw_5rados_8requires_5wrapper, METH_O, 0}; -static PyObject *__pyx_pw_5rados_8requires_5wrapper(PyObject *__pyx_self, PyObject *__pyx_v_f) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("wrapper (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_8requires_4wrapper(__pyx_self, ((PyObject *)__pyx_v_f)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":418 - * # AttributeError: 'method_descriptor' object has no attribute '__module__' - * # @wraps(f) - * def validate_func(*args, **kwargs): # <<<<<<<<<<<<<< - * # ignore the `self` arg - * pos_args = zip(args[1:], types) - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_8requires_7wrapper_1validate_func(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_5rados_8requires_7wrapper_1validate_func = {"validate_func", (PyCFunction)__pyx_pw_5rados_8requires_7wrapper_1validate_func, METH_VARARGS|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5rados_8requires_7wrapper_1validate_func(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_args = 0; - PyObject *__pyx_v_kwargs = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("validate_func (wrapper)", 0); - if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "validate_func", 1))) return NULL; - __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; - __Pyx_GOTREF(__pyx_v_kwargs); - __Pyx_INCREF(__pyx_args); - __pyx_v_args = __pyx_args; - __pyx_r = __pyx_pf_5rados_8requires_7wrapper_validate_func(__pyx_self, __pyx_v_args, __pyx_v_kwargs); - - /* function exit code */ - __Pyx_XDECREF(__pyx_v_args); - __Pyx_XDECREF(__pyx_v_kwargs); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} -static PyObject *__pyx_gb_5rados_8requires_7wrapper_13validate_func_2generator2(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ - -/* "rados.pyx":421 - * # ignore the `self` arg - * pos_args = zip(args[1:], types) - * named_args = ((kwargs[name], (name, spec)) for name, spec in types # <<<<<<<<<<<<<< - * if name in kwargs) - * for arg_val, (arg_name, arg_type) in chain(pos_args, named_args): - */ - -static PyObject *__pyx_pf_5rados_8requires_7wrapper_13validate_func_genexpr(PyObject *__pyx_self) { - struct __pyx_obj_5rados___pyx_scope_struct_6_genexpr *__pyx_cur_scope; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_5rados___pyx_scope_struct_6_genexpr *)__pyx_tp_new_5rados___pyx_scope_struct_6_genexpr(__pyx_ptype_5rados___pyx_scope_struct_6_genexpr, __pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __Pyx_RefNannyFinishContext(); - return NULL; - } - __Pyx_GOTREF(__pyx_cur_scope); - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_5rados___pyx_scope_struct_5_validate_func *) __pyx_self; - __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); - { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5rados_8requires_7wrapper_13validate_func_2generator2, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_requires_locals_wrapper_locals_v); if (unlikely(!gen)) __PYX_ERR(0, 421, __pyx_L1_error) - __Pyx_DECREF(__pyx_cur_scope); - __Pyx_RefNannyFinishContext(); - return (PyObject *) gen; - } - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("rados.requires.wrapper.validate_func.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_gb_5rados_8requires_7wrapper_13validate_func_2generator2(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */ -{ - struct __pyx_obj_5rados___pyx_scope_struct_6_genexpr *__pyx_cur_scope = ((struct __pyx_obj_5rados___pyx_scope_struct_6_genexpr *)__pyx_generator->closure); - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *(*__pyx_t_7)(PyObject *); - int __pyx_t_8; - int __pyx_t_9; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("None", 0); - switch (__pyx_generator->resume_label) { - case 0: goto __pyx_L3_first_run; - case 1: goto __pyx_L9_resume_from_yield; - default: /* CPython raises the right error here */ - __Pyx_RefNannyFinishContext(); - return NULL; - } - __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 421, __pyx_L1_error) - - /* "rados.pyx":422 - * pos_args = zip(args[1:], types) - * named_args = ((kwargs[name], (name, spec)) for name, spec in types - * if name in kwargs) # <<<<<<<<<<<<<< - * for arg_val, (arg_name, arg_type) in chain(pos_args, named_args): - * check_type(arg_val, arg_name, arg_type) - */ - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_types)) { __Pyx_RaiseClosureNameError("types"); __PYX_ERR(0, 422, __pyx_L1_error) } - if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_types == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 422, __pyx_L1_error) - } - - /* "rados.pyx":421 - * # ignore the `self` arg - * pos_args = zip(args[1:], types) - * named_args = ((kwargs[name], (name, spec)) for name, spec in types # <<<<<<<<<<<<<< - * if name in kwargs) - * for arg_val, (arg_name, arg_type) in chain(pos_args, named_args): - */ - __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_types; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; - for (;;) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 421, __pyx_L1_error) - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 421, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { - PyObject* sequence = __pyx_t_3; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 421, __pyx_L1_error) - } - #if CYTHON_COMPILING_IN_CPYTHON - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); - } else { - __pyx_t_4 = PyList_GET_ITEM(sequence, 0); - __pyx_t_5 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - #else - __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 421, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 421, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - #endif - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 421, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; - index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed; - __Pyx_GOTREF(__pyx_t_4); - index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; - __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 421, __pyx_L1_error) - __pyx_t_7 = NULL; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - goto __pyx_L7_unpacking_done; - __pyx_L6_unpacking_failed:; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_7 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 421, __pyx_L1_error) - __pyx_L7_unpacking_done:; - } - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_name); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_name, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_spec); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_spec, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_5 = 0; - - /* "rados.pyx":422 - * pos_args = zip(args[1:], types) - * named_args = ((kwargs[name], (name, spec)) for name, spec in types - * if name in kwargs) # <<<<<<<<<<<<<< - * for arg_val, (arg_name, arg_type) in chain(pos_args, named_args): - * check_type(arg_val, arg_name, arg_type) - */ - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs)) { __Pyx_RaiseClosureNameError("kwargs"); __PYX_ERR(0, 422, __pyx_L1_error) } - if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 422, __pyx_L1_error) - } - __pyx_t_8 = (__Pyx_PyDict_ContainsTF(__pyx_cur_scope->__pyx_v_name, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 422, __pyx_L1_error) - __pyx_t_9 = (__pyx_t_8 != 0); - if (__pyx_t_9) { - - /* "rados.pyx":421 - * # ignore the `self` arg - * pos_args = zip(args[1:], types) - * named_args = ((kwargs[name], (name, spec)) for name, spec in types # <<<<<<<<<<<<<< - * if name in kwargs) - * for arg_val, (arg_name, arg_type) in chain(pos_args, named_args): - */ - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs)) { __Pyx_RaiseClosureNameError("kwargs"); __PYX_ERR(0, 421, __pyx_L1_error) } - if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 421, __pyx_L1_error) - } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs, __pyx_cur_scope->__pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 421, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 421, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_name); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_name); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_cur_scope->__pyx_v_name); - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_spec); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_spec); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_cur_scope->__pyx_v_spec); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 421, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); - __pyx_t_3 = 0; - __pyx_t_5 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - __Pyx_XGIVEREF(__pyx_t_1); - __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; - __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - /* return from generator, yielding value */ - __pyx_generator->resume_label = 1; - return __pyx_r; - __pyx_L9_resume_from_yield:; - __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; - __pyx_cur_scope->__pyx_t_0 = 0; - __Pyx_XGOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 421, __pyx_L1_error) - - /* "rados.pyx":422 - * pos_args = zip(args[1:], types) - * named_args = ((kwargs[name], (name, spec)) for name, spec in types - * if name in kwargs) # <<<<<<<<<<<<<< - * for arg_val, (arg_name, arg_type) in chain(pos_args, named_args): - * check_type(arg_val, arg_name, arg_type) - */ - } - - /* "rados.pyx":421 - * # ignore the `self` arg - * pos_args = zip(args[1:], types) - * named_args = ((kwargs[name], (name, spec)) for name, spec in types # <<<<<<<<<<<<<< - * if name in kwargs) - * for arg_val, (arg_name, arg_type) in chain(pos_args, named_args): - */ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* function exit code */ - PyErr_SetNone(PyExc_StopIteration); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_L0:; - __Pyx_XDECREF(__pyx_r); __pyx_r = 0; - __pyx_generator->resume_label = -1; - __Pyx_Coroutine_clear((PyObject*)__pyx_generator); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":418 - * # AttributeError: 'method_descriptor' object has no attribute '__module__' - * # @wraps(f) - * def validate_func(*args, **kwargs): # <<<<<<<<<<<<<< - * # ignore the `self` arg - * pos_args = zip(args[1:], types) - */ - -static PyObject *__pyx_pf_5rados_8requires_7wrapper_validate_func(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { - struct __pyx_obj_5rados___pyx_scope_struct_5_validate_func *__pyx_cur_scope; - PyObject *__pyx_v_pos_args = NULL; - PyObject *__pyx_v_named_args = NULL; - PyObject *__pyx_v_arg_val = NULL; - PyObject *__pyx_v_arg_name = NULL; - PyObject *__pyx_v_arg_type = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *(*__pyx_t_6)(PyObject *); - PyObject *__pyx_t_7 = NULL; - PyObject *(*__pyx_t_8)(PyObject *); - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - __Pyx_RefNannySetupContext("validate_func", 0); - __pyx_cur_scope = (struct __pyx_obj_5rados___pyx_scope_struct_5_validate_func *)__pyx_tp_new_5rados___pyx_scope_struct_5_validate_func(__pyx_ptype_5rados___pyx_scope_struct_5_validate_func, __pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __Pyx_RefNannyFinishContext(); - return NULL; - } - __Pyx_GOTREF(__pyx_cur_scope); - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_5rados___pyx_scope_struct_4_wrapper *) __Pyx_CyFunction_GetClosure(__pyx_self); - __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); - __pyx_cur_scope->__pyx_v_kwargs = __pyx_v_kwargs; - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_kwargs); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_kwargs); - - /* "rados.pyx":420 - * def validate_func(*args, **kwargs): - * # ignore the `self` arg - * pos_args = zip(args[1:], types) # <<<<<<<<<<<<<< - * named_args = ((kwargs[name], (name, spec)) for name, spec in types - * if name in kwargs) - */ - __pyx_t_1 = __Pyx_PyTuple_GetSlice(__pyx_v_args, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_types)) { __Pyx_RaiseClosureNameError("types"); __PYX_ERR(0, 420, __pyx_L1_error) } - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); - __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_types); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_types); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_types); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_pos_args = __pyx_t_1; - __pyx_t_1 = 0; - - /* "rados.pyx":421 - * # ignore the `self` arg - * pos_args = zip(args[1:], types) - * named_args = ((kwargs[name], (name, spec)) for name, spec in types # <<<<<<<<<<<<<< - * if name in kwargs) - * for arg_val, (arg_name, arg_type) in chain(pos_args, named_args): - */ - __pyx_t_1 = __pyx_pf_5rados_8requires_7wrapper_13validate_func_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 421, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_named_args = __pyx_t_1; - __pyx_t_1 = 0; - - /* "rados.pyx":423 - * named_args = ((kwargs[name], (name, spec)) for name, spec in types - * if name in kwargs) - * for arg_val, (arg_name, arg_type) in chain(pos_args, named_args): # <<<<<<<<<<<<<< - * check_type(arg_val, arg_name, arg_type) - * return f(*args, **kwargs) - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_chain); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 423, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 423, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_pos_args); - __Pyx_GIVEREF(__pyx_v_pos_args); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_pos_args); - __Pyx_INCREF(__pyx_v_named_args); - __Pyx_GIVEREF(__pyx_v_named_args); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_named_args); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; - __pyx_t_6 = NULL; - } else { - __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 423, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 423, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { - if (likely(!__pyx_t_6)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 423, __pyx_L1_error) - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } else { - if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 423, __pyx_L1_error) - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } - } else { - __pyx_t_1 = __pyx_t_6(__pyx_t_2); - if (unlikely(!__pyx_t_1)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 423, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_1); - } - if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { - PyObject* sequence = __pyx_t_1; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 423, __pyx_L1_error) - } - #if CYTHON_COMPILING_IN_CPYTHON - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); - } else { - __pyx_t_5 = PyList_GET_ITEM(sequence, 0); - __pyx_t_3 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(__pyx_t_3); - #else - __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 423, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 423, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 423, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; - index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; - __Pyx_GOTREF(__pyx_t_5); - index = 1; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 423, __pyx_L1_error) - __pyx_t_8 = NULL; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - goto __pyx_L6_unpacking_done; - __pyx_L5_unpacking_failed:; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_8 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 423, __pyx_L1_error) - __pyx_L6_unpacking_done:; - } - __Pyx_XDECREF_SET(__pyx_v_arg_val, __pyx_t_5); - __pyx_t_5 = 0; - if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { - PyObject* sequence = __pyx_t_3; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 423, __pyx_L1_error) - } - #if CYTHON_COMPILING_IN_CPYTHON - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); - } else { - __pyx_t_7 = PyList_GET_ITEM(sequence, 0); - __pyx_t_9 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(__pyx_t_9); - #else - __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 423, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 423, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - #endif - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 423, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_8 = Py_TYPE(__pyx_t_10)->tp_iternext; - index = 0; __pyx_t_7 = __pyx_t_8(__pyx_t_10); if (unlikely(!__pyx_t_7)) goto __pyx_L7_unpacking_failed; - __Pyx_GOTREF(__pyx_t_7); - index = 1; __pyx_t_9 = __pyx_t_8(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L7_unpacking_failed; - __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_10), 2) < 0) __PYX_ERR(0, 423, __pyx_L1_error) - __pyx_t_8 = NULL; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - goto __pyx_L8_unpacking_done; - __pyx_L7_unpacking_failed:; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_8 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 423, __pyx_L1_error) - __pyx_L8_unpacking_done:; - } - __Pyx_XDECREF_SET(__pyx_v_arg_name, __pyx_t_7); - __pyx_t_7 = 0; - __Pyx_XDECREF_SET(__pyx_v_arg_type, __pyx_t_9); - __pyx_t_9 = 0; - - /* "rados.pyx":424 - * if name in kwargs) - * for arg_val, (arg_name, arg_type) in chain(pos_args, named_args): - * check_type(arg_val, arg_name, arg_type) # <<<<<<<<<<<<<< - * return f(*args, **kwargs) - * return validate_func - */ - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_check_type)) { __Pyx_RaiseClosureNameError("check_type"); __PYX_ERR(0, 424, __pyx_L1_error) } - __pyx_t_1 = __pyx_pf_5rados_8requires_2check_type(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_check_type, __pyx_v_arg_val, __pyx_v_arg_name, __pyx_v_arg_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 424, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":423 - * named_args = ((kwargs[name], (name, spec)) for name, spec in types - * if name in kwargs) - * for arg_val, (arg_name, arg_type) in chain(pos_args, named_args): # <<<<<<<<<<<<<< - * check_type(arg_val, arg_name, arg_type) - * return f(*args, **kwargs) - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":425 - * for arg_val, (arg_name, arg_type) in chain(pos_args, named_args): - * check_type(arg_val, arg_name, arg_type) - * return f(*args, **kwargs) # <<<<<<<<<<<<<< - * return validate_func - * return wrapper - */ - __Pyx_XDECREF(__pyx_r); - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_f)) { __Pyx_RaiseClosureNameError("f"); __PYX_ERR(0, 425, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_f, __pyx_v_args, __pyx_cur_scope->__pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 425, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "rados.pyx":418 - * # AttributeError: 'method_descriptor' object has no attribute '__module__' - * # @wraps(f) - * def validate_func(*args, **kwargs): # <<<<<<<<<<<<<< - * # ignore the `self` arg - * pos_args = zip(args[1:], types) - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_10); - __Pyx_AddTraceback("rados.requires.wrapper.validate_func", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_pos_args); - __Pyx_XDECREF(__pyx_v_named_args); - __Pyx_XDECREF(__pyx_v_arg_val); - __Pyx_XDECREF(__pyx_v_arg_name); - __Pyx_XDECREF(__pyx_v_arg_type); - __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":414 - * raise TypeError('%s must be %s' % (arg_name, arg_type.__name__)) - * - * def wrapper(f): # <<<<<<<<<<<<<< - * # FIXME(sileht): this stop with - * # AttributeError: 'method_descriptor' object has no attribute '__module__' - */ - -static PyObject *__pyx_pf_5rados_8requires_4wrapper(PyObject *__pyx_self, PyObject *__pyx_v_f) { - struct __pyx_obj_5rados___pyx_scope_struct_4_wrapper *__pyx_cur_scope; - PyObject *__pyx_v_validate_func = 0; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("wrapper", 0); - __pyx_cur_scope = (struct __pyx_obj_5rados___pyx_scope_struct_4_wrapper *)__pyx_tp_new_5rados___pyx_scope_struct_4_wrapper(__pyx_ptype_5rados___pyx_scope_struct_4_wrapper, __pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __Pyx_RefNannyFinishContext(); - return NULL; - } - __Pyx_GOTREF(__pyx_cur_scope); - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_5rados___pyx_scope_struct__requires *) __Pyx_CyFunction_GetClosure(__pyx_self); - __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); - __pyx_cur_scope->__pyx_v_f = __pyx_v_f; - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f); - - /* "rados.pyx":418 - * # AttributeError: 'method_descriptor' object has no attribute '__module__' - * # @wraps(f) - * def validate_func(*args, **kwargs): # <<<<<<<<<<<<<< - * # ignore the `self` arg - * pos_args = zip(args[1:], types) - */ - __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5rados_8requires_7wrapper_1validate_func, 0, __pyx_n_s_requires_locals_wrapper_locals_v_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_rados, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_validate_func = __pyx_t_1; - __pyx_t_1 = 0; - - /* "rados.pyx":426 - * check_type(arg_val, arg_name, arg_type) - * return f(*args, **kwargs) - * return validate_func # <<<<<<<<<<<<<< - * return wrapper - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_validate_func); - __pyx_r = __pyx_v_validate_func; - goto __pyx_L0; - - /* "rados.pyx":414 - * raise TypeError('%s must be %s' % (arg_name, arg_type.__name__)) - * - * def wrapper(f): # <<<<<<<<<<<<<< - * # FIXME(sileht): this stop with - * # AttributeError: 'method_descriptor' object has no attribute '__module__' - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rados.requires.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_validate_func); - __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":394 - * # validate argument types of an instance method - * # kwargs is an un-ordered dict, so use args instead - * def requires(*types): # <<<<<<<<<<<<<< - * def is_type_of(v, t): - * if t is None: - */ - -static PyObject *__pyx_pf_5rados_2requires(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_types) { - struct __pyx_obj_5rados___pyx_scope_struct__requires *__pyx_cur_scope; - PyObject *__pyx_v_wrapper = 0; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("requires", 0); - __pyx_cur_scope = (struct __pyx_obj_5rados___pyx_scope_struct__requires *)__pyx_tp_new_5rados___pyx_scope_struct__requires(__pyx_ptype_5rados___pyx_scope_struct__requires, __pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __Pyx_RefNannyFinishContext(); - return NULL; - } - __Pyx_GOTREF(__pyx_cur_scope); - __pyx_cur_scope->__pyx_v_types = __pyx_v_types; - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_types); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_types); - - /* "rados.pyx":395 - * # kwargs is an un-ordered dict, so use args instead - * def requires(*types): - * def is_type_of(v, t): # <<<<<<<<<<<<<< - * if t is None: - * return v is None - */ - __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5rados_8requires_1is_type_of, 0, __pyx_n_s_requires_locals_is_type_of, NULL, __pyx_n_s_rados, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_cur_scope->__pyx_v_is_type_of = __pyx_t_1; - __pyx_t_1 = 0; - - /* "rados.pyx":401 - * return isinstance(v, t) - * - * def check_type(val, arg_name, arg_type): # <<<<<<<<<<<<<< - * if isinstance(arg_type, tuple): - * if any(is_type_of(val, t) for t in arg_type): - */ - __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5rados_8requires_3check_type, 0, __pyx_n_s_requires_locals_check_type, ((PyObject*)__pyx_cur_scope), __pyx_n_s_rados, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 401, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_cur_scope->__pyx_v_check_type = __pyx_t_1; - __pyx_t_1 = 0; - - /* "rados.pyx":414 - * raise TypeError('%s must be %s' % (arg_name, arg_type.__name__)) - * - * def wrapper(f): # <<<<<<<<<<<<<< - * # FIXME(sileht): this stop with - * # AttributeError: 'method_descriptor' object has no attribute '__module__' - */ - __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5rados_8requires_5wrapper, 0, __pyx_n_s_requires_locals_wrapper, ((PyObject*)__pyx_cur_scope), __pyx_n_s_rados, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 414, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_wrapper = __pyx_t_1; - __pyx_t_1 = 0; - - /* "rados.pyx":427 - * return f(*args, **kwargs) - * return validate_func - * return wrapper # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_wrapper); - __pyx_r = __pyx_v_wrapper; - goto __pyx_L0; - - /* "rados.pyx":394 - * # validate argument types of an instance method - * # kwargs is an un-ordered dict, so use args instead - * def requires(*types): # <<<<<<<<<<<<<< - * def is_type_of(v, t): - * if t is None: - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rados.requires", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_wrapper); - __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":430 - * - * - * def cstr(val, name, encoding="utf-8", opt=False): # <<<<<<<<<<<<<< - * """ - * Create a byte string from a Python string - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5cstr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_4cstr[] = "cstr(val, name, encoding='utf-8', opt=False)\n\n Create a byte string from a Python string\n\n :param basestring val: Python string\n :param str name: Name of the string parameter, for exceptions\n :param str encoding: Encoding to use\n :param bool opt: If True, None is allowed\n :rtype: bytes\n :raises: :class:`InvalidArgument`\n "; -static PyMethodDef __pyx_mdef_5rados_5cstr = {"cstr", (PyCFunction)__pyx_pw_5rados_5cstr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_4cstr}; -static PyObject *__pyx_pw_5rados_5cstr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_val = 0; - PyObject *__pyx_v_name = 0; - PyObject *__pyx_v_encoding = 0; - PyObject *__pyx_v_opt = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("cstr (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_val,&__pyx_n_s_name_2,&__pyx_n_s_encoding,&__pyx_n_s_opt,0}; - PyObject* values[4] = {0,0,0,0}; - values[2] = ((PyObject *)__pyx_kp_s_utf_8); - values[3] = ((PyObject *)Py_False); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name_2)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("cstr", 0, 2, 4, 1); __PYX_ERR(0, 430, __pyx_L3_error) - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_encoding); - if (value) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_opt); - if (value) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cstr") < 0)) __PYX_ERR(0, 430, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_val = values[0]; - __pyx_v_name = values[1]; - __pyx_v_encoding = values[2]; - __pyx_v_opt = values[3]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("cstr", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 430, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.cstr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_4cstr(__pyx_self, __pyx_v_val, __pyx_v_name, __pyx_v_encoding, __pyx_v_opt); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_4cstr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_val, PyObject *__pyx_v_name, PyObject *__pyx_v_encoding, PyObject *__pyx_v_opt) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - __Pyx_RefNannySetupContext("cstr", 0); - - /* "rados.pyx":441 - * :raises: :class:`InvalidArgument` - * """ - * if opt and val is None: # <<<<<<<<<<<<<< - * return None - * if isinstance(val, bytes): - */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_opt); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 441, __pyx_L1_error) - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_2 = (__pyx_v_val == Py_None); - __pyx_t_3 = (__pyx_t_2 != 0); - __pyx_t_1 = __pyx_t_3; - __pyx_L4_bool_binop_done:; - if (__pyx_t_1) { - - /* "rados.pyx":442 - * """ - * if opt and val is None: - * return None # <<<<<<<<<<<<<< - * if isinstance(val, bytes): - * return val - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; - - /* "rados.pyx":441 - * :raises: :class:`InvalidArgument` - * """ - * if opt and val is None: # <<<<<<<<<<<<<< - * return None - * if isinstance(val, bytes): - */ - } - - /* "rados.pyx":443 - * if opt and val is None: - * return None - * if isinstance(val, bytes): # <<<<<<<<<<<<<< - * return val - * elif isinstance(val, unicode): - */ - __pyx_t_1 = PyBytes_Check(__pyx_v_val); - __pyx_t_3 = (__pyx_t_1 != 0); - if (__pyx_t_3) { - - /* "rados.pyx":444 - * return None - * if isinstance(val, bytes): - * return val # <<<<<<<<<<<<<< - * elif isinstance(val, unicode): - * return val.encode(encoding) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_val); - __pyx_r = __pyx_v_val; - goto __pyx_L0; - - /* "rados.pyx":443 - * if opt and val is None: - * return None - * if isinstance(val, bytes): # <<<<<<<<<<<<<< - * return val - * elif isinstance(val, unicode): - */ - } - - /* "rados.pyx":445 - * if isinstance(val, bytes): - * return val - * elif isinstance(val, unicode): # <<<<<<<<<<<<<< - * return val.encode(encoding) - * else: - */ - __pyx_t_3 = PyUnicode_Check(__pyx_v_val); - __pyx_t_1 = (__pyx_t_3 != 0); - if (__pyx_t_1) { - - /* "rados.pyx":446 - * return val - * elif isinstance(val, unicode): - * return val.encode(encoding) # <<<<<<<<<<<<<< - * else: - * raise TypeError('%s must be a string' % name) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 446, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - } - } - if (!__pyx_t_6) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_encoding); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 446, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - } else { - __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 446, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; - __Pyx_INCREF(__pyx_v_encoding); - __Pyx_GIVEREF(__pyx_v_encoding); - PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_encoding); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 446, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - /* "rados.pyx":445 - * if isinstance(val, bytes): - * return val - * elif isinstance(val, unicode): # <<<<<<<<<<<<<< - * return val.encode(encoding) - * else: - */ - } - - /* "rados.pyx":448 - * return val.encode(encoding) - * else: - * raise TypeError('%s must be a string' % name) # <<<<<<<<<<<<<< - * - * - */ - /*else*/ { - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_must_be_a_string, __pyx_v_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 448, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 448, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 448, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 448, __pyx_L1_error) - } - - /* "rados.pyx":430 - * - * - * def cstr(val, name, encoding="utf-8", opt=False): # <<<<<<<<<<<<<< - * """ - * Create a byte string from a Python string - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("rados.cstr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":451 - * - * - * def cstr_list(list_str, name, encoding="utf-8"): # <<<<<<<<<<<<<< - * return [cstr(s, name) for s in list_str] - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_7cstr_list(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_6cstr_list[] = "cstr_list(list_str, name, encoding='utf-8')"; -static PyMethodDef __pyx_mdef_5rados_7cstr_list = {"cstr_list", (PyCFunction)__pyx_pw_5rados_7cstr_list, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_6cstr_list}; -static PyObject *__pyx_pw_5rados_7cstr_list(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_list_str = 0; - PyObject *__pyx_v_name = 0; - CYTHON_UNUSED PyObject *__pyx_v_encoding = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("cstr_list (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_list_str,&__pyx_n_s_name_2,&__pyx_n_s_encoding,0}; - PyObject* values[3] = {0,0,0}; - values[2] = ((PyObject *)__pyx_kp_s_utf_8); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_list_str)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name_2)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("cstr_list", 0, 2, 3, 1); __PYX_ERR(0, 451, __pyx_L3_error) - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_encoding); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cstr_list") < 0)) __PYX_ERR(0, 451, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_list_str = values[0]; - __pyx_v_name = values[1]; - __pyx_v_encoding = values[2]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("cstr_list", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 451, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.cstr_list", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_6cstr_list(__pyx_self, __pyx_v_list_str, __pyx_v_name, __pyx_v_encoding); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_6cstr_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_list_str, PyObject *__pyx_v_name, CYTHON_UNUSED PyObject *__pyx_v_encoding) { - PyObject *__pyx_v_s = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - Py_ssize_t __pyx_t_3; - PyObject *(*__pyx_t_4)(PyObject *); - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - Py_ssize_t __pyx_t_8; - PyObject *__pyx_t_9 = NULL; - __Pyx_RefNannySetupContext("cstr_list", 0); - - /* "rados.pyx":452 - * - * def cstr_list(list_str, name, encoding="utf-8"): - * return [cstr(s, name) for s in list_str] # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (likely(PyList_CheckExact(__pyx_v_list_str)) || PyTuple_CheckExact(__pyx_v_list_str)) { - __pyx_t_2 = __pyx_v_list_str; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; - __pyx_t_4 = NULL; - } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_list_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 452, __pyx_L1_error) - } - for (;;) { - if (likely(!__pyx_t_4)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 452, __pyx_L1_error) - #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - #endif - } else { - if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 452, __pyx_L1_error) - #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - #endif - } - } else { - __pyx_t_5 = __pyx_t_4(__pyx_t_2); - if (unlikely(!__pyx_t_5)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 452, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_5); - } - __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = NULL; - __pyx_t_8 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_8 = 1; - } - } - __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - if (__pyx_t_7) { - __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; - } - __Pyx_INCREF(__pyx_v_s); - __Pyx_GIVEREF(__pyx_v_s); - PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_s); - __Pyx_INCREF(__pyx_v_name); - __Pyx_GIVEREF(__pyx_v_name); - PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_name); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 452, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "rados.pyx":451 - * - * - * def cstr_list(list_str, name, encoding="utf-8"): # <<<<<<<<<<<<<< - * return [cstr(s, name) for s in list_str] - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("rados.cstr_list", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_s); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":455 - * - * - * def decode_cstr(val, encoding="utf-8"): # <<<<<<<<<<<<<< - * """ - * Decode a byte string into a Python string. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_9decode_cstr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_8decode_cstr[] = "decode_cstr(val, encoding='utf-8')\n\n Decode a byte string into a Python string.\n\n :param bytes val: byte string\n :rtype: unicode or None\n "; -static PyMethodDef __pyx_mdef_5rados_9decode_cstr = {"decode_cstr", (PyCFunction)__pyx_pw_5rados_9decode_cstr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_8decode_cstr}; -static PyObject *__pyx_pw_5rados_9decode_cstr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_val = 0; - PyObject *__pyx_v_encoding = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("decode_cstr (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_val,&__pyx_n_s_encoding,0}; - PyObject* values[2] = {0,0}; - values[1] = ((PyObject *)__pyx_kp_s_utf_8); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_encoding); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decode_cstr") < 0)) __PYX_ERR(0, 455, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_val = values[0]; - __pyx_v_encoding = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("decode_cstr", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 455, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.decode_cstr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_8decode_cstr(__pyx_self, __pyx_v_val, __pyx_v_encoding); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_8decode_cstr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_val, PyObject *__pyx_v_encoding) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - __Pyx_RefNannySetupContext("decode_cstr", 0); - - /* "rados.pyx":462 - * :rtype: unicode or None - * """ - * if val is None: # <<<<<<<<<<<<<< - * return None - * - */ - __pyx_t_1 = (__pyx_v_val == Py_None); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - - /* "rados.pyx":463 - * """ - * if val is None: - * return None # <<<<<<<<<<<<<< - * - * return val.decode(encoding) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; - - /* "rados.pyx":462 - * :rtype: unicode or None - * """ - * if val is None: # <<<<<<<<<<<<<< - * return None - * - */ - } - - /* "rados.pyx":465 - * return None - * - * return val.decode(encoding) # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 465, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - } - } - if (!__pyx_t_5) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_encoding); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - } else { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 465, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; - __Pyx_INCREF(__pyx_v_encoding); - __Pyx_GIVEREF(__pyx_v_encoding); - PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_encoding); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - - /* "rados.pyx":455 - * - * - * def decode_cstr(val, encoding="utf-8"): # <<<<<<<<<<<<<< - * """ - * Decode a byte string into a Python string. - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("rados.decode_cstr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":468 - * - * - * cdef char* opt_str(s) except? NULL: # <<<<<<<<<<<<<< - * if s is None: - * return NULL - */ - -static char *__pyx_f_5rados_opt_str(PyObject *__pyx_v_s) { - char *__pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - char *__pyx_t_3; - __Pyx_RefNannySetupContext("opt_str", 0); - - /* "rados.pyx":469 - * - * cdef char* opt_str(s) except? NULL: - * if s is None: # <<<<<<<<<<<<<< - * return NULL - * return s - */ - __pyx_t_1 = (__pyx_v_s == Py_None); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - - /* "rados.pyx":470 - * cdef char* opt_str(s) except? NULL: - * if s is None: - * return NULL # <<<<<<<<<<<<<< - * return s - * - */ - __pyx_r = NULL; - goto __pyx_L0; - - /* "rados.pyx":469 - * - * cdef char* opt_str(s) except? NULL: - * if s is None: # <<<<<<<<<<<<<< - * return NULL - * return s - */ - } - - /* "rados.pyx":471 - * if s is None: - * return NULL - * return s # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_s); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 471, __pyx_L1_error) - __pyx_r = __pyx_t_3; - goto __pyx_L0; - - /* "rados.pyx":468 - * - * - * cdef char* opt_str(s) except? NULL: # <<<<<<<<<<<<<< - * if s is None: - * return NULL - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("rados.opt_str", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":474 - * - * - * cdef void* realloc_chk(void* ptr, size_t size) except NULL: # <<<<<<<<<<<<<< - * cdef void *ret = realloc(ptr, size) - * if ret == NULL: - */ - -static void *__pyx_f_5rados_realloc_chk(void *__pyx_v_ptr, size_t __pyx_v_size) { - void *__pyx_v_ret; - void *__pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("realloc_chk", 0); - - /* "rados.pyx":475 - * - * cdef void* realloc_chk(void* ptr, size_t size) except NULL: - * cdef void *ret = realloc(ptr, size) # <<<<<<<<<<<<<< - * if ret == NULL: - * raise MemoryError("realloc failed") - */ - __pyx_v_ret = realloc(__pyx_v_ptr, __pyx_v_size); - - /* "rados.pyx":476 - * cdef void* realloc_chk(void* ptr, size_t size) except NULL: - * cdef void *ret = realloc(ptr, size) - * if ret == NULL: # <<<<<<<<<<<<<< - * raise MemoryError("realloc failed") - * return ret - */ - __pyx_t_1 = ((__pyx_v_ret == NULL) != 0); - if (__pyx_t_1) { - - /* "rados.pyx":477 - * cdef void *ret = realloc(ptr, size) - * if ret == NULL: - * raise MemoryError("realloc failed") # <<<<<<<<<<<<<< - * return ret - * - */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 477, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 477, __pyx_L1_error) - - /* "rados.pyx":476 - * cdef void* realloc_chk(void* ptr, size_t size) except NULL: - * cdef void *ret = realloc(ptr, size) - * if ret == NULL: # <<<<<<<<<<<<<< - * raise MemoryError("realloc failed") - * return ret - */ - } - - /* "rados.pyx":478 - * if ret == NULL: - * raise MemoryError("realloc failed") - * return ret # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = __pyx_v_ret; - goto __pyx_L0; - - /* "rados.pyx":474 - * - * - * cdef void* realloc_chk(void* ptr, size_t size) except NULL: # <<<<<<<<<<<<<< - * cdef void *ret = realloc(ptr, size) - * if ret == NULL: - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("rados.realloc_chk", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":481 - * - * - * cdef size_t * to_csize_t_array(list_int): # <<<<<<<<<<<<<< - * cdef size_t *ret = malloc(len(list_int) * sizeof(size_t)) - * if ret == NULL: - */ - -static size_t *__pyx_f_5rados_to_csize_t_array(PyObject *__pyx_v_list_int) { - size_t *__pyx_v_ret; - Py_ssize_t __pyx_v_i; - size_t *__pyx_r; - __Pyx_RefNannyDeclarations - Py_ssize_t __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - size_t __pyx_t_5; - __Pyx_RefNannySetupContext("to_csize_t_array", 0); - - /* "rados.pyx":482 - * - * cdef size_t * to_csize_t_array(list_int): - * cdef size_t *ret = malloc(len(list_int) * sizeof(size_t)) # <<<<<<<<<<<<<< - * if ret == NULL: - * raise MemoryError("malloc failed") - */ - __pyx_t_1 = PyObject_Length(__pyx_v_list_int); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 482, __pyx_L1_error) - __pyx_v_ret = ((size_t *)malloc((__pyx_t_1 * (sizeof(size_t))))); - - /* "rados.pyx":483 - * cdef size_t * to_csize_t_array(list_int): - * cdef size_t *ret = malloc(len(list_int) * sizeof(size_t)) - * if ret == NULL: # <<<<<<<<<<<<<< - * raise MemoryError("malloc failed") - * for i in xrange(len(list_int)): - */ - __pyx_t_2 = ((__pyx_v_ret == NULL) != 0); - if (__pyx_t_2) { - - /* "rados.pyx":484 - * cdef size_t *ret = malloc(len(list_int) * sizeof(size_t)) - * if ret == NULL: - * raise MemoryError("malloc failed") # <<<<<<<<<<<<<< - * for i in xrange(len(list_int)): - * ret[i] = list_int[i] - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 484, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 484, __pyx_L1_error) - - /* "rados.pyx":483 - * cdef size_t * to_csize_t_array(list_int): - * cdef size_t *ret = malloc(len(list_int) * sizeof(size_t)) - * if ret == NULL: # <<<<<<<<<<<<<< - * raise MemoryError("malloc failed") - * for i in xrange(len(list_int)): - */ - } - - /* "rados.pyx":485 - * if ret == NULL: - * raise MemoryError("malloc failed") - * for i in xrange(len(list_int)): # <<<<<<<<<<<<<< - * ret[i] = list_int[i] - * return ret - */ - __pyx_t_1 = PyObject_Length(__pyx_v_list_int); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 485, __pyx_L1_error) - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; - - /* "rados.pyx":486 - * raise MemoryError("malloc failed") - * for i in xrange(len(list_int)): - * ret[i] = list_int[i] # <<<<<<<<<<<<<< - * return ret - * - */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_list_int, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 486, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_t_3); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 486, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - (__pyx_v_ret[__pyx_v_i]) = ((size_t)__pyx_t_5); - } - - /* "rados.pyx":487 - * for i in xrange(len(list_int)): - * ret[i] = list_int[i] - * return ret # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = __pyx_v_ret; - goto __pyx_L0; - - /* "rados.pyx":481 - * - * - * cdef size_t * to_csize_t_array(list_int): # <<<<<<<<<<<<<< - * cdef size_t *ret = malloc(len(list_int) * sizeof(size_t)) - * if ret == NULL: - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("rados.to_csize_t_array", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":490 - * - * - * cdef char ** to_bytes_array(list_bytes): # <<<<<<<<<<<<<< - * cdef char **ret = malloc(len(list_bytes) * sizeof(char *)) - * if ret == NULL: - */ - -static char **__pyx_f_5rados_to_bytes_array(PyObject *__pyx_v_list_bytes) { - char **__pyx_v_ret; - Py_ssize_t __pyx_v_i; - char **__pyx_r; - __Pyx_RefNannyDeclarations - Py_ssize_t __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - char *__pyx_t_5; - __Pyx_RefNannySetupContext("to_bytes_array", 0); - - /* "rados.pyx":491 - * - * cdef char ** to_bytes_array(list_bytes): - * cdef char **ret = malloc(len(list_bytes) * sizeof(char *)) # <<<<<<<<<<<<<< - * if ret == NULL: - * raise MemoryError("malloc failed") - */ - __pyx_t_1 = PyObject_Length(__pyx_v_list_bytes); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 491, __pyx_L1_error) - __pyx_v_ret = ((char **)malloc((__pyx_t_1 * (sizeof(char *))))); - - /* "rados.pyx":492 - * cdef char ** to_bytes_array(list_bytes): - * cdef char **ret = malloc(len(list_bytes) * sizeof(char *)) - * if ret == NULL: # <<<<<<<<<<<<<< - * raise MemoryError("malloc failed") - * for i in xrange(len(list_bytes)): - */ - __pyx_t_2 = ((__pyx_v_ret == NULL) != 0); - if (__pyx_t_2) { - - /* "rados.pyx":493 - * cdef char **ret = malloc(len(list_bytes) * sizeof(char *)) - * if ret == NULL: - * raise MemoryError("malloc failed") # <<<<<<<<<<<<<< - * for i in xrange(len(list_bytes)): - * ret[i] = list_bytes[i] - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 493, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 493, __pyx_L1_error) - - /* "rados.pyx":492 - * cdef char ** to_bytes_array(list_bytes): - * cdef char **ret = malloc(len(list_bytes) * sizeof(char *)) - * if ret == NULL: # <<<<<<<<<<<<<< - * raise MemoryError("malloc failed") - * for i in xrange(len(list_bytes)): - */ - } - - /* "rados.pyx":494 - * if ret == NULL: - * raise MemoryError("malloc failed") - * for i in xrange(len(list_bytes)): # <<<<<<<<<<<<<< - * ret[i] = list_bytes[i] - * return ret - */ - __pyx_t_1 = PyObject_Length(__pyx_v_list_bytes); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 494, __pyx_L1_error) - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; - - /* "rados.pyx":495 - * raise MemoryError("malloc failed") - * for i in xrange(len(list_bytes)): - * ret[i] = list_bytes[i] # <<<<<<<<<<<<<< - * return ret - * - */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_list_bytes, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 495, __pyx_L1_error) - (__pyx_v_ret[__pyx_v_i]) = ((char *)__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - - /* "rados.pyx":496 - * for i in xrange(len(list_bytes)): - * ret[i] = list_bytes[i] - * return ret # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = __pyx_v_ret; - goto __pyx_L0; - - /* "rados.pyx":490 - * - * - * cdef char ** to_bytes_array(list_bytes): # <<<<<<<<<<<<<< - * cdef char **ret = malloc(len(list_bytes) * sizeof(char *)) - * if ret == NULL: - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("rados.to_bytes_array", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":500 - * - * - * cdef int __monitor_callback(void *arg, const char *line, const char *who, # <<<<<<<<<<<<<< - * uint64_t sec, uint64_t nsec, uint64_t seq, - * const char *level, const char *msg) with gil: - */ - -static int __pyx_f_5rados___monitor_callback(void *__pyx_v_arg, char const *__pyx_v_line, char const *__pyx_v_who, uint64_t __pyx_v_sec, uint64_t __pyx_v_nsec, uint64_t __pyx_v_seq, char const *__pyx_v_level, char const *__pyx_v_msg) { - PyObject *__pyx_v_cb_info = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - PyObject *__pyx_t_11 = NULL; - Py_ssize_t __pyx_t_12; - PyObject *__pyx_t_13 = NULL; - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); - #endif - __Pyx_RefNannySetupContext("__monitor_callback", 0); - - /* "rados.pyx":503 - * uint64_t sec, uint64_t nsec, uint64_t seq, - * const char *level, const char *msg) with gil: - * cdef object cb_info = arg # <<<<<<<<<<<<<< - * cb_info[0](cb_info[1], line, who, sec, nsec, seq, level, msg) - * return 0 - */ - __pyx_t_1 = ((PyObject *)__pyx_v_arg); - __Pyx_INCREF(__pyx_t_1); - __pyx_v_cb_info = __pyx_t_1; - __pyx_t_1 = 0; - - /* "rados.pyx":504 - * const char *level, const char *msg) with gil: - * cdef object cb_info = arg - * cb_info[0](cb_info[1], line, who, sec, nsec, seq, level, msg) # <<<<<<<<<<<<<< - * return 0 - * - */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_cb_info, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_cb_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_line); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_who); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyInt_From_uint64_t(__pyx_v_sec); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyInt_From_uint64_t(__pyx_v_nsec); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyInt_From_uint64_t(__pyx_v_seq); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyBytes_FromString(__pyx_v_level); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = __Pyx_PyBytes_FromString(__pyx_v_msg); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = NULL; - __pyx_t_12 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_12 = 1; - } - } - __pyx_t_13 = PyTuple_New(8+__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - if (__pyx_t_11) { - __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL; - } - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_12, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_12, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_13, 2+__pyx_t_12, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_13, 3+__pyx_t_12, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_13, 4+__pyx_t_12, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_13, 5+__pyx_t_12, __pyx_t_8); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_13, 6+__pyx_t_12, __pyx_t_9); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_13, 7+__pyx_t_12, __pyx_t_10); - __pyx_t_3 = 0; - __pyx_t_4 = 0; - __pyx_t_5 = 0; - __pyx_t_6 = 0; - __pyx_t_7 = 0; - __pyx_t_8 = 0; - __pyx_t_9 = 0; - __pyx_t_10 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":505 - * cdef object cb_info = arg - * cb_info[0](cb_info[1], line, who, sec, nsec, seq, level, msg) - * return 0 # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = 0; - goto __pyx_L0; - - /* "rados.pyx":500 - * - * - * cdef int __monitor_callback(void *arg, const char *line, const char *who, # <<<<<<<<<<<<<< - * uint64_t sec, uint64_t nsec, uint64_t seq, - * const char *level, const char *msg) with gil: - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_10); - __Pyx_XDECREF(__pyx_t_11); - __Pyx_XDECREF(__pyx_t_13); - __Pyx_WriteUnraisable("rados.__monitor_callback", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_cb_info); - __Pyx_RefNannyFinishContext(); - #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); - #endif - return __pyx_r; -} - -/* "rados.pyx":510 - * class Version(object): - * """ Version information """ - * def __init__(self, major, minor, extra): # <<<<<<<<<<<<<< - * self.major = major - * self.minor = minor - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_7Version_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_7Version___init__[] = "Version.__init__(self, major, minor, extra)"; -static PyMethodDef __pyx_mdef_5rados_7Version_1__init__ = {"__init__", (PyCFunction)__pyx_pw_5rados_7Version_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_7Version___init__}; -static PyObject *__pyx_pw_5rados_7Version_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_major = 0; - PyObject *__pyx_v_minor = 0; - PyObject *__pyx_v_extra = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_major,&__pyx_n_s_minor,&__pyx_n_s_extra,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_major)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 510, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minor)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 510, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_extra)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 510, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 510, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_self = values[0]; - __pyx_v_major = values[1]; - __pyx_v_minor = values[2]; - __pyx_v_extra = values[3]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 510, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Version.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_7Version___init__(__pyx_self, __pyx_v_self, __pyx_v_major, __pyx_v_minor, __pyx_v_extra); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_7Version___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_major, PyObject *__pyx_v_minor, PyObject *__pyx_v_extra) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__", 0); - - /* "rados.pyx":511 - * """ Version information """ - * def __init__(self, major, minor, extra): - * self.major = major # <<<<<<<<<<<<<< - * self.minor = minor - * self.extra = extra - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_major, __pyx_v_major) < 0) __PYX_ERR(0, 511, __pyx_L1_error) - - /* "rados.pyx":512 - * def __init__(self, major, minor, extra): - * self.major = major - * self.minor = minor # <<<<<<<<<<<<<< - * self.extra = extra - * - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_minor, __pyx_v_minor) < 0) __PYX_ERR(0, 512, __pyx_L1_error) - - /* "rados.pyx":513 - * self.major = major - * self.minor = minor - * self.extra = extra # <<<<<<<<<<<<<< - * - * def __str__(self): - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_extra, __pyx_v_extra) < 0) __PYX_ERR(0, 513, __pyx_L1_error) - - /* "rados.pyx":510 - * class Version(object): - * """ Version information """ - * def __init__(self, major, minor, extra): # <<<<<<<<<<<<<< - * self.major = major - * self.minor = minor - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("rados.Version.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":515 - * self.extra = extra - * - * def __str__(self): # <<<<<<<<<<<<<< - * return "%d.%d.%d" % (self.major, self.minor, self.extra) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_7Version_3__str__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ -static char __pyx_doc_5rados_7Version_2__str__[] = "Version.__str__(self)"; -static PyMethodDef __pyx_mdef_5rados_7Version_3__str__ = {"__str__", (PyCFunction)__pyx_pw_5rados_7Version_3__str__, METH_O, __pyx_doc_5rados_7Version_2__str__}; -static PyObject *__pyx_pw_5rados_7Version_3__str__(PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_7Version_2__str__(__pyx_self, ((PyObject *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_7Version_2__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("__str__", 0); - - /* "rados.pyx":516 - * - * def __str__(self): - * return "%d.%d.%d" % (self.major, self.minor, self.extra) # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_major); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_minor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 516, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_extra); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 516, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 516, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); - __pyx_t_1 = 0; - __pyx_t_2 = 0; - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_d_d_d, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 516, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - - /* "rados.pyx":515 - * self.extra = extra - * - * def __str__(self): # <<<<<<<<<<<<<< - * return "%d.%d.%d" % (self.major, self.minor, self.extra) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("rados.Version.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":523 - * # NOTE(sileht): attributes declared in .pyd - * - * def __init__(self, *args, **kwargs): # <<<<<<<<<<<<<< - * PyEval_InitThreads() - * self.__setup(*args, **kwargs) - */ - -/* Python wrapper */ -static int __pyx_pw_5rados_5Rados_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_5rados_5Rados_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_args = 0; - PyObject *__pyx_v_kwargs = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; - if (unlikely(__pyx_kwds)) { - __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return -1; - __Pyx_GOTREF(__pyx_v_kwargs); - } else { - __pyx_v_kwargs = NULL; - } - __Pyx_INCREF(__pyx_args); - __pyx_v_args = __pyx_args; - __pyx_r = __pyx_pf_5rados_5Rados___init__(((struct __pyx_obj_5rados_Rados *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); - - /* function exit code */ - __Pyx_XDECREF(__pyx_v_args); - __Pyx_XDECREF(__pyx_v_kwargs); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_5Rados___init__(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("__init__", 0); - - /* "rados.pyx":524 - * - * def __init__(self, *args, **kwargs): - * PyEval_InitThreads() # <<<<<<<<<<<<<< - * self.__setup(*args, **kwargs) - * - */ - PyEval_InitThreads(); - - /* "rados.pyx":525 - * def __init__(self, *args, **kwargs): - * PyEval_InitThreads() - * self.__setup(*args, **kwargs) # <<<<<<<<<<<<<< - * - * @requires(('rados_id', opt(str_type)), ('name', opt(str_type)), ('clustername', opt(str_type)), - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setup); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 525, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":523 - * # NOTE(sileht): attributes declared in .pyd - * - * def __init__(self, *args, **kwargs): # <<<<<<<<<<<<<< - * PyEval_InitThreads() - * self.__setup(*args, **kwargs) - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("rados.Rados.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":529 - * @requires(('rados_id', opt(str_type)), ('name', opt(str_type)), ('clustername', opt(str_type)), - * ('conffile', opt(str_type))) - * def __setup(self, rados_id=None, name=None, clustername=None, # <<<<<<<<<<<<<< - * conf_defaults=None, conffile=None, conf=None, flags=0): - * self.monitor_callback = None - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Rados_3__setup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Rados_2__setup[] = "Rados.__setup(self, rados_id=None, name=None, clustername=None, conf_defaults=None, conffile=None, conf=None, flags=0)"; -static PyObject *__pyx_pw_5rados_5Rados_3__setup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_rados_id = 0; - PyObject *__pyx_v_name = 0; - PyObject *__pyx_v_clustername = 0; - PyObject *__pyx_v_conf_defaults = 0; - PyObject *__pyx_v_conffile = 0; - PyObject *__pyx_v_conf = 0; - PyObject *__pyx_v_flags = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__setup (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rados_id,&__pyx_n_s_name_2,&__pyx_n_s_clustername,&__pyx_n_s_conf_defaults,&__pyx_n_s_conffile,&__pyx_n_s_conf,&__pyx_n_s_flags,0}; - PyObject* values[7] = {0,0,0,0,0,0,0}; - values[0] = ((PyObject *)Py_None); - values[1] = ((PyObject *)Py_None); - values[2] = ((PyObject *)Py_None); - - /* "rados.pyx":530 - * ('conffile', opt(str_type))) - * def __setup(self, rados_id=None, name=None, clustername=None, - * conf_defaults=None, conffile=None, conf=None, flags=0): # <<<<<<<<<<<<<< - * self.monitor_callback = None - * self.parsed_args = [] - */ - values[3] = ((PyObject *)Py_None); - values[4] = ((PyObject *)Py_None); - values[5] = ((PyObject *)Py_None); - values[6] = ((PyObject *)__pyx_int_0); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rados_id); - if (value) { values[0] = value; kw_args--; } - } - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name_2); - if (value) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_clustername); - if (value) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_conf_defaults); - if (value) { values[3] = value; kw_args--; } - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_conffile); - if (value) { values[4] = value; kw_args--; } - } - case 5: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_conf); - if (value) { values[5] = value; kw_args--; } - } - case 6: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags); - if (value) { values[6] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__setup") < 0)) __PYX_ERR(0, 529, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_rados_id = values[0]; - __pyx_v_name = values[1]; - __pyx_v_clustername = values[2]; - __pyx_v_conf_defaults = values[3]; - __pyx_v_conffile = values[4]; - __pyx_v_conf = values[5]; - __pyx_v_flags = values[6]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__setup", 0, 0, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 529, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Rados.__setup", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Rados_2__setup(((struct __pyx_obj_5rados_Rados *)__pyx_v_self), __pyx_v_rados_id, __pyx_v_name, __pyx_v_clustername, __pyx_v_conf_defaults, __pyx_v_conffile, __pyx_v_conf, __pyx_v_flags); - - /* "rados.pyx":529 - * @requires(('rados_id', opt(str_type)), ('name', opt(str_type)), ('clustername', opt(str_type)), - * ('conffile', opt(str_type))) - * def __setup(self, rados_id=None, name=None, clustername=None, # <<<<<<<<<<<<<< - * conf_defaults=None, conffile=None, conf=None, flags=0): - * self.monitor_callback = None - */ - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Rados_2__setup(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_rados_id, PyObject *__pyx_v_name, PyObject *__pyx_v_clustername, PyObject *__pyx_v_conf_defaults, PyObject *__pyx_v_conffile, PyObject *__pyx_v_conf, PyObject *__pyx_v_flags) { - char *__pyx_v__name; - char *__pyx_v__clustername; - int __pyx_v__flags; - int __pyx_v_ret; - PyObject *__pyx_v_key = NULL; - PyObject *__pyx_v_value = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - Py_ssize_t __pyx_t_6; - PyObject *__pyx_t_7 = NULL; - char *__pyx_t_8; - int __pyx_t_9; - PyObject *__pyx_t_10 = NULL; - PyObject *(*__pyx_t_11)(PyObject *); - PyObject *(*__pyx_t_12)(PyObject *); - Py_ssize_t __pyx_t_13; - __Pyx_RefNannySetupContext("__setup", 0); - __Pyx_INCREF(__pyx_v_name); - __Pyx_INCREF(__pyx_v_clustername); - __Pyx_INCREF(__pyx_v_conffile); - - /* "rados.pyx":531 - * def __setup(self, rados_id=None, name=None, clustername=None, - * conf_defaults=None, conffile=None, conf=None, flags=0): - * self.monitor_callback = None # <<<<<<<<<<<<<< - * self.parsed_args = [] - * self.conf_defaults = conf_defaults - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_self->monitor_callback); - __Pyx_DECREF(__pyx_v_self->monitor_callback); - __pyx_v_self->monitor_callback = Py_None; - - /* "rados.pyx":532 - * conf_defaults=None, conffile=None, conf=None, flags=0): - * self.monitor_callback = None - * self.parsed_args = [] # <<<<<<<<<<<<<< - * self.conf_defaults = conf_defaults - * self.conffile = conffile - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 532, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __Pyx_GOTREF(__pyx_v_self->parsed_args); - __Pyx_DECREF(__pyx_v_self->parsed_args); - __pyx_v_self->parsed_args = __pyx_t_1; - __pyx_t_1 = 0; - - /* "rados.pyx":533 - * self.monitor_callback = None - * self.parsed_args = [] - * self.conf_defaults = conf_defaults # <<<<<<<<<<<<<< - * self.conffile = conffile - * self.rados_id = rados_id - */ - __Pyx_INCREF(__pyx_v_conf_defaults); - __Pyx_GIVEREF(__pyx_v_conf_defaults); - __Pyx_GOTREF(__pyx_v_self->conf_defaults); - __Pyx_DECREF(__pyx_v_self->conf_defaults); - __pyx_v_self->conf_defaults = __pyx_v_conf_defaults; - - /* "rados.pyx":534 - * self.parsed_args = [] - * self.conf_defaults = conf_defaults - * self.conffile = conffile # <<<<<<<<<<<<<< - * self.rados_id = rados_id - * - */ - __Pyx_INCREF(__pyx_v_conffile); - __Pyx_GIVEREF(__pyx_v_conffile); - __Pyx_GOTREF(__pyx_v_self->conffile); - __Pyx_DECREF(__pyx_v_self->conffile); - __pyx_v_self->conffile = __pyx_v_conffile; - - /* "rados.pyx":535 - * self.conf_defaults = conf_defaults - * self.conffile = conffile - * self.rados_id = rados_id # <<<<<<<<<<<<<< - * - * if rados_id and name: - */ - __Pyx_INCREF(__pyx_v_rados_id); - __Pyx_GIVEREF(__pyx_v_rados_id); - __Pyx_GOTREF(__pyx_v_self->rados_id); - __Pyx_DECREF(__pyx_v_self->rados_id); - __pyx_v_self->rados_id = __pyx_v_rados_id; - - /* "rados.pyx":537 - * self.rados_id = rados_id - * - * if rados_id and name: # <<<<<<<<<<<<<< - * raise Error("Rados(): can't supply both rados_id and name") - * elif rados_id: - */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_rados_id); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 537, __pyx_L1_error) - if (__pyx_t_3) { - } else { - __pyx_t_2 = __pyx_t_3; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_name); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 537, __pyx_L1_error) - __pyx_t_2 = __pyx_t_3; - __pyx_L4_bool_binop_done:; - if (__pyx_t_2) { - - /* "rados.pyx":538 - * - * if rados_id and name: - * raise Error("Rados(): can't supply both rados_id and name") # <<<<<<<<<<<<<< - * elif rados_id: - * name = 'client.' + rados_id - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 538, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 538, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 538, __pyx_L1_error) - - /* "rados.pyx":537 - * self.rados_id = rados_id - * - * if rados_id and name: # <<<<<<<<<<<<<< - * raise Error("Rados(): can't supply both rados_id and name") - * elif rados_id: - */ - } - - /* "rados.pyx":539 - * if rados_id and name: - * raise Error("Rados(): can't supply both rados_id and name") - * elif rados_id: # <<<<<<<<<<<<<< - * name = 'client.' + rados_id - * elif name is None: - */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_rados_id); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 539, __pyx_L1_error) - if (__pyx_t_2) { - - /* "rados.pyx":540 - * raise Error("Rados(): can't supply both rados_id and name") - * elif rados_id: - * name = 'client.' + rados_id # <<<<<<<<<<<<<< - * elif name is None: - * name = 'client.admin' - */ - __pyx_t_4 = PyNumber_Add(__pyx_kp_s_client, __pyx_v_rados_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_4); - __pyx_t_4 = 0; - - /* "rados.pyx":539 - * if rados_id and name: - * raise Error("Rados(): can't supply both rados_id and name") - * elif rados_id: # <<<<<<<<<<<<<< - * name = 'client.' + rados_id - * elif name is None: - */ - goto __pyx_L3; - } - - /* "rados.pyx":541 - * elif rados_id: - * name = 'client.' + rados_id - * elif name is None: # <<<<<<<<<<<<<< - * name = 'client.admin' - * if clustername is None: - */ - __pyx_t_2 = (__pyx_v_name == Py_None); - __pyx_t_3 = (__pyx_t_2 != 0); - if (__pyx_t_3) { - - /* "rados.pyx":542 - * name = 'client.' + rados_id - * elif name is None: - * name = 'client.admin' # <<<<<<<<<<<<<< - * if clustername is None: - * clustername = '' - */ - __Pyx_INCREF(__pyx_kp_s_client_admin); - __Pyx_DECREF_SET(__pyx_v_name, __pyx_kp_s_client_admin); - - /* "rados.pyx":541 - * elif rados_id: - * name = 'client.' + rados_id - * elif name is None: # <<<<<<<<<<<<<< - * name = 'client.admin' - * if clustername is None: - */ - } - __pyx_L3:; - - /* "rados.pyx":543 - * elif name is None: - * name = 'client.admin' - * if clustername is None: # <<<<<<<<<<<<<< - * clustername = '' - * - */ - __pyx_t_3 = (__pyx_v_clustername == Py_None); - __pyx_t_2 = (__pyx_t_3 != 0); - if (__pyx_t_2) { - - /* "rados.pyx":544 - * name = 'client.admin' - * if clustername is None: - * clustername = '' # <<<<<<<<<<<<<< - * - * name = cstr(name, 'name') - */ - __Pyx_INCREF(__pyx_kp_s__13); - __Pyx_DECREF_SET(__pyx_v_clustername, __pyx_kp_s__13); - - /* "rados.pyx":543 - * elif name is None: - * name = 'client.admin' - * if clustername is None: # <<<<<<<<<<<<<< - * clustername = '' - * - */ - } - - /* "rados.pyx":546 - * clustername = '' - * - * name = cstr(name, 'name') # <<<<<<<<<<<<<< - * clustername = cstr(clustername, 'clustername') - * cdef: - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = NULL; - __pyx_t_6 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_6 = 1; - } - } - __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 546, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; - } - __Pyx_INCREF(__pyx_v_name); - __Pyx_GIVEREF(__pyx_v_name); - PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_name); - __Pyx_INCREF(__pyx_n_s_name_2); - __Pyx_GIVEREF(__pyx_n_s_name_2); - PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_n_s_name_2); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 546, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_4); - __pyx_t_4 = 0; - - /* "rados.pyx":547 - * - * name = cstr(name, 'name') - * clustername = cstr(clustername, 'clustername') # <<<<<<<<<<<<<< - * cdef: - * char *_name = name - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = NULL; - __pyx_t_6 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_6 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 547, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_7) { - __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL; - } - __Pyx_INCREF(__pyx_v_clustername); - __Pyx_GIVEREF(__pyx_v_clustername); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_v_clustername); - __Pyx_INCREF(__pyx_n_s_clustername); - __Pyx_GIVEREF(__pyx_n_s_clustername); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_n_s_clustername); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 547, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_clustername, __pyx_t_4); - __pyx_t_4 = 0; - - /* "rados.pyx":549 - * clustername = cstr(clustername, 'clustername') - * cdef: - * char *_name = name # <<<<<<<<<<<<<< - * char *_clustername = clustername - * int _flags = flags - */ - __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 549, __pyx_L1_error) - __pyx_v__name = __pyx_t_8; - - /* "rados.pyx":550 - * cdef: - * char *_name = name - * char *_clustername = clustername # <<<<<<<<<<<<<< - * int _flags = flags - * int ret - */ - __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_clustername); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 550, __pyx_L1_error) - __pyx_v__clustername = __pyx_t_8; - - /* "rados.pyx":551 - * char *_name = name - * char *_clustername = clustername - * int _flags = flags # <<<<<<<<<<<<<< - * int ret - * - */ - __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_flags); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 551, __pyx_L1_error) - __pyx_v__flags = __pyx_t_9; - - /* "rados.pyx":554 - * int ret - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_create2(&self.cluster, _clustername, _name, _flags) - * if ret != 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":555 - * - * with nogil: - * ret = rados_create2(&self.cluster, _clustername, _name, _flags) # <<<<<<<<<<<<<< - * if ret != 0: - * raise Error("rados_initialize failed with error code: %d" % ret) - */ - __pyx_v_ret = rados_create2((&__pyx_v_self->cluster), __pyx_v__clustername, __pyx_v__name, __pyx_v__flags); - } - - /* "rados.pyx":554 - * int ret - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_create2(&self.cluster, _clustername, _name, _flags) - * if ret != 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L9; - } - __pyx_L9:; - } - } - - /* "rados.pyx":556 - * with nogil: - * ret = rados_create2(&self.cluster, _clustername, _name, _flags) - * if ret != 0: # <<<<<<<<<<<<<< - * raise Error("rados_initialize failed with error code: %d" % ret) - * - */ - __pyx_t_2 = ((__pyx_v_ret != 0) != 0); - if (__pyx_t_2) { - - /* "rados.pyx":557 - * ret = rados_create2(&self.cluster, _clustername, _name, _flags) - * if ret != 0: - * raise Error("rados_initialize failed with error code: %d" % ret) # <<<<<<<<<<<<<< - * - * self.state = "configuring" - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 557, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_rados_initialize_failed_with_err, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 557, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_5) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 557, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GOTREF(__pyx_t_4); - } else { - __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 557, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); __pyx_t_5 = NULL; - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 557, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 557, __pyx_L1_error) - - /* "rados.pyx":556 - * with nogil: - * ret = rados_create2(&self.cluster, _clustername, _name, _flags) - * if ret != 0: # <<<<<<<<<<<<<< - * raise Error("rados_initialize failed with error code: %d" % ret) - * - */ - } - - /* "rados.pyx":559 - * raise Error("rados_initialize failed with error code: %d" % ret) - * - * self.state = "configuring" # <<<<<<<<<<<<<< - * # order is important: conf_defaults, then conffile, then conf - * if conf_defaults: - */ - __Pyx_INCREF(__pyx_n_s_configuring); - __Pyx_GIVEREF(__pyx_n_s_configuring); - __Pyx_GOTREF(__pyx_v_self->state); - __Pyx_DECREF(__pyx_v_self->state); - __pyx_v_self->state = __pyx_n_s_configuring; - - /* "rados.pyx":561 - * self.state = "configuring" - * # order is important: conf_defaults, then conffile, then conf - * if conf_defaults: # <<<<<<<<<<<<<< - * for key, value in conf_defaults.items(): - * self.conf_set(key, value) - */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_conf_defaults); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 561, __pyx_L1_error) - if (__pyx_t_2) { - - /* "rados.pyx":562 - * # order is important: conf_defaults, then conffile, then conf - * if conf_defaults: - * for key, value in conf_defaults.items(): # <<<<<<<<<<<<<< - * self.conf_set(key, value) - * if conffile is not None: - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_conf_defaults, __pyx_n_s_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 562, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (__pyx_t_10) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 562, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - } else { - __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 562, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { - __pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0; - __pyx_t_11 = NULL; - } else { - __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 562, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 562, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - for (;;) { - if (likely(!__pyx_t_11)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { - if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 562, __pyx_L1_error) - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 562, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 562, __pyx_L1_error) - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 562, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } - } else { - __pyx_t_4 = __pyx_t_11(__pyx_t_1); - if (unlikely(!__pyx_t_4)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 562, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_4); - } - if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { - PyObject* sequence = __pyx_t_4; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 562, __pyx_L1_error) - } - #if CYTHON_COMPILING_IN_CPYTHON - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); - } else { - __pyx_t_10 = PyList_GET_ITEM(sequence, 0); - __pyx_t_7 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(__pyx_t_7); - #else - __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 562, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 562, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - #endif - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 562, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_12 = Py_TYPE(__pyx_t_5)->tp_iternext; - index = 0; __pyx_t_10 = __pyx_t_12(__pyx_t_5); if (unlikely(!__pyx_t_10)) goto __pyx_L14_unpacking_failed; - __Pyx_GOTREF(__pyx_t_10); - index = 1; __pyx_t_7 = __pyx_t_12(__pyx_t_5); if (unlikely(!__pyx_t_7)) goto __pyx_L14_unpacking_failed; - __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_5), 2) < 0) __PYX_ERR(0, 562, __pyx_L1_error) - __pyx_t_12 = NULL; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L15_unpacking_done; - __pyx_L14_unpacking_failed:; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_12 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 562, __pyx_L1_error) - __pyx_L15_unpacking_done:; - } - __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_10); - __pyx_t_10 = 0; - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_7); - __pyx_t_7 = 0; - - /* "rados.pyx":563 - * if conf_defaults: - * for key, value in conf_defaults.items(): - * self.conf_set(key, value) # <<<<<<<<<<<<<< - * if conffile is not None: - * # read the default conf file when '' is given - */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_conf_set); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_10 = NULL; - __pyx_t_13 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_13 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_10) { - __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_10); __pyx_t_10 = NULL; - } - __Pyx_INCREF(__pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_13, __pyx_v_key); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_13, __pyx_v_value); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "rados.pyx":562 - * # order is important: conf_defaults, then conffile, then conf - * if conf_defaults: - * for key, value in conf_defaults.items(): # <<<<<<<<<<<<<< - * self.conf_set(key, value) - * if conffile is not None: - */ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":561 - * self.state = "configuring" - * # order is important: conf_defaults, then conffile, then conf - * if conf_defaults: # <<<<<<<<<<<<<< - * for key, value in conf_defaults.items(): - * self.conf_set(key, value) - */ - } - - /* "rados.pyx":564 - * for key, value in conf_defaults.items(): - * self.conf_set(key, value) - * if conffile is not None: # <<<<<<<<<<<<<< - * # read the default conf file when '' is given - * if conffile == '': - */ - __pyx_t_2 = (__pyx_v_conffile != Py_None); - __pyx_t_3 = (__pyx_t_2 != 0); - if (__pyx_t_3) { - - /* "rados.pyx":566 - * if conffile is not None: - * # read the default conf file when '' is given - * if conffile == '': # <<<<<<<<<<<<<< - * conffile = None - * self.conf_read_file(conffile) - */ - __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_conffile, __pyx_kp_s__13, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 566, __pyx_L1_error) - if (__pyx_t_3) { - - /* "rados.pyx":567 - * # read the default conf file when '' is given - * if conffile == '': - * conffile = None # <<<<<<<<<<<<<< - * self.conf_read_file(conffile) - * if conf: - */ - __Pyx_INCREF(Py_None); - __Pyx_DECREF_SET(__pyx_v_conffile, Py_None); - - /* "rados.pyx":566 - * if conffile is not None: - * # read the default conf file when '' is given - * if conffile == '': # <<<<<<<<<<<<<< - * conffile = None - * self.conf_read_file(conffile) - */ - } - - /* "rados.pyx":568 - * if conffile == '': - * conffile = None - * self.conf_read_file(conffile) # <<<<<<<<<<<<<< - * if conf: - * for key, value in conf.items(): - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_conf_read_file); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 568, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - } - } - if (!__pyx_t_7) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_conffile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 568, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL; - __Pyx_INCREF(__pyx_v_conffile); - __Pyx_GIVEREF(__pyx_v_conffile); - PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_conffile); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":564 - * for key, value in conf_defaults.items(): - * self.conf_set(key, value) - * if conffile is not None: # <<<<<<<<<<<<<< - * # read the default conf file when '' is given - * if conffile == '': - */ - } - - /* "rados.pyx":569 - * conffile = None - * self.conf_read_file(conffile) - * if conf: # <<<<<<<<<<<<<< - * for key, value in conf.items(): - * self.conf_set(key, value) - */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_conf); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 569, __pyx_L1_error) - if (__pyx_t_3) { - - /* "rados.pyx":570 - * self.conf_read_file(conffile) - * if conf: - * for key, value in conf.items(): # <<<<<<<<<<<<<< - * self.conf_set(key, value) - * - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_conf, __pyx_n_s_items); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - } - } - if (__pyx_t_5) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0; - __pyx_t_11 = NULL; - } else { - __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 570, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { - if (likely(!__pyx_t_11)) { - if (likely(PyList_CheckExact(__pyx_t_4))) { - if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 570, __pyx_L1_error) - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } else { - if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 570, __pyx_L1_error) - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } - } else { - __pyx_t_1 = __pyx_t_11(__pyx_t_4); - if (unlikely(!__pyx_t_1)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 570, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_1); - } - if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { - PyObject* sequence = __pyx_t_1; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 570, __pyx_L1_error) - } - #if CYTHON_COMPILING_IN_CPYTHON - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); - } else { - __pyx_t_5 = PyList_GET_ITEM(sequence, 0); - __pyx_t_7 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(__pyx_t_7); - #else - __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 570, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 570, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - #endif - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 570, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_12 = Py_TYPE(__pyx_t_10)->tp_iternext; - index = 0; __pyx_t_5 = __pyx_t_12(__pyx_t_10); if (unlikely(!__pyx_t_5)) goto __pyx_L21_unpacking_failed; - __Pyx_GOTREF(__pyx_t_5); - index = 1; __pyx_t_7 = __pyx_t_12(__pyx_t_10); if (unlikely(!__pyx_t_7)) goto __pyx_L21_unpacking_failed; - __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_10), 2) < 0) __PYX_ERR(0, 570, __pyx_L1_error) - __pyx_t_12 = NULL; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - goto __pyx_L22_unpacking_done; - __pyx_L21_unpacking_failed:; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_12 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 570, __pyx_L1_error) - __pyx_L22_unpacking_done:; - } - __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5); - __pyx_t_5 = 0; - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_7); - __pyx_t_7 = 0; - - /* "rados.pyx":571 - * if conf: - * for key, value in conf.items(): - * self.conf_set(key, value) # <<<<<<<<<<<<<< - * - * def require_state(self, *args): - */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_conf_set); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 571, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = NULL; - __pyx_t_13 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_13 = 1; - } - } - __pyx_t_10 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 571, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); __pyx_t_5 = NULL; - } - __Pyx_INCREF(__pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_13, __pyx_v_key); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_13, __pyx_v_value); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":570 - * self.conf_read_file(conffile) - * if conf: - * for key, value in conf.items(): # <<<<<<<<<<<<<< - * self.conf_set(key, value) - * - */ - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "rados.pyx":569 - * conffile = None - * self.conf_read_file(conffile) - * if conf: # <<<<<<<<<<<<<< - * for key, value in conf.items(): - * self.conf_set(key, value) - */ - } - - /* "rados.pyx":529 - * @requires(('rados_id', opt(str_type)), ('name', opt(str_type)), ('clustername', opt(str_type)), - * ('conffile', opt(str_type))) - * def __setup(self, rados_id=None, name=None, clustername=None, # <<<<<<<<<<<<<< - * conf_defaults=None, conffile=None, conf=None, flags=0): - * self.monitor_callback = None - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_10); - __Pyx_AddTraceback("rados.Rados.__setup", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_key); - __Pyx_XDECREF(__pyx_v_value); - __Pyx_XDECREF(__pyx_v_name); - __Pyx_XDECREF(__pyx_v_clustername); - __Pyx_XDECREF(__pyx_v_conffile); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":573 - * self.conf_set(key, value) - * - * def require_state(self, *args): # <<<<<<<<<<<<<< - * """ - * Checks if the Rados object is in a special state - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Rados_5require_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Rados_4require_state[] = "Rados.require_state(self, *args)\n\n Checks if the Rados object is in a special state\n\n :raises: RadosStateError\n "; -static PyObject *__pyx_pw_5rados_5Rados_5require_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_args = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("require_state (wrapper)", 0); - if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "require_state", 0))) return NULL; - __Pyx_INCREF(__pyx_args); - __pyx_v_args = __pyx_args; - __pyx_r = __pyx_pf_5rados_5Rados_4require_state(((struct __pyx_obj_5rados_Rados *)__pyx_v_self), __pyx_v_args); - - /* function exit code */ - __Pyx_XDECREF(__pyx_v_args); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Rados_4require_state(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_args) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - __Pyx_RefNannySetupContext("require_state", 0); - - /* "rados.pyx":579 - * :raises: RadosStateError - * """ - * if self.state in args: # <<<<<<<<<<<<<< - * return - * raise RadosStateError("You cannot perform that operation on a \ - */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_self->state, __pyx_v_args, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 579, __pyx_L1_error) - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - - /* "rados.pyx":580 - * """ - * if self.state in args: - * return # <<<<<<<<<<<<<< - * raise RadosStateError("You cannot perform that operation on a \ - * Rados object in state %s." % self.state) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - - /* "rados.pyx":579 - * :raises: RadosStateError - * """ - * if self.state in args: # <<<<<<<<<<<<<< - * return - * raise RadosStateError("You cannot perform that operation on a \ - */ - } - - /* "rados.pyx":581 - * if self.state in args: - * return - * raise RadosStateError("You cannot perform that operation on a \ # <<<<<<<<<<<<<< - * Rados object in state %s." % self.state) - * - */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_RadosStateError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - - /* "rados.pyx":582 - * return - * raise RadosStateError("You cannot perform that operation on a \ - * Rados object in state %s." % self.state) # <<<<<<<<<<<<<< - * - * def shutdown(self): - */ - __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_You_cannot_perform_that_operatio, __pyx_v_self->state); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 582, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - } - } - if (!__pyx_t_6) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_3); - } else { - __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 581, __pyx_L1_error) - - /* "rados.pyx":573 - * self.conf_set(key, value) - * - * def require_state(self, *args): # <<<<<<<<<<<<<< - * """ - * Checks if the Rados object is in a special state - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("rados.Rados.require_state", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":584 - * Rados object in state %s." % self.state) - * - * def shutdown(self): # <<<<<<<<<<<<<< - * """ - * Disconnects from the cluster. Call this explicitly when a - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Rados_7shutdown(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5rados_5Rados_6shutdown[] = "Rados.shutdown(self)\n\n Disconnects from the cluster. Call this explicitly when a\n Rados.connect()ed object is no longer used.\n "; -static PyObject *__pyx_pw_5rados_5Rados_7shutdown(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("shutdown (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Rados_6shutdown(((struct __pyx_obj_5rados_Rados *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Rados_6shutdown(struct __pyx_obj_5rados_Rados *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("shutdown", 0); - - /* "rados.pyx":589 - * Rados.connect()ed object is no longer used. - * """ - * if self.state != "shutdown": # <<<<<<<<<<<<<< - * with nogil: - * rados_shutdown(self.cluster) - */ - __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->state, __pyx_n_s_shutdown, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 589, __pyx_L1_error) - if (__pyx_t_1) { - - /* "rados.pyx":590 - * """ - * if self.state != "shutdown": - * with nogil: # <<<<<<<<<<<<<< - * rados_shutdown(self.cluster) - * self.state = "shutdown" - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":591 - * if self.state != "shutdown": - * with nogil: - * rados_shutdown(self.cluster) # <<<<<<<<<<<<<< - * self.state = "shutdown" - * - */ - rados_shutdown(__pyx_v_self->cluster); - } - - /* "rados.pyx":590 - * """ - * if self.state != "shutdown": - * with nogil: # <<<<<<<<<<<<<< - * rados_shutdown(self.cluster) - * self.state = "shutdown" - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L6; - } - __pyx_L6:; - } - } - - /* "rados.pyx":592 - * with nogil: - * rados_shutdown(self.cluster) - * self.state = "shutdown" # <<<<<<<<<<<<<< - * - * def __enter__(self): - */ - __Pyx_INCREF(__pyx_n_s_shutdown); - __Pyx_GIVEREF(__pyx_n_s_shutdown); - __Pyx_GOTREF(__pyx_v_self->state); - __Pyx_DECREF(__pyx_v_self->state); - __pyx_v_self->state = __pyx_n_s_shutdown; - - /* "rados.pyx":589 - * Rados.connect()ed object is no longer used. - * """ - * if self.state != "shutdown": # <<<<<<<<<<<<<< - * with nogil: - * rados_shutdown(self.cluster) - */ - } - - /* "rados.pyx":584 - * Rados object in state %s." % self.state) - * - * def shutdown(self): # <<<<<<<<<<<<<< - * """ - * Disconnects from the cluster. Call this explicitly when a - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("rados.Rados.shutdown", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":594 - * self.state = "shutdown" - * - * def __enter__(self): # <<<<<<<<<<<<<< - * self.connect() - * return self - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Rados_9__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5rados_5Rados_8__enter__[] = "Rados.__enter__(self)"; -static PyObject *__pyx_pw_5rados_5Rados_9__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Rados_8__enter__(((struct __pyx_obj_5rados_Rados *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Rados_8__enter__(struct __pyx_obj_5rados_Rados *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("__enter__", 0); - - /* "rados.pyx":595 - * - * def __enter__(self): - * self.connect() # <<<<<<<<<<<<<< - * return self - * - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_connect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 595, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 595, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 595, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":596 - * def __enter__(self): - * self.connect() - * return self # <<<<<<<<<<<<<< - * - * def __exit__(self, type_, value, traceback): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __pyx_r = ((PyObject *)__pyx_v_self); - goto __pyx_L0; - - /* "rados.pyx":594 - * self.state = "shutdown" - * - * def __enter__(self): # <<<<<<<<<<<<<< - * self.connect() - * return self - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("rados.Rados.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":598 - * return self - * - * def __exit__(self, type_, value, traceback): # <<<<<<<<<<<<<< - * self.shutdown() - * return False - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Rados_11__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Rados_10__exit__[] = "Rados.__exit__(self, type_, value, traceback)"; -static PyObject *__pyx_pw_5rados_5Rados_11__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - CYTHON_UNUSED PyObject *__pyx_v_type_ = 0; - CYTHON_UNUSED PyObject *__pyx_v_value = 0; - CYTHON_UNUSED PyObject *__pyx_v_traceback = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_type,&__pyx_n_s_value,&__pyx_n_s_traceback,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(0, 598, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_traceback)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(0, 598, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(0, 598, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - } - __pyx_v_type_ = values[0]; - __pyx_v_value = values[1]; - __pyx_v_traceback = values[2]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 598, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Rados.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Rados_10__exit__(((struct __pyx_obj_5rados_Rados *)__pyx_v_self), __pyx_v_type_, __pyx_v_value, __pyx_v_traceback); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Rados_10__exit__(struct __pyx_obj_5rados_Rados *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_type_, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_traceback) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("__exit__", 0); - - /* "rados.pyx":599 - * - * def __exit__(self, type_, value, traceback): - * self.shutdown() # <<<<<<<<<<<<<< - * return False - * - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shutdown); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 599, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 599, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 599, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":600 - * def __exit__(self, type_, value, traceback): - * self.shutdown() - * return False # <<<<<<<<<<<<<< - * - * def version(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - goto __pyx_L0; - - /* "rados.pyx":598 - * return self - * - * def __exit__(self, type_, value, traceback): # <<<<<<<<<<<<<< - * self.shutdown() - * return False - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("rados.Rados.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":602 - * return False - * - * def version(self): # <<<<<<<<<<<<<< - * """ - * Get the version number of the ``librados`` C library. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Rados_13version(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5rados_5Rados_12version[] = "Rados.version(self)\n\n Get the version number of the ``librados`` C library.\n\n :returns: a tuple of ``(major, minor, extra)`` components of the\n librados version\n "; -static PyObject *__pyx_pw_5rados_5Rados_13version(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("version (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Rados_12version(((struct __pyx_obj_5rados_Rados *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Rados_12version(CYTHON_UNUSED struct __pyx_obj_5rados_Rados *__pyx_v_self) { - int __pyx_v_major; - int __pyx_v_minor; - int __pyx_v_extra; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - Py_ssize_t __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - __Pyx_RefNannySetupContext("version", 0); - - /* "rados.pyx":609 - * librados version - * """ - * cdef int major = 0 # <<<<<<<<<<<<<< - * cdef int minor = 0 - * cdef int extra = 0 - */ - __pyx_v_major = 0; - - /* "rados.pyx":610 - * """ - * cdef int major = 0 - * cdef int minor = 0 # <<<<<<<<<<<<<< - * cdef int extra = 0 - * with nogil: - */ - __pyx_v_minor = 0; - - /* "rados.pyx":611 - * cdef int major = 0 - * cdef int minor = 0 - * cdef int extra = 0 # <<<<<<<<<<<<<< - * with nogil: - * rados_version(&major, &minor, &extra) - */ - __pyx_v_extra = 0; - - /* "rados.pyx":612 - * cdef int minor = 0 - * cdef int extra = 0 - * with nogil: # <<<<<<<<<<<<<< - * rados_version(&major, &minor, &extra) - * return Version(major, minor, extra) - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":613 - * cdef int extra = 0 - * with nogil: - * rados_version(&major, &minor, &extra) # <<<<<<<<<<<<<< - * return Version(major, minor, extra) - * - */ - rados_version((&__pyx_v_major), (&__pyx_v_minor), (&__pyx_v_extra)); - } - - /* "rados.pyx":612 - * cdef int minor = 0 - * cdef int extra = 0 - * with nogil: # <<<<<<<<<<<<<< - * rados_version(&major, &minor, &extra) - * return Version(major, minor, extra) - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":614 - * with nogil: - * rados_version(&major, &minor, &extra) - * return Version(major, minor, extra) # <<<<<<<<<<<<<< - * - * @requires(('path', opt(str_type))) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Version); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 614, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_major); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 614, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minor); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 614, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_extra); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 614, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = NULL; - __pyx_t_7 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_7 = 1; - } - } - __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 614, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (__pyx_t_6) { - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; - } - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_5); - __pyx_t_3 = 0; - __pyx_t_4 = 0; - __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 614, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "rados.pyx":602 - * return False - * - * def version(self): # <<<<<<<<<<<<<< - * """ - * Get the version number of the ``librados`` C library. - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("rados.Rados.version", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":617 - * - * @requires(('path', opt(str_type))) - * def conf_read_file(self, path=None): # <<<<<<<<<<<<<< - * """ - * Configure the cluster handle using a Ceph config file. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Rados_15conf_read_file(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Rados_14conf_read_file[] = "Rados.conf_read_file(self, path=None)\n\n Configure the cluster handle using a Ceph config file.\n\n :param path: path to the config file\n :type path: str\n "; -static PyObject *__pyx_pw_5rados_5Rados_15conf_read_file(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_path = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("conf_read_file (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,0}; - PyObject* values[1] = {0}; - values[0] = ((PyObject *)Py_None); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_path); - if (value) { values[0] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "conf_read_file") < 0)) __PYX_ERR(0, 617, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_path = values[0]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("conf_read_file", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 617, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Rados.conf_read_file", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Rados_14conf_read_file(((struct __pyx_obj_5rados_Rados *)__pyx_v_self), __pyx_v_path); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Rados_14conf_read_file(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_path) { - char *__pyx_v__path; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - char *__pyx_t_5; - int __pyx_t_6; - __Pyx_RefNannySetupContext("conf_read_file", 0); - __Pyx_INCREF(__pyx_v_path); - - /* "rados.pyx":624 - * :type path: str - * """ - * self.require_state("configuring", "connected") # <<<<<<<<<<<<<< - * path = cstr(path, 'path', opt=True) - * cdef: - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 624, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":625 - * """ - * self.require_state("configuring", "connected") - * path = cstr(path, 'path', opt=True) # <<<<<<<<<<<<<< - * cdef: - * char *_path = opt_str(path) - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 625, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 625, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_path); - __Pyx_GIVEREF(__pyx_v_path); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_path); - __Pyx_INCREF(__pyx_n_s_path); - __Pyx_GIVEREF(__pyx_n_s_path); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_path); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 625, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_opt, Py_True) < 0) __PYX_ERR(0, 625, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 625, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_path, __pyx_t_4); - __pyx_t_4 = 0; - - /* "rados.pyx":627 - * path = cstr(path, 'path', opt=True) - * cdef: - * char *_path = opt_str(path) # <<<<<<<<<<<<<< - * with nogil: - * ret = rados_conf_read_file(self.cluster, _path) - */ - __pyx_t_5 = __pyx_f_5rados_opt_str(__pyx_v_path); if (unlikely(__pyx_t_5 == NULL && PyErr_Occurred())) __PYX_ERR(0, 627, __pyx_L1_error) - __pyx_v__path = __pyx_t_5; - - /* "rados.pyx":628 - * cdef: - * char *_path = opt_str(path) - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_conf_read_file(self.cluster, _path) - * if ret != 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":629 - * char *_path = opt_str(path) - * with nogil: - * ret = rados_conf_read_file(self.cluster, _path) # <<<<<<<<<<<<<< - * if ret != 0: - * raise make_ex(ret, "error calling conf_read_file") - */ - __pyx_v_ret = rados_conf_read_file(__pyx_v_self->cluster, __pyx_v__path); - } - - /* "rados.pyx":628 - * cdef: - * char *_path = opt_str(path) - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_conf_read_file(self.cluster, _path) - * if ret != 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":630 - * with nogil: - * ret = rados_conf_read_file(self.cluster, _path) - * if ret != 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error calling conf_read_file") - * - */ - __pyx_t_6 = ((__pyx_v_ret != 0) != 0); - if (__pyx_t_6) { - - /* "rados.pyx":631 - * ret = rados_conf_read_file(self.cluster, _path) - * if ret != 0: - * raise make_ex(ret, "error calling conf_read_file") # <<<<<<<<<<<<<< - * - * def conf_parse_argv(self, args): - */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __pyx_f_5rados_make_ex(__pyx_t_4, __pyx_kp_s_error_calling_conf_read_file); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 631, __pyx_L1_error) - - /* "rados.pyx":630 - * with nogil: - * ret = rados_conf_read_file(self.cluster, _path) - * if ret != 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error calling conf_read_file") - * - */ - } - - /* "rados.pyx":617 - * - * @requires(('path', opt(str_type))) - * def conf_read_file(self, path=None): # <<<<<<<<<<<<<< - * """ - * Configure the cluster handle using a Ceph config file. - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("rados.Rados.conf_read_file", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_path); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":633 - * raise make_ex(ret, "error calling conf_read_file") - * - * def conf_parse_argv(self, args): # <<<<<<<<<<<<<< - * """ - * Parse known arguments from args, and remove; returned - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Rados_17conf_parse_argv(PyObject *__pyx_v_self, PyObject *__pyx_v_args); /*proto*/ -static char __pyx_doc_5rados_5Rados_16conf_parse_argv[] = "Rados.conf_parse_argv(self, args)\n\n Parse known arguments from args, and remove; returned\n args contain only those unknown to ceph\n "; -static PyObject *__pyx_pw_5rados_5Rados_17conf_parse_argv(PyObject *__pyx_v_self, PyObject *__pyx_v_args) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("conf_parse_argv (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Rados_16conf_parse_argv(((struct __pyx_obj_5rados_Rados *)__pyx_v_self), ((PyObject *)__pyx_v_args)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Rados_16conf_parse_argv(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_args) { - PyObject *__pyx_v_cargs = NULL; - int __pyx_v__argc; - char **__pyx_v__argv; - char **__pyx_v__remargv; - int __pyx_v_ret; - PyObject *__pyx_v_retargs = NULL; - char *__pyx_v_a; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - Py_ssize_t __pyx_t_6; - PyObject *__pyx_t_7 = NULL; - char **__pyx_t_8; - char **__pyx_t_9; - char **__pyx_t_10; - PyObject *__pyx_t_11 = NULL; - PyObject *__pyx_t_12 = NULL; - int __pyx_t_13; - int __pyx_t_14; - char const *__pyx_t_15; - PyObject *__pyx_t_16 = NULL; - PyObject *__pyx_t_17 = NULL; - PyObject *__pyx_t_18 = NULL; - PyObject *__pyx_t_19 = NULL; - PyObject *__pyx_t_20 = NULL; - PyObject *__pyx_t_21 = NULL; - __Pyx_RefNannySetupContext("conf_parse_argv", 0); - - /* "rados.pyx":638 - * args contain only those unknown to ceph - * """ - * self.require_state("configuring", "connected") # <<<<<<<<<<<<<< - * if not args: - * return - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 638, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":639 - * """ - * self.require_state("configuring", "connected") - * if not args: # <<<<<<<<<<<<<< - * return - * - */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_args); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 639, __pyx_L1_error) - __pyx_t_4 = ((!__pyx_t_3) != 0); - if (__pyx_t_4) { - - /* "rados.pyx":640 - * self.require_state("configuring", "connected") - * if not args: - * return # <<<<<<<<<<<<<< - * - * cargs = cstr_list(args, 'args') - */ - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - - /* "rados.pyx":639 - * """ - * self.require_state("configuring", "connected") - * if not args: # <<<<<<<<<<<<<< - * return - * - */ - } - - /* "rados.pyx":642 - * return - * - * cargs = cstr_list(args, 'args') # <<<<<<<<<<<<<< - * cdef: - * int _argc = len(args) - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 642, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = NULL; - __pyx_t_6 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_6 = 1; - } - } - __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 642, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; - } - __Pyx_INCREF(__pyx_v_args); - __Pyx_GIVEREF(__pyx_v_args); - PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_args); - __Pyx_INCREF(__pyx_n_s_args); - __Pyx_GIVEREF(__pyx_n_s_args); - PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_n_s_args); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 642, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_cargs = __pyx_t_2; - __pyx_t_2 = 0; - - /* "rados.pyx":644 - * cargs = cstr_list(args, 'args') - * cdef: - * int _argc = len(args) # <<<<<<<<<<<<<< - * char **_argv = to_bytes_array(cargs) - * char **_remargv = NULL - */ - __pyx_t_6 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 644, __pyx_L1_error) - __pyx_v__argc = __pyx_t_6; - - /* "rados.pyx":645 - * cdef: - * int _argc = len(args) - * char **_argv = to_bytes_array(cargs) # <<<<<<<<<<<<<< - * char **_remargv = NULL - * - */ - __pyx_v__argv = __pyx_f_5rados_to_bytes_array(__pyx_v_cargs); - - /* "rados.pyx":646 - * int _argc = len(args) - * char **_argv = to_bytes_array(cargs) - * char **_remargv = NULL # <<<<<<<<<<<<<< - * - * try: - */ - __pyx_v__remargv = NULL; - - /* "rados.pyx":648 - * char **_remargv = NULL - * - * try: # <<<<<<<<<<<<<< - * _remargv = malloc(_argc * sizeof(char *)) - * with nogil: - */ - /*try:*/ { - - /* "rados.pyx":649 - * - * try: - * _remargv = malloc(_argc * sizeof(char *)) # <<<<<<<<<<<<<< - * with nogil: - * ret = rados_conf_parse_argv_remainder(self.cluster, _argc, - */ - __pyx_v__remargv = ((char **)malloc((__pyx_v__argc * (sizeof(char *))))); - - /* "rados.pyx":650 - * try: - * _remargv = malloc(_argc * sizeof(char *)) - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_conf_parse_argv_remainder(self.cluster, _argc, - * _argv, - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":651 - * _remargv = malloc(_argc * sizeof(char *)) - * with nogil: - * ret = rados_conf_parse_argv_remainder(self.cluster, _argc, # <<<<<<<<<<<<<< - * _argv, - * _remargv) - */ - __pyx_v_ret = rados_conf_parse_argv_remainder(__pyx_v_self->cluster, __pyx_v__argc, ((char const **)__pyx_v__argv), ((char const **)__pyx_v__remargv)); - } - - /* "rados.pyx":650 - * try: - * _remargv = malloc(_argc * sizeof(char *)) - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_conf_parse_argv_remainder(self.cluster, _argc, - * _argv, - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L9; - } - __pyx_L9:; - } - } - - /* "rados.pyx":654 - * _argv, - * _remargv) - * if ret: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error calling conf_parse_argv_remainder") - * - */ - __pyx_t_4 = (__pyx_v_ret != 0); - if (__pyx_t_4) { - - /* "rados.pyx":655 - * _remargv) - * if ret: - * raise make_ex(ret, "error calling conf_parse_argv_remainder") # <<<<<<<<<<<<<< - * - * # _remargv was allocated with fixed argc; collapse return - */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 655, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __pyx_f_5rados_make_ex(__pyx_t_2, __pyx_kp_s_error_calling_conf_parse_argv_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 655, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 655, __pyx_L5_error) - - /* "rados.pyx":654 - * _argv, - * _remargv) - * if ret: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error calling conf_parse_argv_remainder") - * - */ - } - - /* "rados.pyx":659 - * # _remargv was allocated with fixed argc; collapse return - * # list to eliminate any missing args - * retargs = [decode_cstr(a) for a in _remargv[:_argc] # <<<<<<<<<<<<<< - * if a != NULL] - * self.parsed_args = args - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = (__pyx_v__remargv + __pyx_v__argc); - for (__pyx_t_10 = __pyx_v__remargv; __pyx_t_10 < __pyx_t_9; __pyx_t_10++) { - __pyx_t_8 = __pyx_t_10; - __pyx_v_a = (__pyx_t_8[0]); - - /* "rados.pyx":660 - * # list to eliminate any missing args - * retargs = [decode_cstr(a) for a in _remargv[:_argc] - * if a != NULL] # <<<<<<<<<<<<<< - * self.parsed_args = args - * return retargs - */ - __pyx_t_4 = ((__pyx_v_a != NULL) != 0); - if (__pyx_t_4) { - - /* "rados.pyx":659 - * # _remargv was allocated with fixed argc; collapse return - * # list to eliminate any missing args - * retargs = [decode_cstr(a) for a in _remargv[:_argc] # <<<<<<<<<<<<<< - * if a != NULL] - * self.parsed_args = args - */ - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode_cstr); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 659, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_a); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 659, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_11 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - } - } - if (!__pyx_t_11) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 659, __pyx_L5_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 659, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL; - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 659, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - } - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 659, __pyx_L5_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":660 - * # list to eliminate any missing args - * retargs = [decode_cstr(a) for a in _remargv[:_argc] - * if a != NULL] # <<<<<<<<<<<<<< - * self.parsed_args = args - * return retargs - */ - } - } - __pyx_v_retargs = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":661 - * retargs = [decode_cstr(a) for a in _remargv[:_argc] - * if a != NULL] - * self.parsed_args = args # <<<<<<<<<<<<<< - * return retargs - * finally: - */ - __Pyx_INCREF(__pyx_v_args); - __Pyx_GIVEREF(__pyx_v_args); - __Pyx_GOTREF(__pyx_v_self->parsed_args); - __Pyx_DECREF(__pyx_v_self->parsed_args); - __pyx_v_self->parsed_args = __pyx_v_args; - - /* "rados.pyx":662 - * if a != NULL] - * self.parsed_args = args - * return retargs # <<<<<<<<<<<<<< - * finally: - * free(_argv) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_retargs); - __pyx_r = __pyx_v_retargs; - goto __pyx_L4_return; - } - - /* "rados.pyx":664 - * return retargs - * finally: - * free(_argv) # <<<<<<<<<<<<<< - * free(_remargv) - * - */ - /*finally:*/ { - /*exception exit:*/{ - __Pyx_PyThreadState_declare - __pyx_L5_error:; - __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; - __Pyx_PyThreadState_assign - __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); - if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); - __Pyx_XGOTREF(__pyx_t_16); - __Pyx_XGOTREF(__pyx_t_17); - __Pyx_XGOTREF(__pyx_t_18); - __Pyx_XGOTREF(__pyx_t_19); - __Pyx_XGOTREF(__pyx_t_20); - __Pyx_XGOTREF(__pyx_t_21); - __pyx_t_13 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename; - { - free(__pyx_v__argv); - - /* "rados.pyx":665 - * finally: - * free(_argv) - * free(_remargv) # <<<<<<<<<<<<<< - * - * def conf_parse_env(self, var='CEPH_ARGS'): - */ - free(__pyx_v__remargv); - } - __Pyx_PyThreadState_assign - if (PY_MAJOR_VERSION >= 3) { - __Pyx_XGIVEREF(__pyx_t_19); - __Pyx_XGIVEREF(__pyx_t_20); - __Pyx_XGIVEREF(__pyx_t_21); - __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21); - } - __Pyx_XGIVEREF(__pyx_t_16); - __Pyx_XGIVEREF(__pyx_t_17); - __Pyx_XGIVEREF(__pyx_t_18); - __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18); - __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; - __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15; - goto __pyx_L1_error; - } - __pyx_L4_return: { - __pyx_t_21 = __pyx_r; - __pyx_r = 0; - - /* "rados.pyx":664 - * return retargs - * finally: - * free(_argv) # <<<<<<<<<<<<<< - * free(_remargv) - * - */ - free(__pyx_v__argv); - - /* "rados.pyx":665 - * finally: - * free(_argv) - * free(_remargv) # <<<<<<<<<<<<<< - * - * def conf_parse_env(self, var='CEPH_ARGS'): - */ - free(__pyx_v__remargv); - __pyx_r = __pyx_t_21; - __pyx_t_21 = 0; - goto __pyx_L0; - } - } - - /* "rados.pyx":633 - * raise make_ex(ret, "error calling conf_read_file") - * - * def conf_parse_argv(self, args): # <<<<<<<<<<<<<< - * """ - * Parse known arguments from args, and remove; returned - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_11); - __Pyx_XDECREF(__pyx_t_12); - __Pyx_AddTraceback("rados.Rados.conf_parse_argv", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_cargs); - __Pyx_XDECREF(__pyx_v_retargs); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":667 - * free(_remargv) - * - * def conf_parse_env(self, var='CEPH_ARGS'): # <<<<<<<<<<<<<< - * """ - * Parse known arguments from an environment variable, normally - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Rados_19conf_parse_env(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Rados_18conf_parse_env[] = "Rados.conf_parse_env(self, var='CEPH_ARGS')\n\n Parse known arguments from an environment variable, normally\n CEPH_ARGS.\n "; -static PyObject *__pyx_pw_5rados_5Rados_19conf_parse_env(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_var = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("conf_parse_env (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_var,0}; - PyObject* values[1] = {0}; - values[0] = ((PyObject *)__pyx_n_s_CEPH_ARGS); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_var); - if (value) { values[0] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "conf_parse_env") < 0)) __PYX_ERR(0, 667, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_var = values[0]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("conf_parse_env", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 667, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Rados.conf_parse_env", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Rados_18conf_parse_env(((struct __pyx_obj_5rados_Rados *)__pyx_v_self), __pyx_v_var); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Rados_18conf_parse_env(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_var) { - char *__pyx_v__var; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - Py_ssize_t __pyx_t_6; - PyObject *__pyx_t_7 = NULL; - char *__pyx_t_8; - __Pyx_RefNannySetupContext("conf_parse_env", 0); - __Pyx_INCREF(__pyx_v_var); - - /* "rados.pyx":672 - * CEPH_ARGS. - * """ - * self.require_state("configuring", "connected") # <<<<<<<<<<<<<< - * if not var: - * return - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 672, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 672, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":673 - * """ - * self.require_state("configuring", "connected") - * if not var: # <<<<<<<<<<<<<< - * return - * - */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_var); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 673, __pyx_L1_error) - __pyx_t_4 = ((!__pyx_t_3) != 0); - if (__pyx_t_4) { - - /* "rados.pyx":674 - * self.require_state("configuring", "connected") - * if not var: - * return # <<<<<<<<<<<<<< - * - * var = cstr(var, 'var') - */ - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - - /* "rados.pyx":673 - * """ - * self.require_state("configuring", "connected") - * if not var: # <<<<<<<<<<<<<< - * return - * - */ - } - - /* "rados.pyx":676 - * return - * - * var = cstr(var, 'var') # <<<<<<<<<<<<<< - * cdef: - * char *_var = var - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 676, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = NULL; - __pyx_t_6 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_6 = 1; - } - } - __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 676, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; - } - __Pyx_INCREF(__pyx_v_var); - __Pyx_GIVEREF(__pyx_v_var); - PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_var); - __Pyx_INCREF(__pyx_n_s_var); - __Pyx_GIVEREF(__pyx_n_s_var); - PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_n_s_var); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 676, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_var, __pyx_t_2); - __pyx_t_2 = 0; - - /* "rados.pyx":678 - * var = cstr(var, 'var') - * cdef: - * char *_var = var # <<<<<<<<<<<<<< - * with nogil: - * ret = rados_conf_parse_env(self.cluster, _var) - */ - __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_var); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 678, __pyx_L1_error) - __pyx_v__var = __pyx_t_8; - - /* "rados.pyx":679 - * cdef: - * char *_var = var - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_conf_parse_env(self.cluster, _var) - * if ret != 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":680 - * char *_var = var - * with nogil: - * ret = rados_conf_parse_env(self.cluster, _var) # <<<<<<<<<<<<<< - * if ret != 0: - * raise make_ex(ret, "error calling conf_parse_env") - */ - __pyx_v_ret = rados_conf_parse_env(__pyx_v_self->cluster, __pyx_v__var); - } - - /* "rados.pyx":679 - * cdef: - * char *_var = var - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_conf_parse_env(self.cluster, _var) - * if ret != 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L6; - } - __pyx_L6:; - } - } - - /* "rados.pyx":681 - * with nogil: - * ret = rados_conf_parse_env(self.cluster, _var) - * if ret != 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error calling conf_parse_env") - * - */ - __pyx_t_4 = ((__pyx_v_ret != 0) != 0); - if (__pyx_t_4) { - - /* "rados.pyx":682 - * ret = rados_conf_parse_env(self.cluster, _var) - * if ret != 0: - * raise make_ex(ret, "error calling conf_parse_env") # <<<<<<<<<<<<<< - * - * @requires(('option', str_type)) - */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 682, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __pyx_f_5rados_make_ex(__pyx_t_2, __pyx_kp_s_error_calling_conf_parse_env); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 682, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 682, __pyx_L1_error) - - /* "rados.pyx":681 - * with nogil: - * ret = rados_conf_parse_env(self.cluster, _var) - * if ret != 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error calling conf_parse_env") - * - */ - } - - /* "rados.pyx":667 - * free(_remargv) - * - * def conf_parse_env(self, var='CEPH_ARGS'): # <<<<<<<<<<<<<< - * """ - * Parse known arguments from an environment variable, normally - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("rados.Rados.conf_parse_env", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_var); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":685 - * - * @requires(('option', str_type)) - * def conf_get(self, option): # <<<<<<<<<<<<<< - * """ - * Get the value of a configuration option - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Rados_21conf_get(PyObject *__pyx_v_self, PyObject *__pyx_v_option); /*proto*/ -static char __pyx_doc_5rados_5Rados_20conf_get[] = "Rados.conf_get(self, option)\n\n Get the value of a configuration option\n\n :param option: which option to read\n :type option: str\n\n :returns: str - value of the option or None\n :raises: :class:`TypeError`\n "; -static PyObject *__pyx_pw_5rados_5Rados_21conf_get(PyObject *__pyx_v_self, PyObject *__pyx_v_option) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("conf_get (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Rados_20conf_get(((struct __pyx_obj_5rados_Rados *)__pyx_v_self), ((PyObject *)__pyx_v_option)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Rados_20conf_get(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_option) { - char *__pyx_v__option; - size_t __pyx_v_length; - char *__pyx_v_ret_buf; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - void *__pyx_t_7; - int __pyx_t_8; - PyObject *__pyx_t_9 = NULL; - int __pyx_t_10; - int __pyx_t_11; - char const *__pyx_t_12; - PyObject *__pyx_t_13 = NULL; - PyObject *__pyx_t_14 = NULL; - PyObject *__pyx_t_15 = NULL; - PyObject *__pyx_t_16 = NULL; - PyObject *__pyx_t_17 = NULL; - PyObject *__pyx_t_18 = NULL; - __Pyx_RefNannySetupContext("conf_get", 0); - __Pyx_INCREF(__pyx_v_option); - - /* "rados.pyx":695 - * :raises: :class:`TypeError` - * """ - * self.require_state("configuring", "connected") # <<<<<<<<<<<<<< - * option = cstr(option, 'option') - * cdef: - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 695, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 695, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":696 - * """ - * self.require_state("configuring", "connected") - * option = cstr(option, 'option') # <<<<<<<<<<<<<< - * cdef: - * char *_option = option - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 696, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 696, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_option); - __Pyx_GIVEREF(__pyx_v_option); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_option); - __Pyx_INCREF(__pyx_n_s_option); - __Pyx_GIVEREF(__pyx_n_s_option); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_option); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 696, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_option, __pyx_t_2); - __pyx_t_2 = 0; - - /* "rados.pyx":698 - * option = cstr(option, 'option') - * cdef: - * char *_option = option # <<<<<<<<<<<<<< - * size_t length = 20 - * char *ret_buf = NULL - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_option); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 698, __pyx_L1_error) - __pyx_v__option = __pyx_t_6; - - /* "rados.pyx":699 - * cdef: - * char *_option = option - * size_t length = 20 # <<<<<<<<<<<<<< - * char *ret_buf = NULL - * - */ - __pyx_v_length = 20; - - /* "rados.pyx":700 - * char *_option = option - * size_t length = 20 - * char *ret_buf = NULL # <<<<<<<<<<<<<< - * - * try: - */ - __pyx_v_ret_buf = NULL; - - /* "rados.pyx":702 - * char *ret_buf = NULL - * - * try: # <<<<<<<<<<<<<< - * while True: - * ret_buf = realloc_chk(ret_buf, length) - */ - /*try:*/ { - - /* "rados.pyx":703 - * - * try: - * while True: # <<<<<<<<<<<<<< - * ret_buf = realloc_chk(ret_buf, length) - * with nogil: - */ - while (1) { - - /* "rados.pyx":704 - * try: - * while True: - * ret_buf = realloc_chk(ret_buf, length) # <<<<<<<<<<<<<< - * with nogil: - * ret = rados_conf_get(self.cluster, _option, ret_buf, length) - */ - __pyx_t_7 = __pyx_f_5rados_realloc_chk(__pyx_v_ret_buf, __pyx_v_length); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(0, 704, __pyx_L4_error) - __pyx_v_ret_buf = ((char *)__pyx_t_7); - - /* "rados.pyx":705 - * while True: - * ret_buf = realloc_chk(ret_buf, length) - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_conf_get(self.cluster, _option, ret_buf, length) - * if ret == 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":706 - * ret_buf = realloc_chk(ret_buf, length) - * with nogil: - * ret = rados_conf_get(self.cluster, _option, ret_buf, length) # <<<<<<<<<<<<<< - * if ret == 0: - * return decode_cstr(ret_buf) - */ - __pyx_v_ret = rados_conf_get(__pyx_v_self->cluster, __pyx_v__option, __pyx_v_ret_buf, __pyx_v_length); - } - - /* "rados.pyx":705 - * while True: - * ret_buf = realloc_chk(ret_buf, length) - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_conf_get(self.cluster, _option, ret_buf, length) - * if ret == 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L12; - } - __pyx_L12:; - } - } - - /* "rados.pyx":707 - * with nogil: - * ret = rados_conf_get(self.cluster, _option, ret_buf, length) - * if ret == 0: # <<<<<<<<<<<<<< - * return decode_cstr(ret_buf) - * elif ret == -errno.ENAMETOOLONG: - */ - __pyx_t_8 = ((__pyx_v_ret == 0) != 0); - if (__pyx_t_8) { - - /* "rados.pyx":708 - * ret = rados_conf_get(self.cluster, _option, ret_buf, length) - * if ret == 0: - * return decode_cstr(ret_buf) # <<<<<<<<<<<<<< - * elif ret == -errno.ENAMETOOLONG: - * length = length * 2 - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode_cstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 708, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_ret_buf); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 708, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_3) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 708, __pyx_L4_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 708, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3); __pyx_t_3 = NULL; - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 708, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L3_return; - - /* "rados.pyx":707 - * with nogil: - * ret = rados_conf_get(self.cluster, _option, ret_buf, length) - * if ret == 0: # <<<<<<<<<<<<<< - * return decode_cstr(ret_buf) - * elif ret == -errno.ENAMETOOLONG: - */ - } - - /* "rados.pyx":709 - * if ret == 0: - * return decode_cstr(ret_buf) - * elif ret == -errno.ENAMETOOLONG: # <<<<<<<<<<<<<< - * length = length * 2 - * elif ret == -errno.ENOENT: - */ - __pyx_t_8 = ((__pyx_v_ret == (-ENAMETOOLONG)) != 0); - if (__pyx_t_8) { - - /* "rados.pyx":710 - * return decode_cstr(ret_buf) - * elif ret == -errno.ENAMETOOLONG: - * length = length * 2 # <<<<<<<<<<<<<< - * elif ret == -errno.ENOENT: - * return None - */ - __pyx_v_length = (__pyx_v_length * 2); - - /* "rados.pyx":709 - * if ret == 0: - * return decode_cstr(ret_buf) - * elif ret == -errno.ENAMETOOLONG: # <<<<<<<<<<<<<< - * length = length * 2 - * elif ret == -errno.ENOENT: - */ - goto __pyx_L13; - } - - /* "rados.pyx":711 - * elif ret == -errno.ENAMETOOLONG: - * length = length * 2 - * elif ret == -errno.ENOENT: # <<<<<<<<<<<<<< - * return None - * else: - */ - __pyx_t_8 = ((__pyx_v_ret == (-ENOENT)) != 0); - if (__pyx_t_8) { - - /* "rados.pyx":712 - * length = length * 2 - * elif ret == -errno.ENOENT: - * return None # <<<<<<<<<<<<<< - * else: - * raise make_ex(ret, "error calling conf_get") - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L3_return; - - /* "rados.pyx":711 - * elif ret == -errno.ENAMETOOLONG: - * length = length * 2 - * elif ret == -errno.ENOENT: # <<<<<<<<<<<<<< - * return None - * else: - */ - } - - /* "rados.pyx":714 - * return None - * else: - * raise make_ex(ret, "error calling conf_get") # <<<<<<<<<<<<<< - * finally: - * free(ret_buf) - */ - /*else*/ { - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 714, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __pyx_f_5rados_make_ex(__pyx_t_2, __pyx_kp_s_error_calling_conf_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 714, __pyx_L4_error) - } - __pyx_L13:; - } - } - - /* "rados.pyx":716 - * raise make_ex(ret, "error calling conf_get") - * finally: - * free(ret_buf) # <<<<<<<<<<<<<< - * - * @requires(('option', str_type), ('val', str_type)) - */ - /*finally:*/ { - /*normal exit:*/{ - free(__pyx_v_ret_buf); - goto __pyx_L5; - } - /*exception exit:*/{ - __Pyx_PyThreadState_declare - __pyx_L4_error:; - __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; - __Pyx_PyThreadState_assign - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); - if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); - __Pyx_XGOTREF(__pyx_t_13); - __Pyx_XGOTREF(__pyx_t_14); - __Pyx_XGOTREF(__pyx_t_15); - __Pyx_XGOTREF(__pyx_t_16); - __Pyx_XGOTREF(__pyx_t_17); - __Pyx_XGOTREF(__pyx_t_18); - __pyx_t_10 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename; - { - free(__pyx_v_ret_buf); - } - __Pyx_PyThreadState_assign - if (PY_MAJOR_VERSION >= 3) { - __Pyx_XGIVEREF(__pyx_t_16); - __Pyx_XGIVEREF(__pyx_t_17); - __Pyx_XGIVEREF(__pyx_t_18); - __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); - } - __Pyx_XGIVEREF(__pyx_t_13); - __Pyx_XGIVEREF(__pyx_t_14); - __Pyx_XGIVEREF(__pyx_t_15); - __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15); - __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; - __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12; - goto __pyx_L1_error; - } - __pyx_L3_return: { - __pyx_t_18 = __pyx_r; - __pyx_r = 0; - free(__pyx_v_ret_buf); - __pyx_r = __pyx_t_18; - __pyx_t_18 = 0; - goto __pyx_L0; - } - __pyx_L5:; - } - - /* "rados.pyx":685 - * - * @requires(('option', str_type)) - * def conf_get(self, option): # <<<<<<<<<<<<<< - * """ - * Get the value of a configuration option - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("rados.Rados.conf_get", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_option); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":719 - * - * @requires(('option', str_type), ('val', str_type)) - * def conf_set(self, option, val): # <<<<<<<<<<<<<< - * """ - * Set the value of a configuration option - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Rados_23conf_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Rados_22conf_set[] = "Rados.conf_set(self, option, val)\n\n Set the value of a configuration option\n\n :param option: which option to set\n :type option: str\n :param option: value of the option\n :type option: str\n\n :raises: :class:`TypeError`, :class:`ObjectNotFound`\n "; -static PyObject *__pyx_pw_5rados_5Rados_23conf_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_option = 0; - PyObject *__pyx_v_val = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("conf_set (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_option,&__pyx_n_s_val,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_option)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("conf_set", 1, 2, 2, 1); __PYX_ERR(0, 719, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "conf_set") < 0)) __PYX_ERR(0, 719, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_option = values[0]; - __pyx_v_val = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("conf_set", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 719, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Rados.conf_set", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Rados_22conf_set(((struct __pyx_obj_5rados_Rados *)__pyx_v_self), __pyx_v_option, __pyx_v_val); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Rados_22conf_set(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_option, PyObject *__pyx_v_val) { - char *__pyx_v__option; - char *__pyx_v__val; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - int __pyx_t_7; - __Pyx_RefNannySetupContext("conf_set", 0); - __Pyx_INCREF(__pyx_v_option); - __Pyx_INCREF(__pyx_v_val); - - /* "rados.pyx":730 - * :raises: :class:`TypeError`, :class:`ObjectNotFound` - * """ - * self.require_state("configuring", "connected") # <<<<<<<<<<<<<< - * option = cstr(option, 'option') - * val = cstr(val, 'val') - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":731 - * """ - * self.require_state("configuring", "connected") - * option = cstr(option, 'option') # <<<<<<<<<<<<<< - * val = cstr(val, 'val') - * cdef: - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 731, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 731, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_option); - __Pyx_GIVEREF(__pyx_v_option); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_option); - __Pyx_INCREF(__pyx_n_s_option); - __Pyx_GIVEREF(__pyx_n_s_option); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_option); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 731, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_option, __pyx_t_2); - __pyx_t_2 = 0; - - /* "rados.pyx":732 - * self.require_state("configuring", "connected") - * option = cstr(option, 'option') - * val = cstr(val, 'val') # <<<<<<<<<<<<<< - * cdef: - * char *_option = option - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 732, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_4 = 1; - } - } - __pyx_t_3 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 732, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL; - } - __Pyx_INCREF(__pyx_v_val); - __Pyx_GIVEREF(__pyx_v_val); - PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_4, __pyx_v_val); - __Pyx_INCREF(__pyx_n_s_val); - __Pyx_GIVEREF(__pyx_n_s_val); - PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_4, __pyx_n_s_val); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 732, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_2); - __pyx_t_2 = 0; - - /* "rados.pyx":734 - * val = cstr(val, 'val') - * cdef: - * char *_option = option # <<<<<<<<<<<<<< - * char *_val = val - * - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_option); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 734, __pyx_L1_error) - __pyx_v__option = __pyx_t_6; - - /* "rados.pyx":735 - * cdef: - * char *_option = option - * char *_val = val # <<<<<<<<<<<<<< - * - * with nogil: - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_val); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 735, __pyx_L1_error) - __pyx_v__val = __pyx_t_6; - - /* "rados.pyx":737 - * char *_val = val - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_conf_set(self.cluster, _option, _val) - * if ret != 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":738 - * - * with nogil: - * ret = rados_conf_set(self.cluster, _option, _val) # <<<<<<<<<<<<<< - * if ret != 0: - * raise make_ex(ret, "error calling conf_set") - */ - __pyx_v_ret = rados_conf_set(__pyx_v_self->cluster, __pyx_v__option, __pyx_v__val); - } - - /* "rados.pyx":737 - * char *_val = val - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_conf_set(self.cluster, _option, _val) - * if ret != 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":739 - * with nogil: - * ret = rados_conf_set(self.cluster, _option, _val) - * if ret != 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error calling conf_set") - * - */ - __pyx_t_7 = ((__pyx_v_ret != 0) != 0); - if (__pyx_t_7) { - - /* "rados.pyx":740 - * ret = rados_conf_set(self.cluster, _option, _val) - * if ret != 0: - * raise make_ex(ret, "error calling conf_set") # <<<<<<<<<<<<<< - * - * def ping_monitor(self, mon_id): - */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 740, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __pyx_f_5rados_make_ex(__pyx_t_2, __pyx_kp_s_error_calling_conf_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 740, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 740, __pyx_L1_error) - - /* "rados.pyx":739 - * with nogil: - * ret = rados_conf_set(self.cluster, _option, _val) - * if ret != 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error calling conf_set") - * - */ - } - - /* "rados.pyx":719 - * - * @requires(('option', str_type), ('val', str_type)) - * def conf_set(self, option, val): # <<<<<<<<<<<<<< - * """ - * Set the value of a configuration option - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.Rados.conf_set", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_option); - __Pyx_XDECREF(__pyx_v_val); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":742 - * raise make_ex(ret, "error calling conf_set") - * - * def ping_monitor(self, mon_id): # <<<<<<<<<<<<<< - * """ - * Ping a monitor to assess liveness - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Rados_25ping_monitor(PyObject *__pyx_v_self, PyObject *__pyx_v_mon_id); /*proto*/ -static char __pyx_doc_5rados_5Rados_24ping_monitor[] = "Rados.ping_monitor(self, mon_id)\n\n Ping a monitor to assess liveness\n\n May be used as a simply way to assess liveness, or to obtain\n information about the monitor in a simple way even in the\n absence of quorum.\n\n :param mon_id: the ID portion of the monitor's name (i.e., mon.)\n :type mon_id: str\n :returns: the string reply from the monitor\n "; -static PyObject *__pyx_pw_5rados_5Rados_25ping_monitor(PyObject *__pyx_v_self, PyObject *__pyx_v_mon_id) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("ping_monitor (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Rados_24ping_monitor(((struct __pyx_obj_5rados_Rados *)__pyx_v_self), ((PyObject *)__pyx_v_mon_id)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Rados_24ping_monitor(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_mon_id) { - char *__pyx_v__mon_id; - size_t __pyx_v_outstrlen; - char *__pyx_v_outstr; - int __pyx_v_ret; - PyObject *__pyx_v_my_outstr = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - int __pyx_t_7; - __Pyx_RefNannySetupContext("ping_monitor", 0); - __Pyx_INCREF(__pyx_v_mon_id); - - /* "rados.pyx":755 - * """ - * - * self.require_state("configuring", "connected") # <<<<<<<<<<<<<< - * - * mon_id = cstr(mon_id, 'mon_id') - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 755, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 755, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":757 - * self.require_state("configuring", "connected") - * - * mon_id = cstr(mon_id, 'mon_id') # <<<<<<<<<<<<<< - * cdef: - * char *_mon_id = mon_id - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 757, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 757, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_mon_id); - __Pyx_GIVEREF(__pyx_v_mon_id); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_mon_id); - __Pyx_INCREF(__pyx_n_s_mon_id); - __Pyx_GIVEREF(__pyx_n_s_mon_id); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_mon_id); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 757, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_mon_id, __pyx_t_2); - __pyx_t_2 = 0; - - /* "rados.pyx":759 - * mon_id = cstr(mon_id, 'mon_id') - * cdef: - * char *_mon_id = mon_id # <<<<<<<<<<<<<< - * size_t outstrlen - * char *outstr - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_mon_id); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 759, __pyx_L1_error) - __pyx_v__mon_id = __pyx_t_6; - - /* "rados.pyx":763 - * char *outstr - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_ping_monitor(self.cluster, _mon_id, &outstr, &outstrlen) - * - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":764 - * - * with nogil: - * ret = rados_ping_monitor(self.cluster, _mon_id, &outstr, &outstrlen) # <<<<<<<<<<<<<< - * - * if ret != 0: - */ - __pyx_v_ret = rados_ping_monitor(__pyx_v_self->cluster, __pyx_v__mon_id, (&__pyx_v_outstr), (&__pyx_v_outstrlen)); - } - - /* "rados.pyx":763 - * char *outstr - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_ping_monitor(self.cluster, _mon_id, &outstr, &outstrlen) - * - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":766 - * ret = rados_ping_monitor(self.cluster, _mon_id, &outstr, &outstrlen) - * - * if ret != 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error calling ping_monitor") - * - */ - __pyx_t_7 = ((__pyx_v_ret != 0) != 0); - if (__pyx_t_7) { - - /* "rados.pyx":767 - * - * if ret != 0: - * raise make_ex(ret, "error calling ping_monitor") # <<<<<<<<<<<<<< - * - * if outstrlen: - */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 767, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __pyx_f_5rados_make_ex(__pyx_t_2, __pyx_kp_s_error_calling_ping_monitor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 767, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 767, __pyx_L1_error) - - /* "rados.pyx":766 - * ret = rados_ping_monitor(self.cluster, _mon_id, &outstr, &outstrlen) - * - * if ret != 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error calling ping_monitor") - * - */ - } - - /* "rados.pyx":769 - * raise make_ex(ret, "error calling ping_monitor") - * - * if outstrlen: # <<<<<<<<<<<<<< - * my_outstr = outstr[:outstrlen] - * rados_buffer_free(outstr) - */ - __pyx_t_7 = (__pyx_v_outstrlen != 0); - if (__pyx_t_7) { - - /* "rados.pyx":770 - * - * if outstrlen: - * my_outstr = outstr[:outstrlen] # <<<<<<<<<<<<<< - * rados_buffer_free(outstr) - * return decode_cstr(my_outstr) - */ - __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_outstr + 0, __pyx_v_outstrlen - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 770, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_my_outstr = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":771 - * if outstrlen: - * my_outstr = outstr[:outstrlen] - * rados_buffer_free(outstr) # <<<<<<<<<<<<<< - * return decode_cstr(my_outstr) - * - */ - rados_buffer_free(__pyx_v_outstr); - - /* "rados.pyx":772 - * my_outstr = outstr[:outstrlen] - * rados_buffer_free(outstr) - * return decode_cstr(my_outstr) # <<<<<<<<<<<<<< - * - * def connect(self, timeout=0): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 772, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (!__pyx_t_5) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_my_outstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 772, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 772, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL; - __Pyx_INCREF(__pyx_v_my_outstr); - __Pyx_GIVEREF(__pyx_v_my_outstr); - PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_my_outstr); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 772, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "rados.pyx":769 - * raise make_ex(ret, "error calling ping_monitor") - * - * if outstrlen: # <<<<<<<<<<<<<< - * my_outstr = outstr[:outstrlen] - * rados_buffer_free(outstr) - */ - } - - /* "rados.pyx":742 - * raise make_ex(ret, "error calling conf_set") - * - * def ping_monitor(self, mon_id): # <<<<<<<<<<<<<< - * """ - * Ping a monitor to assess liveness - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.Rados.ping_monitor", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_my_outstr); - __Pyx_XDECREF(__pyx_v_mon_id); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":774 - * return decode_cstr(my_outstr) - * - * def connect(self, timeout=0): # <<<<<<<<<<<<<< - * """ - * Connect to the cluster. Use shutdown() to release resources. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Rados_27connect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Rados_26connect[] = "Rados.connect(self, timeout=0)\n\n Connect to the cluster. Use shutdown() to release resources.\n "; -static PyObject *__pyx_pw_5rados_5Rados_27connect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - CYTHON_UNUSED PyObject *__pyx_v_timeout = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("connect (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeout,0}; - PyObject* values[1] = {0}; - values[0] = ((PyObject *)__pyx_int_0); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeout); - if (value) { values[0] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "connect") < 0)) __PYX_ERR(0, 774, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_timeout = values[0]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("connect", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 774, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Rados.connect", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Rados_26connect(((struct __pyx_obj_5rados_Rados *)__pyx_v_self), __pyx_v_timeout); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Rados_26connect(struct __pyx_obj_5rados_Rados *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_timeout) { - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - __Pyx_RefNannySetupContext("connect", 0); - - /* "rados.pyx":778 - * Connect to the cluster. Use shutdown() to release resources. - * """ - * self.require_state("configuring") # <<<<<<<<<<<<<< - * # NOTE(sileht): timeout was supported by old python API, - * # but this is not something available in C API, so ignore - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 778, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 778, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":782 - * # but this is not something available in C API, so ignore - * # for now and remove it later - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_connect(self.cluster) - * if ret != 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":783 - * # for now and remove it later - * with nogil: - * ret = rados_connect(self.cluster) # <<<<<<<<<<<<<< - * if ret != 0: - * raise make_ex(ret, "error connecting to the cluster") - */ - __pyx_v_ret = rados_connect(__pyx_v_self->cluster); - } - - /* "rados.pyx":782 - * # but this is not something available in C API, so ignore - * # for now and remove it later - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_connect(self.cluster) - * if ret != 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":784 - * with nogil: - * ret = rados_connect(self.cluster) - * if ret != 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error connecting to the cluster") - * self.state = "connected" - */ - __pyx_t_3 = ((__pyx_v_ret != 0) != 0); - if (__pyx_t_3) { - - /* "rados.pyx":785 - * ret = rados_connect(self.cluster) - * if ret != 0: - * raise make_ex(ret, "error connecting to the cluster") # <<<<<<<<<<<<<< - * self.state = "connected" - * - */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 785, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __pyx_f_5rados_make_ex(__pyx_t_2, __pyx_kp_s_error_connecting_to_the_cluster); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 785, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 785, __pyx_L1_error) - - /* "rados.pyx":784 - * with nogil: - * ret = rados_connect(self.cluster) - * if ret != 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error connecting to the cluster") - * self.state = "connected" - */ - } - - /* "rados.pyx":786 - * if ret != 0: - * raise make_ex(ret, "error connecting to the cluster") - * self.state = "connected" # <<<<<<<<<<<<<< - * - * def get_cluster_stats(self): - */ - __Pyx_INCREF(__pyx_n_s_connected); - __Pyx_GIVEREF(__pyx_n_s_connected); - __Pyx_GOTREF(__pyx_v_self->state); - __Pyx_DECREF(__pyx_v_self->state); - __pyx_v_self->state = __pyx_n_s_connected; - - /* "rados.pyx":774 - * return decode_cstr(my_outstr) - * - * def connect(self, timeout=0): # <<<<<<<<<<<<<< - * """ - * Connect to the cluster. Use shutdown() to release resources. - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("rados.Rados.connect", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":788 - * self.state = "connected" - * - * def get_cluster_stats(self): # <<<<<<<<<<<<<< - * """ - * Read usage info about the cluster - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Rados_29get_cluster_stats(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5rados_5Rados_28get_cluster_stats[] = "Rados.get_cluster_stats(self)\n\n Read usage info about the cluster\n\n This tells you total space, space used, space available, and number\n of objects. These are not updated immediately when data is written,\n they are eventually consistent.\n\n :returns: dict - contains the following keys:\n\n - ``kb`` (int) - total space\n\n - ``kb_used`` (int) - space used\n\n - ``kb_avail`` (int) - free space available\n\n - ``num_objects`` (int) - number of objects\n\n "; -static PyObject *__pyx_pw_5rados_5Rados_29get_cluster_stats(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("get_cluster_stats (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Rados_28get_cluster_stats(((struct __pyx_obj_5rados_Rados *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Rados_28get_cluster_stats(struct __pyx_obj_5rados_Rados *__pyx_v_self) { - struct rados_cluster_stat_t __pyx_v_stats; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("get_cluster_stats", 0); - - /* "rados.pyx":810 - * rados_cluster_stat_t stats - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_cluster_stat(self.cluster, &stats) - * - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":811 - * - * with nogil: - * ret = rados_cluster_stat(self.cluster, &stats) # <<<<<<<<<<<<<< - * - * if ret < 0: - */ - __pyx_v_ret = rados_cluster_stat(__pyx_v_self->cluster, (&__pyx_v_stats)); - } - - /* "rados.pyx":810 - * rados_cluster_stat_t stats - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_cluster_stat(self.cluster, &stats) - * - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":813 - * ret = rados_cluster_stat(self.cluster, &stats) - * - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex( - * ret, "Rados.get_cluster_stats(%s): get_stats failed" % self.rados_id) - */ - __pyx_t_1 = ((__pyx_v_ret < 0) != 0); - if (__pyx_t_1) { - - /* "rados.pyx":815 - * if ret < 0: - * raise make_ex( - * ret, "Rados.get_cluster_stats(%s): get_stats failed" % self.rados_id) # <<<<<<<<<<<<<< - * return {'kb': stats.kb, - * 'kb_used': stats.kb_used, - */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 815, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Rados_get_cluster_stats_s_get_st, __pyx_v_self->rados_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 815, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - - /* "rados.pyx":814 - * - * if ret < 0: - * raise make_ex( # <<<<<<<<<<<<<< - * ret, "Rados.get_cluster_stats(%s): get_stats failed" % self.rados_id) - * return {'kb': stats.kb, - */ - __pyx_t_4 = __pyx_f_5rados_make_ex(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 814, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 814, __pyx_L1_error) - - /* "rados.pyx":813 - * ret = rados_cluster_stat(self.cluster, &stats) - * - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex( - * ret, "Rados.get_cluster_stats(%s): get_stats failed" % self.rados_id) - */ - } - - /* "rados.pyx":816 - * raise make_ex( - * ret, "Rados.get_cluster_stats(%s): get_stats failed" % self.rados_id) - * return {'kb': stats.kb, # <<<<<<<<<<<<<< - * 'kb_used': stats.kb_used, - * 'kb_avail': stats.kb_avail, - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 816, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_stats.kb); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_kb, __pyx_t_3) < 0) __PYX_ERR(0, 816, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "rados.pyx":817 - * ret, "Rados.get_cluster_stats(%s): get_stats failed" % self.rados_id) - * return {'kb': stats.kb, - * 'kb_used': stats.kb_used, # <<<<<<<<<<<<<< - * 'kb_avail': stats.kb_avail, - * 'num_objects': stats.num_objects} - */ - __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_stats.kb_used); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 817, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_kb_used, __pyx_t_3) < 0) __PYX_ERR(0, 816, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "rados.pyx":818 - * return {'kb': stats.kb, - * 'kb_used': stats.kb_used, - * 'kb_avail': stats.kb_avail, # <<<<<<<<<<<<<< - * 'num_objects': stats.num_objects} - * - */ - __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_stats.kb_avail); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 818, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_kb_avail, __pyx_t_3) < 0) __PYX_ERR(0, 816, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "rados.pyx":819 - * 'kb_used': stats.kb_used, - * 'kb_avail': stats.kb_avail, - * 'num_objects': stats.num_objects} # <<<<<<<<<<<<<< - * - * @requires(('pool_name', str_type)) - */ - __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_stats.num_objects); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 819, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_num_objects, __pyx_t_3) < 0) __PYX_ERR(0, 816, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - /* "rados.pyx":788 - * self.state = "connected" - * - * def get_cluster_stats(self): # <<<<<<<<<<<<<< - * """ - * Read usage info about the cluster - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("rados.Rados.get_cluster_stats", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":822 - * - * @requires(('pool_name', str_type)) - * def pool_exists(self, pool_name): # <<<<<<<<<<<<<< - * """ - * Checks if a given pool exists. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Rados_31pool_exists(PyObject *__pyx_v_self, PyObject *__pyx_v_pool_name); /*proto*/ -static char __pyx_doc_5rados_5Rados_30pool_exists[] = "Rados.pool_exists(self, pool_name)\n\n Checks if a given pool exists.\n\n :param pool_name: name of the pool to check\n :type pool_name: str\n\n :raises: :class:`TypeError`, :class:`Error`\n :returns: bool - whether the pool exists, false otherwise.\n "; -static PyObject *__pyx_pw_5rados_5Rados_31pool_exists(PyObject *__pyx_v_self, PyObject *__pyx_v_pool_name) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("pool_exists (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Rados_30pool_exists(((struct __pyx_obj_5rados_Rados *)__pyx_v_self), ((PyObject *)__pyx_v_pool_name)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Rados_30pool_exists(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_pool_name) { - char *__pyx_v__pool_name; - int64_t __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - int __pyx_t_7; - __Pyx_RefNannySetupContext("pool_exists", 0); - __Pyx_INCREF(__pyx_v_pool_name); - - /* "rados.pyx":832 - * :returns: bool - whether the pool exists, false otherwise. - * """ - * self.require_state("connected") # <<<<<<<<<<<<<< - * - * pool_name = cstr(pool_name, 'pool_name') - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":834 - * self.require_state("connected") - * - * pool_name = cstr(pool_name, 'pool_name') # <<<<<<<<<<<<<< - * cdef: - * char *_pool_name = pool_name - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_pool_name); - __Pyx_GIVEREF(__pyx_v_pool_name); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_pool_name); - __Pyx_INCREF(__pyx_n_s_pool_name); - __Pyx_GIVEREF(__pyx_n_s_pool_name); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_pool_name); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_pool_name, __pyx_t_2); - __pyx_t_2 = 0; - - /* "rados.pyx":836 - * pool_name = cstr(pool_name, 'pool_name') - * cdef: - * char *_pool_name = pool_name # <<<<<<<<<<<<<< - * - * with nogil: - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_pool_name); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 836, __pyx_L1_error) - __pyx_v__pool_name = __pyx_t_6; - - /* "rados.pyx":838 - * char *_pool_name = pool_name - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_pool_lookup(self.cluster, _pool_name) - * if ret >= 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":839 - * - * with nogil: - * ret = rados_pool_lookup(self.cluster, _pool_name) # <<<<<<<<<<<<<< - * if ret >= 0: - * return True - */ - __pyx_v_ret = rados_pool_lookup(__pyx_v_self->cluster, __pyx_v__pool_name); - } - - /* "rados.pyx":838 - * char *_pool_name = pool_name - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_pool_lookup(self.cluster, _pool_name) - * if ret >= 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":840 - * with nogil: - * ret = rados_pool_lookup(self.cluster, _pool_name) - * if ret >= 0: # <<<<<<<<<<<<<< - * return True - * elif ret == -errno.ENOENT: - */ - __pyx_t_7 = ((__pyx_v_ret >= 0) != 0); - if (__pyx_t_7) { - - /* "rados.pyx":841 - * ret = rados_pool_lookup(self.cluster, _pool_name) - * if ret >= 0: - * return True # <<<<<<<<<<<<<< - * elif ret == -errno.ENOENT: - * return False - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_True); - __pyx_r = Py_True; - goto __pyx_L0; - - /* "rados.pyx":840 - * with nogil: - * ret = rados_pool_lookup(self.cluster, _pool_name) - * if ret >= 0: # <<<<<<<<<<<<<< - * return True - * elif ret == -errno.ENOENT: - */ - } - - /* "rados.pyx":842 - * if ret >= 0: - * return True - * elif ret == -errno.ENOENT: # <<<<<<<<<<<<<< - * return False - * else: - */ - __pyx_t_7 = ((__pyx_v_ret == (-ENOENT)) != 0); - if (__pyx_t_7) { - - /* "rados.pyx":843 - * return True - * elif ret == -errno.ENOENT: - * return False # <<<<<<<<<<<<<< - * else: - * raise make_ex(ret, "error looking up pool '%s'" % pool_name) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - goto __pyx_L0; - - /* "rados.pyx":842 - * if ret >= 0: - * return True - * elif ret == -errno.ENOENT: # <<<<<<<<<<<<<< - * return False - * else: - */ - } - - /* "rados.pyx":845 - * return False - * else: - * raise make_ex(ret, "error looking up pool '%s'" % pool_name) # <<<<<<<<<<<<<< - * - * @requires(('pool_name', str_type)) - */ - /*else*/ { - __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 845, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_error_looking_up_pool_s, __pyx_v_pool_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 845, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_f_5rados_make_ex(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 845, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 845, __pyx_L1_error) - } - - /* "rados.pyx":822 - * - * @requires(('pool_name', str_type)) - * def pool_exists(self, pool_name): # <<<<<<<<<<<<<< - * """ - * Checks if a given pool exists. - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.Rados.pool_exists", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_pool_name); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":848 - * - * @requires(('pool_name', str_type)) - * def pool_lookup(self, pool_name): # <<<<<<<<<<<<<< - * """ - * Returns a pool's ID based on its name. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Rados_33pool_lookup(PyObject *__pyx_v_self, PyObject *__pyx_v_pool_name); /*proto*/ -static char __pyx_doc_5rados_5Rados_32pool_lookup[] = "Rados.pool_lookup(self, pool_name)\n\n Returns a pool's ID based on its name.\n\n :param pool_name: name of the pool to look up\n :type pool_name: str\n\n :raises: :class:`TypeError`, :class:`Error`\n :returns: int - pool ID, or None if it doesn't exist\n "; -static PyObject *__pyx_pw_5rados_5Rados_33pool_lookup(PyObject *__pyx_v_self, PyObject *__pyx_v_pool_name) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("pool_lookup (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Rados_32pool_lookup(((struct __pyx_obj_5rados_Rados *)__pyx_v_self), ((PyObject *)__pyx_v_pool_name)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Rados_32pool_lookup(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_pool_name) { - char *__pyx_v__pool_name; - int64_t __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - int __pyx_t_7; - __Pyx_RefNannySetupContext("pool_lookup", 0); - __Pyx_INCREF(__pyx_v_pool_name); - - /* "rados.pyx":858 - * :returns: int - pool ID, or None if it doesn't exist - * """ - * self.require_state("connected") # <<<<<<<<<<<<<< - * pool_name = cstr(pool_name, 'pool_name') - * cdef: - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":859 - * """ - * self.require_state("connected") - * pool_name = cstr(pool_name, 'pool_name') # <<<<<<<<<<<<<< - * cdef: - * char *_pool_name = pool_name - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 859, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 859, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_pool_name); - __Pyx_GIVEREF(__pyx_v_pool_name); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_pool_name); - __Pyx_INCREF(__pyx_n_s_pool_name); - __Pyx_GIVEREF(__pyx_n_s_pool_name); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_pool_name); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 859, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_pool_name, __pyx_t_2); - __pyx_t_2 = 0; - - /* "rados.pyx":861 - * pool_name = cstr(pool_name, 'pool_name') - * cdef: - * char *_pool_name = pool_name # <<<<<<<<<<<<<< - * - * with nogil: - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_pool_name); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 861, __pyx_L1_error) - __pyx_v__pool_name = __pyx_t_6; - - /* "rados.pyx":863 - * char *_pool_name = pool_name - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_pool_lookup(self.cluster, _pool_name) - * if ret >= 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":864 - * - * with nogil: - * ret = rados_pool_lookup(self.cluster, _pool_name) # <<<<<<<<<<<<<< - * if ret >= 0: - * return int(ret) - */ - __pyx_v_ret = rados_pool_lookup(__pyx_v_self->cluster, __pyx_v__pool_name); - } - - /* "rados.pyx":863 - * char *_pool_name = pool_name - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_pool_lookup(self.cluster, _pool_name) - * if ret >= 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":865 - * with nogil: - * ret = rados_pool_lookup(self.cluster, _pool_name) - * if ret >= 0: # <<<<<<<<<<<<<< - * return int(ret) - * elif ret == -errno.ENOENT: - */ - __pyx_t_7 = ((__pyx_v_ret >= 0) != 0); - if (__pyx_t_7) { - - /* "rados.pyx":866 - * ret = rados_pool_lookup(self.cluster, _pool_name) - * if ret >= 0: - * return int(ret) # <<<<<<<<<<<<<< - * elif ret == -errno.ENOENT: - * return None - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 866, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 866, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "rados.pyx":865 - * with nogil: - * ret = rados_pool_lookup(self.cluster, _pool_name) - * if ret >= 0: # <<<<<<<<<<<<<< - * return int(ret) - * elif ret == -errno.ENOENT: - */ - } - - /* "rados.pyx":867 - * if ret >= 0: - * return int(ret) - * elif ret == -errno.ENOENT: # <<<<<<<<<<<<<< - * return None - * else: - */ - __pyx_t_7 = ((__pyx_v_ret == (-ENOENT)) != 0); - if (__pyx_t_7) { - - /* "rados.pyx":868 - * return int(ret) - * elif ret == -errno.ENOENT: - * return None # <<<<<<<<<<<<<< - * else: - * raise make_ex(ret, "error looking up pool '%s'" % pool_name) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; - - /* "rados.pyx":867 - * if ret >= 0: - * return int(ret) - * elif ret == -errno.ENOENT: # <<<<<<<<<<<<<< - * return None - * else: - */ - } - - /* "rados.pyx":870 - * return None - * else: - * raise make_ex(ret, "error looking up pool '%s'" % pool_name) # <<<<<<<<<<<<<< - * - * @requires(('pool_id', int)) - */ - /*else*/ { - __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 870, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_error_looking_up_pool_s, __pyx_v_pool_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 870, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_f_5rados_make_ex(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 870, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 870, __pyx_L1_error) - } - - /* "rados.pyx":848 - * - * @requires(('pool_name', str_type)) - * def pool_lookup(self, pool_name): # <<<<<<<<<<<<<< - * """ - * Returns a pool's ID based on its name. - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.Rados.pool_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_pool_name); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":873 - * - * @requires(('pool_id', int)) - * def pool_reverse_lookup(self, pool_id): # <<<<<<<<<<<<<< - * """ - * Returns a pool's name based on its ID. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Rados_35pool_reverse_lookup(PyObject *__pyx_v_self, PyObject *__pyx_v_pool_id); /*proto*/ -static char __pyx_doc_5rados_5Rados_34pool_reverse_lookup[] = "Rados.pool_reverse_lookup(self, pool_id)\n\n Returns a pool's name based on its ID.\n\n :param pool_id: ID of the pool to look up\n :type pool_id: int\n\n :raises: :class:`TypeError`, :class:`Error`\n :returns: string - pool name, or None if it doesn't exist\n "; -static PyObject *__pyx_pw_5rados_5Rados_35pool_reverse_lookup(PyObject *__pyx_v_self, PyObject *__pyx_v_pool_id) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("pool_reverse_lookup (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Rados_34pool_reverse_lookup(((struct __pyx_obj_5rados_Rados *)__pyx_v_self), ((PyObject *)__pyx_v_pool_id)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Rados_34pool_reverse_lookup(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_pool_id) { - int64_t __pyx_v__pool_id; - size_t __pyx_v_size; - char *__pyx_v_name; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int64_t __pyx_t_3; - void *__pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - int __pyx_t_10; - int __pyx_t_11; - char const *__pyx_t_12; - PyObject *__pyx_t_13 = NULL; - PyObject *__pyx_t_14 = NULL; - PyObject *__pyx_t_15 = NULL; - PyObject *__pyx_t_16 = NULL; - PyObject *__pyx_t_17 = NULL; - PyObject *__pyx_t_18 = NULL; - __Pyx_RefNannySetupContext("pool_reverse_lookup", 0); - - /* "rados.pyx":883 - * :returns: string - pool name, or None if it doesn't exist - * """ - * self.require_state("connected") # <<<<<<<<<<<<<< - * cdef: - * int64_t _pool_id = pool_id - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 883, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 883, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":885 - * self.require_state("connected") - * cdef: - * int64_t _pool_id = pool_id # <<<<<<<<<<<<<< - * size_t size = 512 - * char *name = NULL - */ - __pyx_t_3 = __Pyx_PyInt_As_int64_t(__pyx_v_pool_id); if (unlikely((__pyx_t_3 == (int64_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 885, __pyx_L1_error) - __pyx_v__pool_id = __pyx_t_3; - - /* "rados.pyx":886 - * cdef: - * int64_t _pool_id = pool_id - * size_t size = 512 # <<<<<<<<<<<<<< - * char *name = NULL - * - */ - __pyx_v_size = 0x200; - - /* "rados.pyx":887 - * int64_t _pool_id = pool_id - * size_t size = 512 - * char *name = NULL # <<<<<<<<<<<<<< - * - * try: - */ - __pyx_v_name = NULL; - - /* "rados.pyx":889 - * char *name = NULL - * - * try: # <<<<<<<<<<<<<< - * while True: - * name = realloc_chk(name, size) - */ - /*try:*/ { - - /* "rados.pyx":890 - * - * try: - * while True: # <<<<<<<<<<<<<< - * name = realloc_chk(name, size) - * with nogil: - */ - while (1) { - - /* "rados.pyx":891 - * try: - * while True: - * name = realloc_chk(name, size) # <<<<<<<<<<<<<< - * with nogil: - * ret = rados_pool_reverse_lookup(self.cluster, _pool_id, name, size) - */ - __pyx_t_4 = __pyx_f_5rados_realloc_chk(__pyx_v_name, __pyx_v_size); if (unlikely(__pyx_t_4 == NULL)) __PYX_ERR(0, 891, __pyx_L4_error) - __pyx_v_name = ((char *)__pyx_t_4); - - /* "rados.pyx":892 - * while True: - * name = realloc_chk(name, size) - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_pool_reverse_lookup(self.cluster, _pool_id, name, size) - * if ret >= 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":893 - * name = realloc_chk(name, size) - * with nogil: - * ret = rados_pool_reverse_lookup(self.cluster, _pool_id, name, size) # <<<<<<<<<<<<<< - * if ret >= 0: - * break - */ - __pyx_v_ret = rados_pool_reverse_lookup(__pyx_v_self->cluster, __pyx_v__pool_id, __pyx_v_name, __pyx_v_size); - } - - /* "rados.pyx":892 - * while True: - * name = realloc_chk(name, size) - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_pool_reverse_lookup(self.cluster, _pool_id, name, size) - * if ret >= 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L12; - } - __pyx_L12:; - } - } - - /* "rados.pyx":894 - * with nogil: - * ret = rados_pool_reverse_lookup(self.cluster, _pool_id, name, size) - * if ret >= 0: # <<<<<<<<<<<<<< - * break - * elif ret != -errno.ERANGE and size <= 4096: - */ - __pyx_t_5 = ((__pyx_v_ret >= 0) != 0); - if (__pyx_t_5) { - - /* "rados.pyx":895 - * ret = rados_pool_reverse_lookup(self.cluster, _pool_id, name, size) - * if ret >= 0: - * break # <<<<<<<<<<<<<< - * elif ret != -errno.ERANGE and size <= 4096: - * size *= 2 - */ - goto __pyx_L7_break; - - /* "rados.pyx":894 - * with nogil: - * ret = rados_pool_reverse_lookup(self.cluster, _pool_id, name, size) - * if ret >= 0: # <<<<<<<<<<<<<< - * break - * elif ret != -errno.ERANGE and size <= 4096: - */ - } - - /* "rados.pyx":896 - * if ret >= 0: - * break - * elif ret != -errno.ERANGE and size <= 4096: # <<<<<<<<<<<<<< - * size *= 2 - * elif ret == -errno.ENOENT: - */ - __pyx_t_6 = ((__pyx_v_ret != (-ERANGE)) != 0); - if (__pyx_t_6) { - } else { - __pyx_t_5 = __pyx_t_6; - goto __pyx_L14_bool_binop_done; - } - __pyx_t_6 = ((__pyx_v_size <= 0x1000) != 0); - __pyx_t_5 = __pyx_t_6; - __pyx_L14_bool_binop_done:; - if (__pyx_t_5) { - - /* "rados.pyx":897 - * break - * elif ret != -errno.ERANGE and size <= 4096: - * size *= 2 # <<<<<<<<<<<<<< - * elif ret == -errno.ENOENT: - * return None - */ - __pyx_v_size = (__pyx_v_size * 2); - - /* "rados.pyx":896 - * if ret >= 0: - * break - * elif ret != -errno.ERANGE and size <= 4096: # <<<<<<<<<<<<<< - * size *= 2 - * elif ret == -errno.ENOENT: - */ - goto __pyx_L13; - } - - /* "rados.pyx":898 - * elif ret != -errno.ERANGE and size <= 4096: - * size *= 2 - * elif ret == -errno.ENOENT: # <<<<<<<<<<<<<< - * return None - * elif ret < 0: - */ - __pyx_t_5 = ((__pyx_v_ret == (-ENOENT)) != 0); - if (__pyx_t_5) { - - /* "rados.pyx":899 - * size *= 2 - * elif ret == -errno.ENOENT: - * return None # <<<<<<<<<<<<<< - * elif ret < 0: - * raise make_ex(ret, "error reverse looking up pool '%s'" % pool_id) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L3_return; - - /* "rados.pyx":898 - * elif ret != -errno.ERANGE and size <= 4096: - * size *= 2 - * elif ret == -errno.ENOENT: # <<<<<<<<<<<<<< - * return None - * elif ret < 0: - */ - } - - /* "rados.pyx":900 - * elif ret == -errno.ENOENT: - * return None - * elif ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error reverse looking up pool '%s'" % pool_id) - * - */ - __pyx_t_5 = ((__pyx_v_ret < 0) != 0); - if (__pyx_t_5) { - - /* "rados.pyx":901 - * return None - * elif ret < 0: - * raise make_ex(ret, "error reverse looking up pool '%s'" % pool_id) # <<<<<<<<<<<<<< - * - * return decode_cstr(name) - */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 901, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_error_reverse_looking_up_pool_s, __pyx_v_pool_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 901, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __pyx_f_5rados_make_ex(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 901, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_7, 0, 0, 0); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(0, 901, __pyx_L4_error) - - /* "rados.pyx":900 - * elif ret == -errno.ENOENT: - * return None - * elif ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error reverse looking up pool '%s'" % pool_id) - * - */ - } - __pyx_L13:; - } - __pyx_L7_break:; - - /* "rados.pyx":903 - * raise make_ex(ret, "error reverse looking up pool '%s'" % pool_id) - * - * return decode_cstr(name) # <<<<<<<<<<<<<< - * - * finally: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode_cstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 903, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 903, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_8) { - __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 903, __pyx_L4_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_t_7); - } else { - __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 903, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 903, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_7; - __pyx_t_7 = 0; - goto __pyx_L3_return; - } - - /* "rados.pyx":906 - * - * finally: - * free(name) # <<<<<<<<<<<<<< - * - * @requires(('pool_name', str_type), ('auid', opt(int)), ('crush_rule', opt(int))) - */ - /*finally:*/ { - /*exception exit:*/{ - __Pyx_PyThreadState_declare - __pyx_L4_error:; - __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; - __Pyx_PyThreadState_assign - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); - if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); - __Pyx_XGOTREF(__pyx_t_13); - __Pyx_XGOTREF(__pyx_t_14); - __Pyx_XGOTREF(__pyx_t_15); - __Pyx_XGOTREF(__pyx_t_16); - __Pyx_XGOTREF(__pyx_t_17); - __Pyx_XGOTREF(__pyx_t_18); - __pyx_t_10 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename; - { - free(__pyx_v_name); - } - __Pyx_PyThreadState_assign - if (PY_MAJOR_VERSION >= 3) { - __Pyx_XGIVEREF(__pyx_t_16); - __Pyx_XGIVEREF(__pyx_t_17); - __Pyx_XGIVEREF(__pyx_t_18); - __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); - } - __Pyx_XGIVEREF(__pyx_t_13); - __Pyx_XGIVEREF(__pyx_t_14); - __Pyx_XGIVEREF(__pyx_t_15); - __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15); - __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; - __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12; - goto __pyx_L1_error; - } - __pyx_L3_return: { - __pyx_t_18 = __pyx_r; - __pyx_r = 0; - free(__pyx_v_name); - __pyx_r = __pyx_t_18; - __pyx_t_18 = 0; - goto __pyx_L0; - } - } - - /* "rados.pyx":873 - * - * @requires(('pool_id', int)) - * def pool_reverse_lookup(self, pool_id): # <<<<<<<<<<<<<< - * """ - * Returns a pool's name based on its ID. - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("rados.Rados.pool_reverse_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":909 - * - * @requires(('pool_name', str_type), ('auid', opt(int)), ('crush_rule', opt(int))) - * def create_pool(self, pool_name, auid=None, crush_rule=None): # <<<<<<<<<<<<<< - * """ - * Create a pool: - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Rados_37create_pool(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Rados_36create_pool[] = "Rados.create_pool(self, pool_name, auid=None, crush_rule=None)\n\n Create a pool:\n - with default settings: if auid=None and crush_rule=None\n - owned by a specific auid: auid given and crush_rule=None\n - with a specific CRUSH rule: if auid=None and crush_rule given\n - with a specific CRUSH rule and auid: if auid and crush_rule given\n\n :param pool_name: name of the pool to create\n :type pool_name: str\n :param auid: the id of the owner of the new pool\n :type auid: int\n :param crush_rule: rule to use for placement in the new pool\n :type crush_rule: int\n\n :raises: :class:`TypeError`, :class:`Error`\n "; -static PyObject *__pyx_pw_5rados_5Rados_37create_pool(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_pool_name = 0; - PyObject *__pyx_v_auid = 0; - PyObject *__pyx_v_crush_rule = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("create_pool (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pool_name,&__pyx_n_s_auid,&__pyx_n_s_crush_rule,0}; - PyObject* values[3] = {0,0,0}; - values[1] = ((PyObject *)Py_None); - values[2] = ((PyObject *)Py_None); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pool_name)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_auid); - if (value) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_crush_rule); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create_pool") < 0)) __PYX_ERR(0, 909, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_pool_name = values[0]; - __pyx_v_auid = values[1]; - __pyx_v_crush_rule = values[2]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("create_pool", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 909, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Rados.create_pool", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Rados_36create_pool(((struct __pyx_obj_5rados_Rados *)__pyx_v_self), __pyx_v_pool_name, __pyx_v_auid, __pyx_v_crush_rule); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Rados_36create_pool(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_pool_name, PyObject *__pyx_v_auid, PyObject *__pyx_v_crush_rule) { - char *__pyx_v__pool_name; - uint8_t __pyx_v__crush_rule; - uint64_t __pyx_v__auid; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - int __pyx_t_7; - int __pyx_t_8; - int __pyx_t_9; - uint8_t __pyx_t_10; - uint64_t __pyx_t_11; - __Pyx_RefNannySetupContext("create_pool", 0); - __Pyx_INCREF(__pyx_v_pool_name); - - /* "rados.pyx":926 - * :raises: :class:`TypeError`, :class:`Error` - * """ - * self.require_state("connected") # <<<<<<<<<<<<<< - * - * pool_name = cstr(pool_name, 'pool_name') - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 926, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 926, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":928 - * self.require_state("connected") - * - * pool_name = cstr(pool_name, 'pool_name') # <<<<<<<<<<<<<< - * cdef: - * char *_pool_name = pool_name - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 928, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 928, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_pool_name); - __Pyx_GIVEREF(__pyx_v_pool_name); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_pool_name); - __Pyx_INCREF(__pyx_n_s_pool_name); - __Pyx_GIVEREF(__pyx_n_s_pool_name); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_pool_name); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 928, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_pool_name, __pyx_t_2); - __pyx_t_2 = 0; - - /* "rados.pyx":930 - * pool_name = cstr(pool_name, 'pool_name') - * cdef: - * char *_pool_name = pool_name # <<<<<<<<<<<<<< - * uint8_t _crush_rule - * uint64_t _auid - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_pool_name); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 930, __pyx_L1_error) - __pyx_v__pool_name = __pyx_t_6; - - /* "rados.pyx":934 - * uint64_t _auid - * - * if auid is None and crush_rule is None: # <<<<<<<<<<<<<< - * with nogil: - * ret = rados_pool_create(self.cluster, _pool_name) - */ - __pyx_t_8 = (__pyx_v_auid == Py_None); - __pyx_t_9 = (__pyx_t_8 != 0); - if (__pyx_t_9) { - } else { - __pyx_t_7 = __pyx_t_9; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_9 = (__pyx_v_crush_rule == Py_None); - __pyx_t_8 = (__pyx_t_9 != 0); - __pyx_t_7 = __pyx_t_8; - __pyx_L4_bool_binop_done:; - if (__pyx_t_7) { - - /* "rados.pyx":935 - * - * if auid is None and crush_rule is None: - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_pool_create(self.cluster, _pool_name) - * elif auid is None: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":936 - * if auid is None and crush_rule is None: - * with nogil: - * ret = rados_pool_create(self.cluster, _pool_name) # <<<<<<<<<<<<<< - * elif auid is None: - * _crush_rule = crush_rule - */ - __pyx_v_ret = rados_pool_create(__pyx_v_self->cluster, __pyx_v__pool_name); - } - - /* "rados.pyx":935 - * - * if auid is None and crush_rule is None: - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_pool_create(self.cluster, _pool_name) - * elif auid is None: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L8; - } - __pyx_L8:; - } - } - - /* "rados.pyx":934 - * uint64_t _auid - * - * if auid is None and crush_rule is None: # <<<<<<<<<<<<<< - * with nogil: - * ret = rados_pool_create(self.cluster, _pool_name) - */ - goto __pyx_L3; - } - - /* "rados.pyx":937 - * with nogil: - * ret = rados_pool_create(self.cluster, _pool_name) - * elif auid is None: # <<<<<<<<<<<<<< - * _crush_rule = crush_rule - * with nogil: - */ - __pyx_t_7 = (__pyx_v_auid == Py_None); - __pyx_t_8 = (__pyx_t_7 != 0); - if (__pyx_t_8) { - - /* "rados.pyx":938 - * ret = rados_pool_create(self.cluster, _pool_name) - * elif auid is None: - * _crush_rule = crush_rule # <<<<<<<<<<<<<< - * with nogil: - * ret = rados_pool_create_with_crush_rule(self.cluster, _pool_name, _crush_rule) - */ - __pyx_t_10 = __Pyx_PyInt_As_uint8_t(__pyx_v_crush_rule); if (unlikely((__pyx_t_10 == (uint8_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 938, __pyx_L1_error) - __pyx_v__crush_rule = __pyx_t_10; - - /* "rados.pyx":939 - * elif auid is None: - * _crush_rule = crush_rule - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_pool_create_with_crush_rule(self.cluster, _pool_name, _crush_rule) - * elif crush_rule is None: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":940 - * _crush_rule = crush_rule - * with nogil: - * ret = rados_pool_create_with_crush_rule(self.cluster, _pool_name, _crush_rule) # <<<<<<<<<<<<<< - * elif crush_rule is None: - * _auid = auid - */ - __pyx_v_ret = rados_pool_create_with_crush_rule(__pyx_v_self->cluster, __pyx_v__pool_name, __pyx_v__crush_rule); - } - - /* "rados.pyx":939 - * elif auid is None: - * _crush_rule = crush_rule - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_pool_create_with_crush_rule(self.cluster, _pool_name, _crush_rule) - * elif crush_rule is None: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L11; - } - __pyx_L11:; - } - } - - /* "rados.pyx":937 - * with nogil: - * ret = rados_pool_create(self.cluster, _pool_name) - * elif auid is None: # <<<<<<<<<<<<<< - * _crush_rule = crush_rule - * with nogil: - */ - goto __pyx_L3; - } - - /* "rados.pyx":941 - * with nogil: - * ret = rados_pool_create_with_crush_rule(self.cluster, _pool_name, _crush_rule) - * elif crush_rule is None: # <<<<<<<<<<<<<< - * _auid = auid - * with nogil: - */ - __pyx_t_8 = (__pyx_v_crush_rule == Py_None); - __pyx_t_7 = (__pyx_t_8 != 0); - if (__pyx_t_7) { - - /* "rados.pyx":942 - * ret = rados_pool_create_with_crush_rule(self.cluster, _pool_name, _crush_rule) - * elif crush_rule is None: - * _auid = auid # <<<<<<<<<<<<<< - * with nogil: - * ret = rados_pool_create_with_auid(self.cluster, _pool_name, _auid) - */ - __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_v_auid); if (unlikely((__pyx_t_11 == (uint64_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 942, __pyx_L1_error) - __pyx_v__auid = __pyx_t_11; - - /* "rados.pyx":943 - * elif crush_rule is None: - * _auid = auid - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_pool_create_with_auid(self.cluster, _pool_name, _auid) - * else: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":944 - * _auid = auid - * with nogil: - * ret = rados_pool_create_with_auid(self.cluster, _pool_name, _auid) # <<<<<<<<<<<<<< - * else: - * _auid = auid - */ - __pyx_v_ret = rados_pool_create_with_auid(__pyx_v_self->cluster, __pyx_v__pool_name, __pyx_v__auid); - } - - /* "rados.pyx":943 - * elif crush_rule is None: - * _auid = auid - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_pool_create_with_auid(self.cluster, _pool_name, _auid) - * else: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L14; - } - __pyx_L14:; - } - } - - /* "rados.pyx":941 - * with nogil: - * ret = rados_pool_create_with_crush_rule(self.cluster, _pool_name, _crush_rule) - * elif crush_rule is None: # <<<<<<<<<<<<<< - * _auid = auid - * with nogil: - */ - goto __pyx_L3; - } - - /* "rados.pyx":946 - * ret = rados_pool_create_with_auid(self.cluster, _pool_name, _auid) - * else: - * _auid = auid # <<<<<<<<<<<<<< - * _crush_rule = crush_rule - * with nogil: - */ - /*else*/ { - __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_v_auid); if (unlikely((__pyx_t_11 == (uint64_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 946, __pyx_L1_error) - __pyx_v__auid = __pyx_t_11; - - /* "rados.pyx":947 - * else: - * _auid = auid - * _crush_rule = crush_rule # <<<<<<<<<<<<<< - * with nogil: - * ret = rados_pool_create_with_all(self.cluster, _pool_name, _auid, _crush_rule) - */ - __pyx_t_10 = __Pyx_PyInt_As_uint8_t(__pyx_v_crush_rule); if (unlikely((__pyx_t_10 == (uint8_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 947, __pyx_L1_error) - __pyx_v__crush_rule = __pyx_t_10; - - /* "rados.pyx":948 - * _auid = auid - * _crush_rule = crush_rule - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_pool_create_with_all(self.cluster, _pool_name, _auid, _crush_rule) - * if ret < 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":949 - * _crush_rule = crush_rule - * with nogil: - * ret = rados_pool_create_with_all(self.cluster, _pool_name, _auid, _crush_rule) # <<<<<<<<<<<<<< - * if ret < 0: - * raise make_ex(ret, "error creating pool '%s'" % pool_name) - */ - __pyx_v_ret = rados_pool_create_with_all(__pyx_v_self->cluster, __pyx_v__pool_name, __pyx_v__auid, __pyx_v__crush_rule); - } - - /* "rados.pyx":948 - * _auid = auid - * _crush_rule = crush_rule - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_pool_create_with_all(self.cluster, _pool_name, _auid, _crush_rule) - * if ret < 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L17; - } - __pyx_L17:; - } - } - } - __pyx_L3:; - - /* "rados.pyx":950 - * with nogil: - * ret = rados_pool_create_with_all(self.cluster, _pool_name, _auid, _crush_rule) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error creating pool '%s'" % pool_name) - * - */ - __pyx_t_7 = ((__pyx_v_ret < 0) != 0); - if (__pyx_t_7) { - - /* "rados.pyx":951 - * ret = rados_pool_create_with_all(self.cluster, _pool_name, _auid, _crush_rule) - * if ret < 0: - * raise make_ex(ret, "error creating pool '%s'" % pool_name) # <<<<<<<<<<<<<< - * - * @requires(('pool_id', int)) - */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 951, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_error_creating_pool_s, __pyx_v_pool_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 951, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_f_5rados_make_ex(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 951, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 951, __pyx_L1_error) - - /* "rados.pyx":950 - * with nogil: - * ret = rados_pool_create_with_all(self.cluster, _pool_name, _auid, _crush_rule) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error creating pool '%s'" % pool_name) - * - */ - } - - /* "rados.pyx":909 - * - * @requires(('pool_name', str_type), ('auid', opt(int)), ('crush_rule', opt(int))) - * def create_pool(self, pool_name, auid=None, crush_rule=None): # <<<<<<<<<<<<<< - * """ - * Create a pool: - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.Rados.create_pool", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_pool_name); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":954 - * - * @requires(('pool_id', int)) - * def get_pool_base_tier(self, pool_id): # <<<<<<<<<<<<<< - * """ - * Get base pool - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Rados_39get_pool_base_tier(PyObject *__pyx_v_self, PyObject *__pyx_v_pool_id); /*proto*/ -static char __pyx_doc_5rados_5Rados_38get_pool_base_tier[] = "Rados.get_pool_base_tier(self, pool_id)\n\n Get base pool\n\n :returns: base pool, or pool_id if tiering is not configured for the pool\n "; -static PyObject *__pyx_pw_5rados_5Rados_39get_pool_base_tier(PyObject *__pyx_v_self, PyObject *__pyx_v_pool_id) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("get_pool_base_tier (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Rados_38get_pool_base_tier(((struct __pyx_obj_5rados_Rados *)__pyx_v_self), ((PyObject *)__pyx_v_pool_id)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Rados_38get_pool_base_tier(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_pool_id) { - int64_t __pyx_v_base_tier; - int64_t __pyx_v__pool_id; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int64_t __pyx_t_3; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - __Pyx_RefNannySetupContext("get_pool_base_tier", 0); - - /* "rados.pyx":960 - * :returns: base pool, or pool_id if tiering is not configured for the pool - * """ - * self.require_state("connected") # <<<<<<<<<<<<<< - * cdef: - * int64_t base_tier = 0 - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 960, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 960, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":962 - * self.require_state("connected") - * cdef: - * int64_t base_tier = 0 # <<<<<<<<<<<<<< - * int64_t _pool_id = pool_id - * - */ - __pyx_v_base_tier = 0; - - /* "rados.pyx":963 - * cdef: - * int64_t base_tier = 0 - * int64_t _pool_id = pool_id # <<<<<<<<<<<<<< - * - * with nogil: - */ - __pyx_t_3 = __Pyx_PyInt_As_int64_t(__pyx_v_pool_id); if (unlikely((__pyx_t_3 == (int64_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 963, __pyx_L1_error) - __pyx_v__pool_id = __pyx_t_3; - - /* "rados.pyx":965 - * int64_t _pool_id = pool_id - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_pool_get_base_tier(self.cluster, _pool_id, &base_tier) - * if ret < 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":966 - * - * with nogil: - * ret = rados_pool_get_base_tier(self.cluster, _pool_id, &base_tier) # <<<<<<<<<<<<<< - * if ret < 0: - * raise make_ex(ret, "get_pool_base_tier(%d)" % pool_id) - */ - __pyx_v_ret = rados_pool_get_base_tier(__pyx_v_self->cluster, __pyx_v__pool_id, (&__pyx_v_base_tier)); - } - - /* "rados.pyx":965 - * int64_t _pool_id = pool_id - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_pool_get_base_tier(self.cluster, _pool_id, &base_tier) - * if ret < 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":967 - * with nogil: - * ret = rados_pool_get_base_tier(self.cluster, _pool_id, &base_tier) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "get_pool_base_tier(%d)" % pool_id) - * return int(base_tier) - */ - __pyx_t_4 = ((__pyx_v_ret < 0) != 0); - if (__pyx_t_4) { - - /* "rados.pyx":968 - * ret = rados_pool_get_base_tier(self.cluster, _pool_id, &base_tier) - * if ret < 0: - * raise make_ex(ret, "get_pool_base_tier(%d)" % pool_id) # <<<<<<<<<<<<<< - * return int(base_tier) - * - */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 968, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_get_pool_base_tier_d, __pyx_v_pool_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 968, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_f_5rados_make_ex(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 968, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 968, __pyx_L1_error) - - /* "rados.pyx":967 - * with nogil: - * ret = rados_pool_get_base_tier(self.cluster, _pool_id, &base_tier) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "get_pool_base_tier(%d)" % pool_id) - * return int(base_tier) - */ - } - - /* "rados.pyx":969 - * if ret < 0: - * raise make_ex(ret, "get_pool_base_tier(%d)" % pool_id) - * return int(base_tier) # <<<<<<<<<<<<<< - * - * @requires(('pool_name', str_type)) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_base_tier); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 969, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 969, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 969, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; - goto __pyx_L0; - - /* "rados.pyx":954 - * - * @requires(('pool_id', int)) - * def get_pool_base_tier(self, pool_id): # <<<<<<<<<<<<<< - * """ - * Get base pool - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.Rados.get_pool_base_tier", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":972 - * - * @requires(('pool_name', str_type)) - * def delete_pool(self, pool_name): # <<<<<<<<<<<<<< - * """ - * Delete a pool and all data inside it. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Rados_41delete_pool(PyObject *__pyx_v_self, PyObject *__pyx_v_pool_name); /*proto*/ -static char __pyx_doc_5rados_5Rados_40delete_pool[] = "Rados.delete_pool(self, pool_name)\n\n Delete a pool and all data inside it.\n\n The pool is removed from the cluster immediately,\n but the actual data is deleted in the background.\n\n :param pool_name: name of the pool to delete\n :type pool_name: str\n\n :raises: :class:`TypeError`, :class:`Error`\n "; -static PyObject *__pyx_pw_5rados_5Rados_41delete_pool(PyObject *__pyx_v_self, PyObject *__pyx_v_pool_name) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("delete_pool (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Rados_40delete_pool(((struct __pyx_obj_5rados_Rados *)__pyx_v_self), ((PyObject *)__pyx_v_pool_name)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Rados_40delete_pool(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_pool_name) { - char *__pyx_v__pool_name; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - int __pyx_t_7; - __Pyx_RefNannySetupContext("delete_pool", 0); - __Pyx_INCREF(__pyx_v_pool_name); - - /* "rados.pyx":984 - * :raises: :class:`TypeError`, :class:`Error` - * """ - * self.require_state("connected") # <<<<<<<<<<<<<< - * - * pool_name = cstr(pool_name, 'pool_name') - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 984, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 984, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":986 - * self.require_state("connected") - * - * pool_name = cstr(pool_name, 'pool_name') # <<<<<<<<<<<<<< - * cdef: - * char *_pool_name = pool_name - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 986, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 986, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_pool_name); - __Pyx_GIVEREF(__pyx_v_pool_name); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_pool_name); - __Pyx_INCREF(__pyx_n_s_pool_name); - __Pyx_GIVEREF(__pyx_n_s_pool_name); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_pool_name); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 986, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_pool_name, __pyx_t_2); - __pyx_t_2 = 0; - - /* "rados.pyx":988 - * pool_name = cstr(pool_name, 'pool_name') - * cdef: - * char *_pool_name = pool_name # <<<<<<<<<<<<<< - * - * with nogil: - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_pool_name); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 988, __pyx_L1_error) - __pyx_v__pool_name = __pyx_t_6; - - /* "rados.pyx":990 - * char *_pool_name = pool_name - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_pool_delete(self.cluster, _pool_name) - * if ret < 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":991 - * - * with nogil: - * ret = rados_pool_delete(self.cluster, _pool_name) # <<<<<<<<<<<<<< - * if ret < 0: - * raise make_ex(ret, "error deleting pool '%s'" % pool_name) - */ - __pyx_v_ret = rados_pool_delete(__pyx_v_self->cluster, __pyx_v__pool_name); - } - - /* "rados.pyx":990 - * char *_pool_name = pool_name - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_pool_delete(self.cluster, _pool_name) - * if ret < 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":992 - * with nogil: - * ret = rados_pool_delete(self.cluster, _pool_name) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error deleting pool '%s'" % pool_name) - * - */ - __pyx_t_7 = ((__pyx_v_ret < 0) != 0); - if (__pyx_t_7) { - - /* "rados.pyx":993 - * ret = rados_pool_delete(self.cluster, _pool_name) - * if ret < 0: - * raise make_ex(ret, "error deleting pool '%s'" % pool_name) # <<<<<<<<<<<<<< - * - * @requires(('pool_id', int)) - */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 993, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_error_deleting_pool_s, __pyx_v_pool_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 993, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_f_5rados_make_ex(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 993, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 993, __pyx_L1_error) - - /* "rados.pyx":992 - * with nogil: - * ret = rados_pool_delete(self.cluster, _pool_name) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error deleting pool '%s'" % pool_name) - * - */ - } - - /* "rados.pyx":972 - * - * @requires(('pool_name', str_type)) - * def delete_pool(self, pool_name): # <<<<<<<<<<<<<< - * """ - * Delete a pool and all data inside it. - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.Rados.delete_pool", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_pool_name); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":996 - * - * @requires(('pool_id', int)) - * def get_inconsistent_pgs(self, pool_id): # <<<<<<<<<<<<<< - * """ - * List inconsistent placement groups in the given pool - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Rados_43get_inconsistent_pgs(PyObject *__pyx_v_self, PyObject *__pyx_v_pool_id); /*proto*/ -static char __pyx_doc_5rados_5Rados_42get_inconsistent_pgs[] = "Rados.get_inconsistent_pgs(self, pool_id)\n\n List inconsistent placement groups in the given pool\n\n :param pool_id: ID of the pool in which PGs are listed\n :type pool_id: int\n :returns: list - inconsistent placement groups\n "; -static PyObject *__pyx_pw_5rados_5Rados_43get_inconsistent_pgs(PyObject *__pyx_v_self, PyObject *__pyx_v_pool_id) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("get_inconsistent_pgs (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Rados_42get_inconsistent_pgs(((struct __pyx_obj_5rados_Rados *)__pyx_v_self), ((PyObject *)__pyx_v_pool_id)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Rados_42get_inconsistent_pgs(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_pool_id) { - int64_t __pyx_v_pool; - size_t __pyx_v_size; - char *__pyx_v_pgs; - int __pyx_v_ret; - PyObject *__pyx_v_pg = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int64_t __pyx_t_3; - void *__pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - Py_ssize_t __pyx_t_10; - PyObject *(*__pyx_t_11)(PyObject *); - int __pyx_t_12; - int __pyx_t_13; - char const *__pyx_t_14; - PyObject *__pyx_t_15 = NULL; - PyObject *__pyx_t_16 = NULL; - PyObject *__pyx_t_17 = NULL; - PyObject *__pyx_t_18 = NULL; - PyObject *__pyx_t_19 = NULL; - PyObject *__pyx_t_20 = NULL; - __Pyx_RefNannySetupContext("get_inconsistent_pgs", 0); - - /* "rados.pyx":1004 - * :returns: list - inconsistent placement groups - * """ - * self.require_state("connected") # <<<<<<<<<<<<<< - * cdef: - * int64_t pool = pool_id - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1004, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1004, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":1006 - * self.require_state("connected") - * cdef: - * int64_t pool = pool_id # <<<<<<<<<<<<<< - * size_t size = 512 - * char *pgs = NULL - */ - __pyx_t_3 = __Pyx_PyInt_As_int64_t(__pyx_v_pool_id); if (unlikely((__pyx_t_3 == (int64_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1006, __pyx_L1_error) - __pyx_v_pool = __pyx_t_3; - - /* "rados.pyx":1007 - * cdef: - * int64_t pool = pool_id - * size_t size = 512 # <<<<<<<<<<<<<< - * char *pgs = NULL - * - */ - __pyx_v_size = 0x200; - - /* "rados.pyx":1008 - * int64_t pool = pool_id - * size_t size = 512 - * char *pgs = NULL # <<<<<<<<<<<<<< - * - * try: - */ - __pyx_v_pgs = NULL; - - /* "rados.pyx":1010 - * char *pgs = NULL - * - * try: # <<<<<<<<<<<<<< - * while True: - * pgs = realloc_chk(pgs, size); - */ - /*try:*/ { - - /* "rados.pyx":1011 - * - * try: - * while True: # <<<<<<<<<<<<<< - * pgs = realloc_chk(pgs, size); - * with nogil: - */ - while (1) { - - /* "rados.pyx":1012 - * try: - * while True: - * pgs = realloc_chk(pgs, size); # <<<<<<<<<<<<<< - * with nogil: - * ret = rados_inconsistent_pg_list(self.cluster, pool, - */ - __pyx_t_4 = __pyx_f_5rados_realloc_chk(__pyx_v_pgs, __pyx_v_size); if (unlikely(__pyx_t_4 == NULL)) __PYX_ERR(0, 1012, __pyx_L4_error) - __pyx_v_pgs = ((char *)__pyx_t_4); - - /* "rados.pyx":1013 - * while True: - * pgs = realloc_chk(pgs, size); - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_inconsistent_pg_list(self.cluster, pool, - * pgs, size) - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1014 - * pgs = realloc_chk(pgs, size); - * with nogil: - * ret = rados_inconsistent_pg_list(self.cluster, pool, # <<<<<<<<<<<<<< - * pgs, size) - * if ret > size: - */ - __pyx_v_ret = rados_inconsistent_pg_list(__pyx_v_self->cluster, __pyx_v_pool, __pyx_v_pgs, __pyx_v_size); - } - - /* "rados.pyx":1013 - * while True: - * pgs = realloc_chk(pgs, size); - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_inconsistent_pg_list(self.cluster, pool, - * pgs, size) - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L12; - } - __pyx_L12:; - } - } - - /* "rados.pyx":1016 - * ret = rados_inconsistent_pg_list(self.cluster, pool, - * pgs, size) - * if ret > size: # <<<<<<<<<<<<<< - * size *= 2 - * elif ret >= 0: - */ - __pyx_t_5 = ((__pyx_v_ret > ((int)__pyx_v_size)) != 0); - if (__pyx_t_5) { - - /* "rados.pyx":1017 - * pgs, size) - * if ret > size: - * size *= 2 # <<<<<<<<<<<<<< - * elif ret >= 0: - * break - */ - __pyx_v_size = (__pyx_v_size * 2); - - /* "rados.pyx":1016 - * ret = rados_inconsistent_pg_list(self.cluster, pool, - * pgs, size) - * if ret > size: # <<<<<<<<<<<<<< - * size *= 2 - * elif ret >= 0: - */ - goto __pyx_L13; - } - - /* "rados.pyx":1018 - * if ret > size: - * size *= 2 - * elif ret >= 0: # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_t_5 = ((__pyx_v_ret >= 0) != 0); - if (__pyx_t_5) { - - /* "rados.pyx":1019 - * size *= 2 - * elif ret >= 0: - * break # <<<<<<<<<<<<<< - * else: - * raise make_ex(ret, "error calling inconsistent_pg_list") - */ - goto __pyx_L7_break; - - /* "rados.pyx":1018 - * if ret > size: - * size *= 2 - * elif ret >= 0: # <<<<<<<<<<<<<< - * break - * else: - */ - } - - /* "rados.pyx":1021 - * break - * else: - * raise make_ex(ret, "error calling inconsistent_pg_list") # <<<<<<<<<<<<<< - * return [pg for pg in decode_cstr(pgs[:ret]).split('\0') if pg] - * finally: - */ - /*else*/ { - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1021, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __pyx_f_5rados_make_ex(__pyx_t_2, __pyx_kp_s_error_calling_inconsistent_pg_li); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1021, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 1021, __pyx_L4_error) - } - __pyx_L13:; - } - __pyx_L7_break:; - - /* "rados.pyx":1022 - * else: - * raise make_ex(ret, "error calling inconsistent_pg_list") - * return [pg for pg in decode_cstr(pgs[:ret]).split('\0') if pg] # <<<<<<<<<<<<<< - * finally: - * free(pgs) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1022, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode_cstr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1022, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_pgs + 0, __pyx_v_ret - 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1022, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - } - } - if (!__pyx_t_8) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1022, __pyx_L4_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1022, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1022, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_split); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1022, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1022, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { - __pyx_t_6 = __pyx_t_2; __Pyx_INCREF(__pyx_t_6); __pyx_t_10 = 0; - __pyx_t_11 = NULL; - } else { - __pyx_t_10 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1022, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1022, __pyx_L4_error) - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - for (;;) { - if (likely(!__pyx_t_11)) { - if (likely(PyList_CheckExact(__pyx_t_6))) { - if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_6)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 1022, __pyx_L4_error) - #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1022, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); - #endif - } else { - if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_6)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 1022, __pyx_L4_error) - #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1022, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); - #endif - } - } else { - __pyx_t_2 = __pyx_t_11(__pyx_t_6); - if (unlikely(!__pyx_t_2)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1022, __pyx_L4_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_2); - } - __Pyx_XDECREF_SET(__pyx_v_pg, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_pg); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1022, __pyx_L4_error) - if (__pyx_t_5) { - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_v_pg))) __PYX_ERR(0, 1022, __pyx_L4_error) - } - } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L3_return; - } - - /* "rados.pyx":1024 - * return [pg for pg in decode_cstr(pgs[:ret]).split('\0') if pg] - * finally: - * free(pgs) # <<<<<<<<<<<<<< - * - * def list_pools(self): - */ - /*finally:*/ { - /*exception exit:*/{ - __Pyx_PyThreadState_declare - __pyx_L4_error:; - __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; - __Pyx_PyThreadState_assign - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); - if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); - __Pyx_XGOTREF(__pyx_t_15); - __Pyx_XGOTREF(__pyx_t_16); - __Pyx_XGOTREF(__pyx_t_17); - __Pyx_XGOTREF(__pyx_t_18); - __Pyx_XGOTREF(__pyx_t_19); - __Pyx_XGOTREF(__pyx_t_20); - __pyx_t_12 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename; - { - free(__pyx_v_pgs); - } - __Pyx_PyThreadState_assign - if (PY_MAJOR_VERSION >= 3) { - __Pyx_XGIVEREF(__pyx_t_18); - __Pyx_XGIVEREF(__pyx_t_19); - __Pyx_XGIVEREF(__pyx_t_20); - __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20); - } - __Pyx_XGIVEREF(__pyx_t_15); - __Pyx_XGIVEREF(__pyx_t_16); - __Pyx_XGIVEREF(__pyx_t_17); - __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17); - __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; - __pyx_lineno = __pyx_t_12; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14; - goto __pyx_L1_error; - } - __pyx_L3_return: { - __pyx_t_20 = __pyx_r; - __pyx_r = 0; - free(__pyx_v_pgs); - __pyx_r = __pyx_t_20; - __pyx_t_20 = 0; - goto __pyx_L0; - } - } - - /* "rados.pyx":996 - * - * @requires(('pool_id', int)) - * def get_inconsistent_pgs(self, pool_id): # <<<<<<<<<<<<<< - * """ - * List inconsistent placement groups in the given pool - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("rados.Rados.get_inconsistent_pgs", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_pg); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1026 - * free(pgs) - * - * def list_pools(self): # <<<<<<<<<<<<<< - * """ - * Gets a list of pool names. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Rados_45list_pools(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5rados_5Rados_44list_pools[] = "Rados.list_pools(self)\n\n Gets a list of pool names.\n\n :returns: list - of pool names.\n "; -static PyObject *__pyx_pw_5rados_5Rados_45list_pools(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("list_pools (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Rados_44list_pools(((struct __pyx_obj_5rados_Rados *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Rados_44list_pools(struct __pyx_obj_5rados_Rados *__pyx_v_self) { - size_t __pyx_v_size; - char *__pyx_v_c_names; - int __pyx_v_ret; - PyObject *__pyx_v_name = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - void *__pyx_t_3; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - Py_ssize_t __pyx_t_9; - PyObject *(*__pyx_t_10)(PyObject *); - int __pyx_t_11; - int __pyx_t_12; - char const *__pyx_t_13; - PyObject *__pyx_t_14 = NULL; - PyObject *__pyx_t_15 = NULL; - PyObject *__pyx_t_16 = NULL; - PyObject *__pyx_t_17 = NULL; - PyObject *__pyx_t_18 = NULL; - PyObject *__pyx_t_19 = NULL; - __Pyx_RefNannySetupContext("list_pools", 0); - - /* "rados.pyx":1032 - * :returns: list - of pool names. - * """ - * self.require_state("connected") # <<<<<<<<<<<<<< - * cdef: - * size_t size = 512 - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1032, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1032, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":1034 - * self.require_state("connected") - * cdef: - * size_t size = 512 # <<<<<<<<<<<<<< - * char *c_names = NULL - * - */ - __pyx_v_size = 0x200; - - /* "rados.pyx":1035 - * cdef: - * size_t size = 512 - * char *c_names = NULL # <<<<<<<<<<<<<< - * - * try: - */ - __pyx_v_c_names = NULL; - - /* "rados.pyx":1037 - * char *c_names = NULL - * - * try: # <<<<<<<<<<<<<< - * while True: - * c_names = realloc_chk(c_names, size) - */ - /*try:*/ { - - /* "rados.pyx":1038 - * - * try: - * while True: # <<<<<<<<<<<<<< - * c_names = realloc_chk(c_names, size) - * with nogil: - */ - while (1) { - - /* "rados.pyx":1039 - * try: - * while True: - * c_names = realloc_chk(c_names, size) # <<<<<<<<<<<<<< - * with nogil: - * ret = rados_pool_list(self.cluster, c_names, size) - */ - __pyx_t_3 = __pyx_f_5rados_realloc_chk(__pyx_v_c_names, __pyx_v_size); if (unlikely(__pyx_t_3 == NULL)) __PYX_ERR(0, 1039, __pyx_L4_error) - __pyx_v_c_names = ((char *)__pyx_t_3); - - /* "rados.pyx":1040 - * while True: - * c_names = realloc_chk(c_names, size) - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_pool_list(self.cluster, c_names, size) - * if ret > size: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1041 - * c_names = realloc_chk(c_names, size) - * with nogil: - * ret = rados_pool_list(self.cluster, c_names, size) # <<<<<<<<<<<<<< - * if ret > size: - * size *= 2 - */ - __pyx_v_ret = rados_pool_list(__pyx_v_self->cluster, __pyx_v_c_names, __pyx_v_size); - } - - /* "rados.pyx":1040 - * while True: - * c_names = realloc_chk(c_names, size) - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_pool_list(self.cluster, c_names, size) - * if ret > size: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L12; - } - __pyx_L12:; - } - } - - /* "rados.pyx":1042 - * with nogil: - * ret = rados_pool_list(self.cluster, c_names, size) - * if ret > size: # <<<<<<<<<<<<<< - * size *= 2 - * elif ret >= 0: - */ - __pyx_t_4 = ((__pyx_v_ret > ((int)__pyx_v_size)) != 0); - if (__pyx_t_4) { - - /* "rados.pyx":1043 - * ret = rados_pool_list(self.cluster, c_names, size) - * if ret > size: - * size *= 2 # <<<<<<<<<<<<<< - * elif ret >= 0: - * break - */ - __pyx_v_size = (__pyx_v_size * 2); - - /* "rados.pyx":1042 - * with nogil: - * ret = rados_pool_list(self.cluster, c_names, size) - * if ret > size: # <<<<<<<<<<<<<< - * size *= 2 - * elif ret >= 0: - */ - goto __pyx_L13; - } - - /* "rados.pyx":1044 - * if ret > size: - * size *= 2 - * elif ret >= 0: # <<<<<<<<<<<<<< - * break - * return [name for name in decode_cstr(c_names[:ret]).split('\0') - */ - __pyx_t_4 = ((__pyx_v_ret >= 0) != 0); - if (__pyx_t_4) { - - /* "rados.pyx":1045 - * size *= 2 - * elif ret >= 0: - * break # <<<<<<<<<<<<<< - * return [name for name in decode_cstr(c_names[:ret]).split('\0') - * if name] - */ - goto __pyx_L7_break; - - /* "rados.pyx":1044 - * if ret > size: - * size *= 2 - * elif ret >= 0: # <<<<<<<<<<<<<< - * break - * return [name for name in decode_cstr(c_names[:ret]).split('\0') - */ - } - __pyx_L13:; - } - __pyx_L7_break:; - - /* "rados.pyx":1046 - * elif ret >= 0: - * break - * return [name for name in decode_cstr(c_names[:ret]).split('\0') # <<<<<<<<<<<<<< - * if name] - * finally: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1046, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode_cstr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1046, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_c_names + 0, __pyx_v_ret - 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1046, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - } - } - if (!__pyx_t_7) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1046, __pyx_L4_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1046, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1046, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1046, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1046, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5); __pyx_t_9 = 0; - __pyx_t_10 = NULL; - } else { - __pyx_t_9 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1046, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1046, __pyx_L4_error) - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { - if (likely(!__pyx_t_10)) { - if (likely(PyList_CheckExact(__pyx_t_5))) { - if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_5)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1046, __pyx_L4_error) - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1046, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } else { - if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_5)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1046, __pyx_L4_error) - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1046, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } - } else { - __pyx_t_1 = __pyx_t_10(__pyx_t_5); - if (unlikely(!__pyx_t_1)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1046, __pyx_L4_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_1); - } - __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":1047 - * break - * return [name for name in decode_cstr(c_names[:ret]).split('\0') - * if name] # <<<<<<<<<<<<<< - * finally: - * free(c_names) - */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_name); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1047, __pyx_L4_error) - if (__pyx_t_4) { - - /* "rados.pyx":1046 - * elif ret >= 0: - * break - * return [name for name in decode_cstr(c_names[:ret]).split('\0') # <<<<<<<<<<<<<< - * if name] - * finally: - */ - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_v_name))) __PYX_ERR(0, 1046, __pyx_L4_error) - - /* "rados.pyx":1047 - * break - * return [name for name in decode_cstr(c_names[:ret]).split('\0') - * if name] # <<<<<<<<<<<<<< - * finally: - * free(c_names) - */ - } - - /* "rados.pyx":1046 - * elif ret >= 0: - * break - * return [name for name in decode_cstr(c_names[:ret]).split('\0') # <<<<<<<<<<<<<< - * if name] - * finally: - */ - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L3_return; - } - - /* "rados.pyx":1049 - * if name] - * finally: - * free(c_names) # <<<<<<<<<<<<<< - * - * def get_fsid(self): - */ - /*finally:*/ { - /*exception exit:*/{ - __Pyx_PyThreadState_declare - __pyx_L4_error:; - __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; - __Pyx_PyThreadState_assign - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); - if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); - __Pyx_XGOTREF(__pyx_t_14); - __Pyx_XGOTREF(__pyx_t_15); - __Pyx_XGOTREF(__pyx_t_16); - __Pyx_XGOTREF(__pyx_t_17); - __Pyx_XGOTREF(__pyx_t_18); - __Pyx_XGOTREF(__pyx_t_19); - __pyx_t_11 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename; - { - free(__pyx_v_c_names); - } - __Pyx_PyThreadState_assign - if (PY_MAJOR_VERSION >= 3) { - __Pyx_XGIVEREF(__pyx_t_17); - __Pyx_XGIVEREF(__pyx_t_18); - __Pyx_XGIVEREF(__pyx_t_19); - __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19); - } - __Pyx_XGIVEREF(__pyx_t_14); - __Pyx_XGIVEREF(__pyx_t_15); - __Pyx_XGIVEREF(__pyx_t_16); - __Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16); - __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; - __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13; - goto __pyx_L1_error; - } - __pyx_L3_return: { - __pyx_t_19 = __pyx_r; - __pyx_r = 0; - free(__pyx_v_c_names); - __pyx_r = __pyx_t_19; - __pyx_t_19 = 0; - goto __pyx_L0; - } - } - - /* "rados.pyx":1026 - * free(pgs) - * - * def list_pools(self): # <<<<<<<<<<<<<< - * """ - * Gets a list of pool names. - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("rados.Rados.list_pools", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_name); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1051 - * free(c_names) - * - * def get_fsid(self): # <<<<<<<<<<<<<< - * """ - * Get the fsid of the cluster as a hexadecimal string. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Rados_47get_fsid(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5rados_5Rados_46get_fsid[] = "Rados.get_fsid(self)\n\n Get the fsid of the cluster as a hexadecimal string.\n\n :raises: :class:`Error`\n :returns: str - cluster fsid\n "; -static PyObject *__pyx_pw_5rados_5Rados_47get_fsid(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("get_fsid (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Rados_46get_fsid(((struct __pyx_obj_5rados_Rados *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Rados_46get_fsid(struct __pyx_obj_5rados_Rados *__pyx_v_self) { - char *__pyx_v_ret_buf; - size_t __pyx_v_buf_len; - PyObject *__pyx_v_ret_s; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3; - char *__pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - int __pyx_t_7; - char const *__pyx_t_8; - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - PyObject *__pyx_t_11 = NULL; - PyObject *__pyx_t_12 = NULL; - PyObject *__pyx_t_13 = NULL; - PyObject *__pyx_t_14 = NULL; - __Pyx_RefNannySetupContext("get_fsid", 0); - - /* "rados.pyx":1058 - * :returns: str - cluster fsid - * """ - * self.require_state("connected") # <<<<<<<<<<<<<< - * cdef: - * char *ret_buf - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1058, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1058, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":1061 - * cdef: - * char *ret_buf - * size_t buf_len = 37 # <<<<<<<<<<<<<< - * PyObject* ret_s = NULL - * - */ - __pyx_v_buf_len = 37; - - /* "rados.pyx":1062 - * char *ret_buf - * size_t buf_len = 37 - * PyObject* ret_s = NULL # <<<<<<<<<<<<<< - * - * ret_s = PyBytes_FromStringAndSize(NULL, buf_len) - */ - __pyx_v_ret_s = NULL; - - /* "rados.pyx":1064 - * PyObject* ret_s = NULL - * - * ret_s = PyBytes_FromStringAndSize(NULL, buf_len) # <<<<<<<<<<<<<< - * try: - * ret_buf = PyBytes_AsString(ret_s) - */ - __pyx_t_3 = PyBytes_FromStringAndSize(NULL, __pyx_v_buf_len); if (unlikely(__pyx_t_3 == NULL)) __PYX_ERR(0, 1064, __pyx_L1_error) - __pyx_v_ret_s = __pyx_t_3; - - /* "rados.pyx":1065 - * - * ret_s = PyBytes_FromStringAndSize(NULL, buf_len) - * try: # <<<<<<<<<<<<<< - * ret_buf = PyBytes_AsString(ret_s) - * with nogil: - */ - /*try:*/ { - - /* "rados.pyx":1066 - * ret_s = PyBytes_FromStringAndSize(NULL, buf_len) - * try: - * ret_buf = PyBytes_AsString(ret_s) # <<<<<<<<<<<<<< - * with nogil: - * ret = rados_cluster_fsid(self.cluster, ret_buf, buf_len) - */ - __pyx_t_4 = PyBytes_AsString(__pyx_v_ret_s); if (unlikely(__pyx_t_4 == NULL)) __PYX_ERR(0, 1066, __pyx_L4_error) - __pyx_v_ret_buf = __pyx_t_4; - - /* "rados.pyx":1067 - * try: - * ret_buf = PyBytes_AsString(ret_s) - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_cluster_fsid(self.cluster, ret_buf, buf_len) - * if ret < 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1068 - * ret_buf = PyBytes_AsString(ret_s) - * with nogil: - * ret = rados_cluster_fsid(self.cluster, ret_buf, buf_len) # <<<<<<<<<<<<<< - * if ret < 0: - * raise make_ex(ret, "error getting cluster fsid") - */ - __pyx_v_ret = rados_cluster_fsid(__pyx_v_self->cluster, __pyx_v_ret_buf, __pyx_v_buf_len); - } - - /* "rados.pyx":1067 - * try: - * ret_buf = PyBytes_AsString(ret_s) - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_cluster_fsid(self.cluster, ret_buf, buf_len) - * if ret < 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L8; - } - __pyx_L8:; - } - } - - /* "rados.pyx":1069 - * with nogil: - * ret = rados_cluster_fsid(self.cluster, ret_buf, buf_len) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error getting cluster fsid") - * if ret != buf_len: - */ - __pyx_t_5 = ((__pyx_v_ret < 0) != 0); - if (__pyx_t_5) { - - /* "rados.pyx":1070 - * ret = rados_cluster_fsid(self.cluster, ret_buf, buf_len) - * if ret < 0: - * raise make_ex(ret, "error getting cluster fsid") # <<<<<<<<<<<<<< - * if ret != buf_len: - * _PyBytes_Resize(&ret_s, ret) - */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1070, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __pyx_f_5rados_make_ex(__pyx_t_2, __pyx_kp_s_error_getting_cluster_fsid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1070, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 1070, __pyx_L4_error) - - /* "rados.pyx":1069 - * with nogil: - * ret = rados_cluster_fsid(self.cluster, ret_buf, buf_len) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error getting cluster fsid") - * if ret != buf_len: - */ - } - - /* "rados.pyx":1071 - * if ret < 0: - * raise make_ex(ret, "error getting cluster fsid") - * if ret != buf_len: # <<<<<<<<<<<<<< - * _PyBytes_Resize(&ret_s, ret) - * return ret_s - */ - __pyx_t_5 = ((__pyx_v_ret != ((int)__pyx_v_buf_len)) != 0); - if (__pyx_t_5) { - - /* "rados.pyx":1072 - * raise make_ex(ret, "error getting cluster fsid") - * if ret != buf_len: - * _PyBytes_Resize(&ret_s, ret) # <<<<<<<<<<<<<< - * return ret_s - * finally: - */ - __pyx_t_6 = _PyBytes_Resize((&__pyx_v_ret_s), __pyx_v_ret); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 1072, __pyx_L4_error) - - /* "rados.pyx":1071 - * if ret < 0: - * raise make_ex(ret, "error getting cluster fsid") - * if ret != buf_len: # <<<<<<<<<<<<<< - * _PyBytes_Resize(&ret_s, ret) - * return ret_s - */ - } - - /* "rados.pyx":1073 - * if ret != buf_len: - * _PyBytes_Resize(&ret_s, ret) - * return ret_s # <<<<<<<<<<<<<< - * finally: - * # We DECREF unconditionally: the cast to object above will have - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_ret_s)); - __pyx_r = ((PyObject *)__pyx_v_ret_s); - goto __pyx_L3_return; - } - - /* "rados.pyx":1079 - * # including if _PyString_Resize fails (that will free the string - * # itself and set ret_s to NULL, hence XDECREF). - * ref.Py_XDECREF(ret_s) # <<<<<<<<<<<<<< - * - * @requires(('ioctx_name', str_type)) - */ - /*finally:*/ { - /*exception exit:*/{ - __Pyx_PyThreadState_declare - __pyx_L4_error:; - __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; - __Pyx_PyThreadState_assign - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); - if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); - __Pyx_XGOTREF(__pyx_t_9); - __Pyx_XGOTREF(__pyx_t_10); - __Pyx_XGOTREF(__pyx_t_11); - __Pyx_XGOTREF(__pyx_t_12); - __Pyx_XGOTREF(__pyx_t_13); - __Pyx_XGOTREF(__pyx_t_14); - __pyx_t_6 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_8 = __pyx_filename; - { - Py_XDECREF(__pyx_v_ret_s); - } - __Pyx_PyThreadState_assign - if (PY_MAJOR_VERSION >= 3) { - __Pyx_XGIVEREF(__pyx_t_12); - __Pyx_XGIVEREF(__pyx_t_13); - __Pyx_XGIVEREF(__pyx_t_14); - __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); - } - __Pyx_XGIVEREF(__pyx_t_9); - __Pyx_XGIVEREF(__pyx_t_10); - __Pyx_XGIVEREF(__pyx_t_11); - __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11); - __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; - __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8; - goto __pyx_L1_error; - } - __pyx_L3_return: { - __pyx_t_14 = __pyx_r; - __pyx_r = 0; - Py_XDECREF(__pyx_v_ret_s); - __pyx_r = __pyx_t_14; - __pyx_t_14 = 0; - goto __pyx_L0; - } - } - - /* "rados.pyx":1051 - * free(c_names) - * - * def get_fsid(self): # <<<<<<<<<<<<<< - * """ - * Get the fsid of the cluster as a hexadecimal string. - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("rados.Rados.get_fsid", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1082 - * - * @requires(('ioctx_name', str_type)) - * def open_ioctx(self, ioctx_name): # <<<<<<<<<<<<<< - * """ - * Create an io context - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Rados_49open_ioctx(PyObject *__pyx_v_self, PyObject *__pyx_v_ioctx_name); /*proto*/ -static char __pyx_doc_5rados_5Rados_48open_ioctx[] = "Rados.open_ioctx(self, ioctx_name)\n\n Create an io context\n\n The io context allows you to perform operations within a particular\n pool.\n\n :param ioctx_name: name of the pool\n :type ioctx_name: str\n\n :raises: :class:`TypeError`, :class:`Error`\n :returns: Ioctx - Rados Ioctx object\n "; -static PyObject *__pyx_pw_5rados_5Rados_49open_ioctx(PyObject *__pyx_v_self, PyObject *__pyx_v_ioctx_name) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("open_ioctx (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Rados_48open_ioctx(((struct __pyx_obj_5rados_Rados *)__pyx_v_self), ((PyObject *)__pyx_v_ioctx_name)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Rados_48open_ioctx(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_ioctx_name) { - rados_ioctx_t __pyx_v_ioctx; - char *__pyx_v__ioctx_name; - int __pyx_v_ret; - struct __pyx_obj_5rados_Ioctx *__pyx_v_io = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - int __pyx_t_7; - __Pyx_RefNannySetupContext("open_ioctx", 0); - __Pyx_INCREF(__pyx_v_ioctx_name); - - /* "rados.pyx":1095 - * :returns: Ioctx - Rados Ioctx object - * """ - * self.require_state("connected") # <<<<<<<<<<<<<< - * ioctx_name = cstr(ioctx_name, 'ioctx_name') - * cdef: - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1095, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1095, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":1096 - * """ - * self.require_state("connected") - * ioctx_name = cstr(ioctx_name, 'ioctx_name') # <<<<<<<<<<<<<< - * cdef: - * rados_ioctx_t ioctx - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1096, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1096, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_ioctx_name); - __Pyx_GIVEREF(__pyx_v_ioctx_name); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_ioctx_name); - __Pyx_INCREF(__pyx_n_s_ioctx_name); - __Pyx_GIVEREF(__pyx_n_s_ioctx_name); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_ioctx_name); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_ioctx_name, __pyx_t_2); - __pyx_t_2 = 0; - - /* "rados.pyx":1099 - * cdef: - * rados_ioctx_t ioctx - * char *_ioctx_name = ioctx_name # <<<<<<<<<<<<<< - * with nogil: - * ret = rados_ioctx_create(self.cluster, _ioctx_name, &ioctx) - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_ioctx_name); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 1099, __pyx_L1_error) - __pyx_v__ioctx_name = __pyx_t_6; - - /* "rados.pyx":1100 - * rados_ioctx_t ioctx - * char *_ioctx_name = ioctx_name - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_ioctx_create(self.cluster, _ioctx_name, &ioctx) - * if ret < 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1101 - * char *_ioctx_name = ioctx_name - * with nogil: - * ret = rados_ioctx_create(self.cluster, _ioctx_name, &ioctx) # <<<<<<<<<<<<<< - * if ret < 0: - * raise make_ex(ret, "error opening pool '%s'" % ioctx_name) - */ - __pyx_v_ret = rados_ioctx_create(__pyx_v_self->cluster, __pyx_v__ioctx_name, (&__pyx_v_ioctx)); - } - - /* "rados.pyx":1100 - * rados_ioctx_t ioctx - * char *_ioctx_name = ioctx_name - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_ioctx_create(self.cluster, _ioctx_name, &ioctx) - * if ret < 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":1102 - * with nogil: - * ret = rados_ioctx_create(self.cluster, _ioctx_name, &ioctx) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error opening pool '%s'" % ioctx_name) - * io = Ioctx(ioctx_name) - */ - __pyx_t_7 = ((__pyx_v_ret < 0) != 0); - if (__pyx_t_7) { - - /* "rados.pyx":1103 - * ret = rados_ioctx_create(self.cluster, _ioctx_name, &ioctx) - * if ret < 0: - * raise make_ex(ret, "error opening pool '%s'" % ioctx_name) # <<<<<<<<<<<<<< - * io = Ioctx(ioctx_name) - * io.io = ioctx - */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1103, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_error_opening_pool_s, __pyx_v_ioctx_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1103, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_f_5rados_make_ex(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1103, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 1103, __pyx_L1_error) - - /* "rados.pyx":1102 - * with nogil: - * ret = rados_ioctx_create(self.cluster, _ioctx_name, &ioctx) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error opening pool '%s'" % ioctx_name) - * io = Ioctx(ioctx_name) - */ - } - - /* "rados.pyx":1104 - * if ret < 0: - * raise make_ex(ret, "error opening pool '%s'" % ioctx_name) - * io = Ioctx(ioctx_name) # <<<<<<<<<<<<<< - * io.io = ioctx - * return io - */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(__pyx_v_ioctx_name); - __Pyx_GIVEREF(__pyx_v_ioctx_name); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_ioctx_name); - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5rados_Ioctx), __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_io = ((struct __pyx_obj_5rados_Ioctx *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":1105 - * raise make_ex(ret, "error opening pool '%s'" % ioctx_name) - * io = Ioctx(ioctx_name) - * io.io = ioctx # <<<<<<<<<<<<<< - * return io - * - */ - __pyx_v_io->io = __pyx_v_ioctx; - - /* "rados.pyx":1106 - * io = Ioctx(ioctx_name) - * io.io = ioctx - * return io # <<<<<<<<<<<<<< - * - * def mon_command(self, cmd, inbuf, timeout=0, target=None): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_io)); - __pyx_r = ((PyObject *)__pyx_v_io); - goto __pyx_L0; - - /* "rados.pyx":1082 - * - * @requires(('ioctx_name', str_type)) - * def open_ioctx(self, ioctx_name): # <<<<<<<<<<<<<< - * """ - * Create an io context - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.Rados.open_ioctx", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_io); - __Pyx_XDECREF(__pyx_v_ioctx_name); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1108 - * return io - * - * def mon_command(self, cmd, inbuf, timeout=0, target=None): # <<<<<<<<<<<<<< - * """ - * mon_command[_target](cmd, inbuf, outbuf, outbuflen, outs, outslen) - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Rados_51mon_command(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Rados_50mon_command[] = "Rados.mon_command(self, cmd, inbuf, timeout=0, target=None)\n\n mon_command[_target](cmd, inbuf, outbuf, outbuflen, outs, outslen)\n returns (int ret, string outbuf, string outs)\n "; -static PyObject *__pyx_pw_5rados_5Rados_51mon_command(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_cmd = 0; - PyObject *__pyx_v_inbuf = 0; - CYTHON_UNUSED PyObject *__pyx_v_timeout = 0; - PyObject *__pyx_v_target = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("mon_command (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cmd,&__pyx_n_s_inbuf,&__pyx_n_s_timeout,&__pyx_n_s_target,0}; - PyObject* values[4] = {0,0,0,0}; - values[2] = ((PyObject *)__pyx_int_0); - values[3] = ((PyObject *)Py_None); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cmd)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_inbuf)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("mon_command", 0, 2, 4, 1); __PYX_ERR(0, 1108, __pyx_L3_error) - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeout); - if (value) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_target); - if (value) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mon_command") < 0)) __PYX_ERR(0, 1108, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_cmd = values[0]; - __pyx_v_inbuf = values[1]; - __pyx_v_timeout = values[2]; - __pyx_v_target = values[3]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("mon_command", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1108, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Rados.mon_command", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Rados_50mon_command(((struct __pyx_obj_5rados_Rados *)__pyx_v_self), __pyx_v_cmd, __pyx_v_inbuf, __pyx_v_timeout, __pyx_v_target); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Rados_50mon_command(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_cmd, PyObject *__pyx_v_inbuf, CYTHON_UNUSED PyObject *__pyx_v_timeout, PyObject *__pyx_v_target) { - char *__pyx_v__target; - char **__pyx_v__cmd; - size_t __pyx_v__cmdlen; - char *__pyx_v__inbuf; - size_t __pyx_v__inbuf_len; - char *__pyx_v__outbuf; - size_t __pyx_v__outbuf_len; - char *__pyx_v__outs; - size_t __pyx_v__outs_len; - int __pyx_v_ret; - PyObject *__pyx_v_my_outs = NULL; - PyObject *__pyx_v_my_outbuf = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; - int __pyx_t_7; - char *__pyx_t_8; - PyObject *__pyx_t_9 = NULL; - int __pyx_t_10; - int __pyx_t_11; - char const *__pyx_t_12; - PyObject *__pyx_t_13 = NULL; - PyObject *__pyx_t_14 = NULL; - PyObject *__pyx_t_15 = NULL; - PyObject *__pyx_t_16 = NULL; - PyObject *__pyx_t_17 = NULL; - PyObject *__pyx_t_18 = NULL; - __Pyx_RefNannySetupContext("mon_command", 0); - __Pyx_INCREF(__pyx_v_cmd); - __Pyx_INCREF(__pyx_v_inbuf); - __Pyx_INCREF(__pyx_v_target); - - /* "rados.pyx":1116 - * # timeout argument, but we keep it for backward compat with old python binding - * - * self.require_state("connected") # <<<<<<<<<<<<<< - * cmd = cstr_list(cmd, 'c') - * - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1116, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1116, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":1117 - * - * self.require_state("connected") - * cmd = cstr_list(cmd, 'c') # <<<<<<<<<<<<<< - * - * if isinstance(target, int): - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1117, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1117, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_cmd); - __Pyx_GIVEREF(__pyx_v_cmd); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_cmd); - __Pyx_INCREF(__pyx_n_s_c); - __Pyx_GIVEREF(__pyx_n_s_c); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_c); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1117, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_cmd, __pyx_t_2); - __pyx_t_2 = 0; - - /* "rados.pyx":1119 - * cmd = cstr_list(cmd, 'c') - * - * if isinstance(target, int): # <<<<<<<<<<<<<< - * # NOTE(sileht): looks weird but test_monmap_dump pass int - * target = str(target) - */ - __pyx_t_6 = PyInt_Check(__pyx_v_target); - __pyx_t_7 = (__pyx_t_6 != 0); - if (__pyx_t_7) { - - /* "rados.pyx":1121 - * if isinstance(target, int): - * # NOTE(sileht): looks weird but test_monmap_dump pass int - * target = str(target) # <<<<<<<<<<<<<< - * - * target = cstr(target, 'target', opt=True) - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1121, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v_target); - __Pyx_GIVEREF(__pyx_v_target); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_target); - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1121, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_target, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":1119 - * cmd = cstr_list(cmd, 'c') - * - * if isinstance(target, int): # <<<<<<<<<<<<<< - * # NOTE(sileht): looks weird but test_monmap_dump pass int - * target = str(target) - */ - } - - /* "rados.pyx":1123 - * target = str(target) - * - * target = cstr(target, 'target', opt=True) # <<<<<<<<<<<<<< - * inbuf = cstr(inbuf, 'inbuf') - * - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1123, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1123, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v_target); - __Pyx_GIVEREF(__pyx_v_target); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_target); - __Pyx_INCREF(__pyx_n_s_target); - __Pyx_GIVEREF(__pyx_n_s_target); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_target); - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1123, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_opt, Py_True) < 0) __PYX_ERR(0, 1123, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1123, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF_SET(__pyx_v_target, __pyx_t_3); - __pyx_t_3 = 0; - - /* "rados.pyx":1124 - * - * target = cstr(target, 'target', opt=True) - * inbuf = cstr(inbuf, 'inbuf') # <<<<<<<<<<<<<< - * - * cdef: - */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1124, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_4 = 1; - } - } - __pyx_t_1 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (__pyx_t_2) { - __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = NULL; - } - __Pyx_INCREF(__pyx_v_inbuf); - __Pyx_GIVEREF(__pyx_v_inbuf); - PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_4, __pyx_v_inbuf); - __Pyx_INCREF(__pyx_n_s_inbuf); - __Pyx_GIVEREF(__pyx_n_s_inbuf); - PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_4, __pyx_n_s_inbuf); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1124, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF_SET(__pyx_v_inbuf, __pyx_t_3); - __pyx_t_3 = 0; - - /* "rados.pyx":1127 - * - * cdef: - * char *_target = opt_str(target) # <<<<<<<<<<<<<< - * char **_cmd = to_bytes_array(cmd) - * size_t _cmdlen = len(cmd) - */ - __pyx_t_8 = __pyx_f_5rados_opt_str(__pyx_v_target); if (unlikely(__pyx_t_8 == NULL && PyErr_Occurred())) __PYX_ERR(0, 1127, __pyx_L1_error) - __pyx_v__target = __pyx_t_8; - - /* "rados.pyx":1128 - * cdef: - * char *_target = opt_str(target) - * char **_cmd = to_bytes_array(cmd) # <<<<<<<<<<<<<< - * size_t _cmdlen = len(cmd) - * - */ - __pyx_v__cmd = __pyx_f_5rados_to_bytes_array(__pyx_v_cmd); - - /* "rados.pyx":1129 - * char *_target = opt_str(target) - * char **_cmd = to_bytes_array(cmd) - * size_t _cmdlen = len(cmd) # <<<<<<<<<<<<<< - * - * char *_inbuf = inbuf - */ - __pyx_t_4 = PyObject_Length(__pyx_v_cmd); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1129, __pyx_L1_error) - __pyx_v__cmdlen = __pyx_t_4; - - /* "rados.pyx":1131 - * size_t _cmdlen = len(cmd) - * - * char *_inbuf = inbuf # <<<<<<<<<<<<<< - * size_t _inbuf_len = len(inbuf) - * - */ - __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_inbuf); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 1131, __pyx_L1_error) - __pyx_v__inbuf = __pyx_t_8; - - /* "rados.pyx":1132 - * - * char *_inbuf = inbuf - * size_t _inbuf_len = len(inbuf) # <<<<<<<<<<<<<< - * - * char *_outbuf - */ - __pyx_t_4 = PyObject_Length(__pyx_v_inbuf); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1132, __pyx_L1_error) - __pyx_v__inbuf_len = __pyx_t_4; - - /* "rados.pyx":1139 - * size_t _outs_len - * - * try: # <<<<<<<<<<<<<< - * if target: - * with nogil: - */ - /*try:*/ { - - /* "rados.pyx":1140 - * - * try: - * if target: # <<<<<<<<<<<<<< - * with nogil: - * ret = rados_mon_command_target(self.cluster, _target, - */ - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_target); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1140, __pyx_L5_error) - if (__pyx_t_7) { - - /* "rados.pyx":1141 - * try: - * if target: - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_mon_command_target(self.cluster, _target, - * _cmd, _cmdlen, - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1142 - * if target: - * with nogil: - * ret = rados_mon_command_target(self.cluster, _target, # <<<<<<<<<<<<<< - * _cmd, _cmdlen, - * _inbuf, _inbuf_len, - */ - __pyx_v_ret = rados_mon_command_target(__pyx_v_self->cluster, __pyx_v__target, ((char const **)__pyx_v__cmd), __pyx_v__cmdlen, ((char const *)__pyx_v__inbuf), __pyx_v__inbuf_len, (&__pyx_v__outbuf), (&__pyx_v__outbuf_len), (&__pyx_v__outs), (&__pyx_v__outs_len)); - } - - /* "rados.pyx":1141 - * try: - * if target: - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_mon_command_target(self.cluster, _target, - * _cmd, _cmdlen, - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L10; - } - __pyx_L10:; - } - } - - /* "rados.pyx":1140 - * - * try: - * if target: # <<<<<<<<<<<<<< - * with nogil: - * ret = rados_mon_command_target(self.cluster, _target, - */ - goto __pyx_L7; - } - - /* "rados.pyx":1148 - * &_outs, &_outs_len) - * else: - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_mon_command(self.cluster, - * _cmd, _cmdlen, - */ - /*else*/ { - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1149 - * else: - * with nogil: - * ret = rados_mon_command(self.cluster, # <<<<<<<<<<<<<< - * _cmd, _cmdlen, - * _inbuf, _inbuf_len, - */ - __pyx_v_ret = rados_mon_command(__pyx_v_self->cluster, ((char const **)__pyx_v__cmd), __pyx_v__cmdlen, ((char const *)__pyx_v__inbuf), __pyx_v__inbuf_len, (&__pyx_v__outbuf), (&__pyx_v__outbuf_len), (&__pyx_v__outs), (&__pyx_v__outs_len)); - } - - /* "rados.pyx":1148 - * &_outs, &_outs_len) - * else: - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_mon_command(self.cluster, - * _cmd, _cmdlen, - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L13; - } - __pyx_L13:; - } - } - } - __pyx_L7:; - - /* "rados.pyx":1155 - * &_outs, &_outs_len) - * - * my_outs = decode_cstr(_outs[:_outs_len]) # <<<<<<<<<<<<<< - * my_outbuf = _outbuf[:_outbuf_len] - * if _outs_len: - */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode_cstr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1155, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v__outs + 0, __pyx_v__outs_len - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1155, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - } - } - if (!__pyx_t_2) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1155, __pyx_L5_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GOTREF(__pyx_t_3); - } else { - __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1155, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); __pyx_t_2 = NULL; - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1155, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_my_outs = __pyx_t_3; - __pyx_t_3 = 0; - - /* "rados.pyx":1156 - * - * my_outs = decode_cstr(_outs[:_outs_len]) - * my_outbuf = _outbuf[:_outbuf_len] # <<<<<<<<<<<<<< - * if _outs_len: - * rados_buffer_free(_outs) - */ - __pyx_t_3 = __Pyx_PyBytes_FromStringAndSize(__pyx_v__outbuf + 0, __pyx_v__outbuf_len - 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1156, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_v_my_outbuf = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; - - /* "rados.pyx":1157 - * my_outs = decode_cstr(_outs[:_outs_len]) - * my_outbuf = _outbuf[:_outbuf_len] - * if _outs_len: # <<<<<<<<<<<<<< - * rados_buffer_free(_outs) - * if _outbuf_len: - */ - __pyx_t_7 = (__pyx_v__outs_len != 0); - if (__pyx_t_7) { - - /* "rados.pyx":1158 - * my_outbuf = _outbuf[:_outbuf_len] - * if _outs_len: - * rados_buffer_free(_outs) # <<<<<<<<<<<<<< - * if _outbuf_len: - * rados_buffer_free(_outbuf) - */ - rados_buffer_free(__pyx_v__outs); - - /* "rados.pyx":1157 - * my_outs = decode_cstr(_outs[:_outs_len]) - * my_outbuf = _outbuf[:_outbuf_len] - * if _outs_len: # <<<<<<<<<<<<<< - * rados_buffer_free(_outs) - * if _outbuf_len: - */ - } - - /* "rados.pyx":1159 - * if _outs_len: - * rados_buffer_free(_outs) - * if _outbuf_len: # <<<<<<<<<<<<<< - * rados_buffer_free(_outbuf) - * return (ret, my_outbuf, my_outs) - */ - __pyx_t_7 = (__pyx_v__outbuf_len != 0); - if (__pyx_t_7) { - - /* "rados.pyx":1160 - * rados_buffer_free(_outs) - * if _outbuf_len: - * rados_buffer_free(_outbuf) # <<<<<<<<<<<<<< - * return (ret, my_outbuf, my_outs) - * finally: - */ - rados_buffer_free(__pyx_v__outbuf); - - /* "rados.pyx":1159 - * if _outs_len: - * rados_buffer_free(_outs) - * if _outbuf_len: # <<<<<<<<<<<<<< - * rados_buffer_free(_outbuf) - * return (ret, my_outbuf, my_outs) - */ - } - - /* "rados.pyx":1161 - * if _outbuf_len: - * rados_buffer_free(_outbuf) - * return (ret, my_outbuf, my_outs) # <<<<<<<<<<<<<< - * finally: - * free(_cmd) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1161, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1161, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); - __Pyx_INCREF(__pyx_v_my_outbuf); - __Pyx_GIVEREF(__pyx_v_my_outbuf); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_my_outbuf); - __Pyx_INCREF(__pyx_v_my_outs); - __Pyx_GIVEREF(__pyx_v_my_outs); - PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_my_outs); - __pyx_t_3 = 0; - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; - goto __pyx_L4_return; - } - - /* "rados.pyx":1163 - * return (ret, my_outbuf, my_outs) - * finally: - * free(_cmd) # <<<<<<<<<<<<<< - * - * def osd_command(self, osdid, cmd, inbuf, timeout=0): - */ - /*finally:*/ { - /*exception exit:*/{ - __Pyx_PyThreadState_declare - __pyx_L5_error:; - __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; - __Pyx_PyThreadState_assign - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); - if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); - __Pyx_XGOTREF(__pyx_t_13); - __Pyx_XGOTREF(__pyx_t_14); - __Pyx_XGOTREF(__pyx_t_15); - __Pyx_XGOTREF(__pyx_t_16); - __Pyx_XGOTREF(__pyx_t_17); - __Pyx_XGOTREF(__pyx_t_18); - __pyx_t_10 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename; - { - free(__pyx_v__cmd); - } - __Pyx_PyThreadState_assign - if (PY_MAJOR_VERSION >= 3) { - __Pyx_XGIVEREF(__pyx_t_16); - __Pyx_XGIVEREF(__pyx_t_17); - __Pyx_XGIVEREF(__pyx_t_18); - __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); - } - __Pyx_XGIVEREF(__pyx_t_13); - __Pyx_XGIVEREF(__pyx_t_14); - __Pyx_XGIVEREF(__pyx_t_15); - __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15); - __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; - __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12; - goto __pyx_L1_error; - } - __pyx_L4_return: { - __pyx_t_18 = __pyx_r; - __pyx_r = 0; - free(__pyx_v__cmd); - __pyx_r = __pyx_t_18; - __pyx_t_18 = 0; - goto __pyx_L0; - } - } - - /* "rados.pyx":1108 - * return io - * - * def mon_command(self, cmd, inbuf, timeout=0, target=None): # <<<<<<<<<<<<<< - * """ - * mon_command[_target](cmd, inbuf, outbuf, outbuflen, outs, outslen) - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("rados.Rados.mon_command", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_my_outs); - __Pyx_XDECREF(__pyx_v_my_outbuf); - __Pyx_XDECREF(__pyx_v_cmd); - __Pyx_XDECREF(__pyx_v_inbuf); - __Pyx_XDECREF(__pyx_v_target); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1165 - * free(_cmd) - * - * def osd_command(self, osdid, cmd, inbuf, timeout=0): # <<<<<<<<<<<<<< - * """ - * osd_command(osdid, cmd, inbuf, outbuf, outbuflen, outs, outslen) - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Rados_53osd_command(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Rados_52osd_command[] = "Rados.osd_command(self, osdid, cmd, inbuf, timeout=0)\n\n osd_command(osdid, cmd, inbuf, outbuf, outbuflen, outs, outslen)\n returns (int ret, string outbuf, string outs)\n "; -static PyObject *__pyx_pw_5rados_5Rados_53osd_command(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_osdid = 0; - PyObject *__pyx_v_cmd = 0; - PyObject *__pyx_v_inbuf = 0; - CYTHON_UNUSED PyObject *__pyx_v_timeout = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("osd_command (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_osdid,&__pyx_n_s_cmd,&__pyx_n_s_inbuf,&__pyx_n_s_timeout,0}; - PyObject* values[4] = {0,0,0,0}; - values[3] = ((PyObject *)__pyx_int_0); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_osdid)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cmd)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("osd_command", 0, 3, 4, 1); __PYX_ERR(0, 1165, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_inbuf)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("osd_command", 0, 3, 4, 2); __PYX_ERR(0, 1165, __pyx_L3_error) - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeout); - if (value) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "osd_command") < 0)) __PYX_ERR(0, 1165, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_osdid = values[0]; - __pyx_v_cmd = values[1]; - __pyx_v_inbuf = values[2]; - __pyx_v_timeout = values[3]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("osd_command", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1165, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Rados.osd_command", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Rados_52osd_command(((struct __pyx_obj_5rados_Rados *)__pyx_v_self), __pyx_v_osdid, __pyx_v_cmd, __pyx_v_inbuf, __pyx_v_timeout); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Rados_52osd_command(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_osdid, PyObject *__pyx_v_cmd, PyObject *__pyx_v_inbuf, CYTHON_UNUSED PyObject *__pyx_v_timeout) { - int __pyx_v__osdid; - char **__pyx_v__cmd; - size_t __pyx_v__cmdlen; - char *__pyx_v__inbuf; - size_t __pyx_v__inbuf_len; - char *__pyx_v__outbuf; - size_t __pyx_v__outbuf_len; - char *__pyx_v__outs; - size_t __pyx_v__outs_len; - int __pyx_v_ret; - PyObject *__pyx_v_my_outs = NULL; - PyObject *__pyx_v_my_outbuf = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; - char *__pyx_t_7; - PyObject *__pyx_t_8 = NULL; - int __pyx_t_9; - int __pyx_t_10; - char const *__pyx_t_11; - PyObject *__pyx_t_12 = NULL; - PyObject *__pyx_t_13 = NULL; - PyObject *__pyx_t_14 = NULL; - PyObject *__pyx_t_15 = NULL; - PyObject *__pyx_t_16 = NULL; - PyObject *__pyx_t_17 = NULL; - __Pyx_RefNannySetupContext("osd_command", 0); - __Pyx_INCREF(__pyx_v_cmd); - __Pyx_INCREF(__pyx_v_inbuf); - - /* "rados.pyx":1172 - * # NOTE(sileht): timeout is ignored because C API doesn't provide - * # timeout argument, but we keep it for backward compat with old python binding - * self.require_state("connected") # <<<<<<<<<<<<<< - * - * cmd = cstr_list(cmd, 'cmd') - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1172, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1172, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":1174 - * self.require_state("connected") - * - * cmd = cstr_list(cmd, 'cmd') # <<<<<<<<<<<<<< - * inbuf = cstr(inbuf, 'inbuf') - * - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_cmd); - __Pyx_GIVEREF(__pyx_v_cmd); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_cmd); - __Pyx_INCREF(__pyx_n_s_cmd); - __Pyx_GIVEREF(__pyx_n_s_cmd); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_cmd); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_cmd, __pyx_t_2); - __pyx_t_2 = 0; - - /* "rados.pyx":1175 - * - * cmd = cstr_list(cmd, 'cmd') - * inbuf = cstr(inbuf, 'inbuf') # <<<<<<<<<<<<<< - * - * cdef: - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_4 = 1; - } - } - __pyx_t_3 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL; - } - __Pyx_INCREF(__pyx_v_inbuf); - __Pyx_GIVEREF(__pyx_v_inbuf); - PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_4, __pyx_v_inbuf); - __Pyx_INCREF(__pyx_n_s_inbuf); - __Pyx_GIVEREF(__pyx_n_s_inbuf); - PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_4, __pyx_n_s_inbuf); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_inbuf, __pyx_t_2); - __pyx_t_2 = 0; - - /* "rados.pyx":1178 - * - * cdef: - * int _osdid = osdid # <<<<<<<<<<<<<< - * char **_cmd = to_bytes_array(cmd) - * size_t _cmdlen = len(cmd) - */ - __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_osdid); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1178, __pyx_L1_error) - __pyx_v__osdid = __pyx_t_6; - - /* "rados.pyx":1179 - * cdef: - * int _osdid = osdid - * char **_cmd = to_bytes_array(cmd) # <<<<<<<<<<<<<< - * size_t _cmdlen = len(cmd) - * - */ - __pyx_v__cmd = __pyx_f_5rados_to_bytes_array(__pyx_v_cmd); - - /* "rados.pyx":1180 - * int _osdid = osdid - * char **_cmd = to_bytes_array(cmd) - * size_t _cmdlen = len(cmd) # <<<<<<<<<<<<<< - * - * char *_inbuf = inbuf - */ - __pyx_t_4 = PyObject_Length(__pyx_v_cmd); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1180, __pyx_L1_error) - __pyx_v__cmdlen = __pyx_t_4; - - /* "rados.pyx":1182 - * size_t _cmdlen = len(cmd) - * - * char *_inbuf = inbuf # <<<<<<<<<<<<<< - * size_t _inbuf_len = len(inbuf) - * - */ - __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_inbuf); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 1182, __pyx_L1_error) - __pyx_v__inbuf = __pyx_t_7; - - /* "rados.pyx":1183 - * - * char *_inbuf = inbuf - * size_t _inbuf_len = len(inbuf) # <<<<<<<<<<<<<< - * - * char *_outbuf - */ - __pyx_t_4 = PyObject_Length(__pyx_v_inbuf); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1183, __pyx_L1_error) - __pyx_v__inbuf_len = __pyx_t_4; - - /* "rados.pyx":1190 - * size_t _outs_len - * - * try: # <<<<<<<<<<<<<< - * with nogil: - * ret = rados_osd_command(self.cluster, _osdid, - */ - /*try:*/ { - - /* "rados.pyx":1191 - * - * try: - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_osd_command(self.cluster, _osdid, - * _cmd, _cmdlen, - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1192 - * try: - * with nogil: - * ret = rados_osd_command(self.cluster, _osdid, # <<<<<<<<<<<<<< - * _cmd, _cmdlen, - * _inbuf, _inbuf_len, - */ - __pyx_v_ret = rados_osd_command(__pyx_v_self->cluster, __pyx_v__osdid, ((char const **)__pyx_v__cmd), __pyx_v__cmdlen, ((char const *)__pyx_v__inbuf), __pyx_v__inbuf_len, (&__pyx_v__outbuf), (&__pyx_v__outbuf_len), (&__pyx_v__outs), (&__pyx_v__outs_len)); - } - - /* "rados.pyx":1191 - * - * try: - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_osd_command(self.cluster, _osdid, - * _cmd, _cmdlen, - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L8; - } - __pyx_L8:; - } - } - - /* "rados.pyx":1198 - * &_outs, &_outs_len) - * - * my_outs = decode_cstr(_outs[:_outs_len]) # <<<<<<<<<<<<<< - * my_outbuf = _outbuf[:_outbuf_len] - * if _outs_len: - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode_cstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1198, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyBytes_FromStringAndSize(__pyx_v__outs + 0, __pyx_v__outs_len - 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1198, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1198, __pyx_L4_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1198, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1198, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_my_outs = __pyx_t_2; - __pyx_t_2 = 0; - - /* "rados.pyx":1199 - * - * my_outs = decode_cstr(_outs[:_outs_len]) - * my_outbuf = _outbuf[:_outbuf_len] # <<<<<<<<<<<<<< - * if _outs_len: - * rados_buffer_free(_outs) - */ - __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v__outbuf + 0, __pyx_v__outbuf_len - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1199, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_v_my_outbuf = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; - - /* "rados.pyx":1200 - * my_outs = decode_cstr(_outs[:_outs_len]) - * my_outbuf = _outbuf[:_outbuf_len] - * if _outs_len: # <<<<<<<<<<<<<< - * rados_buffer_free(_outs) - * if _outbuf_len: - */ - __pyx_t_9 = (__pyx_v__outs_len != 0); - if (__pyx_t_9) { - - /* "rados.pyx":1201 - * my_outbuf = _outbuf[:_outbuf_len] - * if _outs_len: - * rados_buffer_free(_outs) # <<<<<<<<<<<<<< - * if _outbuf_len: - * rados_buffer_free(_outbuf) - */ - rados_buffer_free(__pyx_v__outs); - - /* "rados.pyx":1200 - * my_outs = decode_cstr(_outs[:_outs_len]) - * my_outbuf = _outbuf[:_outbuf_len] - * if _outs_len: # <<<<<<<<<<<<<< - * rados_buffer_free(_outs) - * if _outbuf_len: - */ - } - - /* "rados.pyx":1202 - * if _outs_len: - * rados_buffer_free(_outs) - * if _outbuf_len: # <<<<<<<<<<<<<< - * rados_buffer_free(_outbuf) - * return (ret, my_outbuf, my_outs) - */ - __pyx_t_9 = (__pyx_v__outbuf_len != 0); - if (__pyx_t_9) { - - /* "rados.pyx":1203 - * rados_buffer_free(_outs) - * if _outbuf_len: - * rados_buffer_free(_outbuf) # <<<<<<<<<<<<<< - * return (ret, my_outbuf, my_outs) - * finally: - */ - rados_buffer_free(__pyx_v__outbuf); - - /* "rados.pyx":1202 - * if _outs_len: - * rados_buffer_free(_outs) - * if _outbuf_len: # <<<<<<<<<<<<<< - * rados_buffer_free(_outbuf) - * return (ret, my_outbuf, my_outs) - */ - } - - /* "rados.pyx":1204 - * if _outbuf_len: - * rados_buffer_free(_outbuf) - * return (ret, my_outbuf, my_outs) # <<<<<<<<<<<<<< - * finally: - * free(_cmd) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1204, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1204, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); - __Pyx_INCREF(__pyx_v_my_outbuf); - __Pyx_GIVEREF(__pyx_v_my_outbuf); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_my_outbuf); - __Pyx_INCREF(__pyx_v_my_outs); - __Pyx_GIVEREF(__pyx_v_my_outs); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_my_outs); - __pyx_t_2 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L3_return; - } - - /* "rados.pyx":1206 - * return (ret, my_outbuf, my_outs) - * finally: - * free(_cmd) # <<<<<<<<<<<<<< - * - * def pg_command(self, pgid, cmd, inbuf, timeout=0): - */ - /*finally:*/ { - /*exception exit:*/{ - __Pyx_PyThreadState_declare - __pyx_L4_error:; - __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; - __Pyx_PyThreadState_assign - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); - if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); - __Pyx_XGOTREF(__pyx_t_12); - __Pyx_XGOTREF(__pyx_t_13); - __Pyx_XGOTREF(__pyx_t_14); - __Pyx_XGOTREF(__pyx_t_15); - __Pyx_XGOTREF(__pyx_t_16); - __Pyx_XGOTREF(__pyx_t_17); - __pyx_t_6 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename; - { - free(__pyx_v__cmd); - } - __Pyx_PyThreadState_assign - if (PY_MAJOR_VERSION >= 3) { - __Pyx_XGIVEREF(__pyx_t_15); - __Pyx_XGIVEREF(__pyx_t_16); - __Pyx_XGIVEREF(__pyx_t_17); - __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); - } - __Pyx_XGIVEREF(__pyx_t_12); - __Pyx_XGIVEREF(__pyx_t_13); - __Pyx_XGIVEREF(__pyx_t_14); - __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14); - __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; - __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11; - goto __pyx_L1_error; - } - __pyx_L3_return: { - __pyx_t_17 = __pyx_r; - __pyx_r = 0; - free(__pyx_v__cmd); - __pyx_r = __pyx_t_17; - __pyx_t_17 = 0; - goto __pyx_L0; - } - } - - /* "rados.pyx":1165 - * free(_cmd) - * - * def osd_command(self, osdid, cmd, inbuf, timeout=0): # <<<<<<<<<<<<<< - * """ - * osd_command(osdid, cmd, inbuf, outbuf, outbuflen, outs, outslen) - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("rados.Rados.osd_command", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_my_outs); - __Pyx_XDECREF(__pyx_v_my_outbuf); - __Pyx_XDECREF(__pyx_v_cmd); - __Pyx_XDECREF(__pyx_v_inbuf); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1208 - * free(_cmd) - * - * def pg_command(self, pgid, cmd, inbuf, timeout=0): # <<<<<<<<<<<<<< - * """ - * pg_command(pgid, cmd, inbuf, outbuf, outbuflen, outs, outslen) - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Rados_55pg_command(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Rados_54pg_command[] = "Rados.pg_command(self, pgid, cmd, inbuf, timeout=0)\n\n pg_command(pgid, cmd, inbuf, outbuf, outbuflen, outs, outslen)\n returns (int ret, string outbuf, string outs)\n "; -static PyObject *__pyx_pw_5rados_5Rados_55pg_command(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_pgid = 0; - PyObject *__pyx_v_cmd = 0; - PyObject *__pyx_v_inbuf = 0; - CYTHON_UNUSED PyObject *__pyx_v_timeout = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("pg_command (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pgid,&__pyx_n_s_cmd,&__pyx_n_s_inbuf,&__pyx_n_s_timeout,0}; - PyObject* values[4] = {0,0,0,0}; - values[3] = ((PyObject *)__pyx_int_0); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pgid)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cmd)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("pg_command", 0, 3, 4, 1); __PYX_ERR(0, 1208, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_inbuf)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("pg_command", 0, 3, 4, 2); __PYX_ERR(0, 1208, __pyx_L3_error) - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeout); - if (value) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pg_command") < 0)) __PYX_ERR(0, 1208, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_pgid = values[0]; - __pyx_v_cmd = values[1]; - __pyx_v_inbuf = values[2]; - __pyx_v_timeout = values[3]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("pg_command", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1208, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Rados.pg_command", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Rados_54pg_command(((struct __pyx_obj_5rados_Rados *)__pyx_v_self), __pyx_v_pgid, __pyx_v_cmd, __pyx_v_inbuf, __pyx_v_timeout); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Rados_54pg_command(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_pgid, PyObject *__pyx_v_cmd, PyObject *__pyx_v_inbuf, CYTHON_UNUSED PyObject *__pyx_v_timeout) { - char *__pyx_v__pgid; - char **__pyx_v__cmd; - size_t __pyx_v__cmdlen; - char *__pyx_v__inbuf; - size_t __pyx_v__inbuf_len; - char *__pyx_v__outbuf; - size_t __pyx_v__outbuf_len; - char *__pyx_v__outs; - size_t __pyx_v__outs_len; - int __pyx_v_ret; - PyObject *__pyx_v_my_outs = NULL; - PyObject *__pyx_v_my_outbuf = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; - int __pyx_t_9; - int __pyx_t_10; - char const *__pyx_t_11; - PyObject *__pyx_t_12 = NULL; - PyObject *__pyx_t_13 = NULL; - PyObject *__pyx_t_14 = NULL; - PyObject *__pyx_t_15 = NULL; - PyObject *__pyx_t_16 = NULL; - PyObject *__pyx_t_17 = NULL; - __Pyx_RefNannySetupContext("pg_command", 0); - __Pyx_INCREF(__pyx_v_pgid); - __Pyx_INCREF(__pyx_v_cmd); - __Pyx_INCREF(__pyx_v_inbuf); - - /* "rados.pyx":1215 - * # NOTE(sileht): timeout is ignored because C API doesn't provide - * # timeout argument, but we keep it for backward compat with old python binding - * self.require_state("connected") # <<<<<<<<<<<<<< - * - * pgid = cstr(pgid, 'pgid') - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":1217 - * self.require_state("connected") - * - * pgid = cstr(pgid, 'pgid') # <<<<<<<<<<<<<< - * cmd = cstr_list(cmd, 'cmd') - * inbuf = cstr(inbuf, 'inbuf') - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1217, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1217, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_pgid); - __Pyx_GIVEREF(__pyx_v_pgid); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_pgid); - __Pyx_INCREF(__pyx_n_s_pgid); - __Pyx_GIVEREF(__pyx_n_s_pgid); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_pgid); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1217, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_pgid, __pyx_t_2); - __pyx_t_2 = 0; - - /* "rados.pyx":1218 - * - * pgid = cstr(pgid, 'pgid') - * cmd = cstr_list(cmd, 'cmd') # <<<<<<<<<<<<<< - * inbuf = cstr(inbuf, 'inbuf') - * - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_4 = 1; - } - } - __pyx_t_3 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL; - } - __Pyx_INCREF(__pyx_v_cmd); - __Pyx_GIVEREF(__pyx_v_cmd); - PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_4, __pyx_v_cmd); - __Pyx_INCREF(__pyx_n_s_cmd); - __Pyx_GIVEREF(__pyx_n_s_cmd); - PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_4, __pyx_n_s_cmd); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_cmd, __pyx_t_2); - __pyx_t_2 = 0; - - /* "rados.pyx":1219 - * pgid = cstr(pgid, 'pgid') - * cmd = cstr_list(cmd, 'cmd') - * inbuf = cstr(inbuf, 'inbuf') # <<<<<<<<<<<<<< - * - * cdef: - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1219, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1219, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_inbuf); - __Pyx_GIVEREF(__pyx_v_inbuf); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_inbuf); - __Pyx_INCREF(__pyx_n_s_inbuf); - __Pyx_GIVEREF(__pyx_n_s_inbuf); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_inbuf); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1219, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_inbuf, __pyx_t_2); - __pyx_t_2 = 0; - - /* "rados.pyx":1222 - * - * cdef: - * char *_pgid = pgid # <<<<<<<<<<<<<< - * char **_cmd = to_bytes_array(cmd) - * size_t _cmdlen = len(cmd) - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_pgid); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 1222, __pyx_L1_error) - __pyx_v__pgid = __pyx_t_6; - - /* "rados.pyx":1223 - * cdef: - * char *_pgid = pgid - * char **_cmd = to_bytes_array(cmd) # <<<<<<<<<<<<<< - * size_t _cmdlen = len(cmd) - * - */ - __pyx_v__cmd = __pyx_f_5rados_to_bytes_array(__pyx_v_cmd); - - /* "rados.pyx":1224 - * char *_pgid = pgid - * char **_cmd = to_bytes_array(cmd) - * size_t _cmdlen = len(cmd) # <<<<<<<<<<<<<< - * - * char *_inbuf = inbuf - */ - __pyx_t_4 = PyObject_Length(__pyx_v_cmd); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1224, __pyx_L1_error) - __pyx_v__cmdlen = __pyx_t_4; - - /* "rados.pyx":1226 - * size_t _cmdlen = len(cmd) - * - * char *_inbuf = inbuf # <<<<<<<<<<<<<< - * size_t _inbuf_len = len(inbuf) - * - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_inbuf); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 1226, __pyx_L1_error) - __pyx_v__inbuf = __pyx_t_6; - - /* "rados.pyx":1227 - * - * char *_inbuf = inbuf - * size_t _inbuf_len = len(inbuf) # <<<<<<<<<<<<<< - * - * char *_outbuf - */ - __pyx_t_4 = PyObject_Length(__pyx_v_inbuf); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1227, __pyx_L1_error) - __pyx_v__inbuf_len = __pyx_t_4; - - /* "rados.pyx":1234 - * size_t _outs_len - * - * try: # <<<<<<<<<<<<<< - * with nogil: - * ret = rados_pg_command(self.cluster, _pgid, - */ - /*try:*/ { - - /* "rados.pyx":1235 - * - * try: - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_pg_command(self.cluster, _pgid, - * _cmd, _cmdlen, - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1236 - * try: - * with nogil: - * ret = rados_pg_command(self.cluster, _pgid, # <<<<<<<<<<<<<< - * _cmd, _cmdlen, - * _inbuf, _inbuf_len, - */ - __pyx_v_ret = rados_pg_command(__pyx_v_self->cluster, __pyx_v__pgid, ((char const **)__pyx_v__cmd), __pyx_v__cmdlen, ((char const *)__pyx_v__inbuf), __pyx_v__inbuf_len, (&__pyx_v__outbuf), (&__pyx_v__outbuf_len), (&__pyx_v__outs), (&__pyx_v__outs_len)); - } - - /* "rados.pyx":1235 - * - * try: - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_pg_command(self.cluster, _pgid, - * _cmd, _cmdlen, - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L8; - } - __pyx_L8:; - } - } - - /* "rados.pyx":1242 - * &_outs, &_outs_len) - * - * my_outs = decode_cstr(_outs[:_outs_len]) # <<<<<<<<<<<<<< - * my_outbuf = _outbuf[:_outbuf_len] - * if _outs_len: - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode_cstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyBytes_FromStringAndSize(__pyx_v__outs + 0, __pyx_v__outs_len - 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1242, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_3) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1242, __pyx_L4_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1242, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL; - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1242, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_my_outs = __pyx_t_2; - __pyx_t_2 = 0; - - /* "rados.pyx":1243 - * - * my_outs = decode_cstr(_outs[:_outs_len]) - * my_outbuf = _outbuf[:_outbuf_len] # <<<<<<<<<<<<<< - * if _outs_len: - * rados_buffer_free(_outs) - */ - __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v__outbuf + 0, __pyx_v__outbuf_len - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1243, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_v_my_outbuf = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; - - /* "rados.pyx":1244 - * my_outs = decode_cstr(_outs[:_outs_len]) - * my_outbuf = _outbuf[:_outbuf_len] - * if _outs_len: # <<<<<<<<<<<<<< - * rados_buffer_free(_outs) - * if _outbuf_len: - */ - __pyx_t_8 = (__pyx_v__outs_len != 0); - if (__pyx_t_8) { - - /* "rados.pyx":1245 - * my_outbuf = _outbuf[:_outbuf_len] - * if _outs_len: - * rados_buffer_free(_outs) # <<<<<<<<<<<<<< - * if _outbuf_len: - * rados_buffer_free(_outbuf) - */ - rados_buffer_free(__pyx_v__outs); - - /* "rados.pyx":1244 - * my_outs = decode_cstr(_outs[:_outs_len]) - * my_outbuf = _outbuf[:_outbuf_len] - * if _outs_len: # <<<<<<<<<<<<<< - * rados_buffer_free(_outs) - * if _outbuf_len: - */ - } - - /* "rados.pyx":1246 - * if _outs_len: - * rados_buffer_free(_outs) - * if _outbuf_len: # <<<<<<<<<<<<<< - * rados_buffer_free(_outbuf) - * return (ret, my_outbuf, my_outs) - */ - __pyx_t_8 = (__pyx_v__outbuf_len != 0); - if (__pyx_t_8) { - - /* "rados.pyx":1247 - * rados_buffer_free(_outs) - * if _outbuf_len: - * rados_buffer_free(_outbuf) # <<<<<<<<<<<<<< - * return (ret, my_outbuf, my_outs) - * finally: - */ - rados_buffer_free(__pyx_v__outbuf); - - /* "rados.pyx":1246 - * if _outs_len: - * rados_buffer_free(_outs) - * if _outbuf_len: # <<<<<<<<<<<<<< - * rados_buffer_free(_outbuf) - * return (ret, my_outbuf, my_outs) - */ - } - - /* "rados.pyx":1248 - * if _outbuf_len: - * rados_buffer_free(_outbuf) - * return (ret, my_outbuf, my_outs) # <<<<<<<<<<<<<< - * finally: - * free(_cmd) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1248, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1248, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); - __Pyx_INCREF(__pyx_v_my_outbuf); - __Pyx_GIVEREF(__pyx_v_my_outbuf); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_my_outbuf); - __Pyx_INCREF(__pyx_v_my_outs); - __Pyx_GIVEREF(__pyx_v_my_outs); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_my_outs); - __pyx_t_2 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L3_return; - } - - /* "rados.pyx":1250 - * return (ret, my_outbuf, my_outs) - * finally: - * free(_cmd) # <<<<<<<<<<<<<< - * - * def wait_for_latest_osdmap(self): - */ - /*finally:*/ { - /*exception exit:*/{ - __Pyx_PyThreadState_declare - __pyx_L4_error:; - __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; - __Pyx_PyThreadState_assign - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); - if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); - __Pyx_XGOTREF(__pyx_t_12); - __Pyx_XGOTREF(__pyx_t_13); - __Pyx_XGOTREF(__pyx_t_14); - __Pyx_XGOTREF(__pyx_t_15); - __Pyx_XGOTREF(__pyx_t_16); - __Pyx_XGOTREF(__pyx_t_17); - __pyx_t_9 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename; - { - free(__pyx_v__cmd); - } - __Pyx_PyThreadState_assign - if (PY_MAJOR_VERSION >= 3) { - __Pyx_XGIVEREF(__pyx_t_15); - __Pyx_XGIVEREF(__pyx_t_16); - __Pyx_XGIVEREF(__pyx_t_17); - __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); - } - __Pyx_XGIVEREF(__pyx_t_12); - __Pyx_XGIVEREF(__pyx_t_13); - __Pyx_XGIVEREF(__pyx_t_14); - __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14); - __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; - __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11; - goto __pyx_L1_error; - } - __pyx_L3_return: { - __pyx_t_17 = __pyx_r; - __pyx_r = 0; - free(__pyx_v__cmd); - __pyx_r = __pyx_t_17; - __pyx_t_17 = 0; - goto __pyx_L0; - } - } - - /* "rados.pyx":1208 - * free(_cmd) - * - * def pg_command(self, pgid, cmd, inbuf, timeout=0): # <<<<<<<<<<<<<< - * """ - * pg_command(pgid, cmd, inbuf, outbuf, outbuflen, outs, outslen) - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("rados.Rados.pg_command", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_my_outs); - __Pyx_XDECREF(__pyx_v_my_outbuf); - __Pyx_XDECREF(__pyx_v_pgid); - __Pyx_XDECREF(__pyx_v_cmd); - __Pyx_XDECREF(__pyx_v_inbuf); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1252 - * free(_cmd) - * - * def wait_for_latest_osdmap(self): # <<<<<<<<<<<<<< - * self.require_state("connected") - * with nogil: - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Rados_57wait_for_latest_osdmap(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5rados_5Rados_56wait_for_latest_osdmap[] = "Rados.wait_for_latest_osdmap(self)"; -static PyObject *__pyx_pw_5rados_5Rados_57wait_for_latest_osdmap(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("wait_for_latest_osdmap (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Rados_56wait_for_latest_osdmap(((struct __pyx_obj_5rados_Rados *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Rados_56wait_for_latest_osdmap(struct __pyx_obj_5rados_Rados *__pyx_v_self) { - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("wait_for_latest_osdmap", 0); - - /* "rados.pyx":1253 - * - * def wait_for_latest_osdmap(self): - * self.require_state("connected") # <<<<<<<<<<<<<< - * with nogil: - * ret = rados_wait_for_latest_osdmap(self.cluster) - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1253, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1253, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":1254 - * def wait_for_latest_osdmap(self): - * self.require_state("connected") - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_wait_for_latest_osdmap(self.cluster) - * return ret - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1255 - * self.require_state("connected") - * with nogil: - * ret = rados_wait_for_latest_osdmap(self.cluster) # <<<<<<<<<<<<<< - * return ret - * - */ - __pyx_v_ret = rados_wait_for_latest_osdmap(__pyx_v_self->cluster); - } - - /* "rados.pyx":1254 - * def wait_for_latest_osdmap(self): - * self.require_state("connected") - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_wait_for_latest_osdmap(self.cluster) - * return ret - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":1256 - * with nogil: - * ret = rados_wait_for_latest_osdmap(self.cluster) - * return ret # <<<<<<<<<<<<<< - * - * def blacklist_add(self, client_address, expire_seconds=0): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1256, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "rados.pyx":1252 - * free(_cmd) - * - * def wait_for_latest_osdmap(self): # <<<<<<<<<<<<<< - * self.require_state("connected") - * with nogil: - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("rados.Rados.wait_for_latest_osdmap", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1258 - * return ret - * - * def blacklist_add(self, client_address, expire_seconds=0): # <<<<<<<<<<<<<< - * """ - * Blacklist a client from the OSDs - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Rados_59blacklist_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Rados_58blacklist_add[] = "Rados.blacklist_add(self, client_address, expire_seconds=0)\n\n Blacklist a client from the OSDs\n\n :param client_address: client address\n :type client_address: str\n :param expire_seconds: number of seconds to blacklist\n :type expire_seconds: int\n\n :raises: :class:`Error`\n "; -static PyObject *__pyx_pw_5rados_5Rados_59blacklist_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_client_address = 0; - PyObject *__pyx_v_expire_seconds = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("blacklist_add (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_client_address,&__pyx_n_s_expire_seconds,0}; - PyObject* values[2] = {0,0}; - values[1] = ((PyObject *)__pyx_int_0); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_client_address)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_expire_seconds); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "blacklist_add") < 0)) __PYX_ERR(0, 1258, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_client_address = values[0]; - __pyx_v_expire_seconds = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("blacklist_add", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1258, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Rados.blacklist_add", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Rados_58blacklist_add(((struct __pyx_obj_5rados_Rados *)__pyx_v_self), __pyx_v_client_address, __pyx_v_expire_seconds); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Rados_58blacklist_add(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_client_address, PyObject *__pyx_v_expire_seconds) { - uint32_t __pyx_v__expire_seconds; - char *__pyx_v__client_address; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - uint32_t __pyx_t_6; - char *__pyx_t_7; - int __pyx_t_8; - __Pyx_RefNannySetupContext("blacklist_add", 0); - __Pyx_INCREF(__pyx_v_client_address); - - /* "rados.pyx":1269 - * :raises: :class:`Error` - * """ - * self.require_state("connected") # <<<<<<<<<<<<<< - * client_address = cstr(client_address, 'client_address') - * cdef: - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1269, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1269, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":1270 - * """ - * self.require_state("connected") - * client_address = cstr(client_address, 'client_address') # <<<<<<<<<<<<<< - * cdef: - * uint32_t _expire_seconds = expire_seconds - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1270, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1270, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_client_address); - __Pyx_GIVEREF(__pyx_v_client_address); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_client_address); - __Pyx_INCREF(__pyx_n_s_client_address); - __Pyx_GIVEREF(__pyx_n_s_client_address); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_client_address); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1270, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_client_address, __pyx_t_2); - __pyx_t_2 = 0; - - /* "rados.pyx":1272 - * client_address = cstr(client_address, 'client_address') - * cdef: - * uint32_t _expire_seconds = expire_seconds # <<<<<<<<<<<<<< - * char *_client_address = client_address - * - */ - __pyx_t_6 = __Pyx_PyInt_As_uint32_t(__pyx_v_expire_seconds); if (unlikely((__pyx_t_6 == (uint32_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1272, __pyx_L1_error) - __pyx_v__expire_seconds = __pyx_t_6; - - /* "rados.pyx":1273 - * cdef: - * uint32_t _expire_seconds = expire_seconds - * char *_client_address = client_address # <<<<<<<<<<<<<< - * - * with nogil: - */ - __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_client_address); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 1273, __pyx_L1_error) - __pyx_v__client_address = __pyx_t_7; - - /* "rados.pyx":1275 - * char *_client_address = client_address - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_blacklist_add(self.cluster, _client_address, _expire_seconds) - * if ret < 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1276 - * - * with nogil: - * ret = rados_blacklist_add(self.cluster, _client_address, _expire_seconds) # <<<<<<<<<<<<<< - * if ret < 0: - * raise make_ex(ret, "error blacklisting client '%s'" % client_address) - */ - __pyx_v_ret = rados_blacklist_add(__pyx_v_self->cluster, __pyx_v__client_address, __pyx_v__expire_seconds); - } - - /* "rados.pyx":1275 - * char *_client_address = client_address - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_blacklist_add(self.cluster, _client_address, _expire_seconds) - * if ret < 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":1277 - * with nogil: - * ret = rados_blacklist_add(self.cluster, _client_address, _expire_seconds) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error blacklisting client '%s'" % client_address) - * - */ - __pyx_t_8 = ((__pyx_v_ret < 0) != 0); - if (__pyx_t_8) { - - /* "rados.pyx":1278 - * ret = rados_blacklist_add(self.cluster, _client_address, _expire_seconds) - * if ret < 0: - * raise make_ex(ret, "error blacklisting client '%s'" % client_address) # <<<<<<<<<<<<<< - * - * def monitor_log(self, level, callback, arg): - */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_error_blacklisting_client_s, __pyx_v_client_address); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_f_5rados_make_ex(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 1278, __pyx_L1_error) - - /* "rados.pyx":1277 - * with nogil: - * ret = rados_blacklist_add(self.cluster, _client_address, _expire_seconds) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error blacklisting client '%s'" % client_address) - * - */ - } - - /* "rados.pyx":1258 - * return ret - * - * def blacklist_add(self, client_address, expire_seconds=0): # <<<<<<<<<<<<<< - * """ - * Blacklist a client from the OSDs - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.Rados.blacklist_add", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_client_address); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1280 - * raise make_ex(ret, "error blacklisting client '%s'" % client_address) - * - * def monitor_log(self, level, callback, arg): # <<<<<<<<<<<<<< - * if level not in MONITOR_LEVELS: - * raise LogicError("invalid monitor level " + level) - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Rados_61monitor_log(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Rados_60monitor_log[] = "Rados.monitor_log(self, level, callback, arg)"; -static PyObject *__pyx_pw_5rados_5Rados_61monitor_log(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_level = 0; - PyObject *__pyx_v_callback = 0; - PyObject *__pyx_v_arg = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("monitor_log (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_callback,&__pyx_n_s_arg,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("monitor_log", 1, 3, 3, 1); __PYX_ERR(0, 1280, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arg)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("monitor_log", 1, 3, 3, 2); __PYX_ERR(0, 1280, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "monitor_log") < 0)) __PYX_ERR(0, 1280, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - } - __pyx_v_level = values[0]; - __pyx_v_callback = values[1]; - __pyx_v_arg = values[2]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("monitor_log", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1280, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Rados.monitor_log", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Rados_60monitor_log(((struct __pyx_obj_5rados_Rados *)__pyx_v_self), __pyx_v_level, __pyx_v_callback, __pyx_v_arg); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Rados_60monitor_log(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_level, PyObject *__pyx_v_callback, PyObject *__pyx_v_arg) { - char *__pyx_v__level; - int __pyx_v_r; - PyObject *__pyx_v_cb = NULL; - PyObject *__pyx_v__arg; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; - Py_ssize_t __pyx_t_9; - char *__pyx_t_10; - __Pyx_RefNannySetupContext("monitor_log", 0); - __Pyx_INCREF(__pyx_v_level); - - /* "rados.pyx":1281 - * - * def monitor_log(self, level, callback, arg): - * if level not in MONITOR_LEVELS: # <<<<<<<<<<<<<< - * raise LogicError("invalid monitor level " + level) - * if callback is not None and not callable(callback): - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_MONITOR_LEVELS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1281, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_level, __pyx_t_1, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1281, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = (__pyx_t_2 != 0); - if (__pyx_t_3) { - - /* "rados.pyx":1282 - * def monitor_log(self, level, callback, arg): - * if level not in MONITOR_LEVELS: - * raise LogicError("invalid monitor level " + level) # <<<<<<<<<<<<<< - * if callback is not None and not callable(callback): - * raise LogicError("callback must be a callable function or None") - */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_LogicError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyNumber_Add(__pyx_kp_s_invalid_monitor_level, __pyx_v_level); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - } - } - if (!__pyx_t_6) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1282, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 1282, __pyx_L1_error) - - /* "rados.pyx":1281 - * - * def monitor_log(self, level, callback, arg): - * if level not in MONITOR_LEVELS: # <<<<<<<<<<<<<< - * raise LogicError("invalid monitor level " + level) - * if callback is not None and not callable(callback): - */ - } - - /* "rados.pyx":1283 - * if level not in MONITOR_LEVELS: - * raise LogicError("invalid monitor level " + level) - * if callback is not None and not callable(callback): # <<<<<<<<<<<<<< - * raise LogicError("callback must be a callable function or None") - * - */ - __pyx_t_2 = (__pyx_v_callback != Py_None); - __pyx_t_8 = (__pyx_t_2 != 0); - if (__pyx_t_8) { - } else { - __pyx_t_3 = __pyx_t_8; - goto __pyx_L5_bool_binop_done; - } - __pyx_t_8 = __Pyx_PyCallable_Check(__pyx_v_callback); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 1283, __pyx_L1_error) - __pyx_t_2 = ((!(__pyx_t_8 != 0)) != 0); - __pyx_t_3 = __pyx_t_2; - __pyx_L5_bool_binop_done:; - if (__pyx_t_3) { - - /* "rados.pyx":1284 - * raise LogicError("invalid monitor level " + level) - * if callback is not None and not callable(callback): - * raise LogicError("callback must be a callable function or None") # <<<<<<<<<<<<<< - * - * level = cstr(level, 'level') - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_LogicError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1284, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1284, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 1284, __pyx_L1_error) - - /* "rados.pyx":1283 - * if level not in MONITOR_LEVELS: - * raise LogicError("invalid monitor level " + level) - * if callback is not None and not callable(callback): # <<<<<<<<<<<<<< - * raise LogicError("callback must be a callable function or None") - * - */ - } - - /* "rados.pyx":1286 - * raise LogicError("callback must be a callable function or None") - * - * level = cstr(level, 'level') # <<<<<<<<<<<<<< - * cdef char *_level = level - * - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1286, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = NULL; - __pyx_t_9 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_9 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1286, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_7) { - __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL; - } - __Pyx_INCREF(__pyx_v_level); - __Pyx_GIVEREF(__pyx_v_level); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_9, __pyx_v_level); - __Pyx_INCREF(__pyx_n_s_level); - __Pyx_GIVEREF(__pyx_n_s_level); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_9, __pyx_n_s_level); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1286, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_level, __pyx_t_4); - __pyx_t_4 = 0; - - /* "rados.pyx":1287 - * - * level = cstr(level, 'level') - * cdef char *_level = level # <<<<<<<<<<<<<< - * - * if callback is None: - */ - __pyx_t_10 = __Pyx_PyObject_AsString(__pyx_v_level); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 1287, __pyx_L1_error) - __pyx_v__level = __pyx_t_10; - - /* "rados.pyx":1289 - * cdef char *_level = level - * - * if callback is None: # <<<<<<<<<<<<<< - * with nogil: - * r = rados_monitor_log(self.cluster, _level, NULL, NULL) - */ - __pyx_t_3 = (__pyx_v_callback == Py_None); - __pyx_t_2 = (__pyx_t_3 != 0); - if (__pyx_t_2) { - - /* "rados.pyx":1290 - * - * if callback is None: - * with nogil: # <<<<<<<<<<<<<< - * r = rados_monitor_log(self.cluster, _level, NULL, NULL) - * self.monitor_callback = None - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1291 - * if callback is None: - * with nogil: - * r = rados_monitor_log(self.cluster, _level, NULL, NULL) # <<<<<<<<<<<<<< - * self.monitor_callback = None - * return - */ - __pyx_v_r = rados_monitor_log(__pyx_v_self->cluster, ((char const *)__pyx_v__level), NULL, NULL); - } - - /* "rados.pyx":1290 - * - * if callback is None: - * with nogil: # <<<<<<<<<<<<<< - * r = rados_monitor_log(self.cluster, _level, NULL, NULL) - * self.monitor_callback = None - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L10; - } - __pyx_L10:; - } - } - - /* "rados.pyx":1292 - * with nogil: - * r = rados_monitor_log(self.cluster, _level, NULL, NULL) - * self.monitor_callback = None # <<<<<<<<<<<<<< - * return - * - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_self->monitor_callback); - __Pyx_DECREF(__pyx_v_self->monitor_callback); - __pyx_v_self->monitor_callback = Py_None; - - /* "rados.pyx":1293 - * r = rados_monitor_log(self.cluster, _level, NULL, NULL) - * self.monitor_callback = None - * return # <<<<<<<<<<<<<< - * - * cb = (callback, arg) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - - /* "rados.pyx":1289 - * cdef char *_level = level - * - * if callback is None: # <<<<<<<<<<<<<< - * with nogil: - * r = rados_monitor_log(self.cluster, _level, NULL, NULL) - */ - } - - /* "rados.pyx":1295 - * return - * - * cb = (callback, arg) # <<<<<<<<<<<<<< - * cdef PyObject* _arg = cb - * with nogil: - */ - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1295, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_v_callback); - __Pyx_GIVEREF(__pyx_v_callback); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_callback); - __Pyx_INCREF(__pyx_v_arg); - __Pyx_GIVEREF(__pyx_v_arg); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_arg); - __pyx_v_cb = ((PyObject*)__pyx_t_4); - __pyx_t_4 = 0; - - /* "rados.pyx":1296 - * - * cb = (callback, arg) - * cdef PyObject* _arg = cb # <<<<<<<<<<<<<< - * with nogil: - * r = rados_monitor_log(self.cluster, _level, - */ - __pyx_v__arg = ((PyObject *)__pyx_v_cb); - - /* "rados.pyx":1297 - * cb = (callback, arg) - * cdef PyObject* _arg = cb - * with nogil: # <<<<<<<<<<<<<< - * r = rados_monitor_log(self.cluster, _level, - * &__monitor_callback, _arg) - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1298 - * cdef PyObject* _arg = cb - * with nogil: - * r = rados_monitor_log(self.cluster, _level, # <<<<<<<<<<<<<< - * &__monitor_callback, _arg) - * - */ - __pyx_v_r = rados_monitor_log(__pyx_v_self->cluster, ((char const *)__pyx_v__level), ((rados_log_callback_t)(&__pyx_f_5rados___monitor_callback)), __pyx_v__arg); - } - - /* "rados.pyx":1297 - * cb = (callback, arg) - * cdef PyObject* _arg = cb - * with nogil: # <<<<<<<<<<<<<< - * r = rados_monitor_log(self.cluster, _level, - * &__monitor_callback, _arg) - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L13; - } - __pyx_L13:; - } - } - - /* "rados.pyx":1301 - * &__monitor_callback, _arg) - * - * if r: # <<<<<<<<<<<<<< - * raise make_ex(r, 'error calling rados_monitor_log') - * # NOTE(sileht): Prevents the callback method from being garbage collected - */ - __pyx_t_2 = (__pyx_v_r != 0); - if (__pyx_t_2) { - - /* "rados.pyx":1302 - * - * if r: - * raise make_ex(r, 'error calling rados_monitor_log') # <<<<<<<<<<<<<< - * # NOTE(sileht): Prevents the callback method from being garbage collected - * self.monitor_callback = cb - */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_r); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1302, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __pyx_f_5rados_make_ex(__pyx_t_4, __pyx_kp_s_error_calling_rados_monitor_log); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1302, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 1302, __pyx_L1_error) - - /* "rados.pyx":1301 - * &__monitor_callback, _arg) - * - * if r: # <<<<<<<<<<<<<< - * raise make_ex(r, 'error calling rados_monitor_log') - * # NOTE(sileht): Prevents the callback method from being garbage collected - */ - } - - /* "rados.pyx":1304 - * raise make_ex(r, 'error calling rados_monitor_log') - * # NOTE(sileht): Prevents the callback method from being garbage collected - * self.monitor_callback = cb # <<<<<<<<<<<<<< - * - * - */ - __Pyx_INCREF(__pyx_v_cb); - __Pyx_GIVEREF(__pyx_v_cb); - __Pyx_GOTREF(__pyx_v_self->monitor_callback); - __Pyx_DECREF(__pyx_v_self->monitor_callback); - __pyx_v_self->monitor_callback = __pyx_v_cb; - - /* "rados.pyx":1280 - * raise make_ex(ret, "error blacklisting client '%s'" % client_address) - * - * def monitor_log(self, level, callback, arg): # <<<<<<<<<<<<<< - * if level not in MONITOR_LEVELS: - * raise LogicError("invalid monitor level " + level) - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("rados.Rados.monitor_log", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_cb); - __Pyx_XDECREF(__pyx_v_level); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pxd":17 - * cdef: - * rados_t cluster - * public object state # <<<<<<<<<<<<<< - * public object monitor_callback - * public object parsed_args - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Rados_5state_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_5rados_5Rados_5state_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Rados_5state___get__(((struct __pyx_obj_5rados_Rados *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Rados_5state___get__(struct __pyx_obj_5rados_Rados *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->state); - __pyx_r = __pyx_v_self->state; - goto __pyx_L0; - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_5Rados_5state_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_5rados_5Rados_5state_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Rados_5state_2__set__(((struct __pyx_obj_5rados_Rados *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_5Rados_5state_2__set__(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__", 0); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __Pyx_GOTREF(__pyx_v_self->state); - __Pyx_DECREF(__pyx_v_self->state); - __pyx_v_self->state = __pyx_v_value; - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_5Rados_5state_5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_5rados_5Rados_5state_5__del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Rados_5state_4__del__(((struct __pyx_obj_5rados_Rados *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_5Rados_5state_4__del__(struct __pyx_obj_5rados_Rados *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__", 0); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_self->state); - __Pyx_DECREF(__pyx_v_self->state); - __pyx_v_self->state = Py_None; - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pxd":18 - * rados_t cluster - * public object state - * public object monitor_callback # <<<<<<<<<<<<<< - * public object parsed_args - * public object conf_defaults - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Rados_16monitor_callback_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_5rados_5Rados_16monitor_callback_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Rados_16monitor_callback___get__(((struct __pyx_obj_5rados_Rados *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Rados_16monitor_callback___get__(struct __pyx_obj_5rados_Rados *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->monitor_callback); - __pyx_r = __pyx_v_self->monitor_callback; - goto __pyx_L0; - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_5Rados_16monitor_callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_5rados_5Rados_16monitor_callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Rados_16monitor_callback_2__set__(((struct __pyx_obj_5rados_Rados *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_5Rados_16monitor_callback_2__set__(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__", 0); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __Pyx_GOTREF(__pyx_v_self->monitor_callback); - __Pyx_DECREF(__pyx_v_self->monitor_callback); - __pyx_v_self->monitor_callback = __pyx_v_value; - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_5Rados_16monitor_callback_5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_5rados_5Rados_16monitor_callback_5__del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Rados_16monitor_callback_4__del__(((struct __pyx_obj_5rados_Rados *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_5Rados_16monitor_callback_4__del__(struct __pyx_obj_5rados_Rados *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__", 0); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_self->monitor_callback); - __Pyx_DECREF(__pyx_v_self->monitor_callback); - __pyx_v_self->monitor_callback = Py_None; - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pxd":19 - * public object state - * public object monitor_callback - * public object parsed_args # <<<<<<<<<<<<<< - * public object conf_defaults - * public object conffile - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Rados_11parsed_args_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_5rados_5Rados_11parsed_args_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Rados_11parsed_args___get__(((struct __pyx_obj_5rados_Rados *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Rados_11parsed_args___get__(struct __pyx_obj_5rados_Rados *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->parsed_args); - __pyx_r = __pyx_v_self->parsed_args; - goto __pyx_L0; - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_5Rados_11parsed_args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_5rados_5Rados_11parsed_args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Rados_11parsed_args_2__set__(((struct __pyx_obj_5rados_Rados *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_5Rados_11parsed_args_2__set__(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__", 0); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __Pyx_GOTREF(__pyx_v_self->parsed_args); - __Pyx_DECREF(__pyx_v_self->parsed_args); - __pyx_v_self->parsed_args = __pyx_v_value; - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_5Rados_11parsed_args_5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_5rados_5Rados_11parsed_args_5__del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Rados_11parsed_args_4__del__(((struct __pyx_obj_5rados_Rados *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_5Rados_11parsed_args_4__del__(struct __pyx_obj_5rados_Rados *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__", 0); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_self->parsed_args); - __Pyx_DECREF(__pyx_v_self->parsed_args); - __pyx_v_self->parsed_args = Py_None; - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pxd":20 - * public object monitor_callback - * public object parsed_args - * public object conf_defaults # <<<<<<<<<<<<<< - * public object conffile - * public object rados_id - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Rados_13conf_defaults_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_5rados_5Rados_13conf_defaults_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Rados_13conf_defaults___get__(((struct __pyx_obj_5rados_Rados *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Rados_13conf_defaults___get__(struct __pyx_obj_5rados_Rados *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->conf_defaults); - __pyx_r = __pyx_v_self->conf_defaults; - goto __pyx_L0; - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_5Rados_13conf_defaults_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_5rados_5Rados_13conf_defaults_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Rados_13conf_defaults_2__set__(((struct __pyx_obj_5rados_Rados *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_5Rados_13conf_defaults_2__set__(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__", 0); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __Pyx_GOTREF(__pyx_v_self->conf_defaults); - __Pyx_DECREF(__pyx_v_self->conf_defaults); - __pyx_v_self->conf_defaults = __pyx_v_value; - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_5Rados_13conf_defaults_5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_5rados_5Rados_13conf_defaults_5__del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Rados_13conf_defaults_4__del__(((struct __pyx_obj_5rados_Rados *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_5Rados_13conf_defaults_4__del__(struct __pyx_obj_5rados_Rados *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__", 0); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_self->conf_defaults); - __Pyx_DECREF(__pyx_v_self->conf_defaults); - __pyx_v_self->conf_defaults = Py_None; - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pxd":21 - * public object parsed_args - * public object conf_defaults - * public object conffile # <<<<<<<<<<<<<< - * public object rados_id - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Rados_8conffile_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_5rados_5Rados_8conffile_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Rados_8conffile___get__(((struct __pyx_obj_5rados_Rados *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Rados_8conffile___get__(struct __pyx_obj_5rados_Rados *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->conffile); - __pyx_r = __pyx_v_self->conffile; - goto __pyx_L0; - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_5Rados_8conffile_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_5rados_5Rados_8conffile_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Rados_8conffile_2__set__(((struct __pyx_obj_5rados_Rados *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_5Rados_8conffile_2__set__(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__", 0); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __Pyx_GOTREF(__pyx_v_self->conffile); - __Pyx_DECREF(__pyx_v_self->conffile); - __pyx_v_self->conffile = __pyx_v_value; - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_5Rados_8conffile_5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_5rados_5Rados_8conffile_5__del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Rados_8conffile_4__del__(((struct __pyx_obj_5rados_Rados *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_5Rados_8conffile_4__del__(struct __pyx_obj_5rados_Rados *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__", 0); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_self->conffile); - __Pyx_DECREF(__pyx_v_self->conffile); - __pyx_v_self->conffile = Py_None; - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pxd":22 - * public object conf_defaults - * public object conffile - * public object rados_id # <<<<<<<<<<<<<< - * - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Rados_8rados_id_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_5rados_5Rados_8rados_id_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Rados_8rados_id___get__(((struct __pyx_obj_5rados_Rados *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Rados_8rados_id___get__(struct __pyx_obj_5rados_Rados *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->rados_id); - __pyx_r = __pyx_v_self->rados_id; - goto __pyx_L0; - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_5Rados_8rados_id_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_5rados_5Rados_8rados_id_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Rados_8rados_id_2__set__(((struct __pyx_obj_5rados_Rados *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_5Rados_8rados_id_2__set__(struct __pyx_obj_5rados_Rados *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__", 0); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __Pyx_GOTREF(__pyx_v_self->rados_id); - __Pyx_DECREF(__pyx_v_self->rados_id); - __pyx_v_self->rados_id = __pyx_v_value; - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_5Rados_8rados_id_5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_5rados_5Rados_8rados_id_5__del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Rados_8rados_id_4__del__(((struct __pyx_obj_5rados_Rados *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_5Rados_8rados_id_4__del__(struct __pyx_obj_5rados_Rados *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__", 0); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_self->rados_id); - __Pyx_DECREF(__pyx_v_self->rados_id); - __pyx_v_self->rados_id = Py_None; - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1313 - * cdef rados_omap_iter_t ctx - * - * def __cinit__(self, Ioctx ioctx): # <<<<<<<<<<<<<< - * self.ioctx = ioctx - * - */ - -/* Python wrapper */ -static int __pyx_pw_5rados_12OmapIterator_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_5rados_12OmapIterator_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - struct __pyx_obj_5rados_Ioctx *__pyx_v_ioctx = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ioctx,0}; - PyObject* values[1] = {0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ioctx)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1313, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - } - __pyx_v_ioctx = ((struct __pyx_obj_5rados_Ioctx *)values[0]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1313, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.OmapIterator.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ioctx), __pyx_ptype_5rados_Ioctx, 1, "ioctx", 0))) __PYX_ERR(0, 1313, __pyx_L1_error) - __pyx_r = __pyx_pf_5rados_12OmapIterator___cinit__(((struct __pyx_obj_5rados_OmapIterator *)__pyx_v_self), __pyx_v_ioctx); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_12OmapIterator___cinit__(struct __pyx_obj_5rados_OmapIterator *__pyx_v_self, struct __pyx_obj_5rados_Ioctx *__pyx_v_ioctx) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__cinit__", 0); - - /* "rados.pyx":1314 - * - * def __cinit__(self, Ioctx ioctx): - * self.ioctx = ioctx # <<<<<<<<<<<<<< - * - * def __iter__(self): - */ - __Pyx_INCREF(((PyObject *)__pyx_v_ioctx)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_ioctx)); - __Pyx_GOTREF(__pyx_v_self->ioctx); - __Pyx_DECREF(((PyObject *)__pyx_v_self->ioctx)); - __pyx_v_self->ioctx = __pyx_v_ioctx; - - /* "rados.pyx":1313 - * cdef rados_omap_iter_t ctx - * - * def __cinit__(self, Ioctx ioctx): # <<<<<<<<<<<<<< - * self.ioctx = ioctx - * - */ - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1316 - * self.ioctx = ioctx - * - * def __iter__(self): # <<<<<<<<<<<<<< - * return self - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_12OmapIterator_3__iter__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_5rados_12OmapIterator_3__iter__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_12OmapIterator_2__iter__(((struct __pyx_obj_5rados_OmapIterator *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_12OmapIterator_2__iter__(struct __pyx_obj_5rados_OmapIterator *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__iter__", 0); - - /* "rados.pyx":1317 - * - * def __iter__(self): - * return self # <<<<<<<<<<<<<< - * - * def __next__(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __pyx_r = ((PyObject *)__pyx_v_self); - goto __pyx_L0; - - /* "rados.pyx":1316 - * self.ioctx = ioctx - * - * def __iter__(self): # <<<<<<<<<<<<<< - * return self - * - */ - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1319 - * return self - * - * def __next__(self): # <<<<<<<<<<<<<< - * """ - * Get the next key-value pair in the object - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_12OmapIterator_5__next__(PyObject *__pyx_v_self); /*proto*/ -static char __pyx_doc_5rados_12OmapIterator_4__next__[] = "\n Get the next key-value pair in the object\n :returns: next rados.OmapItem\n "; -#if CYTHON_COMPILING_IN_CPYTHON -struct wrapperbase __pyx_wrapperbase_5rados_12OmapIterator_4__next__; -#endif -static PyObject *__pyx_pw_5rados_12OmapIterator_5__next__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_12OmapIterator_4__next__(((struct __pyx_obj_5rados_OmapIterator *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_12OmapIterator_4__next__(struct __pyx_obj_5rados_OmapIterator *__pyx_v_self) { - char *__pyx_v_key_; - char *__pyx_v_val_; - size_t __pyx_v_len_; - int __pyx_v_ret; - PyObject *__pyx_v_key = NULL; - PyObject *__pyx_v_val = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - __Pyx_RefNannySetupContext("__next__", 0); - - /* "rados.pyx":1325 - * """ - * cdef: - * char *key_ = NULL # <<<<<<<<<<<<<< - * char *val_ = NULL - * size_t len_ - */ - __pyx_v_key_ = NULL; - - /* "rados.pyx":1326 - * cdef: - * char *key_ = NULL - * char *val_ = NULL # <<<<<<<<<<<<<< - * size_t len_ - * - */ - __pyx_v_val_ = NULL; - - /* "rados.pyx":1329 - * size_t len_ - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_omap_get_next(self.ctx, &key_, &val_, &len_) - * - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1330 - * - * with nogil: - * ret = rados_omap_get_next(self.ctx, &key_, &val_, &len_) # <<<<<<<<<<<<<< - * - * if ret != 0: - */ - __pyx_v_ret = rados_omap_get_next(__pyx_v_self->ctx, (&__pyx_v_key_), (&__pyx_v_val_), (&__pyx_v_len_)); - } - - /* "rados.pyx":1329 - * size_t len_ - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_omap_get_next(self.ctx, &key_, &val_, &len_) - * - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":1332 - * ret = rados_omap_get_next(self.ctx, &key_, &val_, &len_) - * - * if ret != 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error iterating over the omap") - * if key_ == NULL: - */ - __pyx_t_1 = ((__pyx_v_ret != 0) != 0); - if (__pyx_t_1) { - - /* "rados.pyx":1333 - * - * if ret != 0: - * raise make_ex(ret, "error iterating over the omap") # <<<<<<<<<<<<<< - * if key_ == NULL: - * raise StopIteration() - */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1333, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_f_5rados_make_ex(__pyx_t_2, __pyx_kp_s_error_iterating_over_the_omap); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1333, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 1333, __pyx_L1_error) - - /* "rados.pyx":1332 - * ret = rados_omap_get_next(self.ctx, &key_, &val_, &len_) - * - * if ret != 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error iterating over the omap") - * if key_ == NULL: - */ - } - - /* "rados.pyx":1334 - * if ret != 0: - * raise make_ex(ret, "error iterating over the omap") - * if key_ == NULL: # <<<<<<<<<<<<<< - * raise StopIteration() - * key = decode_cstr(key_) - */ - __pyx_t_1 = ((__pyx_v_key_ == NULL) != 0); - if (__pyx_t_1) { - - /* "rados.pyx":1335 - * raise make_ex(ret, "error iterating over the omap") - * if key_ == NULL: - * raise StopIteration() # <<<<<<<<<<<<<< - * key = decode_cstr(key_) - * val = None - */ - __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_builtin_StopIteration); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1335, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 1335, __pyx_L1_error) - - /* "rados.pyx":1334 - * if ret != 0: - * raise make_ex(ret, "error iterating over the omap") - * if key_ == NULL: # <<<<<<<<<<<<<< - * raise StopIteration() - * key = decode_cstr(key_) - */ - } - - /* "rados.pyx":1336 - * if key_ == NULL: - * raise StopIteration() - * key = decode_cstr(key_) # <<<<<<<<<<<<<< - * val = None - * if val_ != NULL: - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1336, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_key_); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1336, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (!__pyx_t_5) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1336, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GOTREF(__pyx_t_3); - } else { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1336, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1336, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_key = __pyx_t_3; - __pyx_t_3 = 0; - - /* "rados.pyx":1337 - * raise StopIteration() - * key = decode_cstr(key_) - * val = None # <<<<<<<<<<<<<< - * if val_ != NULL: - * val = val_[:len_] - */ - __Pyx_INCREF(Py_None); - __pyx_v_val = Py_None; - - /* "rados.pyx":1338 - * key = decode_cstr(key_) - * val = None - * if val_ != NULL: # <<<<<<<<<<<<<< - * val = val_[:len_] - * return (key, val) - */ - __pyx_t_1 = ((__pyx_v_val_ != NULL) != 0); - if (__pyx_t_1) { - - /* "rados.pyx":1339 - * val = None - * if val_ != NULL: - * val = val_[:len_] # <<<<<<<<<<<<<< - * return (key, val) - * - */ - __pyx_t_3 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_val_ + 0, __pyx_v_len_ - 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1339, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_3); - __pyx_t_3 = 0; - - /* "rados.pyx":1338 - * key = decode_cstr(key_) - * val = None - * if val_ != NULL: # <<<<<<<<<<<<<< - * val = val_[:len_] - * return (key, val) - */ - } - - /* "rados.pyx":1340 - * if val_ != NULL: - * val = val_[:len_] - * return (key, val) # <<<<<<<<<<<<<< - * - * def __dealloc__(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1340, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_key); - __Pyx_INCREF(__pyx_v_val); - __Pyx_GIVEREF(__pyx_v_val); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_val); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - - /* "rados.pyx":1319 - * return self - * - * def __next__(self): # <<<<<<<<<<<<<< - * """ - * Get the next key-value pair in the object - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("rados.OmapIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_key); - __Pyx_XDECREF(__pyx_v_val); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1342 - * return (key, val) - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * with nogil: - * rados_omap_get_end(self.ctx) - */ - -/* Python wrapper */ -static void __pyx_pw_5rados_12OmapIterator_7__dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_pw_5rados_12OmapIterator_7__dealloc__(PyObject *__pyx_v_self) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); - __pyx_pf_5rados_12OmapIterator_6__dealloc__(((struct __pyx_obj_5rados_OmapIterator *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -static void __pyx_pf_5rados_12OmapIterator_6__dealloc__(struct __pyx_obj_5rados_OmapIterator *__pyx_v_self) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__dealloc__", 0); - - /* "rados.pyx":1343 - * - * def __dealloc__(self): - * with nogil: # <<<<<<<<<<<<<< - * rados_omap_get_end(self.ctx) - * - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1344 - * def __dealloc__(self): - * with nogil: - * rados_omap_get_end(self.ctx) # <<<<<<<<<<<<<< - * - * - */ - rados_omap_get_end(__pyx_v_self->ctx); - } - - /* "rados.pyx":1343 - * - * def __dealloc__(self): - * with nogil: # <<<<<<<<<<<<<< - * rados_omap_get_end(self.ctx) - * - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":1342 - * return (key, val) - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * with nogil: - * rados_omap_get_end(self.ctx) - */ - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "rados.pyx":1310 - * """Omap iterator""" - * - * cdef public Ioctx ioctx # <<<<<<<<<<<<<< - * cdef rados_omap_iter_t ctx - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_12OmapIterator_5ioctx_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_5rados_12OmapIterator_5ioctx_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_12OmapIterator_5ioctx___get__(((struct __pyx_obj_5rados_OmapIterator *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_12OmapIterator_5ioctx___get__(struct __pyx_obj_5rados_OmapIterator *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_self->ioctx)); - __pyx_r = ((PyObject *)__pyx_v_self->ioctx); - goto __pyx_L0; - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_12OmapIterator_5ioctx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_5rados_12OmapIterator_5ioctx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_12OmapIterator_5ioctx_2__set__(((struct __pyx_obj_5rados_OmapIterator *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_12OmapIterator_5ioctx_2__set__(struct __pyx_obj_5rados_OmapIterator *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__set__", 0); - if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5rados_Ioctx))))) __PYX_ERR(0, 1310, __pyx_L1_error) - __pyx_t_1 = __pyx_v_value; - __Pyx_INCREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __Pyx_GOTREF(__pyx_v_self->ioctx); - __Pyx_DECREF(((PyObject *)__pyx_v_self->ioctx)); - __pyx_v_self->ioctx = ((struct __pyx_obj_5rados_Ioctx *)__pyx_t_1); - __pyx_t_1 = 0; - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rados.OmapIterator.ioctx.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_12OmapIterator_5ioctx_5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_5rados_12OmapIterator_5ioctx_5__del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_12OmapIterator_5ioctx_4__del__(((struct __pyx_obj_5rados_OmapIterator *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_12OmapIterator_5ioctx_4__del__(struct __pyx_obj_5rados_OmapIterator *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__", 0); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_self->ioctx); - __Pyx_DECREF(((PyObject *)__pyx_v_self->ioctx)); - __pyx_v_self->ioctx = ((struct __pyx_obj_5rados_Ioctx *)Py_None); - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1354 - * cdef public object ioctx - * - * def __cinit__(self, Ioctx ioctx): # <<<<<<<<<<<<<< - * self.ioctx = ioctx - * - */ - -/* Python wrapper */ -static int __pyx_pw_5rados_14ObjectIterator_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_5rados_14ObjectIterator_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - struct __pyx_obj_5rados_Ioctx *__pyx_v_ioctx = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ioctx,0}; - PyObject* values[1] = {0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ioctx)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1354, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - } - __pyx_v_ioctx = ((struct __pyx_obj_5rados_Ioctx *)values[0]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1354, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.ObjectIterator.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ioctx), __pyx_ptype_5rados_Ioctx, 1, "ioctx", 0))) __PYX_ERR(0, 1354, __pyx_L1_error) - __pyx_r = __pyx_pf_5rados_14ObjectIterator___cinit__(((struct __pyx_obj_5rados_ObjectIterator *)__pyx_v_self), __pyx_v_ioctx); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_14ObjectIterator___cinit__(struct __pyx_obj_5rados_ObjectIterator *__pyx_v_self, struct __pyx_obj_5rados_Ioctx *__pyx_v_ioctx) { - int __pyx_v_ret; - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("__cinit__", 0); - - /* "rados.pyx":1355 - * - * def __cinit__(self, Ioctx ioctx): - * self.ioctx = ioctx # <<<<<<<<<<<<<< - * - * with nogil: - */ - __Pyx_INCREF(((PyObject *)__pyx_v_ioctx)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_ioctx)); - __Pyx_GOTREF(__pyx_v_self->ioctx); - __Pyx_DECREF(__pyx_v_self->ioctx); - __pyx_v_self->ioctx = ((PyObject *)__pyx_v_ioctx); - - /* "rados.pyx":1357 - * self.ioctx = ioctx - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_nobjects_list_open(ioctx.io, &self.ctx) - * if ret < 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1358 - * - * with nogil: - * ret = rados_nobjects_list_open(ioctx.io, &self.ctx) # <<<<<<<<<<<<<< - * if ret < 0: - * raise make_ex(ret, "error iterating over the objects in ioctx '%s'" - */ - __pyx_v_ret = rados_nobjects_list_open(__pyx_v_ioctx->io, (&__pyx_v_self->ctx)); - } - - /* "rados.pyx":1357 - * self.ioctx = ioctx - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_nobjects_list_open(ioctx.io, &self.ctx) - * if ret < 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":1359 - * with nogil: - * ret = rados_nobjects_list_open(ioctx.io, &self.ctx) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error iterating over the objects in ioctx '%s'" - * % self.ioctx.name) - */ - __pyx_t_1 = ((__pyx_v_ret < 0) != 0); - if (__pyx_t_1) { - - /* "rados.pyx":1360 - * ret = rados_nobjects_list_open(ioctx.io, &self.ctx) - * if ret < 0: - * raise make_ex(ret, "error iterating over the objects in ioctx '%s'" # <<<<<<<<<<<<<< - * % self.ioctx.name) - * - */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1360, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - - /* "rados.pyx":1361 - * if ret < 0: - * raise make_ex(ret, "error iterating over the objects in ioctx '%s'" - * % self.ioctx.name) # <<<<<<<<<<<<<< - * - * def __iter__(self): - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->ioctx, __pyx_n_s_name_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1361, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_error_iterating_over_the_objects, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1361, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "rados.pyx":1360 - * ret = rados_nobjects_list_open(ioctx.io, &self.ctx) - * if ret < 0: - * raise make_ex(ret, "error iterating over the objects in ioctx '%s'" # <<<<<<<<<<<<<< - * % self.ioctx.name) - * - */ - __pyx_t_3 = __pyx_f_5rados_make_ex(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1360, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 1360, __pyx_L1_error) - - /* "rados.pyx":1359 - * with nogil: - * ret = rados_nobjects_list_open(ioctx.io, &self.ctx) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error iterating over the objects in ioctx '%s'" - * % self.ioctx.name) - */ - } - - /* "rados.pyx":1354 - * cdef public object ioctx - * - * def __cinit__(self, Ioctx ioctx): # <<<<<<<<<<<<<< - * self.ioctx = ioctx - * - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("rados.ObjectIterator.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1363 - * % self.ioctx.name) - * - * def __iter__(self): # <<<<<<<<<<<<<< - * return self - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_14ObjectIterator_3__iter__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_5rados_14ObjectIterator_3__iter__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_14ObjectIterator_2__iter__(((struct __pyx_obj_5rados_ObjectIterator *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_14ObjectIterator_2__iter__(struct __pyx_obj_5rados_ObjectIterator *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__iter__", 0); - - /* "rados.pyx":1364 - * - * def __iter__(self): - * return self # <<<<<<<<<<<<<< - * - * def __next__(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __pyx_r = ((PyObject *)__pyx_v_self); - goto __pyx_L0; - - /* "rados.pyx":1363 - * % self.ioctx.name) - * - * def __iter__(self): # <<<<<<<<<<<<<< - * return self - * - */ - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1366 - * return self - * - * def __next__(self): # <<<<<<<<<<<<<< - * """ - * Get the next object name and locator in the pool - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_14ObjectIterator_5__next__(PyObject *__pyx_v_self); /*proto*/ -static char __pyx_doc_5rados_14ObjectIterator_4__next__[] = "\n Get the next object name and locator in the pool\n\n :raises: StopIteration\n :returns: next rados.Ioctx Object\n "; -#if CYTHON_COMPILING_IN_CPYTHON -struct wrapperbase __pyx_wrapperbase_5rados_14ObjectIterator_4__next__; -#endif -static PyObject *__pyx_pw_5rados_14ObjectIterator_5__next__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_14ObjectIterator_4__next__(((struct __pyx_obj_5rados_ObjectIterator *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_14ObjectIterator_4__next__(struct __pyx_obj_5rados_ObjectIterator *__pyx_v_self) { - char const *__pyx_v_key_; - char const *__pyx_v_locator_; - char const *__pyx_v_nspace_; - int __pyx_v_ret; - PyObject *__pyx_v_key = NULL; - PyObject *__pyx_v_locator = NULL; - PyObject *__pyx_v_nspace = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - Py_ssize_t __pyx_t_8; - __Pyx_RefNannySetupContext("__next__", 0); - - /* "rados.pyx":1374 - * """ - * cdef: - * const char *key_ = NULL # <<<<<<<<<<<<<< - * const char *locator_ = NULL - * const char *nspace_ = NULL - */ - __pyx_v_key_ = NULL; - - /* "rados.pyx":1375 - * cdef: - * const char *key_ = NULL - * const char *locator_ = NULL # <<<<<<<<<<<<<< - * const char *nspace_ = NULL - * - */ - __pyx_v_locator_ = NULL; - - /* "rados.pyx":1376 - * const char *key_ = NULL - * const char *locator_ = NULL - * const char *nspace_ = NULL # <<<<<<<<<<<<<< - * - * with nogil: - */ - __pyx_v_nspace_ = NULL; - - /* "rados.pyx":1378 - * const char *nspace_ = NULL - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_nobjects_list_next(self.ctx, &key_, &locator_, &nspace_) - * - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1379 - * - * with nogil: - * ret = rados_nobjects_list_next(self.ctx, &key_, &locator_, &nspace_) # <<<<<<<<<<<<<< - * - * if ret < 0: - */ - __pyx_v_ret = rados_nobjects_list_next(__pyx_v_self->ctx, (&__pyx_v_key_), (&__pyx_v_locator_), (&__pyx_v_nspace_)); - } - - /* "rados.pyx":1378 - * const char *nspace_ = NULL - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_nobjects_list_next(self.ctx, &key_, &locator_, &nspace_) - * - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":1381 - * ret = rados_nobjects_list_next(self.ctx, &key_, &locator_, &nspace_) - * - * if ret < 0: # <<<<<<<<<<<<<< - * raise StopIteration() - * - */ - __pyx_t_1 = ((__pyx_v_ret < 0) != 0); - if (__pyx_t_1) { - - /* "rados.pyx":1382 - * - * if ret < 0: - * raise StopIteration() # <<<<<<<<<<<<<< - * - * key = decode_cstr(key_) - */ - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_builtin_StopIteration); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1382, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1382, __pyx_L1_error) - - /* "rados.pyx":1381 - * ret = rados_nobjects_list_next(self.ctx, &key_, &locator_, &nspace_) - * - * if ret < 0: # <<<<<<<<<<<<<< - * raise StopIteration() - * - */ - } - - /* "rados.pyx":1384 - * raise StopIteration() - * - * key = decode_cstr(key_) # <<<<<<<<<<<<<< - * locator = decode_cstr(locator_) if locator_ != NULL else None - * nspace = decode_cstr(nspace_) if nspace_ != NULL else None - */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode_cstr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1384, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_key_); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1384, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - } - } - if (!__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1384, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1384, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1384, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_key = __pyx_t_2; - __pyx_t_2 = 0; - - /* "rados.pyx":1385 - * - * key = decode_cstr(key_) - * locator = decode_cstr(locator_) if locator_ != NULL else None # <<<<<<<<<<<<<< - * nspace = decode_cstr(nspace_) if nspace_ != NULL else None - * return Object(self.ioctx, key, locator, nspace) - */ - if (((__pyx_v_locator_ != NULL) != 0)) { - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode_cstr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1385, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_locator_); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1385, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - } - } - if (!__pyx_t_5) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1385, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GOTREF(__pyx_t_3); - } else { - __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1385, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1385, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_2 = __pyx_t_3; - __pyx_t_3 = 0; - } else { - __Pyx_INCREF(Py_None); - __pyx_t_2 = Py_None; - } - __pyx_v_locator = __pyx_t_2; - __pyx_t_2 = 0; - - /* "rados.pyx":1386 - * key = decode_cstr(key_) - * locator = decode_cstr(locator_) if locator_ != NULL else None - * nspace = decode_cstr(nspace_) if nspace_ != NULL else None # <<<<<<<<<<<<<< - * return Object(self.ioctx, key, locator, nspace) - * - */ - if (((__pyx_v_nspace_ != NULL) != 0)) { - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode_cstr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1386, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyBytes_FromString(__pyx_v_nspace_); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1386, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - } - } - if (!__pyx_t_4) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1386, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GOTREF(__pyx_t_3); - } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1386, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1386, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_2 = __pyx_t_3; - __pyx_t_3 = 0; - } else { - __Pyx_INCREF(Py_None); - __pyx_t_2 = Py_None; - } - __pyx_v_nspace = __pyx_t_2; - __pyx_t_2 = 0; - - /* "rados.pyx":1387 - * locator = decode_cstr(locator_) if locator_ != NULL else None - * nspace = decode_cstr(nspace_) if nspace_ != NULL else None - * return Object(self.ioctx, key, locator, nspace) # <<<<<<<<<<<<<< - * - * def __dealloc__(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Object); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1387, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = NULL; - __pyx_t_8 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_8 = 1; - } - } - __pyx_t_5 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1387, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_6) { - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL; - } - __Pyx_INCREF(__pyx_v_self->ioctx); - __Pyx_GIVEREF(__pyx_v_self->ioctx); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_v_self->ioctx); - __Pyx_INCREF(__pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_v_key); - __Pyx_INCREF(__pyx_v_locator); - __Pyx_GIVEREF(__pyx_v_locator); - PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_8, __pyx_v_locator); - __Pyx_INCREF(__pyx_v_nspace); - __Pyx_GIVEREF(__pyx_v_nspace); - PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_8, __pyx_v_nspace); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1387, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "rados.pyx":1366 - * return self - * - * def __next__(self): # <<<<<<<<<<<<<< - * """ - * Get the next object name and locator in the pool - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("rados.ObjectIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_key); - __Pyx_XDECREF(__pyx_v_locator); - __Pyx_XDECREF(__pyx_v_nspace); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1389 - * return Object(self.ioctx, key, locator, nspace) - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * with nogil: - * rados_nobjects_list_close(self.ctx) - */ - -/* Python wrapper */ -static void __pyx_pw_5rados_14ObjectIterator_7__dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_pw_5rados_14ObjectIterator_7__dealloc__(PyObject *__pyx_v_self) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); - __pyx_pf_5rados_14ObjectIterator_6__dealloc__(((struct __pyx_obj_5rados_ObjectIterator *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -static void __pyx_pf_5rados_14ObjectIterator_6__dealloc__(struct __pyx_obj_5rados_ObjectIterator *__pyx_v_self) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__dealloc__", 0); - - /* "rados.pyx":1390 - * - * def __dealloc__(self): - * with nogil: # <<<<<<<<<<<<<< - * rados_nobjects_list_close(self.ctx) - * - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1391 - * def __dealloc__(self): - * with nogil: - * rados_nobjects_list_close(self.ctx) # <<<<<<<<<<<<<< - * - * - */ - rados_nobjects_list_close(__pyx_v_self->ctx); - } - - /* "rados.pyx":1390 - * - * def __dealloc__(self): - * with nogil: # <<<<<<<<<<<<<< - * rados_nobjects_list_close(self.ctx) - * - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":1389 - * return Object(self.ioctx, key, locator, nspace) - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * with nogil: - * rados_nobjects_list_close(self.ctx) - */ - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "rados.pyx":1352 - * cdef rados_list_ctx_t ctx - * - * cdef public object ioctx # <<<<<<<<<<<<<< - * - * def __cinit__(self, Ioctx ioctx): - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_14ObjectIterator_5ioctx_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_5rados_14ObjectIterator_5ioctx_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_14ObjectIterator_5ioctx___get__(((struct __pyx_obj_5rados_ObjectIterator *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_14ObjectIterator_5ioctx___get__(struct __pyx_obj_5rados_ObjectIterator *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->ioctx); - __pyx_r = __pyx_v_self->ioctx; - goto __pyx_L0; - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_14ObjectIterator_5ioctx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_5rados_14ObjectIterator_5ioctx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_14ObjectIterator_5ioctx_2__set__(((struct __pyx_obj_5rados_ObjectIterator *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_14ObjectIterator_5ioctx_2__set__(struct __pyx_obj_5rados_ObjectIterator *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__", 0); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __Pyx_GOTREF(__pyx_v_self->ioctx); - __Pyx_DECREF(__pyx_v_self->ioctx); - __pyx_v_self->ioctx = __pyx_v_value; - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_14ObjectIterator_5ioctx_5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_5rados_14ObjectIterator_5ioctx_5__del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_14ObjectIterator_5ioctx_4__del__(((struct __pyx_obj_5rados_ObjectIterator *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_14ObjectIterator_5ioctx_4__del__(struct __pyx_obj_5rados_ObjectIterator *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__", 0); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_self->ioctx); - __Pyx_DECREF(__pyx_v_self->ioctx); - __pyx_v_self->ioctx = Py_None; - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1403 - * cdef public object oid - * - * def __cinit__(self, Ioctx ioctx, oid): # <<<<<<<<<<<<<< - * self.ioctx = ioctx - * self.oid = cstr(oid, 'oid') - */ - -/* Python wrapper */ -static int __pyx_pw_5rados_13XattrIterator_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_5rados_13XattrIterator_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - struct __pyx_obj_5rados_Ioctx *__pyx_v_ioctx = 0; - PyObject *__pyx_v_oid = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ioctx,&__pyx_n_s_oid,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ioctx)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_oid)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(0, 1403, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1403, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_ioctx = ((struct __pyx_obj_5rados_Ioctx *)values[0]); - __pyx_v_oid = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1403, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.XattrIterator.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ioctx), __pyx_ptype_5rados_Ioctx, 1, "ioctx", 0))) __PYX_ERR(0, 1403, __pyx_L1_error) - __pyx_r = __pyx_pf_5rados_13XattrIterator___cinit__(((struct __pyx_obj_5rados_XattrIterator *)__pyx_v_self), __pyx_v_ioctx, __pyx_v_oid); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_13XattrIterator___cinit__(struct __pyx_obj_5rados_XattrIterator *__pyx_v_self, struct __pyx_obj_5rados_Ioctx *__pyx_v_ioctx, PyObject *__pyx_v_oid) { - int __pyx_v_ret; - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - int __pyx_t_7; - __Pyx_RefNannySetupContext("__cinit__", 0); - - /* "rados.pyx":1404 - * - * def __cinit__(self, Ioctx ioctx, oid): - * self.ioctx = ioctx # <<<<<<<<<<<<<< - * self.oid = cstr(oid, 'oid') - * self._oid = self.oid - */ - __Pyx_INCREF(((PyObject *)__pyx_v_ioctx)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_ioctx)); - __Pyx_GOTREF(__pyx_v_self->ioctx); - __Pyx_DECREF(((PyObject *)__pyx_v_self->ioctx)); - __pyx_v_self->ioctx = __pyx_v_ioctx; - - /* "rados.pyx":1405 - * def __cinit__(self, Ioctx ioctx, oid): - * self.ioctx = ioctx - * self.oid = cstr(oid, 'oid') # <<<<<<<<<<<<<< - * self._oid = self.oid - * - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1405, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1405, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_oid); - __Pyx_GIVEREF(__pyx_v_oid); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_oid); - __Pyx_INCREF(__pyx_n_s_oid); - __Pyx_GIVEREF(__pyx_n_s_oid); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_oid); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1405, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GIVEREF(__pyx_t_1); - __Pyx_GOTREF(__pyx_v_self->oid); - __Pyx_DECREF(__pyx_v_self->oid); - __pyx_v_self->oid = __pyx_t_1; - __pyx_t_1 = 0; - - /* "rados.pyx":1406 - * self.ioctx = ioctx - * self.oid = cstr(oid, 'oid') - * self._oid = self.oid # <<<<<<<<<<<<<< - * - * with nogil: - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_self->oid); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 1406, __pyx_L1_error) - __pyx_v_self->_oid = __pyx_t_6; - - /* "rados.pyx":1408 - * self._oid = self.oid - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_getxattrs(ioctx.io, self._oid, &self.it) - * if ret != 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1409 - * - * with nogil: - * ret = rados_getxattrs(ioctx.io, self._oid, &self.it) # <<<<<<<<<<<<<< - * if ret != 0: - * raise make_ex(ret, "Failed to get rados xattrs for object %r" % oid) - */ - __pyx_v_ret = rados_getxattrs(__pyx_v_ioctx->io, __pyx_v_self->_oid, (&__pyx_v_self->it)); - } - - /* "rados.pyx":1408 - * self._oid = self.oid - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_getxattrs(ioctx.io, self._oid, &self.it) - * if ret != 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":1410 - * with nogil: - * ret = rados_getxattrs(ioctx.io, self._oid, &self.it) - * if ret != 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Failed to get rados xattrs for object %r" % oid) - * - */ - __pyx_t_7 = ((__pyx_v_ret != 0) != 0); - if (__pyx_t_7) { - - /* "rados.pyx":1411 - * ret = rados_getxattrs(ioctx.io, self._oid, &self.it) - * if ret != 0: - * raise make_ex(ret, "Failed to get rados xattrs for object %r" % oid) # <<<<<<<<<<<<<< - * - * def __iter__(self): - */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1411, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Failed_to_get_rados_xattrs_for_o, __pyx_v_oid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1411, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __pyx_f_5rados_make_ex(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1411, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 1411, __pyx_L1_error) - - /* "rados.pyx":1410 - * with nogil: - * ret = rados_getxattrs(ioctx.io, self._oid, &self.it) - * if ret != 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Failed to get rados xattrs for object %r" % oid) - * - */ - } - - /* "rados.pyx":1403 - * cdef public object oid - * - * def __cinit__(self, Ioctx ioctx, oid): # <<<<<<<<<<<<<< - * self.ioctx = ioctx - * self.oid = cstr(oid, 'oid') - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.XattrIterator.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1413 - * raise make_ex(ret, "Failed to get rados xattrs for object %r" % oid) - * - * def __iter__(self): # <<<<<<<<<<<<<< - * return self - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_13XattrIterator_3__iter__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_5rados_13XattrIterator_3__iter__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_13XattrIterator_2__iter__(((struct __pyx_obj_5rados_XattrIterator *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_13XattrIterator_2__iter__(struct __pyx_obj_5rados_XattrIterator *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__iter__", 0); - - /* "rados.pyx":1414 - * - * def __iter__(self): - * return self # <<<<<<<<<<<<<< - * - * def __next__(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __pyx_r = ((PyObject *)__pyx_v_self); - goto __pyx_L0; - - /* "rados.pyx":1413 - * raise make_ex(ret, "Failed to get rados xattrs for object %r" % oid) - * - * def __iter__(self): # <<<<<<<<<<<<<< - * return self - * - */ - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1416 - * return self - * - * def __next__(self): # <<<<<<<<<<<<<< - * """ - * Get the next xattr on the object - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_13XattrIterator_5__next__(PyObject *__pyx_v_self); /*proto*/ -static char __pyx_doc_5rados_13XattrIterator_4__next__[] = "\n Get the next xattr on the object\n\n :raises: StopIteration\n :returns: pair - of name and value of the next Xattr\n "; -#if CYTHON_COMPILING_IN_CPYTHON -struct wrapperbase __pyx_wrapperbase_5rados_13XattrIterator_4__next__; -#endif -static PyObject *__pyx_pw_5rados_13XattrIterator_5__next__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_13XattrIterator_4__next__(((struct __pyx_obj_5rados_XattrIterator *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_13XattrIterator_4__next__(struct __pyx_obj_5rados_XattrIterator *__pyx_v_self) { - char const *__pyx_v_name_; - char const *__pyx_v_val_; - size_t __pyx_v_len_; - int __pyx_v_ret; - PyObject *__pyx_v_name = NULL; - PyObject *__pyx_v_val = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - __Pyx_RefNannySetupContext("__next__", 0); - - /* "rados.pyx":1424 - * """ - * cdef: - * const char *name_ = NULL # <<<<<<<<<<<<<< - * const char *val_ = NULL - * size_t len_ = 0 - */ - __pyx_v_name_ = NULL; - - /* "rados.pyx":1425 - * cdef: - * const char *name_ = NULL - * const char *val_ = NULL # <<<<<<<<<<<<<< - * size_t len_ = 0 - * - */ - __pyx_v_val_ = NULL; - - /* "rados.pyx":1426 - * const char *name_ = NULL - * const char *val_ = NULL - * size_t len_ = 0 # <<<<<<<<<<<<<< - * - * with nogil: - */ - __pyx_v_len_ = 0; - - /* "rados.pyx":1428 - * size_t len_ = 0 - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_getxattrs_next(self.it, &name_, &val_, &len_) - * if ret != 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1429 - * - * with nogil: - * ret = rados_getxattrs_next(self.it, &name_, &val_, &len_) # <<<<<<<<<<<<<< - * if ret != 0: - * raise make_ex(ret, "error iterating over the extended attributes \ - */ - __pyx_v_ret = rados_getxattrs_next(__pyx_v_self->it, (&__pyx_v_name_), (&__pyx_v_val_), (&__pyx_v_len_)); - } - - /* "rados.pyx":1428 - * size_t len_ = 0 - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_getxattrs_next(self.it, &name_, &val_, &len_) - * if ret != 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":1430 - * with nogil: - * ret = rados_getxattrs_next(self.it, &name_, &val_, &len_) - * if ret != 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error iterating over the extended attributes \ - * in '%s'" % self.oid) - */ - __pyx_t_1 = ((__pyx_v_ret != 0) != 0); - if (__pyx_t_1) { - - /* "rados.pyx":1431 - * ret = rados_getxattrs_next(self.it, &name_, &val_, &len_) - * if ret != 0: - * raise make_ex(ret, "error iterating over the extended attributes \ # <<<<<<<<<<<<<< - * in '%s'" % self.oid) - * if name_ == NULL: - */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1431, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - - /* "rados.pyx":1432 - * if ret != 0: - * raise make_ex(ret, "error iterating over the extended attributes \ - * in '%s'" % self.oid) # <<<<<<<<<<<<<< - * if name_ == NULL: - * raise StopIteration() - */ - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_error_iterating_over_the_extende, __pyx_v_self->oid); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1432, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - - /* "rados.pyx":1431 - * ret = rados_getxattrs_next(self.it, &name_, &val_, &len_) - * if ret != 0: - * raise make_ex(ret, "error iterating over the extended attributes \ # <<<<<<<<<<<<<< - * in '%s'" % self.oid) - * if name_ == NULL: - */ - __pyx_t_4 = __pyx_f_5rados_make_ex(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1431, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 1431, __pyx_L1_error) - - /* "rados.pyx":1430 - * with nogil: - * ret = rados_getxattrs_next(self.it, &name_, &val_, &len_) - * if ret != 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error iterating over the extended attributes \ - * in '%s'" % self.oid) - */ - } - - /* "rados.pyx":1433 - * raise make_ex(ret, "error iterating over the extended attributes \ - * in '%s'" % self.oid) - * if name_ == NULL: # <<<<<<<<<<<<<< - * raise StopIteration() - * name = decode_cstr(name_) - */ - __pyx_t_1 = ((__pyx_v_name_ == NULL) != 0); - if (__pyx_t_1) { - - /* "rados.pyx":1434 - * in '%s'" % self.oid) - * if name_ == NULL: - * raise StopIteration() # <<<<<<<<<<<<<< - * name = decode_cstr(name_) - * val = val_[:len_] - */ - __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_builtin_StopIteration); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1434, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 1434, __pyx_L1_error) - - /* "rados.pyx":1433 - * raise make_ex(ret, "error iterating over the extended attributes \ - * in '%s'" % self.oid) - * if name_ == NULL: # <<<<<<<<<<<<<< - * raise StopIteration() - * name = decode_cstr(name_) - */ - } - - /* "rados.pyx":1435 - * if name_ == NULL: - * raise StopIteration() - * name = decode_cstr(name_) # <<<<<<<<<<<<<< - * val = val_[:len_] - * return (name, val) - */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode_cstr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1435, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_name_); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1435, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - } - } - if (!__pyx_t_5) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1435, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_t_4); - } else { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1435, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1435, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_name = __pyx_t_4; - __pyx_t_4 = 0; - - /* "rados.pyx":1436 - * raise StopIteration() - * name = decode_cstr(name_) - * val = val_[:len_] # <<<<<<<<<<<<<< - * return (name, val) - * - */ - __pyx_t_4 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_val_ + 0, __pyx_v_len_ - 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1436, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_v_val = ((PyObject*)__pyx_t_4); - __pyx_t_4 = 0; - - /* "rados.pyx":1437 - * name = decode_cstr(name_) - * val = val_[:len_] - * return (name, val) # <<<<<<<<<<<<<< - * - * def __dealloc__(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1437, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_v_name); - __Pyx_GIVEREF(__pyx_v_name); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_name); - __Pyx_INCREF(__pyx_v_val); - __Pyx_GIVEREF(__pyx_v_val); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_val); - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - /* "rados.pyx":1416 - * return self - * - * def __next__(self): # <<<<<<<<<<<<<< - * """ - * Get the next xattr on the object - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("rados.XattrIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_name); - __Pyx_XDECREF(__pyx_v_val); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1439 - * return (name, val) - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * with nogil: - * rados_getxattrs_end(self.it) - */ - -/* Python wrapper */ -static void __pyx_pw_5rados_13XattrIterator_7__dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_pw_5rados_13XattrIterator_7__dealloc__(PyObject *__pyx_v_self) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); - __pyx_pf_5rados_13XattrIterator_6__dealloc__(((struct __pyx_obj_5rados_XattrIterator *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -static void __pyx_pf_5rados_13XattrIterator_6__dealloc__(struct __pyx_obj_5rados_XattrIterator *__pyx_v_self) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__dealloc__", 0); - - /* "rados.pyx":1440 - * - * def __dealloc__(self): - * with nogil: # <<<<<<<<<<<<<< - * rados_getxattrs_end(self.it) - * - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1441 - * def __dealloc__(self): - * with nogil: - * rados_getxattrs_end(self.it) # <<<<<<<<<<<<<< - * - * - */ - rados_getxattrs_end(__pyx_v_self->it); - } - - /* "rados.pyx":1440 - * - * def __dealloc__(self): - * with nogil: # <<<<<<<<<<<<<< - * rados_getxattrs_end(self.it) - * - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":1439 - * return (name, val) - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * with nogil: - * rados_getxattrs_end(self.it) - */ - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "rados.pyx":1400 - * cdef char* _oid - * - * cdef public Ioctx ioctx # <<<<<<<<<<<<<< - * cdef public object oid - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_13XattrIterator_5ioctx_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_5rados_13XattrIterator_5ioctx_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_13XattrIterator_5ioctx___get__(((struct __pyx_obj_5rados_XattrIterator *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_13XattrIterator_5ioctx___get__(struct __pyx_obj_5rados_XattrIterator *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_self->ioctx)); - __pyx_r = ((PyObject *)__pyx_v_self->ioctx); - goto __pyx_L0; - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_13XattrIterator_5ioctx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_5rados_13XattrIterator_5ioctx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_13XattrIterator_5ioctx_2__set__(((struct __pyx_obj_5rados_XattrIterator *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_13XattrIterator_5ioctx_2__set__(struct __pyx_obj_5rados_XattrIterator *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__set__", 0); - if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5rados_Ioctx))))) __PYX_ERR(0, 1400, __pyx_L1_error) - __pyx_t_1 = __pyx_v_value; - __Pyx_INCREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __Pyx_GOTREF(__pyx_v_self->ioctx); - __Pyx_DECREF(((PyObject *)__pyx_v_self->ioctx)); - __pyx_v_self->ioctx = ((struct __pyx_obj_5rados_Ioctx *)__pyx_t_1); - __pyx_t_1 = 0; - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rados.XattrIterator.ioctx.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_13XattrIterator_5ioctx_5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_5rados_13XattrIterator_5ioctx_5__del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_13XattrIterator_5ioctx_4__del__(((struct __pyx_obj_5rados_XattrIterator *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_13XattrIterator_5ioctx_4__del__(struct __pyx_obj_5rados_XattrIterator *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__", 0); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_self->ioctx); - __Pyx_DECREF(((PyObject *)__pyx_v_self->ioctx)); - __pyx_v_self->ioctx = ((struct __pyx_obj_5rados_Ioctx *)Py_None); - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1401 - * - * cdef public Ioctx ioctx - * cdef public object oid # <<<<<<<<<<<<<< - * - * def __cinit__(self, Ioctx ioctx, oid): - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_13XattrIterator_3oid_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_5rados_13XattrIterator_3oid_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_13XattrIterator_3oid___get__(((struct __pyx_obj_5rados_XattrIterator *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_13XattrIterator_3oid___get__(struct __pyx_obj_5rados_XattrIterator *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->oid); - __pyx_r = __pyx_v_self->oid; - goto __pyx_L0; - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_13XattrIterator_3oid_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_5rados_13XattrIterator_3oid_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_13XattrIterator_3oid_2__set__(((struct __pyx_obj_5rados_XattrIterator *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_13XattrIterator_3oid_2__set__(struct __pyx_obj_5rados_XattrIterator *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__", 0); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __Pyx_GOTREF(__pyx_v_self->oid); - __Pyx_DECREF(__pyx_v_self->oid); - __pyx_v_self->oid = __pyx_v_value; - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_13XattrIterator_3oid_5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_5rados_13XattrIterator_3oid_5__del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_13XattrIterator_3oid_4__del__(((struct __pyx_obj_5rados_XattrIterator *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_13XattrIterator_3oid_4__del__(struct __pyx_obj_5rados_XattrIterator *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__", 0); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_self->oid); - __Pyx_DECREF(__pyx_v_self->oid); - __pyx_v_self->oid = Py_None; - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1453 - * cdef int cur_snap - * - * def __cinit__(self, Ioctx ioctx): # <<<<<<<<<<<<<< - * self.ioctx = ioctx - * # We don't know how big a buffer we need until we've called the - */ - -/* Python wrapper */ -static int __pyx_pw_5rados_12SnapIterator_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_5rados_12SnapIterator_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - struct __pyx_obj_5rados_Ioctx *__pyx_v_ioctx = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ioctx,0}; - PyObject* values[1] = {0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ioctx)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1453, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - } - __pyx_v_ioctx = ((struct __pyx_obj_5rados_Ioctx *)values[0]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1453, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.SnapIterator.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ioctx), __pyx_ptype_5rados_Ioctx, 1, "ioctx", 0))) __PYX_ERR(0, 1453, __pyx_L1_error) - __pyx_r = __pyx_pf_5rados_12SnapIterator___cinit__(((struct __pyx_obj_5rados_SnapIterator *)__pyx_v_self), __pyx_v_ioctx); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_12SnapIterator___cinit__(struct __pyx_obj_5rados_SnapIterator *__pyx_v_self, struct __pyx_obj_5rados_Ioctx *__pyx_v_ioctx) { - int __pyx_v_num_snaps; - int __pyx_v_ret; - int __pyx_r; - __Pyx_RefNannyDeclarations - void *__pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - __Pyx_RefNannySetupContext("__cinit__", 0); - - /* "rados.pyx":1454 - * - * def __cinit__(self, Ioctx ioctx): - * self.ioctx = ioctx # <<<<<<<<<<<<<< - * # We don't know how big a buffer we need until we've called the - * # function. So use the exponential doubling strategy. - */ - __Pyx_INCREF(((PyObject *)__pyx_v_ioctx)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_ioctx)); - __Pyx_GOTREF(__pyx_v_self->ioctx); - __Pyx_DECREF(((PyObject *)__pyx_v_self->ioctx)); - __pyx_v_self->ioctx = __pyx_v_ioctx; - - /* "rados.pyx":1457 - * # We don't know how big a buffer we need until we've called the - * # function. So use the exponential doubling strategy. - * cdef int num_snaps = 10 # <<<<<<<<<<<<<< - * while True: - * self.snaps = realloc_chk(self.snaps, - */ - __pyx_v_num_snaps = 10; - - /* "rados.pyx":1458 - * # function. So use the exponential doubling strategy. - * cdef int num_snaps = 10 - * while True: # <<<<<<<<<<<<<< - * self.snaps = realloc_chk(self.snaps, - * num_snaps * - */ - while (1) { - - /* "rados.pyx":1459 - * cdef int num_snaps = 10 - * while True: - * self.snaps = realloc_chk(self.snaps, # <<<<<<<<<<<<<< - * num_snaps * - * sizeof(rados_snap_t)) - */ - __pyx_t_1 = __pyx_f_5rados_realloc_chk(__pyx_v_self->snaps, (__pyx_v_num_snaps * (sizeof(rados_snap_t)))); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(0, 1459, __pyx_L1_error) - __pyx_v_self->snaps = ((rados_snap_t *)__pyx_t_1); - - /* "rados.pyx":1463 - * sizeof(rados_snap_t)) - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_ioctx_snap_list(ioctx.io, self.snaps, num_snaps) - * if ret >= 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1464 - * - * with nogil: - * ret = rados_ioctx_snap_list(ioctx.io, self.snaps, num_snaps) # <<<<<<<<<<<<<< - * if ret >= 0: - * self.max_snap = ret - */ - __pyx_v_ret = rados_ioctx_snap_list(__pyx_v_ioctx->io, __pyx_v_self->snaps, __pyx_v_num_snaps); - } - - /* "rados.pyx":1463 - * sizeof(rados_snap_t)) - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_ioctx_snap_list(ioctx.io, self.snaps, num_snaps) - * if ret >= 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L9; - } - __pyx_L9:; - } - } - - /* "rados.pyx":1465 - * with nogil: - * ret = rados_ioctx_snap_list(ioctx.io, self.snaps, num_snaps) - * if ret >= 0: # <<<<<<<<<<<<<< - * self.max_snap = ret - * break - */ - __pyx_t_2 = ((__pyx_v_ret >= 0) != 0); - if (__pyx_t_2) { - - /* "rados.pyx":1466 - * ret = rados_ioctx_snap_list(ioctx.io, self.snaps, num_snaps) - * if ret >= 0: - * self.max_snap = ret # <<<<<<<<<<<<<< - * break - * elif ret != -errno.ERANGE: - */ - __pyx_v_self->max_snap = __pyx_v_ret; - - /* "rados.pyx":1467 - * if ret >= 0: - * self.max_snap = ret - * break # <<<<<<<<<<<<<< - * elif ret != -errno.ERANGE: - * raise make_ex(ret, "error calling rados_snap_list for \ - */ - goto __pyx_L4_break; - - /* "rados.pyx":1465 - * with nogil: - * ret = rados_ioctx_snap_list(ioctx.io, self.snaps, num_snaps) - * if ret >= 0: # <<<<<<<<<<<<<< - * self.max_snap = ret - * break - */ - } - - /* "rados.pyx":1468 - * self.max_snap = ret - * break - * elif ret != -errno.ERANGE: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error calling rados_snap_list for \ - * ioctx '%s'" % self.ioctx.name) - */ - __pyx_t_2 = ((__pyx_v_ret != (-ERANGE)) != 0); - if (__pyx_t_2) { - - /* "rados.pyx":1469 - * break - * elif ret != -errno.ERANGE: - * raise make_ex(ret, "error calling rados_snap_list for \ # <<<<<<<<<<<<<< - * ioctx '%s'" % self.ioctx.name) - * num_snaps = num_snaps * 2 - */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1469, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - - /* "rados.pyx":1470 - * elif ret != -errno.ERANGE: - * raise make_ex(ret, "error calling rados_snap_list for \ - * ioctx '%s'" % self.ioctx.name) # <<<<<<<<<<<<<< - * num_snaps = num_snaps * 2 - * self.cur_snap = 0 - */ - __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->ioctx->name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1470, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_error_calling_rados_snap_list_fo, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1470, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "rados.pyx":1469 - * break - * elif ret != -errno.ERANGE: - * raise make_ex(ret, "error calling rados_snap_list for \ # <<<<<<<<<<<<<< - * ioctx '%s'" % self.ioctx.name) - * num_snaps = num_snaps * 2 - */ - __pyx_t_4 = __pyx_f_5rados_make_ex(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1469, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 1469, __pyx_L1_error) - - /* "rados.pyx":1468 - * self.max_snap = ret - * break - * elif ret != -errno.ERANGE: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error calling rados_snap_list for \ - * ioctx '%s'" % self.ioctx.name) - */ - } - - /* "rados.pyx":1471 - * raise make_ex(ret, "error calling rados_snap_list for \ - * ioctx '%s'" % self.ioctx.name) - * num_snaps = num_snaps * 2 # <<<<<<<<<<<<<< - * self.cur_snap = 0 - * - */ - __pyx_v_num_snaps = (__pyx_v_num_snaps * 2); - } - __pyx_L4_break:; - - /* "rados.pyx":1472 - * ioctx '%s'" % self.ioctx.name) - * num_snaps = num_snaps * 2 - * self.cur_snap = 0 # <<<<<<<<<<<<<< - * - * def __iter__(self): - */ - __pyx_v_self->cur_snap = 0; - - /* "rados.pyx":1453 - * cdef int cur_snap - * - * def __cinit__(self, Ioctx ioctx): # <<<<<<<<<<<<<< - * self.ioctx = ioctx - * # We don't know how big a buffer we need until we've called the - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.SnapIterator.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1474 - * self.cur_snap = 0 - * - * def __iter__(self): # <<<<<<<<<<<<<< - * return self - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_12SnapIterator_3__iter__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_5rados_12SnapIterator_3__iter__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_12SnapIterator_2__iter__(((struct __pyx_obj_5rados_SnapIterator *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_12SnapIterator_2__iter__(struct __pyx_obj_5rados_SnapIterator *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__iter__", 0); - - /* "rados.pyx":1475 - * - * def __iter__(self): - * return self # <<<<<<<<<<<<<< - * - * def __next__(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __pyx_r = ((PyObject *)__pyx_v_self); - goto __pyx_L0; - - /* "rados.pyx":1474 - * self.cur_snap = 0 - * - * def __iter__(self): # <<<<<<<<<<<<<< - * return self - * - */ - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1477 - * return self - * - * def __next__(self): # <<<<<<<<<<<<<< - * """ - * Get the next Snapshot - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_12SnapIterator_5__next__(PyObject *__pyx_v_self); /*proto*/ -static char __pyx_doc_5rados_12SnapIterator_4__next__[] = "\n Get the next Snapshot\n\n :raises: :class:`Error`, StopIteration\n :returns: Snap - next snapshot\n "; -#if CYTHON_COMPILING_IN_CPYTHON -struct wrapperbase __pyx_wrapperbase_5rados_12SnapIterator_4__next__; -#endif -static PyObject *__pyx_pw_5rados_12SnapIterator_5__next__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_12SnapIterator_4__next__(((struct __pyx_obj_5rados_SnapIterator *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_12SnapIterator_4__next__(struct __pyx_obj_5rados_SnapIterator *__pyx_v_self) { - rados_snap_t __pyx_v_snap_id; - int __pyx_v_name_len; - char *__pyx_v_name; - int __pyx_v_ret; - struct __pyx_obj_5rados_Snap *__pyx_v_snap = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - void *__pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; - int __pyx_t_9; - char const *__pyx_t_10; - PyObject *__pyx_t_11 = NULL; - PyObject *__pyx_t_12 = NULL; - PyObject *__pyx_t_13 = NULL; - PyObject *__pyx_t_14 = NULL; - PyObject *__pyx_t_15 = NULL; - PyObject *__pyx_t_16 = NULL; - __Pyx_RefNannySetupContext("__next__", 0); - - /* "rados.pyx":1484 - * :returns: Snap - next snapshot - * """ - * if self.cur_snap >= self.max_snap: # <<<<<<<<<<<<<< - * raise StopIteration - * - */ - __pyx_t_1 = ((__pyx_v_self->cur_snap >= __pyx_v_self->max_snap) != 0); - if (__pyx_t_1) { - - /* "rados.pyx":1485 - * """ - * if self.cur_snap >= self.max_snap: - * raise StopIteration # <<<<<<<<<<<<<< - * - * cdef: - */ - __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0); - __PYX_ERR(0, 1485, __pyx_L1_error) - - /* "rados.pyx":1484 - * :returns: Snap - next snapshot - * """ - * if self.cur_snap >= self.max_snap: # <<<<<<<<<<<<<< - * raise StopIteration - * - */ - } - - /* "rados.pyx":1488 - * - * cdef: - * rados_snap_t snap_id = self.snaps[self.cur_snap] # <<<<<<<<<<<<<< - * int name_len = 10 - * char *name = NULL - */ - __pyx_v_snap_id = (__pyx_v_self->snaps[__pyx_v_self->cur_snap]); - - /* "rados.pyx":1489 - * cdef: - * rados_snap_t snap_id = self.snaps[self.cur_snap] - * int name_len = 10 # <<<<<<<<<<<<<< - * char *name = NULL - * - */ - __pyx_v_name_len = 10; - - /* "rados.pyx":1490 - * rados_snap_t snap_id = self.snaps[self.cur_snap] - * int name_len = 10 - * char *name = NULL # <<<<<<<<<<<<<< - * - * try: - */ - __pyx_v_name = NULL; - - /* "rados.pyx":1492 - * char *name = NULL - * - * try: # <<<<<<<<<<<<<< - * while True: - * name = realloc_chk(name, name_len) - */ - /*try:*/ { - - /* "rados.pyx":1493 - * - * try: - * while True: # <<<<<<<<<<<<<< - * name = realloc_chk(name, name_len) - * with nogil: - */ - while (1) { - - /* "rados.pyx":1494 - * try: - * while True: - * name = realloc_chk(name, name_len) # <<<<<<<<<<<<<< - * with nogil: - * ret = rados_ioctx_snap_get_name(self.ioctx.io, snap_id, name, name_len) - */ - __pyx_t_2 = __pyx_f_5rados_realloc_chk(__pyx_v_name, __pyx_v_name_len); if (unlikely(__pyx_t_2 == NULL)) __PYX_ERR(0, 1494, __pyx_L5_error) - __pyx_v_name = ((char *)__pyx_t_2); - - /* "rados.pyx":1495 - * while True: - * name = realloc_chk(name, name_len) - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_ioctx_snap_get_name(self.ioctx.io, snap_id, name, name_len) - * if ret == 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1496 - * name = realloc_chk(name, name_len) - * with nogil: - * ret = rados_ioctx_snap_get_name(self.ioctx.io, snap_id, name, name_len) # <<<<<<<<<<<<<< - * if ret == 0: - * break - */ - __pyx_v_ret = rados_ioctx_snap_get_name(__pyx_v_self->ioctx->io, __pyx_v_snap_id, __pyx_v_name, __pyx_v_name_len); - } - - /* "rados.pyx":1495 - * while True: - * name = realloc_chk(name, name_len) - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_ioctx_snap_get_name(self.ioctx.io, snap_id, name, name_len) - * if ret == 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L13; - } - __pyx_L13:; - } - } - - /* "rados.pyx":1497 - * with nogil: - * ret = rados_ioctx_snap_get_name(self.ioctx.io, snap_id, name, name_len) - * if ret == 0: # <<<<<<<<<<<<<< - * break - * elif ret != -errno.ERANGE: - */ - __pyx_t_1 = ((__pyx_v_ret == 0) != 0); - if (__pyx_t_1) { - - /* "rados.pyx":1498 - * ret = rados_ioctx_snap_get_name(self.ioctx.io, snap_id, name, name_len) - * if ret == 0: - * break # <<<<<<<<<<<<<< - * elif ret != -errno.ERANGE: - * raise make_ex(ret, "rados_snap_get_name error") - */ - goto __pyx_L8_break; - - /* "rados.pyx":1497 - * with nogil: - * ret = rados_ioctx_snap_get_name(self.ioctx.io, snap_id, name, name_len) - * if ret == 0: # <<<<<<<<<<<<<< - * break - * elif ret != -errno.ERANGE: - */ - } - - /* "rados.pyx":1499 - * if ret == 0: - * break - * elif ret != -errno.ERANGE: # <<<<<<<<<<<<<< - * raise make_ex(ret, "rados_snap_get_name error") - * else: - */ - __pyx_t_1 = ((__pyx_v_ret != (-ERANGE)) != 0); - if (__pyx_t_1) { - - /* "rados.pyx":1500 - * break - * elif ret != -errno.ERANGE: - * raise make_ex(ret, "rados_snap_get_name error") # <<<<<<<<<<<<<< - * else: - * name_len = name_len * 2 - */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1500, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_f_5rados_make_ex(__pyx_t_3, __pyx_kp_s_rados_snap_get_name_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1500, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 1500, __pyx_L5_error) - - /* "rados.pyx":1499 - * if ret == 0: - * break - * elif ret != -errno.ERANGE: # <<<<<<<<<<<<<< - * raise make_ex(ret, "rados_snap_get_name error") - * else: - */ - } - - /* "rados.pyx":1502 - * raise make_ex(ret, "rados_snap_get_name error") - * else: - * name_len = name_len * 2 # <<<<<<<<<<<<<< - * - * snap = Snap(self.ioctx, decode_cstr(name[:name_len]).rstrip('\0'), snap_id) - */ - /*else*/ { - __pyx_v_name_len = (__pyx_v_name_len * 2); - } - } - __pyx_L8_break:; - - /* "rados.pyx":1504 - * name_len = name_len * 2 - * - * snap = Snap(self.ioctx, decode_cstr(name[:name_len]).rstrip('\0'), snap_id) # <<<<<<<<<<<<<< - * self.cur_snap = self.cur_snap + 1 - * return snap - */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode_cstr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1504, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_name + 0, __pyx_v_name_len - 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1504, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - } - } - if (!__pyx_t_6) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1504, __pyx_L5_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_4); - } else { - __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1504, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1504, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_rstrip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1504, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1504, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_snap_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1504, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1504, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_INCREF(((PyObject *)__pyx_v_self->ioctx)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self->ioctx)); - PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_self->ioctx)); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3); - __pyx_t_4 = 0; - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5rados_Snap), __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1504, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_v_snap = ((struct __pyx_obj_5rados_Snap *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "rados.pyx":1505 - * - * snap = Snap(self.ioctx, decode_cstr(name[:name_len]).rstrip('\0'), snap_id) - * self.cur_snap = self.cur_snap + 1 # <<<<<<<<<<<<<< - * return snap - * finally: - */ - __pyx_v_self->cur_snap = (__pyx_v_self->cur_snap + 1); - - /* "rados.pyx":1506 - * snap = Snap(self.ioctx, decode_cstr(name[:name_len]).rstrip('\0'), snap_id) - * self.cur_snap = self.cur_snap + 1 - * return snap # <<<<<<<<<<<<<< - * finally: - * free(name) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_snap)); - __pyx_r = ((PyObject *)__pyx_v_snap); - goto __pyx_L4_return; - } - - /* "rados.pyx":1508 - * return snap - * finally: - * free(name) # <<<<<<<<<<<<<< - * - * - */ - /*finally:*/ { - /*exception exit:*/{ - __Pyx_PyThreadState_declare - __pyx_L5_error:; - __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; - __Pyx_PyThreadState_assign - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); - if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); - __Pyx_XGOTREF(__pyx_t_11); - __Pyx_XGOTREF(__pyx_t_12); - __Pyx_XGOTREF(__pyx_t_13); - __Pyx_XGOTREF(__pyx_t_14); - __Pyx_XGOTREF(__pyx_t_15); - __Pyx_XGOTREF(__pyx_t_16); - __pyx_t_8 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename; - { - free(__pyx_v_name); - } - __Pyx_PyThreadState_assign - if (PY_MAJOR_VERSION >= 3) { - __Pyx_XGIVEREF(__pyx_t_14); - __Pyx_XGIVEREF(__pyx_t_15); - __Pyx_XGIVEREF(__pyx_t_16); - __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); - } - __Pyx_XGIVEREF(__pyx_t_11); - __Pyx_XGIVEREF(__pyx_t_12); - __Pyx_XGIVEREF(__pyx_t_13); - __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13); - __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; - __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10; - goto __pyx_L1_error; - } - __pyx_L4_return: { - __pyx_t_16 = __pyx_r; - __pyx_r = 0; - free(__pyx_v_name); - __pyx_r = __pyx_t_16; - __pyx_t_16 = 0; - goto __pyx_L0; - } - } - - /* "rados.pyx":1477 - * return self - * - * def __next__(self): # <<<<<<<<<<<<<< - * """ - * Get the next Snapshot - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("rados.SnapIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_snap); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1447 - * """Snapshot iterator""" - * - * cdef public Ioctx ioctx # <<<<<<<<<<<<<< - * - * cdef rados_snap_t *snaps - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_12SnapIterator_5ioctx_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_5rados_12SnapIterator_5ioctx_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_12SnapIterator_5ioctx___get__(((struct __pyx_obj_5rados_SnapIterator *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_12SnapIterator_5ioctx___get__(struct __pyx_obj_5rados_SnapIterator *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_self->ioctx)); - __pyx_r = ((PyObject *)__pyx_v_self->ioctx); - goto __pyx_L0; - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_12SnapIterator_5ioctx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_5rados_12SnapIterator_5ioctx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_12SnapIterator_5ioctx_2__set__(((struct __pyx_obj_5rados_SnapIterator *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_12SnapIterator_5ioctx_2__set__(struct __pyx_obj_5rados_SnapIterator *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__set__", 0); - if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5rados_Ioctx))))) __PYX_ERR(0, 1447, __pyx_L1_error) - __pyx_t_1 = __pyx_v_value; - __Pyx_INCREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __Pyx_GOTREF(__pyx_v_self->ioctx); - __Pyx_DECREF(((PyObject *)__pyx_v_self->ioctx)); - __pyx_v_self->ioctx = ((struct __pyx_obj_5rados_Ioctx *)__pyx_t_1); - __pyx_t_1 = 0; - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rados.SnapIterator.ioctx.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_12SnapIterator_5ioctx_5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_5rados_12SnapIterator_5ioctx_5__del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_12SnapIterator_5ioctx_4__del__(((struct __pyx_obj_5rados_SnapIterator *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_12SnapIterator_5ioctx_4__del__(struct __pyx_obj_5rados_SnapIterator *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__", 0); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_self->ioctx); - __Pyx_DECREF(((PyObject *)__pyx_v_self->ioctx)); - __pyx_v_self->ioctx = ((struct __pyx_obj_5rados_Ioctx *)Py_None); - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1520 - * cdef public rados_snap_t snap_id - * - * def __cinit__(self, Ioctx ioctx, object name, rados_snap_t snap_id): # <<<<<<<<<<<<<< - * self.ioctx = ioctx - * self.name = name - */ - -/* Python wrapper */ -static int __pyx_pw_5rados_4Snap_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_5rados_4Snap_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - struct __pyx_obj_5rados_Ioctx *__pyx_v_ioctx = 0; - PyObject *__pyx_v_name = 0; - rados_snap_t __pyx_v_snap_id; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ioctx,&__pyx_n_s_name_2,&__pyx_n_s_snap_id,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ioctx)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name_2)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); __PYX_ERR(0, 1520, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_snap_id)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); __PYX_ERR(0, 1520, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1520, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - } - __pyx_v_ioctx = ((struct __pyx_obj_5rados_Ioctx *)values[0]); - __pyx_v_name = values[1]; - __pyx_v_snap_id = __Pyx_PyInt_As_uint64_t(values[2]); if (unlikely((__pyx_v_snap_id == (rados_snap_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1520, __pyx_L3_error) - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1520, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Snap.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ioctx), __pyx_ptype_5rados_Ioctx, 1, "ioctx", 0))) __PYX_ERR(0, 1520, __pyx_L1_error) - __pyx_r = __pyx_pf_5rados_4Snap___cinit__(((struct __pyx_obj_5rados_Snap *)__pyx_v_self), __pyx_v_ioctx, __pyx_v_name, __pyx_v_snap_id); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_4Snap___cinit__(struct __pyx_obj_5rados_Snap *__pyx_v_self, struct __pyx_obj_5rados_Ioctx *__pyx_v_ioctx, PyObject *__pyx_v_name, rados_snap_t __pyx_v_snap_id) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__cinit__", 0); - - /* "rados.pyx":1521 - * - * def __cinit__(self, Ioctx ioctx, object name, rados_snap_t snap_id): - * self.ioctx = ioctx # <<<<<<<<<<<<<< - * self.name = name - * self.snap_id = snap_id - */ - __Pyx_INCREF(((PyObject *)__pyx_v_ioctx)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_ioctx)); - __Pyx_GOTREF(__pyx_v_self->ioctx); - __Pyx_DECREF(((PyObject *)__pyx_v_self->ioctx)); - __pyx_v_self->ioctx = __pyx_v_ioctx; - - /* "rados.pyx":1522 - * def __cinit__(self, Ioctx ioctx, object name, rados_snap_t snap_id): - * self.ioctx = ioctx - * self.name = name # <<<<<<<<<<<<<< - * self.snap_id = snap_id - * - */ - __Pyx_INCREF(__pyx_v_name); - __Pyx_GIVEREF(__pyx_v_name); - __Pyx_GOTREF(__pyx_v_self->name); - __Pyx_DECREF(__pyx_v_self->name); - __pyx_v_self->name = __pyx_v_name; - - /* "rados.pyx":1523 - * self.ioctx = ioctx - * self.name = name - * self.snap_id = snap_id # <<<<<<<<<<<<<< - * - * def __str__(self): - */ - __pyx_v_self->snap_id = __pyx_v_snap_id; - - /* "rados.pyx":1520 - * cdef public rados_snap_t snap_id - * - * def __cinit__(self, Ioctx ioctx, object name, rados_snap_t snap_id): # <<<<<<<<<<<<<< - * self.ioctx = ioctx - * self.name = name - */ - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1525 - * self.snap_id = snap_id - * - * def __str__(self): # <<<<<<<<<<<<<< - * return "rados.Snap(ioctx=%s,name=%s,snap_id=%d)" \ - * % (str(self.ioctx), self.name, self.snap_id) - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_4Snap_3__str__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_5rados_4Snap_3__str__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_4Snap_2__str__(((struct __pyx_obj_5rados_Snap *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_4Snap_2__str__(struct __pyx_obj_5rados_Snap *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("__str__", 0); - - /* "rados.pyx":1526 - * - * def __str__(self): - * return "rados.Snap(ioctx=%s,name=%s,snap_id=%d)" \ # <<<<<<<<<<<<<< - * % (str(self.ioctx), self.name, self.snap_id) - * - */ - __Pyx_XDECREF(__pyx_r); - - /* "rados.pyx":1527 - * def __str__(self): - * return "rados.Snap(ioctx=%s,name=%s,snap_id=%d)" \ - * % (str(self.ioctx), self.name, self.snap_id) # <<<<<<<<<<<<<< - * - * def get_timestamp(self): - */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_v_self->ioctx)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self->ioctx)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->ioctx)); - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_self->snap_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); - __Pyx_INCREF(__pyx_v_self->name); - __Pyx_GIVEREF(__pyx_v_self->name); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->name); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1); - __pyx_t_2 = 0; - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_rados_Snap_ioctx_s_name_s_snap_i, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "rados.pyx":1525 - * self.snap_id = snap_id - * - * def __str__(self): # <<<<<<<<<<<<<< - * return "rados.Snap(ioctx=%s,name=%s,snap_id=%d)" \ - * % (str(self.ioctx), self.name, self.snap_id) - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("rados.Snap.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1529 - * % (str(self.ioctx), self.name, self.snap_id) - * - * def get_timestamp(self): # <<<<<<<<<<<<<< - * """ - * Find when a snapshot in the current pool occurred - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_4Snap_5get_timestamp(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5rados_4Snap_4get_timestamp[] = "Snap.get_timestamp(self)\n\n Find when a snapshot in the current pool occurred\n\n :raises: :class:`Error`\n :returns: datetime - the data and time the snapshot was created\n "; -static PyObject *__pyx_pw_5rados_4Snap_5get_timestamp(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("get_timestamp (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_4Snap_4get_timestamp(((struct __pyx_obj_5rados_Snap *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_4Snap_4get_timestamp(struct __pyx_obj_5rados_Snap *__pyx_v_self) { - time_t __pyx_v_snap_time; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - __Pyx_RefNannySetupContext("get_timestamp", 0); - - /* "rados.pyx":1538 - * cdef time_t snap_time - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_ioctx_snap_get_stamp(self.ioctx.io, self.snap_id, &snap_time) - * if ret != 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1539 - * - * with nogil: - * ret = rados_ioctx_snap_get_stamp(self.ioctx.io, self.snap_id, &snap_time) # <<<<<<<<<<<<<< - * if ret != 0: - * raise make_ex(ret, "rados_ioctx_snap_get_stamp error") - */ - __pyx_v_ret = rados_ioctx_snap_get_stamp(__pyx_v_self->ioctx->io, __pyx_v_self->snap_id, (&__pyx_v_snap_time)); - } - - /* "rados.pyx":1538 - * cdef time_t snap_time - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_ioctx_snap_get_stamp(self.ioctx.io, self.snap_id, &snap_time) - * if ret != 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":1540 - * with nogil: - * ret = rados_ioctx_snap_get_stamp(self.ioctx.io, self.snap_id, &snap_time) - * if ret != 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "rados_ioctx_snap_get_stamp error") - * return datetime.fromtimestamp(snap_time) - */ - __pyx_t_1 = ((__pyx_v_ret != 0) != 0); - if (__pyx_t_1) { - - /* "rados.pyx":1541 - * ret = rados_ioctx_snap_get_stamp(self.ioctx.io, self.snap_id, &snap_time) - * if ret != 0: - * raise make_ex(ret, "rados_ioctx_snap_get_stamp error") # <<<<<<<<<<<<<< - * return datetime.fromtimestamp(snap_time) - * - */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1541, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_f_5rados_make_ex(__pyx_t_2, __pyx_kp_s_rados_ioctx_snap_get_stamp_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1541, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 1541, __pyx_L1_error) - - /* "rados.pyx":1540 - * with nogil: - * ret = rados_ioctx_snap_get_stamp(self.ioctx.io, self.snap_id, &snap_time) - * if ret != 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "rados_ioctx_snap_get_stamp error") - * return datetime.fromtimestamp(snap_time) - */ - } - - /* "rados.pyx":1542 - * if ret != 0: - * raise make_ex(ret, "rados_ioctx_snap_get_stamp error") - * return datetime.fromtimestamp(snap_time) # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1542, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_fromtimestamp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1542, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_time_t(__pyx_v_snap_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1542, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - } - } - if (!__pyx_t_5) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1542, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_t_3); - } else { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1542, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1542, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - - /* "rados.pyx":1529 - * % (str(self.ioctx), self.name, self.snap_id) - * - * def get_timestamp(self): # <<<<<<<<<<<<<< - * """ - * Find when a snapshot in the current pool occurred - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("rados.Snap.get_timestamp", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1513 - * cdef class Snap(object): - * """Snapshot object""" - * cdef public Ioctx ioctx # <<<<<<<<<<<<<< - * cdef public object name - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_4Snap_5ioctx_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_5rados_4Snap_5ioctx_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_4Snap_5ioctx___get__(((struct __pyx_obj_5rados_Snap *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_4Snap_5ioctx___get__(struct __pyx_obj_5rados_Snap *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_self->ioctx)); - __pyx_r = ((PyObject *)__pyx_v_self->ioctx); - goto __pyx_L0; - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_4Snap_5ioctx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_5rados_4Snap_5ioctx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_4Snap_5ioctx_2__set__(((struct __pyx_obj_5rados_Snap *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_4Snap_5ioctx_2__set__(struct __pyx_obj_5rados_Snap *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__set__", 0); - if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5rados_Ioctx))))) __PYX_ERR(0, 1513, __pyx_L1_error) - __pyx_t_1 = __pyx_v_value; - __Pyx_INCREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __Pyx_GOTREF(__pyx_v_self->ioctx); - __Pyx_DECREF(((PyObject *)__pyx_v_self->ioctx)); - __pyx_v_self->ioctx = ((struct __pyx_obj_5rados_Ioctx *)__pyx_t_1); - __pyx_t_1 = 0; - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rados.Snap.ioctx.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_4Snap_5ioctx_5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_5rados_4Snap_5ioctx_5__del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_4Snap_5ioctx_4__del__(((struct __pyx_obj_5rados_Snap *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_4Snap_5ioctx_4__del__(struct __pyx_obj_5rados_Snap *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__", 0); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_self->ioctx); - __Pyx_DECREF(((PyObject *)__pyx_v_self->ioctx)); - __pyx_v_self->ioctx = ((struct __pyx_obj_5rados_Ioctx *)Py_None); - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1514 - * """Snapshot object""" - * cdef public Ioctx ioctx - * cdef public object name # <<<<<<<<<<<<<< - * - * # NOTE(sileht): old API was storing the ctypes object - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_4Snap_4name_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_5rados_4Snap_4name_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_4Snap_4name___get__(((struct __pyx_obj_5rados_Snap *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_4Snap_4name___get__(struct __pyx_obj_5rados_Snap *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->name); - __pyx_r = __pyx_v_self->name; - goto __pyx_L0; - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_4Snap_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_5rados_4Snap_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_4Snap_4name_2__set__(((struct __pyx_obj_5rados_Snap *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_4Snap_4name_2__set__(struct __pyx_obj_5rados_Snap *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__", 0); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __Pyx_GOTREF(__pyx_v_self->name); - __Pyx_DECREF(__pyx_v_self->name); - __pyx_v_self->name = __pyx_v_value; - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_4Snap_4name_5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_5rados_4Snap_4name_5__del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_4Snap_4name_4__del__(((struct __pyx_obj_5rados_Snap *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_4Snap_4name_4__del__(struct __pyx_obj_5rados_Snap *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__", 0); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_self->name); - __Pyx_DECREF(__pyx_v_self->name); - __pyx_v_self->name = Py_None; - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1518 - * # NOTE(sileht): old API was storing the ctypes object - * # instead of the value .... - * cdef public rados_snap_t snap_id # <<<<<<<<<<<<<< - * - * def __cinit__(self, Ioctx ioctx, object name, rados_snap_t snap_id): - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_4Snap_7snap_id_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_5rados_4Snap_7snap_id_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_4Snap_7snap_id___get__(((struct __pyx_obj_5rados_Snap *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_4Snap_7snap_id___get__(struct __pyx_obj_5rados_Snap *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_self->snap_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1518, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rados.Snap.snap_id.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_4Snap_7snap_id_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_5rados_4Snap_7snap_id_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_4Snap_7snap_id_2__set__(((struct __pyx_obj_5rados_Snap *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_4Snap_7snap_id_2__set__(struct __pyx_obj_5rados_Snap *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - rados_snap_t __pyx_t_1; - __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_As_uint64_t(__pyx_v_value); if (unlikely((__pyx_t_1 == (rados_snap_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1518, __pyx_L1_error) - __pyx_v_self->snap_id = __pyx_t_1; - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("rados.Snap.snap_id.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1559 - * PyObject* buf - * - * def __cinit__(self, Ioctx ioctx, object oncomplete, object onsafe): # <<<<<<<<<<<<<< - * self.oncomplete = oncomplete - * self.onsafe = onsafe - */ - -/* Python wrapper */ -static int __pyx_pw_5rados_10Completion_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_5rados_10Completion_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - struct __pyx_obj_5rados_Ioctx *__pyx_v_ioctx = 0; - PyObject *__pyx_v_oncomplete = 0; - PyObject *__pyx_v_onsafe = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ioctx,&__pyx_n_s_oncomplete,&__pyx_n_s_onsafe,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ioctx)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_oncomplete)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); __PYX_ERR(0, 1559, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_onsafe)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); __PYX_ERR(0, 1559, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1559, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - } - __pyx_v_ioctx = ((struct __pyx_obj_5rados_Ioctx *)values[0]); - __pyx_v_oncomplete = values[1]; - __pyx_v_onsafe = values[2]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1559, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Completion.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ioctx), __pyx_ptype_5rados_Ioctx, 1, "ioctx", 0))) __PYX_ERR(0, 1559, __pyx_L1_error) - __pyx_r = __pyx_pf_5rados_10Completion___cinit__(((struct __pyx_obj_5rados_Completion *)__pyx_v_self), __pyx_v_ioctx, __pyx_v_oncomplete, __pyx_v_onsafe); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_10Completion___cinit__(struct __pyx_obj_5rados_Completion *__pyx_v_self, struct __pyx_obj_5rados_Ioctx *__pyx_v_ioctx, PyObject *__pyx_v_oncomplete, PyObject *__pyx_v_onsafe) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__cinit__", 0); - - /* "rados.pyx":1560 - * - * def __cinit__(self, Ioctx ioctx, object oncomplete, object onsafe): - * self.oncomplete = oncomplete # <<<<<<<<<<<<<< - * self.onsafe = onsafe - * self.ioctx = ioctx - */ - __Pyx_INCREF(__pyx_v_oncomplete); - __Pyx_GIVEREF(__pyx_v_oncomplete); - __Pyx_GOTREF(__pyx_v_self->oncomplete); - __Pyx_DECREF(__pyx_v_self->oncomplete); - __pyx_v_self->oncomplete = __pyx_v_oncomplete; - - /* "rados.pyx":1561 - * def __cinit__(self, Ioctx ioctx, object oncomplete, object onsafe): - * self.oncomplete = oncomplete - * self.onsafe = onsafe # <<<<<<<<<<<<<< - * self.ioctx = ioctx - * - */ - __Pyx_INCREF(__pyx_v_onsafe); - __Pyx_GIVEREF(__pyx_v_onsafe); - __Pyx_GOTREF(__pyx_v_self->onsafe); - __Pyx_DECREF(__pyx_v_self->onsafe); - __pyx_v_self->onsafe = __pyx_v_onsafe; - - /* "rados.pyx":1562 - * self.oncomplete = oncomplete - * self.onsafe = onsafe - * self.ioctx = ioctx # <<<<<<<<<<<<<< - * - * def is_safe(self): - */ - __Pyx_INCREF(((PyObject *)__pyx_v_ioctx)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_ioctx)); - __Pyx_GOTREF(__pyx_v_self->ioctx); - __Pyx_DECREF(((PyObject *)__pyx_v_self->ioctx)); - __pyx_v_self->ioctx = __pyx_v_ioctx; - - /* "rados.pyx":1559 - * PyObject* buf - * - * def __cinit__(self, Ioctx ioctx, object oncomplete, object onsafe): # <<<<<<<<<<<<<< - * self.oncomplete = oncomplete - * self.onsafe = onsafe - */ - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1564 - * self.ioctx = ioctx - * - * def is_safe(self): # <<<<<<<<<<<<<< - * """ - * Is an asynchronous operation safe? - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_10Completion_3is_safe(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5rados_10Completion_2is_safe[] = "Completion.is_safe(self)\n\n Is an asynchronous operation safe?\n\n This does not imply that the safe callback has finished.\n\n :returns: True if the operation is safe\n "; -static PyObject *__pyx_pw_5rados_10Completion_3is_safe(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("is_safe (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_10Completion_2is_safe(((struct __pyx_obj_5rados_Completion *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_10Completion_2is_safe(struct __pyx_obj_5rados_Completion *__pyx_v_self) { - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("is_safe", 0); - - /* "rados.pyx":1572 - * :returns: True if the operation is safe - * """ - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_aio_is_safe(self.rados_comp) - * return ret == 1 - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1573 - * """ - * with nogil: - * ret = rados_aio_is_safe(self.rados_comp) # <<<<<<<<<<<<<< - * return ret == 1 - * - */ - __pyx_v_ret = rados_aio_is_safe(__pyx_v_self->rados_comp); - } - - /* "rados.pyx":1572 - * :returns: True if the operation is safe - * """ - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_aio_is_safe(self.rados_comp) - * return ret == 1 - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":1574 - * with nogil: - * ret = rados_aio_is_safe(self.rados_comp) - * return ret == 1 # <<<<<<<<<<<<<< - * - * def is_complete(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_ret == 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1574, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "rados.pyx":1564 - * self.ioctx = ioctx - * - * def is_safe(self): # <<<<<<<<<<<<<< - * """ - * Is an asynchronous operation safe? - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rados.Completion.is_safe", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1576 - * return ret == 1 - * - * def is_complete(self): # <<<<<<<<<<<<<< - * """ - * Has an asynchronous operation completed? - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_10Completion_5is_complete(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5rados_10Completion_4is_complete[] = "Completion.is_complete(self)\n\n Has an asynchronous operation completed?\n\n This does not imply that the safe callback has finished.\n\n :returns: True if the operation is completed\n "; -static PyObject *__pyx_pw_5rados_10Completion_5is_complete(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("is_complete (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_10Completion_4is_complete(((struct __pyx_obj_5rados_Completion *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_10Completion_4is_complete(struct __pyx_obj_5rados_Completion *__pyx_v_self) { - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("is_complete", 0); - - /* "rados.pyx":1584 - * :returns: True if the operation is completed - * """ - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_aio_is_complete(self.rados_comp) - * return ret == 1 - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1585 - * """ - * with nogil: - * ret = rados_aio_is_complete(self.rados_comp) # <<<<<<<<<<<<<< - * return ret == 1 - * - */ - __pyx_v_ret = rados_aio_is_complete(__pyx_v_self->rados_comp); - } - - /* "rados.pyx":1584 - * :returns: True if the operation is completed - * """ - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_aio_is_complete(self.rados_comp) - * return ret == 1 - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":1586 - * with nogil: - * ret = rados_aio_is_complete(self.rados_comp) - * return ret == 1 # <<<<<<<<<<<<<< - * - * def wait_for_safe(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_ret == 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1586, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "rados.pyx":1576 - * return ret == 1 - * - * def is_complete(self): # <<<<<<<<<<<<<< - * """ - * Has an asynchronous operation completed? - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rados.Completion.is_complete", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1588 - * return ret == 1 - * - * def wait_for_safe(self): # <<<<<<<<<<<<<< - * """ - * Wait for an asynchronous operation to be marked safe - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_10Completion_7wait_for_safe(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5rados_10Completion_6wait_for_safe[] = "Completion.wait_for_safe(self)\n\n Wait for an asynchronous operation to be marked safe\n\n This does not imply that the safe callback has finished.\n "; -static PyObject *__pyx_pw_5rados_10Completion_7wait_for_safe(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("wait_for_safe (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_10Completion_6wait_for_safe(((struct __pyx_obj_5rados_Completion *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_10Completion_6wait_for_safe(struct __pyx_obj_5rados_Completion *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("wait_for_safe", 0); - - /* "rados.pyx":1594 - * This does not imply that the safe callback has finished. - * """ - * with nogil: # <<<<<<<<<<<<<< - * rados_aio_wait_for_safe(self.rados_comp) - * - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1595 - * """ - * with nogil: - * rados_aio_wait_for_safe(self.rados_comp) # <<<<<<<<<<<<<< - * - * def wait_for_complete(self): - */ - rados_aio_wait_for_safe(__pyx_v_self->rados_comp); - } - - /* "rados.pyx":1594 - * This does not imply that the safe callback has finished. - * """ - * with nogil: # <<<<<<<<<<<<<< - * rados_aio_wait_for_safe(self.rados_comp) - * - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":1588 - * return ret == 1 - * - * def wait_for_safe(self): # <<<<<<<<<<<<<< - * """ - * Wait for an asynchronous operation to be marked safe - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1597 - * rados_aio_wait_for_safe(self.rados_comp) - * - * def wait_for_complete(self): # <<<<<<<<<<<<<< - * """ - * Wait for an asynchronous operation to complete - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_10Completion_9wait_for_complete(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5rados_10Completion_8wait_for_complete[] = "Completion.wait_for_complete(self)\n\n Wait for an asynchronous operation to complete\n\n This does not imply that the complete callback has finished.\n "; -static PyObject *__pyx_pw_5rados_10Completion_9wait_for_complete(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("wait_for_complete (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_10Completion_8wait_for_complete(((struct __pyx_obj_5rados_Completion *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_10Completion_8wait_for_complete(struct __pyx_obj_5rados_Completion *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("wait_for_complete", 0); - - /* "rados.pyx":1603 - * This does not imply that the complete callback has finished. - * """ - * with nogil: # <<<<<<<<<<<<<< - * rados_aio_wait_for_complete(self.rados_comp) - * - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1604 - * """ - * with nogil: - * rados_aio_wait_for_complete(self.rados_comp) # <<<<<<<<<<<<<< - * - * def wait_for_safe_and_cb(self): - */ - rados_aio_wait_for_complete(__pyx_v_self->rados_comp); - } - - /* "rados.pyx":1603 - * This does not imply that the complete callback has finished. - * """ - * with nogil: # <<<<<<<<<<<<<< - * rados_aio_wait_for_complete(self.rados_comp) - * - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":1597 - * rados_aio_wait_for_safe(self.rados_comp) - * - * def wait_for_complete(self): # <<<<<<<<<<<<<< - * """ - * Wait for an asynchronous operation to complete - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1606 - * rados_aio_wait_for_complete(self.rados_comp) - * - * def wait_for_safe_and_cb(self): # <<<<<<<<<<<<<< - * """ - * Wait for an asynchronous operation to be marked safe and for - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_10Completion_11wait_for_safe_and_cb(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5rados_10Completion_10wait_for_safe_and_cb[] = "Completion.wait_for_safe_and_cb(self)\n\n Wait for an asynchronous operation to be marked safe and for\n the safe callback to have returned\n "; -static PyObject *__pyx_pw_5rados_10Completion_11wait_for_safe_and_cb(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("wait_for_safe_and_cb (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_10Completion_10wait_for_safe_and_cb(((struct __pyx_obj_5rados_Completion *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_10Completion_10wait_for_safe_and_cb(struct __pyx_obj_5rados_Completion *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("wait_for_safe_and_cb", 0); - - /* "rados.pyx":1611 - * the safe callback to have returned - * """ - * with nogil: # <<<<<<<<<<<<<< - * rados_aio_wait_for_safe_and_cb(self.rados_comp) - * - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1612 - * """ - * with nogil: - * rados_aio_wait_for_safe_and_cb(self.rados_comp) # <<<<<<<<<<<<<< - * - * def wait_for_complete_and_cb(self): - */ - rados_aio_wait_for_safe_and_cb(__pyx_v_self->rados_comp); - } - - /* "rados.pyx":1611 - * the safe callback to have returned - * """ - * with nogil: # <<<<<<<<<<<<<< - * rados_aio_wait_for_safe_and_cb(self.rados_comp) - * - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":1606 - * rados_aio_wait_for_complete(self.rados_comp) - * - * def wait_for_safe_and_cb(self): # <<<<<<<<<<<<<< - * """ - * Wait for an asynchronous operation to be marked safe and for - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1614 - * rados_aio_wait_for_safe_and_cb(self.rados_comp) - * - * def wait_for_complete_and_cb(self): # <<<<<<<<<<<<<< - * """ - * Wait for an asynchronous operation to complete and for the - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_10Completion_13wait_for_complete_and_cb(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5rados_10Completion_12wait_for_complete_and_cb[] = "Completion.wait_for_complete_and_cb(self)\n\n Wait for an asynchronous operation to complete and for the\n complete callback to have returned\n\n :returns: whether the operation is completed\n "; -static PyObject *__pyx_pw_5rados_10Completion_13wait_for_complete_and_cb(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("wait_for_complete_and_cb (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_10Completion_12wait_for_complete_and_cb(((struct __pyx_obj_5rados_Completion *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_10Completion_12wait_for_complete_and_cb(struct __pyx_obj_5rados_Completion *__pyx_v_self) { - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("wait_for_complete_and_cb", 0); - - /* "rados.pyx":1621 - * :returns: whether the operation is completed - * """ - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_aio_wait_for_complete_and_cb(self.rados_comp) - * return ret - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1622 - * """ - * with nogil: - * ret = rados_aio_wait_for_complete_and_cb(self.rados_comp) # <<<<<<<<<<<<<< - * return ret - * - */ - __pyx_v_ret = rados_aio_wait_for_complete_and_cb(__pyx_v_self->rados_comp); - } - - /* "rados.pyx":1621 - * :returns: whether the operation is completed - * """ - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_aio_wait_for_complete_and_cb(self.rados_comp) - * return ret - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":1623 - * with nogil: - * ret = rados_aio_wait_for_complete_and_cb(self.rados_comp) - * return ret # <<<<<<<<<<<<<< - * - * def get_return_value(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1623, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "rados.pyx":1614 - * rados_aio_wait_for_safe_and_cb(self.rados_comp) - * - * def wait_for_complete_and_cb(self): # <<<<<<<<<<<<<< - * """ - * Wait for an asynchronous operation to complete and for the - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rados.Completion.wait_for_complete_and_cb", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1625 - * return ret - * - * def get_return_value(self): # <<<<<<<<<<<<<< - * """ - * Get the return value of an asychronous operation - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_10Completion_15get_return_value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5rados_10Completion_14get_return_value[] = "Completion.get_return_value(self)\n\n Get the return value of an asychronous operation\n\n The return value is set when the operation is complete or safe,\n whichever comes first.\n\n :returns: int - return value of the operation\n "; -static PyObject *__pyx_pw_5rados_10Completion_15get_return_value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("get_return_value (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_10Completion_14get_return_value(((struct __pyx_obj_5rados_Completion *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_10Completion_14get_return_value(struct __pyx_obj_5rados_Completion *__pyx_v_self) { - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("get_return_value", 0); - - /* "rados.pyx":1634 - * :returns: int - return value of the operation - * """ - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_aio_get_return_value(self.rados_comp) - * return ret - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1635 - * """ - * with nogil: - * ret = rados_aio_get_return_value(self.rados_comp) # <<<<<<<<<<<<<< - * return ret - * - */ - __pyx_v_ret = rados_aio_get_return_value(__pyx_v_self->rados_comp); - } - - /* "rados.pyx":1634 - * :returns: int - return value of the operation - * """ - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_aio_get_return_value(self.rados_comp) - * return ret - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":1636 - * with nogil: - * ret = rados_aio_get_return_value(self.rados_comp) - * return ret # <<<<<<<<<<<<<< - * - * def __dealloc__(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1636, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "rados.pyx":1625 - * return ret - * - * def get_return_value(self): # <<<<<<<<<<<<<< - * """ - * Get the return value of an asychronous operation - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rados.Completion.get_return_value", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1638 - * return ret - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * """ - * Release a completion - */ - -/* Python wrapper */ -static void __pyx_pw_5rados_10Completion_17__dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_pw_5rados_10Completion_17__dealloc__(PyObject *__pyx_v_self) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); - __pyx_pf_5rados_10Completion_16__dealloc__(((struct __pyx_obj_5rados_Completion *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -static void __pyx_pf_5rados_10Completion_16__dealloc__(struct __pyx_obj_5rados_Completion *__pyx_v_self) { - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("__dealloc__", 0); - - /* "rados.pyx":1645 - * freed immediately if the operation is not acked and committed. - * """ - * ref.Py_XDECREF(self.buf) # <<<<<<<<<<<<<< - * self.buf = NULL - * if self.rados_comp != NULL: - */ - Py_XDECREF(__pyx_v_self->buf); - - /* "rados.pyx":1646 - * """ - * ref.Py_XDECREF(self.buf) - * self.buf = NULL # <<<<<<<<<<<<<< - * if self.rados_comp != NULL: - * with nogil: - */ - __pyx_v_self->buf = NULL; - - /* "rados.pyx":1647 - * ref.Py_XDECREF(self.buf) - * self.buf = NULL - * if self.rados_comp != NULL: # <<<<<<<<<<<<<< - * with nogil: - * rados_aio_release(self.rados_comp) - */ - __pyx_t_1 = ((__pyx_v_self->rados_comp != NULL) != 0); - if (__pyx_t_1) { - - /* "rados.pyx":1648 - * self.buf = NULL - * if self.rados_comp != NULL: - * with nogil: # <<<<<<<<<<<<<< - * rados_aio_release(self.rados_comp) - * self.rados_comp = NULL - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1649 - * if self.rados_comp != NULL: - * with nogil: - * rados_aio_release(self.rados_comp) # <<<<<<<<<<<<<< - * self.rados_comp = NULL - * - */ - rados_aio_release(__pyx_v_self->rados_comp); - - /* "rados.pyx":1650 - * with nogil: - * rados_aio_release(self.rados_comp) - * self.rados_comp = NULL # <<<<<<<<<<<<<< - * - * def _complete(self): - */ - __pyx_v_self->rados_comp = NULL; - } - - /* "rados.pyx":1648 - * self.buf = NULL - * if self.rados_comp != NULL: - * with nogil: # <<<<<<<<<<<<<< - * rados_aio_release(self.rados_comp) - * self.rados_comp = NULL - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L6; - } - __pyx_L6:; - } - } - - /* "rados.pyx":1647 - * ref.Py_XDECREF(self.buf) - * self.buf = NULL - * if self.rados_comp != NULL: # <<<<<<<<<<<<<< - * with nogil: - * rados_aio_release(self.rados_comp) - */ - } - - /* "rados.pyx":1638 - * return ret - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * """ - * Release a completion - */ - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "rados.pyx":1652 - * self.rados_comp = NULL - * - * def _complete(self): # <<<<<<<<<<<<<< - * self.oncomplete(self) - * with self.ioctx.lock: - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_10Completion_19_complete(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5rados_10Completion_18_complete[] = "Completion._complete(self)"; -static PyObject *__pyx_pw_5rados_10Completion_19_complete(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_complete (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_10Completion_18_complete(((struct __pyx_obj_5rados_Completion *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_10Completion_18_complete(struct __pyx_obj_5rados_Completion *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - int __pyx_t_9; - PyObject *__pyx_t_10 = NULL; - int __pyx_t_11; - __Pyx_RefNannySetupContext("_complete", 0); - - /* "rados.pyx":1653 - * - * def _complete(self): - * self.oncomplete(self) # <<<<<<<<<<<<<< - * with self.ioctx.lock: - * if self.oncomplete: - */ - __Pyx_INCREF(__pyx_v_self->oncomplete); - __pyx_t_2 = __pyx_v_self->oncomplete; __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (!__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1653, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1653, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_self)); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1653, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":1654 - * def _complete(self): - * self.oncomplete(self) - * with self.ioctx.lock: # <<<<<<<<<<<<<< - * if self.oncomplete: - * self.ioctx.complete_completions.remove(self) - */ - /*with:*/ { - __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->ioctx->lock, __pyx_n_s_exit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1654, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->ioctx->lock, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1654, __pyx_L3_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_4) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1654, __pyx_L3_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1654, __pyx_L3_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /*try:*/ { - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); - __Pyx_XGOTREF(__pyx_t_6); - __Pyx_XGOTREF(__pyx_t_7); - __Pyx_XGOTREF(__pyx_t_8); - /*try:*/ { - - /* "rados.pyx":1655 - * self.oncomplete(self) - * with self.ioctx.lock: - * if self.oncomplete: # <<<<<<<<<<<<<< - * self.ioctx.complete_completions.remove(self) - * - */ - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_self->oncomplete); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1655, __pyx_L7_error) - if (__pyx_t_9) { - - /* "rados.pyx":1656 - * with self.ioctx.lock: - * if self.oncomplete: - * self.ioctx.complete_completions.remove(self) # <<<<<<<<<<<<<< - * - * def _safe(self): - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->ioctx->complete_completions, __pyx_n_s_remove); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1656, __pyx_L7_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (!__pyx_t_4) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1656, __pyx_L7_error) - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1656, __pyx_L7_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL; - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - PyTuple_SET_ITEM(__pyx_t_3, 0+1, ((PyObject *)__pyx_v_self)); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1656, __pyx_L7_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":1655 - * self.oncomplete(self) - * with self.ioctx.lock: - * if self.oncomplete: # <<<<<<<<<<<<<< - * self.ioctx.complete_completions.remove(self) - * - */ - } - - /* "rados.pyx":1654 - * def _complete(self): - * self.oncomplete(self) - * with self.ioctx.lock: # <<<<<<<<<<<<<< - * if self.oncomplete: - * self.ioctx.complete_completions.remove(self) - */ - } - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - goto __pyx_L14_try_end; - __pyx_L7_error:; - __Pyx_PyThreadState_assign - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - /*except:*/ { - __Pyx_AddTraceback("rados.Completion._complete", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 1654, __pyx_L9_except_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1654, __pyx_L9_except_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1654, __pyx_L9_except_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_10); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__pyx_t_9 < 0) __PYX_ERR(0, 1654, __pyx_L9_except_error) - __pyx_t_11 = ((!(__pyx_t_9 != 0)) != 0); - if (__pyx_t_11) { - __Pyx_GIVEREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_2, __pyx_t_3); - __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; - __PYX_ERR(0, 1654, __pyx_L9_except_error) - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L8_exception_handled; - } - __pyx_L9_except_error:; - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_6); - __Pyx_XGIVEREF(__pyx_t_7); - __Pyx_XGIVEREF(__pyx_t_8); - __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); - goto __pyx_L1_error; - __pyx_L8_exception_handled:; - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_6); - __Pyx_XGIVEREF(__pyx_t_7); - __Pyx_XGIVEREF(__pyx_t_8); - __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); - __pyx_L14_try_end:; - } - } - /*finally:*/ { - /*normal exit:*/{ - if (__pyx_t_5) { - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__41, NULL); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1654, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } - goto __pyx_L6; - } - __pyx_L6:; - } - goto __pyx_L19; - __pyx_L3_error:; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L1_error; - __pyx_L19:; - } - - /* "rados.pyx":1652 - * self.rados_comp = NULL - * - * def _complete(self): # <<<<<<<<<<<<<< - * self.oncomplete(self) - * with self.ioctx.lock: - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("rados.Completion._complete", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1658 - * self.ioctx.complete_completions.remove(self) - * - * def _safe(self): # <<<<<<<<<<<<<< - * self.onsafe(self) - * with self.ioctx.lock: - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_10Completion_21_safe(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5rados_10Completion_20_safe[] = "Completion._safe(self)"; -static PyObject *__pyx_pw_5rados_10Completion_21_safe(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_safe (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_10Completion_20_safe(((struct __pyx_obj_5rados_Completion *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_10Completion_20_safe(struct __pyx_obj_5rados_Completion *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - int __pyx_t_9; - PyObject *__pyx_t_10 = NULL; - int __pyx_t_11; - __Pyx_RefNannySetupContext("_safe", 0); - - /* "rados.pyx":1659 - * - * def _safe(self): - * self.onsafe(self) # <<<<<<<<<<<<<< - * with self.ioctx.lock: - * if self.onsafe: - */ - __Pyx_INCREF(__pyx_v_self->onsafe); - __pyx_t_2 = __pyx_v_self->onsafe; __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (!__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1659, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1659, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_self)); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1659, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":1660 - * def _safe(self): - * self.onsafe(self) - * with self.ioctx.lock: # <<<<<<<<<<<<<< - * if self.onsafe: - * self.ioctx.safe_completions.remove(self) - */ - /*with:*/ { - __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->ioctx->lock, __pyx_n_s_exit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1660, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->ioctx->lock, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1660, __pyx_L3_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_4) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1660, __pyx_L3_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1660, __pyx_L3_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /*try:*/ { - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); - __Pyx_XGOTREF(__pyx_t_6); - __Pyx_XGOTREF(__pyx_t_7); - __Pyx_XGOTREF(__pyx_t_8); - /*try:*/ { - - /* "rados.pyx":1661 - * self.onsafe(self) - * with self.ioctx.lock: - * if self.onsafe: # <<<<<<<<<<<<<< - * self.ioctx.safe_completions.remove(self) - * - */ - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_self->onsafe); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1661, __pyx_L7_error) - if (__pyx_t_9) { - - /* "rados.pyx":1662 - * with self.ioctx.lock: - * if self.onsafe: - * self.ioctx.safe_completions.remove(self) # <<<<<<<<<<<<<< - * - * def _cleanup(self): - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->ioctx->safe_completions, __pyx_n_s_remove); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1662, __pyx_L7_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (!__pyx_t_4) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1662, __pyx_L7_error) - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1662, __pyx_L7_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL; - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - PyTuple_SET_ITEM(__pyx_t_3, 0+1, ((PyObject *)__pyx_v_self)); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1662, __pyx_L7_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":1661 - * self.onsafe(self) - * with self.ioctx.lock: - * if self.onsafe: # <<<<<<<<<<<<<< - * self.ioctx.safe_completions.remove(self) - * - */ - } - - /* "rados.pyx":1660 - * def _safe(self): - * self.onsafe(self) - * with self.ioctx.lock: # <<<<<<<<<<<<<< - * if self.onsafe: - * self.ioctx.safe_completions.remove(self) - */ - } - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - goto __pyx_L14_try_end; - __pyx_L7_error:; - __Pyx_PyThreadState_assign - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - /*except:*/ { - __Pyx_AddTraceback("rados.Completion._safe", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 1660, __pyx_L9_except_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1660, __pyx_L9_except_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1660, __pyx_L9_except_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_10); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__pyx_t_9 < 0) __PYX_ERR(0, 1660, __pyx_L9_except_error) - __pyx_t_11 = ((!(__pyx_t_9 != 0)) != 0); - if (__pyx_t_11) { - __Pyx_GIVEREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_2, __pyx_t_3); - __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; - __PYX_ERR(0, 1660, __pyx_L9_except_error) - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L8_exception_handled; - } - __pyx_L9_except_error:; - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_6); - __Pyx_XGIVEREF(__pyx_t_7); - __Pyx_XGIVEREF(__pyx_t_8); - __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); - goto __pyx_L1_error; - __pyx_L8_exception_handled:; - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_6); - __Pyx_XGIVEREF(__pyx_t_7); - __Pyx_XGIVEREF(__pyx_t_8); - __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); - __pyx_L14_try_end:; - } - } - /*finally:*/ { - /*normal exit:*/{ - if (__pyx_t_5) { - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__42, NULL); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1660, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } - goto __pyx_L6; - } - __pyx_L6:; - } - goto __pyx_L19; - __pyx_L3_error:; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L1_error; - __pyx_L19:; - } - - /* "rados.pyx":1658 - * self.ioctx.complete_completions.remove(self) - * - * def _safe(self): # <<<<<<<<<<<<<< - * self.onsafe(self) - * with self.ioctx.lock: - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("rados.Completion._safe", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1664 - * self.ioctx.safe_completions.remove(self) - * - * def _cleanup(self): # <<<<<<<<<<<<<< - * with self.ioctx.lock: - * if self.oncomplete: - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_10Completion_23_cleanup(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5rados_10Completion_22_cleanup[] = "Completion._cleanup(self)"; -static PyObject *__pyx_pw_5rados_10Completion_23_cleanup(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_cleanup (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_10Completion_22_cleanup(((struct __pyx_obj_5rados_Completion *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_10Completion_22_cleanup(struct __pyx_obj_5rados_Completion *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - int __pyx_t_11; - __Pyx_RefNannySetupContext("_cleanup", 0); - - /* "rados.pyx":1665 - * - * def _cleanup(self): - * with self.ioctx.lock: # <<<<<<<<<<<<<< - * if self.oncomplete: - * self.ioctx.complete_completions.remove(self) - */ - /*with:*/ { - __pyx_t_1 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->ioctx->lock, __pyx_n_s_exit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1665, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->ioctx->lock, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1665, __pyx_L3_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - } - } - if (__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1665, __pyx_L3_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1665, __pyx_L3_error) - } - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /*try:*/ { - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); - __Pyx_XGOTREF(__pyx_t_5); - __Pyx_XGOTREF(__pyx_t_6); - __Pyx_XGOTREF(__pyx_t_7); - /*try:*/ { - - /* "rados.pyx":1666 - * def _cleanup(self): - * with self.ioctx.lock: - * if self.oncomplete: # <<<<<<<<<<<<<< - * self.ioctx.complete_completions.remove(self) - * if self.onsafe: - */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_self->oncomplete); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1666, __pyx_L7_error) - if (__pyx_t_8) { - - /* "rados.pyx":1667 - * with self.ioctx.lock: - * if self.oncomplete: - * self.ioctx.complete_completions.remove(self) # <<<<<<<<<<<<<< - * if self.onsafe: - * self.ioctx.safe_completions.remove(self) - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->ioctx->complete_completions, __pyx_n_s_remove); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1667, __pyx_L7_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - } - } - if (!__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1667, __pyx_L7_error) - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1667, __pyx_L7_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL; - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - PyTuple_SET_ITEM(__pyx_t_9, 0+1, ((PyObject *)__pyx_v_self)); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1667, __pyx_L7_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":1666 - * def _cleanup(self): - * with self.ioctx.lock: - * if self.oncomplete: # <<<<<<<<<<<<<< - * self.ioctx.complete_completions.remove(self) - * if self.onsafe: - */ - } - - /* "rados.pyx":1668 - * if self.oncomplete: - * self.ioctx.complete_completions.remove(self) - * if self.onsafe: # <<<<<<<<<<<<<< - * self.ioctx.safe_completions.remove(self) - * - */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_self->onsafe); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1668, __pyx_L7_error) - if (__pyx_t_8) { - - /* "rados.pyx":1669 - * self.ioctx.complete_completions.remove(self) - * if self.onsafe: - * self.ioctx.safe_completions.remove(self) # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->ioctx->safe_completions, __pyx_n_s_remove); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1669, __pyx_L7_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - } - } - if (!__pyx_t_9) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1669, __pyx_L7_error) - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1669, __pyx_L7_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_9); __pyx_t_9 = NULL; - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_self)); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1669, __pyx_L7_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":1668 - * if self.oncomplete: - * self.ioctx.complete_completions.remove(self) - * if self.onsafe: # <<<<<<<<<<<<<< - * self.ioctx.safe_completions.remove(self) - * - */ - } - - /* "rados.pyx":1665 - * - * def _cleanup(self): - * with self.ioctx.lock: # <<<<<<<<<<<<<< - * if self.oncomplete: - * self.ioctx.complete_completions.remove(self) - */ - } - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - goto __pyx_L14_try_end; - __pyx_L7_error:; - __Pyx_PyThreadState_assign - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - /*except:*/ { - __Pyx_AddTraceback("rados.Completion._cleanup", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 1665, __pyx_L9_except_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1665, __pyx_L9_except_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1665, __pyx_L9_except_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_10); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__pyx_t_8 < 0) __PYX_ERR(0, 1665, __pyx_L9_except_error) - __pyx_t_11 = ((!(__pyx_t_8 != 0)) != 0); - if (__pyx_t_11) { - __Pyx_GIVEREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - __Pyx_XGIVEREF(__pyx_t_4); - __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_3, __pyx_t_4); - __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; - __PYX_ERR(0, 1665, __pyx_L9_except_error) - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L8_exception_handled; - } - __pyx_L9_except_error:; - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_5); - __Pyx_XGIVEREF(__pyx_t_6); - __Pyx_XGIVEREF(__pyx_t_7); - __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); - goto __pyx_L1_error; - __pyx_L8_exception_handled:; - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_5); - __Pyx_XGIVEREF(__pyx_t_6); - __Pyx_XGIVEREF(__pyx_t_7); - __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); - __pyx_L14_try_end:; - } - } - /*finally:*/ { - /*normal exit:*/{ - if (__pyx_t_1) { - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__43, NULL); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1665, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - goto __pyx_L6; - } - __pyx_L6:; - } - goto __pyx_L20; - __pyx_L3_error:; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L1_error; - __pyx_L20:; - } - - /* "rados.pyx":1664 - * self.ioctx.safe_completions.remove(self) - * - * def _cleanup(self): # <<<<<<<<<<<<<< - * with self.ioctx.lock: - * if self.oncomplete: - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("rados.Completion._cleanup", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1549 - * - * cdef public: - * Ioctx ioctx # <<<<<<<<<<<<<< - * object oncomplete - * object onsafe - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_10Completion_5ioctx_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_5rados_10Completion_5ioctx_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_10Completion_5ioctx___get__(((struct __pyx_obj_5rados_Completion *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_10Completion_5ioctx___get__(struct __pyx_obj_5rados_Completion *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_self->ioctx)); - __pyx_r = ((PyObject *)__pyx_v_self->ioctx); - goto __pyx_L0; - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_10Completion_5ioctx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_5rados_10Completion_5ioctx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_10Completion_5ioctx_2__set__(((struct __pyx_obj_5rados_Completion *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_10Completion_5ioctx_2__set__(struct __pyx_obj_5rados_Completion *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__set__", 0); - if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5rados_Ioctx))))) __PYX_ERR(0, 1549, __pyx_L1_error) - __pyx_t_1 = __pyx_v_value; - __Pyx_INCREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __Pyx_GOTREF(__pyx_v_self->ioctx); - __Pyx_DECREF(((PyObject *)__pyx_v_self->ioctx)); - __pyx_v_self->ioctx = ((struct __pyx_obj_5rados_Ioctx *)__pyx_t_1); - __pyx_t_1 = 0; - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rados.Completion.ioctx.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_10Completion_5ioctx_5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_5rados_10Completion_5ioctx_5__del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_10Completion_5ioctx_4__del__(((struct __pyx_obj_5rados_Completion *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_10Completion_5ioctx_4__del__(struct __pyx_obj_5rados_Completion *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__", 0); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_self->ioctx); - __Pyx_DECREF(((PyObject *)__pyx_v_self->ioctx)); - __pyx_v_self->ioctx = ((struct __pyx_obj_5rados_Ioctx *)Py_None); - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1550 - * cdef public: - * Ioctx ioctx - * object oncomplete # <<<<<<<<<<<<<< - * object onsafe - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_10Completion_10oncomplete_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_5rados_10Completion_10oncomplete_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_10Completion_10oncomplete___get__(((struct __pyx_obj_5rados_Completion *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_10Completion_10oncomplete___get__(struct __pyx_obj_5rados_Completion *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->oncomplete); - __pyx_r = __pyx_v_self->oncomplete; - goto __pyx_L0; - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_10Completion_10oncomplete_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_5rados_10Completion_10oncomplete_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_10Completion_10oncomplete_2__set__(((struct __pyx_obj_5rados_Completion *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_10Completion_10oncomplete_2__set__(struct __pyx_obj_5rados_Completion *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__", 0); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __Pyx_GOTREF(__pyx_v_self->oncomplete); - __Pyx_DECREF(__pyx_v_self->oncomplete); - __pyx_v_self->oncomplete = __pyx_v_value; - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_10Completion_10oncomplete_5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_5rados_10Completion_10oncomplete_5__del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_10Completion_10oncomplete_4__del__(((struct __pyx_obj_5rados_Completion *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_10Completion_10oncomplete_4__del__(struct __pyx_obj_5rados_Completion *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__", 0); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_self->oncomplete); - __Pyx_DECREF(__pyx_v_self->oncomplete); - __pyx_v_self->oncomplete = Py_None; - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1551 - * Ioctx ioctx - * object oncomplete - * object onsafe # <<<<<<<<<<<<<< - * - * cdef: - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_10Completion_6onsafe_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_5rados_10Completion_6onsafe_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_10Completion_6onsafe___get__(((struct __pyx_obj_5rados_Completion *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_10Completion_6onsafe___get__(struct __pyx_obj_5rados_Completion *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->onsafe); - __pyx_r = __pyx_v_self->onsafe; - goto __pyx_L0; - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_10Completion_6onsafe_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_5rados_10Completion_6onsafe_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_10Completion_6onsafe_2__set__(((struct __pyx_obj_5rados_Completion *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_10Completion_6onsafe_2__set__(struct __pyx_obj_5rados_Completion *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__", 0); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __Pyx_GOTREF(__pyx_v_self->onsafe); - __Pyx_DECREF(__pyx_v_self->onsafe); - __pyx_v_self->onsafe = __pyx_v_value; - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_10Completion_6onsafe_5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_5rados_10Completion_6onsafe_5__del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_10Completion_6onsafe_4__del__(((struct __pyx_obj_5rados_Completion *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_10Completion_6onsafe_4__del__(struct __pyx_obj_5rados_Completion *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__", 0); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_self->onsafe); - __Pyx_DECREF(__pyx_v_self->onsafe); - __pyx_v_self->onsafe = Py_None; - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1673 - * - * class OpCtx(object): - * def __enter__(self): # <<<<<<<<<<<<<< - * return self.create() - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5OpCtx_1__enter__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ -static char __pyx_doc_5rados_5OpCtx___enter__[] = "OpCtx.__enter__(self)"; -static PyMethodDef __pyx_mdef_5rados_5OpCtx_1__enter__ = {"__enter__", (PyCFunction)__pyx_pw_5rados_5OpCtx_1__enter__, METH_O, __pyx_doc_5rados_5OpCtx___enter__}; -static PyObject *__pyx_pw_5rados_5OpCtx_1__enter__(PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5OpCtx___enter__(__pyx_self, ((PyObject *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5OpCtx___enter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("__enter__", 0); - - /* "rados.pyx":1674 - * class OpCtx(object): - * def __enter__(self): - * return self.create() # <<<<<<<<<<<<<< - * - * def __exit__(self, type, msg, traceback): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_create); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1674, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1674, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1674, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "rados.pyx":1673 - * - * class OpCtx(object): - * def __enter__(self): # <<<<<<<<<<<<<< - * return self.create() - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("rados.OpCtx.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1676 - * return self.create() - * - * def __exit__(self, type, msg, traceback): # <<<<<<<<<<<<<< - * self.release() - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5OpCtx_3__exit__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5OpCtx_2__exit__[] = "OpCtx.__exit__(self, type, msg, traceback)"; -static PyMethodDef __pyx_mdef_5rados_5OpCtx_3__exit__ = {"__exit__", (PyCFunction)__pyx_pw_5rados_5OpCtx_3__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5OpCtx_2__exit__}; -static PyObject *__pyx_pw_5rados_5OpCtx_3__exit__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_self = 0; - CYTHON_UNUSED PyObject *__pyx_v_type = 0; - CYTHON_UNUSED PyObject *__pyx_v_msg = 0; - CYTHON_UNUSED PyObject *__pyx_v_traceback = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_type_2,&__pyx_n_s_msg,&__pyx_n_s_traceback,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_type_2)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__exit__", 1, 4, 4, 1); __PYX_ERR(0, 1676, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_msg)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__exit__", 1, 4, 4, 2); __PYX_ERR(0, 1676, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_traceback)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__exit__", 1, 4, 4, 3); __PYX_ERR(0, 1676, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(0, 1676, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_self = values[0]; - __pyx_v_type = values[1]; - __pyx_v_msg = values[2]; - __pyx_v_traceback = values[3]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__exit__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1676, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.OpCtx.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5OpCtx_2__exit__(__pyx_self, __pyx_v_self, __pyx_v_type, __pyx_v_msg, __pyx_v_traceback); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5OpCtx_2__exit__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_type, CYTHON_UNUSED PyObject *__pyx_v_msg, CYTHON_UNUSED PyObject *__pyx_v_traceback) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("__exit__", 0); - - /* "rados.pyx":1677 - * - * def __exit__(self, type, msg, traceback): - * self.release() # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_release); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1677, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1677, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1677, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":1676 - * return self.create() - * - * def __exit__(self, type, msg, traceback): # <<<<<<<<<<<<<< - * self.release() - * - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("rados.OpCtx.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1683 - * cdef rados_write_op_t write_op - * - * def create(self): # <<<<<<<<<<<<<< - * with nogil: - * self.write_op = rados_create_write_op() - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_7WriteOp_1create(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5rados_7WriteOp_create[] = "WriteOp.create(self)"; -static PyObject *__pyx_pw_5rados_7WriteOp_1create(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("create (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_7WriteOp_create(((struct __pyx_obj_5rados_WriteOp *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_7WriteOp_create(struct __pyx_obj_5rados_WriteOp *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("create", 0); - - /* "rados.pyx":1684 - * - * def create(self): - * with nogil: # <<<<<<<<<<<<<< - * self.write_op = rados_create_write_op() - * return self - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1685 - * def create(self): - * with nogil: - * self.write_op = rados_create_write_op() # <<<<<<<<<<<<<< - * return self - * - */ - __pyx_v_self->write_op = rados_create_write_op(); - } - - /* "rados.pyx":1684 - * - * def create(self): - * with nogil: # <<<<<<<<<<<<<< - * self.write_op = rados_create_write_op() - * return self - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":1686 - * with nogil: - * self.write_op = rados_create_write_op() - * return self # <<<<<<<<<<<<<< - * - * def release(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __pyx_r = ((PyObject *)__pyx_v_self); - goto __pyx_L0; - - /* "rados.pyx":1683 - * cdef rados_write_op_t write_op - * - * def create(self): # <<<<<<<<<<<<<< - * with nogil: - * self.write_op = rados_create_write_op() - */ - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1688 - * return self - * - * def release(self): # <<<<<<<<<<<<<< - * with nogil: - * rados_release_write_op(self.write_op) - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_7WriteOp_3release(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5rados_7WriteOp_2release[] = "WriteOp.release(self)"; -static PyObject *__pyx_pw_5rados_7WriteOp_3release(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("release (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_7WriteOp_2release(((struct __pyx_obj_5rados_WriteOp *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_7WriteOp_2release(struct __pyx_obj_5rados_WriteOp *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("release", 0); - - /* "rados.pyx":1689 - * - * def release(self): - * with nogil: # <<<<<<<<<<<<<< - * rados_release_write_op(self.write_op) - * - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1690 - * def release(self): - * with nogil: - * rados_release_write_op(self.write_op) # <<<<<<<<<<<<<< - * - * - */ - rados_release_write_op(__pyx_v_self->write_op); - } - - /* "rados.pyx":1689 - * - * def release(self): - * with nogil: # <<<<<<<<<<<<<< - * rados_release_write_op(self.write_op) - * - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":1688 - * return self - * - * def release(self): # <<<<<<<<<<<<<< - * with nogil: - * rados_release_write_op(self.write_op) - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1700 - * cdef rados_read_op_t read_op - * - * def create(self): # <<<<<<<<<<<<<< - * with nogil: - * self.read_op = rados_create_read_op() - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_6ReadOp_1create(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5rados_6ReadOp_create[] = "ReadOp.create(self)"; -static PyObject *__pyx_pw_5rados_6ReadOp_1create(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("create (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_6ReadOp_create(((struct __pyx_obj_5rados_ReadOp *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_6ReadOp_create(struct __pyx_obj_5rados_ReadOp *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("create", 0); - - /* "rados.pyx":1701 - * - * def create(self): - * with nogil: # <<<<<<<<<<<<<< - * self.read_op = rados_create_read_op() - * return self - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1702 - * def create(self): - * with nogil: - * self.read_op = rados_create_read_op() # <<<<<<<<<<<<<< - * return self - * - */ - __pyx_v_self->read_op = rados_create_read_op(); - } - - /* "rados.pyx":1701 - * - * def create(self): - * with nogil: # <<<<<<<<<<<<<< - * self.read_op = rados_create_read_op() - * return self - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":1703 - * with nogil: - * self.read_op = rados_create_read_op() - * return self # <<<<<<<<<<<<<< - * - * def release(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __pyx_r = ((PyObject *)__pyx_v_self); - goto __pyx_L0; - - /* "rados.pyx":1700 - * cdef rados_read_op_t read_op - * - * def create(self): # <<<<<<<<<<<<<< - * with nogil: - * self.read_op = rados_create_read_op() - */ - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1705 - * return self - * - * def release(self): # <<<<<<<<<<<<<< - * with nogil: - * rados_release_read_op(self.read_op) - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_6ReadOp_3release(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5rados_6ReadOp_2release[] = "ReadOp.release(self)"; -static PyObject *__pyx_pw_5rados_6ReadOp_3release(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("release (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_6ReadOp_2release(((struct __pyx_obj_5rados_ReadOp *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_6ReadOp_2release(struct __pyx_obj_5rados_ReadOp *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("release", 0); - - /* "rados.pyx":1706 - * - * def release(self): - * with nogil: # <<<<<<<<<<<<<< - * rados_release_read_op(self.read_op) - * - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1707 - * def release(self): - * with nogil: - * rados_release_read_op(self.read_op) # <<<<<<<<<<<<<< - * - * - */ - rados_release_read_op(__pyx_v_self->read_op); - } - - /* "rados.pyx":1706 - * - * def release(self): - * with nogil: # <<<<<<<<<<<<<< - * rados_release_read_op(self.read_op) - * - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":1705 - * return self - * - * def release(self): # <<<<<<<<<<<<<< - * with nogil: - * rados_release_read_op(self.read_op) - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1714 - * - * - * cdef int __aio_safe_cb(rados_completion_t completion, void *args) with gil: # <<<<<<<<<<<<<< - * """ - * Callback to onsafe() for asynchronous operations - */ - -static int __pyx_f_5rados___aio_safe_cb(CYTHON_UNUSED rados_completion_t __pyx_v_completion, void *__pyx_v_args) { - PyObject *__pyx_v_cb = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); - #endif - __Pyx_RefNannySetupContext("__aio_safe_cb", 0); - - /* "rados.pyx":1718 - * Callback to onsafe() for asynchronous operations - * """ - * cdef object cb = args # <<<<<<<<<<<<<< - * cb._safe() - * return 0 - */ - __pyx_t_1 = ((PyObject *)__pyx_v_args); - __Pyx_INCREF(__pyx_t_1); - __pyx_v_cb = __pyx_t_1; - __pyx_t_1 = 0; - - /* "rados.pyx":1719 - * """ - * cdef object cb = args - * cb._safe() # <<<<<<<<<<<<<< - * return 0 - * - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cb, __pyx_n_s_safe); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1719, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1719, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1719, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":1720 - * cdef object cb = args - * cb._safe() - * return 0 # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = 0; - goto __pyx_L0; - - /* "rados.pyx":1714 - * - * - * cdef int __aio_safe_cb(rados_completion_t completion, void *args) with gil: # <<<<<<<<<<<<<< - * """ - * Callback to onsafe() for asynchronous operations - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("rados.__aio_safe_cb", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_cb); - __Pyx_RefNannyFinishContext(); - #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); - #endif - return __pyx_r; -} - -/* "rados.pyx":1723 - * - * - * cdef int __aio_complete_cb(rados_completion_t completion, void *args) with gil: # <<<<<<<<<<<<<< - * """ - * Callback to oncomplete() for asynchronous operations - */ - -static int __pyx_f_5rados___aio_complete_cb(CYTHON_UNUSED rados_completion_t __pyx_v_completion, void *__pyx_v_args) { - PyObject *__pyx_v_cb = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); - #endif - __Pyx_RefNannySetupContext("__aio_complete_cb", 0); - - /* "rados.pyx":1727 - * Callback to oncomplete() for asynchronous operations - * """ - * cdef object cb = args # <<<<<<<<<<<<<< - * cb._complete() - * return 0 - */ - __pyx_t_1 = ((PyObject *)__pyx_v_args); - __Pyx_INCREF(__pyx_t_1); - __pyx_v_cb = __pyx_t_1; - __pyx_t_1 = 0; - - /* "rados.pyx":1728 - * """ - * cdef object cb = args - * cb._complete() # <<<<<<<<<<<<<< - * return 0 - * - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cb, __pyx_n_s_complete); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1728, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1728, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1728, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":1729 - * cdef object cb = args - * cb._complete() - * return 0 # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = 0; - goto __pyx_L0; - - /* "rados.pyx":1723 - * - * - * cdef int __aio_complete_cb(rados_completion_t completion, void *args) with gil: # <<<<<<<<<<<<<< - * """ - * Callback to oncomplete() for asynchronous operations - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("rados.__aio_complete_cb", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_cb); - __Pyx_RefNannyFinishContext(); - #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); - #endif - return __pyx_r; -} - -/* "rados.pyx":1736 - * # NOTE(sileht): attributes declared in .pyd - * - * def __init__(self, name): # <<<<<<<<<<<<<< - * self.name = name - * self.state = "open" - */ - -/* Python wrapper */ -static int __pyx_pw_5rados_5Ioctx_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_5rados_5Ioctx_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_name = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name_2,0}; - PyObject* values[1] = {0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name_2)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1736, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - } - __pyx_v_name = values[0]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1736, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Ioctx.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Ioctx___init__(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), __pyx_v_name); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_5Ioctx___init__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_name) { - int __pyx_r; - __Pyx_RefNannyDeclarations - char *__pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("__init__", 0); - - /* "rados.pyx":1737 - * - * def __init__(self, name): - * self.name = name # <<<<<<<<<<<<<< - * self.state = "open" - * - */ - __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 1737, __pyx_L1_error) - __pyx_v_self->name = __pyx_t_1; - - /* "rados.pyx":1738 - * def __init__(self, name): - * self.name = name - * self.state = "open" # <<<<<<<<<<<<<< - * - * self.locator_key = "" - */ - __Pyx_INCREF(__pyx_n_s_open); - __Pyx_GIVEREF(__pyx_n_s_open); - __Pyx_GOTREF(__pyx_v_self->state); - __Pyx_DECREF(__pyx_v_self->state); - __pyx_v_self->state = __pyx_n_s_open; - - /* "rados.pyx":1740 - * self.state = "open" - * - * self.locator_key = "" # <<<<<<<<<<<<<< - * self.nspace = "" - * self.lock = threading.Lock() - */ - __Pyx_INCREF(__pyx_kp_s__13); - __Pyx_GIVEREF(__pyx_kp_s__13); - __Pyx_GOTREF(__pyx_v_self->locator_key); - __Pyx_DECREF(__pyx_v_self->locator_key); - __pyx_v_self->locator_key = __pyx_kp_s__13; - - /* "rados.pyx":1741 - * - * self.locator_key = "" - * self.nspace = "" # <<<<<<<<<<<<<< - * self.lock = threading.Lock() - * self.safe_completions = [] - */ - __Pyx_INCREF(__pyx_kp_s__13); - __Pyx_GIVEREF(__pyx_kp_s__13); - __Pyx_GOTREF(__pyx_v_self->nspace); - __Pyx_DECREF(__pyx_v_self->nspace); - __pyx_v_self->nspace = __pyx_kp_s__13; - - /* "rados.pyx":1742 - * self.locator_key = "" - * self.nspace = "" - * self.lock = threading.Lock() # <<<<<<<<<<<<<< - * self.safe_completions = [] - * self.complete_completions = [] - */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_threading); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1742, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Lock); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1742, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - } - } - if (__pyx_t_3) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1742, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1742, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GIVEREF(__pyx_t_2); - __Pyx_GOTREF(__pyx_v_self->lock); - __Pyx_DECREF(__pyx_v_self->lock); - __pyx_v_self->lock = __pyx_t_2; - __pyx_t_2 = 0; - - /* "rados.pyx":1743 - * self.nspace = "" - * self.lock = threading.Lock() - * self.safe_completions = [] # <<<<<<<<<<<<<< - * self.complete_completions = [] - * - */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1743, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __Pyx_GOTREF(__pyx_v_self->safe_completions); - __Pyx_DECREF(__pyx_v_self->safe_completions); - __pyx_v_self->safe_completions = __pyx_t_2; - __pyx_t_2 = 0; - - /* "rados.pyx":1744 - * self.lock = threading.Lock() - * self.safe_completions = [] - * self.complete_completions = [] # <<<<<<<<<<<<<< - * - * def __enter__(self): - */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1744, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __Pyx_GOTREF(__pyx_v_self->complete_completions); - __Pyx_DECREF(__pyx_v_self->complete_completions); - __pyx_v_self->complete_completions = __pyx_t_2; - __pyx_t_2 = 0; - - /* "rados.pyx":1736 - * # NOTE(sileht): attributes declared in .pyd - * - * def __init__(self, name): # <<<<<<<<<<<<<< - * self.name = name - * self.state = "open" - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("rados.Ioctx.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1746 - * self.complete_completions = [] - * - * def __enter__(self): # <<<<<<<<<<<<<< - * return self - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_3__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_2__enter__[] = "Ioctx.__enter__(self)"; -static PyObject *__pyx_pw_5rados_5Ioctx_3__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_2__enter__(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_2__enter__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__enter__", 0); - - /* "rados.pyx":1747 - * - * def __enter__(self): - * return self # <<<<<<<<<<<<<< - * - * def __exit__(self, type_, value, traceback): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __pyx_r = ((PyObject *)__pyx_v_self); - goto __pyx_L0; - - /* "rados.pyx":1746 - * self.complete_completions = [] - * - * def __enter__(self): # <<<<<<<<<<<<<< - * return self - * - */ - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1749 - * return self - * - * def __exit__(self, type_, value, traceback): # <<<<<<<<<<<<<< - * self.close() - * return False - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_5__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_4__exit__[] = "Ioctx.__exit__(self, type_, value, traceback)"; -static PyObject *__pyx_pw_5rados_5Ioctx_5__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - CYTHON_UNUSED PyObject *__pyx_v_type_ = 0; - CYTHON_UNUSED PyObject *__pyx_v_value = 0; - CYTHON_UNUSED PyObject *__pyx_v_traceback = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_type,&__pyx_n_s_value,&__pyx_n_s_traceback,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(0, 1749, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_traceback)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(0, 1749, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(0, 1749, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - } - __pyx_v_type_ = values[0]; - __pyx_v_value = values[1]; - __pyx_v_traceback = values[2]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1749, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Ioctx.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Ioctx_4__exit__(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), __pyx_v_type_, __pyx_v_value, __pyx_v_traceback); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_4__exit__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_type_, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_traceback) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("__exit__", 0); - - /* "rados.pyx":1750 - * - * def __exit__(self, type_, value, traceback): - * self.close() # <<<<<<<<<<<<<< - * return False - * - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1750, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1750, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1750, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":1751 - * def __exit__(self, type_, value, traceback): - * self.close() - * return False # <<<<<<<<<<<<<< - * - * def __del__(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - goto __pyx_L0; - - /* "rados.pyx":1749 - * return self - * - * def __exit__(self, type_, value, traceback): # <<<<<<<<<<<<<< - * self.close() - * return False - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("rados.Ioctx.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1753 - * return False - * - * def __del__(self): # <<<<<<<<<<<<<< - * self.close() - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_7__del__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_6__del__[] = "Ioctx.__del__(self)"; -static PyObject *__pyx_pw_5rados_5Ioctx_7__del__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_6__del__(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_6__del__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("__del__", 0); - - /* "rados.pyx":1754 - * - * def __del__(self): - * self.close() # <<<<<<<<<<<<<< - * - * def __track_completion(self, completion_obj): - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1754, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1754, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1754, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":1753 - * return False - * - * def __del__(self): # <<<<<<<<<<<<<< - * self.close() - * - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("rados.Ioctx.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1756 - * self.close() - * - * def __track_completion(self, completion_obj): # <<<<<<<<<<<<<< - * if completion_obj.oncomplete: - * with self.lock: - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_9__track_completion(PyObject *__pyx_v_self, PyObject *__pyx_v_completion_obj); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_8__track_completion[] = "Ioctx.__track_completion(self, completion_obj)"; -static PyObject *__pyx_pw_5rados_5Ioctx_9__track_completion(PyObject *__pyx_v_self, PyObject *__pyx_v_completion_obj) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__track_completion (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_8__track_completion(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), ((PyObject *)__pyx_v_completion_obj)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_8__track_completion(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_completion_obj) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - int __pyx_t_9; - PyObject *__pyx_t_10 = NULL; - PyObject *__pyx_t_11 = NULL; - int __pyx_t_12; - __Pyx_RefNannySetupContext("__track_completion", 0); - - /* "rados.pyx":1757 - * - * def __track_completion(self, completion_obj): - * if completion_obj.oncomplete: # <<<<<<<<<<<<<< - * with self.lock: - * self.complete_completions.append(completion_obj) - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_completion_obj, __pyx_n_s_oncomplete); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1757, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1757, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_2) { - - /* "rados.pyx":1758 - * def __track_completion(self, completion_obj): - * if completion_obj.oncomplete: - * with self.lock: # <<<<<<<<<<<<<< - * self.complete_completions.append(completion_obj) - * if completion_obj.onsafe: - */ - /*with:*/ { - __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->lock, __pyx_n_s_exit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1758, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->lock, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1758, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - } - } - if (__pyx_t_5) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1758, __pyx_L4_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1758, __pyx_L4_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /*try:*/ { - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); - __Pyx_XGOTREF(__pyx_t_6); - __Pyx_XGOTREF(__pyx_t_7); - __Pyx_XGOTREF(__pyx_t_8); - /*try:*/ { - - /* "rados.pyx":1759 - * if completion_obj.oncomplete: - * with self.lock: - * self.complete_completions.append(completion_obj) # <<<<<<<<<<<<<< - * if completion_obj.onsafe: - * with self.lock: - */ - __pyx_t_9 = __Pyx_PyObject_Append(__pyx_v_self->complete_completions, __pyx_v_completion_obj); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 1759, __pyx_L8_error) - - /* "rados.pyx":1758 - * def __track_completion(self, completion_obj): - * if completion_obj.oncomplete: - * with self.lock: # <<<<<<<<<<<<<< - * self.complete_completions.append(completion_obj) - * if completion_obj.onsafe: - */ - } - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - goto __pyx_L15_try_end; - __pyx_L8_error:; - __Pyx_PyThreadState_assign - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - /*except:*/ { - __Pyx_AddTraceback("rados.Ioctx.__track_completion", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(0, 1758, __pyx_L10_except_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1758, __pyx_L10_except_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1758, __pyx_L10_except_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_11); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (__pyx_t_2 < 0) __PYX_ERR(0, 1758, __pyx_L10_except_error) - __pyx_t_12 = ((!(__pyx_t_2 != 0)) != 0); - if (__pyx_t_12) { - __Pyx_GIVEREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_4); - __Pyx_XGIVEREF(__pyx_t_5); - __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_4, __pyx_t_5); - __pyx_t_1 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; - __PYX_ERR(0, 1758, __pyx_L10_except_error) - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L9_exception_handled; - } - __pyx_L10_except_error:; - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_6); - __Pyx_XGIVEREF(__pyx_t_7); - __Pyx_XGIVEREF(__pyx_t_8); - __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); - goto __pyx_L1_error; - __pyx_L9_exception_handled:; - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_6); - __Pyx_XGIVEREF(__pyx_t_7); - __Pyx_XGIVEREF(__pyx_t_8); - __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); - __pyx_L15_try_end:; - } - } - /*finally:*/ { - /*normal exit:*/{ - if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__44, NULL); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1758, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } - goto __pyx_L7; - } - __pyx_L7:; - } - goto __pyx_L19; - __pyx_L4_error:; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L1_error; - __pyx_L19:; - } - - /* "rados.pyx":1757 - * - * def __track_completion(self, completion_obj): - * if completion_obj.oncomplete: # <<<<<<<<<<<<<< - * with self.lock: - * self.complete_completions.append(completion_obj) - */ - } - - /* "rados.pyx":1760 - * with self.lock: - * self.complete_completions.append(completion_obj) - * if completion_obj.onsafe: # <<<<<<<<<<<<<< - * with self.lock: - * self.safe_completions.append(completion_obj) - */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_completion_obj, __pyx_n_s_onsafe); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1760, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1760, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_12) { - - /* "rados.pyx":1761 - * self.complete_completions.append(completion_obj) - * if completion_obj.onsafe: - * with self.lock: # <<<<<<<<<<<<<< - * self.safe_completions.append(completion_obj) - * - */ - /*with:*/ { - __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->lock, __pyx_n_s_exit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1761, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->lock, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1761, __pyx_L21_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - } - } - if (__pyx_t_1) { - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1761, __pyx_L21_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } else { - __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1761, __pyx_L21_error) - } - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /*try:*/ { - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); - __Pyx_XGOTREF(__pyx_t_8); - __Pyx_XGOTREF(__pyx_t_7); - __Pyx_XGOTREF(__pyx_t_6); - /*try:*/ { - - /* "rados.pyx":1762 - * if completion_obj.onsafe: - * with self.lock: - * self.safe_completions.append(completion_obj) # <<<<<<<<<<<<<< - * - * def __get_completion(self, oncomplete, onsafe): - */ - __pyx_t_9 = __Pyx_PyObject_Append(__pyx_v_self->safe_completions, __pyx_v_completion_obj); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 1762, __pyx_L25_error) - - /* "rados.pyx":1761 - * self.complete_completions.append(completion_obj) - * if completion_obj.onsafe: - * with self.lock: # <<<<<<<<<<<<<< - * self.safe_completions.append(completion_obj) - * - */ - } - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - goto __pyx_L32_try_end; - __pyx_L25_error:; - __Pyx_PyThreadState_assign - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - /*except:*/ { - __Pyx_AddTraceback("rados.Ioctx.__track_completion", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_1) < 0) __PYX_ERR(0, 1761, __pyx_L27_except_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = PyTuple_Pack(3, __pyx_t_5, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1761, __pyx_L27_except_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1761, __pyx_L27_except_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_11); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (__pyx_t_12 < 0) __PYX_ERR(0, 1761, __pyx_L27_except_error) - __pyx_t_2 = ((!(__pyx_t_12 != 0)) != 0); - if (__pyx_t_2) { - __Pyx_GIVEREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_4); - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_ErrRestoreWithState(__pyx_t_5, __pyx_t_4, __pyx_t_1); - __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_1 = 0; - __PYX_ERR(0, 1761, __pyx_L27_except_error) - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L26_exception_handled; - } - __pyx_L27_except_error:; - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_8); - __Pyx_XGIVEREF(__pyx_t_7); - __Pyx_XGIVEREF(__pyx_t_6); - __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_7, __pyx_t_6); - goto __pyx_L1_error; - __pyx_L26_exception_handled:; - __Pyx_PyThreadState_assign - __Pyx_XGIVEREF(__pyx_t_8); - __Pyx_XGIVEREF(__pyx_t_7); - __Pyx_XGIVEREF(__pyx_t_6); - __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_7, __pyx_t_6); - __pyx_L32_try_end:; - } - } - /*finally:*/ { - /*normal exit:*/{ - if (__pyx_t_3) { - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__45, NULL); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1761, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - goto __pyx_L24; - } - __pyx_L24:; - } - goto __pyx_L36; - __pyx_L21_error:; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L1_error; - __pyx_L36:; - } - - /* "rados.pyx":1760 - * with self.lock: - * self.complete_completions.append(completion_obj) - * if completion_obj.onsafe: # <<<<<<<<<<<<<< - * with self.lock: - * self.safe_completions.append(completion_obj) - */ - } - - /* "rados.pyx":1756 - * self.close() - * - * def __track_completion(self, completion_obj): # <<<<<<<<<<<<<< - * if completion_obj.oncomplete: - * with self.lock: - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_10); - __Pyx_AddTraceback("rados.Ioctx.__track_completion", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1764 - * self.safe_completions.append(completion_obj) - * - * def __get_completion(self, oncomplete, onsafe): # <<<<<<<<<<<<<< - * """ - * Constructs a completion to use with asynchronous operations - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_11__get_completion(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_10__get_completion[] = "Ioctx.__get_completion(self, oncomplete, onsafe)\n\n Constructs a completion to use with asynchronous operations\n\n :param oncomplete: what to do when the write is safe and complete in memory\n on all replicas\n :type oncomplete: completion\n :param onsafe: what to do when the write is safe and complete on storage\n on all replicas\n :type onsafe: completion\n\n :raises: :class:`Error`\n :returns: completion object\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_11__get_completion(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_oncomplete = 0; - PyObject *__pyx_v_onsafe = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get_completion (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_oncomplete,&__pyx_n_s_onsafe,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_oncomplete)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_onsafe)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__get_completion", 1, 2, 2, 1); __PYX_ERR(0, 1764, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__get_completion") < 0)) __PYX_ERR(0, 1764, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_oncomplete = values[0]; - __pyx_v_onsafe = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__get_completion", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1764, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Ioctx.__get_completion", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Ioctx_10__get_completion(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), __pyx_v_oncomplete, __pyx_v_onsafe); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_10__get_completion(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_oncomplete, PyObject *__pyx_v_onsafe) { - struct __pyx_obj_5rados_Completion *__pyx_v_completion_obj = NULL; - rados_callback_t __pyx_v_complete_cb; - rados_callback_t __pyx_v_safe_cb; - rados_completion_t __pyx_v_completion; - PyObject *__pyx_v_p_completion_obj; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - __Pyx_RefNannySetupContext("__get_completion", 0); - - /* "rados.pyx":1779 - * """ - * - * completion_obj = Completion(self, oncomplete, onsafe) # <<<<<<<<<<<<<< - * - * cdef: - */ - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1779, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); - __Pyx_INCREF(__pyx_v_oncomplete); - __Pyx_GIVEREF(__pyx_v_oncomplete); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_oncomplete); - __Pyx_INCREF(__pyx_v_onsafe); - __Pyx_GIVEREF(__pyx_v_onsafe); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_onsafe); - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5rados_Completion), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1779, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_completion_obj = ((struct __pyx_obj_5rados_Completion *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "rados.pyx":1782 - * - * cdef: - * rados_callback_t complete_cb = NULL # <<<<<<<<<<<<<< - * rados_callback_t safe_cb = NULL - * rados_completion_t completion - */ - __pyx_v_complete_cb = NULL; - - /* "rados.pyx":1783 - * cdef: - * rados_callback_t complete_cb = NULL - * rados_callback_t safe_cb = NULL # <<<<<<<<<<<<<< - * rados_completion_t completion - * PyObject* p_completion_obj= completion_obj - */ - __pyx_v_safe_cb = NULL; - - /* "rados.pyx":1785 - * rados_callback_t safe_cb = NULL - * rados_completion_t completion - * PyObject* p_completion_obj= completion_obj # <<<<<<<<<<<<<< - * - * if oncomplete: - */ - __pyx_v_p_completion_obj = ((PyObject *)__pyx_v_completion_obj); - - /* "rados.pyx":1787 - * PyObject* p_completion_obj= completion_obj - * - * if oncomplete: # <<<<<<<<<<<<<< - * complete_cb = &__aio_complete_cb - * if onsafe: - */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_oncomplete); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1787, __pyx_L1_error) - if (__pyx_t_3) { - - /* "rados.pyx":1788 - * - * if oncomplete: - * complete_cb = &__aio_complete_cb # <<<<<<<<<<<<<< - * if onsafe: - * safe_cb = &__aio_safe_cb - */ - __pyx_v_complete_cb = ((rados_callback_t)(&__pyx_f_5rados___aio_complete_cb)); - - /* "rados.pyx":1787 - * PyObject* p_completion_obj= completion_obj - * - * if oncomplete: # <<<<<<<<<<<<<< - * complete_cb = &__aio_complete_cb - * if onsafe: - */ - } - - /* "rados.pyx":1789 - * if oncomplete: - * complete_cb = &__aio_complete_cb - * if onsafe: # <<<<<<<<<<<<<< - * safe_cb = &__aio_safe_cb - * - */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_onsafe); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1789, __pyx_L1_error) - if (__pyx_t_3) { - - /* "rados.pyx":1790 - * complete_cb = &__aio_complete_cb - * if onsafe: - * safe_cb = &__aio_safe_cb # <<<<<<<<<<<<<< - * - * with nogil: - */ - __pyx_v_safe_cb = ((rados_callback_t)(&__pyx_f_5rados___aio_safe_cb)); - - /* "rados.pyx":1789 - * if oncomplete: - * complete_cb = &__aio_complete_cb - * if onsafe: # <<<<<<<<<<<<<< - * safe_cb = &__aio_safe_cb - * - */ - } - - /* "rados.pyx":1792 - * safe_cb = &__aio_safe_cb - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_aio_create_completion(p_completion_obj, complete_cb, safe_cb, - * &completion) - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1793 - * - * with nogil: - * ret = rados_aio_create_completion(p_completion_obj, complete_cb, safe_cb, # <<<<<<<<<<<<<< - * &completion) - * if ret < 0: - */ - __pyx_v_ret = rados_aio_create_completion(__pyx_v_p_completion_obj, __pyx_v_complete_cb, __pyx_v_safe_cb, (&__pyx_v_completion)); - } - - /* "rados.pyx":1792 - * safe_cb = &__aio_safe_cb - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_aio_create_completion(p_completion_obj, complete_cb, safe_cb, - * &completion) - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L7; - } - __pyx_L7:; - } - } - - /* "rados.pyx":1795 - * ret = rados_aio_create_completion(p_completion_obj, complete_cb, safe_cb, - * &completion) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error getting a completion") - * - */ - __pyx_t_3 = ((__pyx_v_ret < 0) != 0); - if (__pyx_t_3) { - - /* "rados.pyx":1796 - * &completion) - * if ret < 0: - * raise make_ex(ret, "error getting a completion") # <<<<<<<<<<<<<< - * - * completion_obj.rados_comp = completion - */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __pyx_f_5rados_make_ex(__pyx_t_2, __pyx_kp_s_error_getting_a_completion); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 1796, __pyx_L1_error) - - /* "rados.pyx":1795 - * ret = rados_aio_create_completion(p_completion_obj, complete_cb, safe_cb, - * &completion) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error getting a completion") - * - */ - } - - /* "rados.pyx":1798 - * raise make_ex(ret, "error getting a completion") - * - * completion_obj.rados_comp = completion # <<<<<<<<<<<<<< - * return completion_obj - * - */ - __pyx_v_completion_obj->rados_comp = __pyx_v_completion; - - /* "rados.pyx":1799 - * - * completion_obj.rados_comp = completion - * return completion_obj # <<<<<<<<<<<<<< - * - * def aio_write(self, object_name, to_write, offset=0, - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_completion_obj)); - __pyx_r = ((PyObject *)__pyx_v_completion_obj); - goto __pyx_L0; - - /* "rados.pyx":1764 - * self.safe_completions.append(completion_obj) - * - * def __get_completion(self, oncomplete, onsafe): # <<<<<<<<<<<<<< - * """ - * Constructs a completion to use with asynchronous operations - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("rados.Ioctx.__get_completion", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_completion_obj); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1801 - * return completion_obj - * - * def aio_write(self, object_name, to_write, offset=0, # <<<<<<<<<<<<<< - * oncomplete=None, onsafe=None): - * """ - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_13aio_write(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_12aio_write[] = "Ioctx.aio_write(self, object_name, to_write, offset=0, oncomplete=None, onsafe=None)\n\n Write data to an object asynchronously\n\n Queues the write and returns.\n\n :param object_name: name of the object\n :type object_name: str\n :param to_write: data to write\n :type to_write: bytes\n :param offset: byte offset in the object to begin writing at\n :type offset: int\n :param oncomplete: what to do when the write is safe and complete in memory\n on all replicas\n :type oncomplete: completion\n :param onsafe: what to do when the write is safe and complete on storage\n on all replicas\n :type onsafe: completion\n\n :raises: :class:`Error`\n :returns: completion object\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_13aio_write(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_object_name = 0; - PyObject *__pyx_v_to_write = 0; - PyObject *__pyx_v_offset = 0; - PyObject *__pyx_v_oncomplete = 0; - PyObject *__pyx_v_onsafe = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("aio_write (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_object_name,&__pyx_n_s_to_write,&__pyx_n_s_offset,&__pyx_n_s_oncomplete,&__pyx_n_s_onsafe,0}; - PyObject* values[5] = {0,0,0,0,0}; - values[2] = ((PyObject *)__pyx_int_0); - - /* "rados.pyx":1802 - * - * def aio_write(self, object_name, to_write, offset=0, - * oncomplete=None, onsafe=None): # <<<<<<<<<<<<<< - * """ - * Write data to an object asynchronously - */ - values[3] = ((PyObject *)Py_None); - values[4] = ((PyObject *)Py_None); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_object_name)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_to_write)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("aio_write", 0, 2, 5, 1); __PYX_ERR(0, 1801, __pyx_L3_error) - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_offset); - if (value) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_oncomplete); - if (value) { values[3] = value; kw_args--; } - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_onsafe); - if (value) { values[4] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "aio_write") < 0)) __PYX_ERR(0, 1801, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_object_name = values[0]; - __pyx_v_to_write = values[1]; - __pyx_v_offset = values[2]; - __pyx_v_oncomplete = values[3]; - __pyx_v_onsafe = values[4]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("aio_write", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1801, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Ioctx.aio_write", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Ioctx_12aio_write(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), __pyx_v_object_name, __pyx_v_to_write, __pyx_v_offset, __pyx_v_oncomplete, __pyx_v_onsafe); - - /* "rados.pyx":1801 - * return completion_obj - * - * def aio_write(self, object_name, to_write, offset=0, # <<<<<<<<<<<<<< - * oncomplete=None, onsafe=None): - * """ - */ - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_12aio_write(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_object_name, PyObject *__pyx_v_to_write, PyObject *__pyx_v_offset, PyObject *__pyx_v_oncomplete, PyObject *__pyx_v_onsafe) { - struct __pyx_obj_5rados_Completion *__pyx_v_completion = 0; - char *__pyx_v__object_name; - char *__pyx_v__to_write; - size_t __pyx_v_size; - uint64_t __pyx_v__offset; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - uint64_t __pyx_t_7; - int __pyx_t_8; - __Pyx_RefNannySetupContext("aio_write", 0); - __Pyx_INCREF(__pyx_v_object_name); - - /* "rados.pyx":1825 - * """ - * - * object_name = cstr(object_name, 'object_name') # <<<<<<<<<<<<<< - * - * cdef: - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1825, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1825, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_object_name); - __Pyx_GIVEREF(__pyx_v_object_name); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_object_name); - __Pyx_INCREF(__pyx_n_s_object_name); - __Pyx_GIVEREF(__pyx_n_s_object_name); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_object_name); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1825, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_object_name, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":1829 - * cdef: - * Completion completion - * char* _object_name = object_name # <<<<<<<<<<<<<< - * char* _to_write = to_write - * size_t size = len(to_write) - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_object_name); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 1829, __pyx_L1_error) - __pyx_v__object_name = __pyx_t_6; - - /* "rados.pyx":1830 - * Completion completion - * char* _object_name = object_name - * char* _to_write = to_write # <<<<<<<<<<<<<< - * size_t size = len(to_write) - * uint64_t _offset = offset - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_to_write); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 1830, __pyx_L1_error) - __pyx_v__to_write = __pyx_t_6; - - /* "rados.pyx":1831 - * char* _object_name = object_name - * char* _to_write = to_write - * size_t size = len(to_write) # <<<<<<<<<<<<<< - * uint64_t _offset = offset - * - */ - __pyx_t_4 = PyObject_Length(__pyx_v_to_write); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1831, __pyx_L1_error) - __pyx_v_size = __pyx_t_4; - - /* "rados.pyx":1832 - * char* _to_write = to_write - * size_t size = len(to_write) - * uint64_t _offset = offset # <<<<<<<<<<<<<< - * - * completion = self.__get_completion(oncomplete, onsafe) - */ - __pyx_t_7 = __Pyx_PyInt_As_uint64_t(__pyx_v_offset); if (unlikely((__pyx_t_7 == (uint64_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1832, __pyx_L1_error) - __pyx_v__offset = __pyx_t_7; - - /* "rados.pyx":1834 - * uint64_t _offset = offset - * - * completion = self.__get_completion(oncomplete, onsafe) # <<<<<<<<<<<<<< - * self.__track_completion(completion) - * with nogil: - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_completion); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_3 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL; - } - __Pyx_INCREF(__pyx_v_oncomplete); - __Pyx_GIVEREF(__pyx_v_oncomplete); - PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_4, __pyx_v_oncomplete); - __Pyx_INCREF(__pyx_v_onsafe); - __Pyx_GIVEREF(__pyx_v_onsafe); - PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_4, __pyx_v_onsafe); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5rados_Completion))))) __PYX_ERR(0, 1834, __pyx_L1_error) - __pyx_v_completion = ((struct __pyx_obj_5rados_Completion *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":1835 - * - * completion = self.__get_completion(oncomplete, onsafe) - * self.__track_completion(completion) # <<<<<<<<<<<<<< - * with nogil: - * ret = rados_aio_write(self.io, _object_name, completion.rados_comp, - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_track_completion); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1835, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (!__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_completion)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1835, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1835, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - __Pyx_INCREF(((PyObject *)__pyx_v_completion)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_completion)); - PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_completion)); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1835, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":1836 - * completion = self.__get_completion(oncomplete, onsafe) - * self.__track_completion(completion) - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_aio_write(self.io, _object_name, completion.rados_comp, - * _to_write, size, _offset) - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1837 - * self.__track_completion(completion) - * with nogil: - * ret = rados_aio_write(self.io, _object_name, completion.rados_comp, # <<<<<<<<<<<<<< - * _to_write, size, _offset) - * if ret < 0: - */ - __pyx_v_ret = rados_aio_write(__pyx_v_self->io, __pyx_v__object_name, __pyx_v_completion->rados_comp, __pyx_v__to_write, __pyx_v_size, __pyx_v__offset); - } - - /* "rados.pyx":1836 - * completion = self.__get_completion(oncomplete, onsafe) - * self.__track_completion(completion) - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_aio_write(self.io, _object_name, completion.rados_comp, - * _to_write, size, _offset) - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":1839 - * ret = rados_aio_write(self.io, _object_name, completion.rados_comp, - * _to_write, size, _offset) - * if ret < 0: # <<<<<<<<<<<<<< - * completion._cleanup() - * raise make_ex(ret, "error writing object %s" % object_name) - */ - __pyx_t_8 = ((__pyx_v_ret < 0) != 0); - if (__pyx_t_8) { - - /* "rados.pyx":1840 - * _to_write, size, _offset) - * if ret < 0: - * completion._cleanup() # <<<<<<<<<<<<<< - * raise make_ex(ret, "error writing object %s" % object_name) - * return completion - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_completion), __pyx_n_s_cleanup); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1840, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_5) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1840, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":1841 - * if ret < 0: - * completion._cleanup() - * raise make_ex(ret, "error writing object %s" % object_name) # <<<<<<<<<<<<<< - * return completion - * - */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1841, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_error_writing_object_s, __pyx_v_object_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1841, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __pyx_f_5rados_make_ex(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1841, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 1841, __pyx_L1_error) - - /* "rados.pyx":1839 - * ret = rados_aio_write(self.io, _object_name, completion.rados_comp, - * _to_write, size, _offset) - * if ret < 0: # <<<<<<<<<<<<<< - * completion._cleanup() - * raise make_ex(ret, "error writing object %s" % object_name) - */ - } - - /* "rados.pyx":1842 - * completion._cleanup() - * raise make_ex(ret, "error writing object %s" % object_name) - * return completion # <<<<<<<<<<<<<< - * - * def aio_write_full(self, object_name, to_write, - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_completion)); - __pyx_r = ((PyObject *)__pyx_v_completion); - goto __pyx_L0; - - /* "rados.pyx":1801 - * return completion_obj - * - * def aio_write(self, object_name, to_write, offset=0, # <<<<<<<<<<<<<< - * oncomplete=None, onsafe=None): - * """ - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.Ioctx.aio_write", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_completion); - __Pyx_XDECREF(__pyx_v_object_name); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1844 - * return completion - * - * def aio_write_full(self, object_name, to_write, # <<<<<<<<<<<<<< - * oncomplete=None, onsafe=None): - * """ - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_15aio_write_full(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_14aio_write_full[] = "Ioctx.aio_write_full(self, object_name, to_write, oncomplete=None, onsafe=None)\n\n Asychronously write an entire object\n\n The object is filled with the provided data. If the object exists,\n it is atomically truncated and then written.\n Queues the write and returns.\n\n :param object_name: name of the object\n :type object_name: str\n :param to_write: data to write\n :type to_write: str\n :param oncomplete: what to do when the write is safe and complete in memory\n on all replicas\n :type oncomplete: completion\n :param onsafe: what to do when the write is safe and complete on storage\n on all replicas\n :type onsafe: completion\n\n :raises: :class:`Error`\n :returns: completion object\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_15aio_write_full(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_object_name = 0; - PyObject *__pyx_v_to_write = 0; - PyObject *__pyx_v_oncomplete = 0; - PyObject *__pyx_v_onsafe = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("aio_write_full (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_object_name,&__pyx_n_s_to_write,&__pyx_n_s_oncomplete,&__pyx_n_s_onsafe,0}; - PyObject* values[4] = {0,0,0,0}; - - /* "rados.pyx":1845 - * - * def aio_write_full(self, object_name, to_write, - * oncomplete=None, onsafe=None): # <<<<<<<<<<<<<< - * """ - * Asychronously write an entire object - */ - values[2] = ((PyObject *)Py_None); - values[3] = ((PyObject *)Py_None); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_object_name)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_to_write)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("aio_write_full", 0, 2, 4, 1); __PYX_ERR(0, 1844, __pyx_L3_error) - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_oncomplete); - if (value) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_onsafe); - if (value) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "aio_write_full") < 0)) __PYX_ERR(0, 1844, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_object_name = values[0]; - __pyx_v_to_write = values[1]; - __pyx_v_oncomplete = values[2]; - __pyx_v_onsafe = values[3]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("aio_write_full", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1844, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Ioctx.aio_write_full", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Ioctx_14aio_write_full(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), __pyx_v_object_name, __pyx_v_to_write, __pyx_v_oncomplete, __pyx_v_onsafe); - - /* "rados.pyx":1844 - * return completion - * - * def aio_write_full(self, object_name, to_write, # <<<<<<<<<<<<<< - * oncomplete=None, onsafe=None): - * """ - */ - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_14aio_write_full(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_object_name, PyObject *__pyx_v_to_write, PyObject *__pyx_v_oncomplete, PyObject *__pyx_v_onsafe) { - struct __pyx_obj_5rados_Completion *__pyx_v_completion = 0; - char *__pyx_v__object_name; - char *__pyx_v__to_write; - size_t __pyx_v_size; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - int __pyx_t_7; - __Pyx_RefNannySetupContext("aio_write_full", 0); - __Pyx_INCREF(__pyx_v_object_name); - - /* "rados.pyx":1868 - * """ - * - * object_name = cstr(object_name, 'object_name') # <<<<<<<<<<<<<< - * - * cdef: - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1868, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1868, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_object_name); - __Pyx_GIVEREF(__pyx_v_object_name); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_object_name); - __Pyx_INCREF(__pyx_n_s_object_name); - __Pyx_GIVEREF(__pyx_n_s_object_name); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_object_name); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1868, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_object_name, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":1872 - * cdef: - * Completion completion - * char* _object_name = object_name # <<<<<<<<<<<<<< - * char* _to_write = to_write - * size_t size = len(to_write) - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_object_name); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 1872, __pyx_L1_error) - __pyx_v__object_name = __pyx_t_6; - - /* "rados.pyx":1873 - * Completion completion - * char* _object_name = object_name - * char* _to_write = to_write # <<<<<<<<<<<<<< - * size_t size = len(to_write) - * - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_to_write); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 1873, __pyx_L1_error) - __pyx_v__to_write = __pyx_t_6; - - /* "rados.pyx":1874 - * char* _object_name = object_name - * char* _to_write = to_write - * size_t size = len(to_write) # <<<<<<<<<<<<<< - * - * completion = self.__get_completion(oncomplete, onsafe) - */ - __pyx_t_4 = PyObject_Length(__pyx_v_to_write); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1874, __pyx_L1_error) - __pyx_v_size = __pyx_t_4; - - /* "rados.pyx":1876 - * size_t size = len(to_write) - * - * completion = self.__get_completion(oncomplete, onsafe) # <<<<<<<<<<<<<< - * self.__track_completion(completion) - * with nogil: - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_completion); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1876, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_3 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1876, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL; - } - __Pyx_INCREF(__pyx_v_oncomplete); - __Pyx_GIVEREF(__pyx_v_oncomplete); - PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_4, __pyx_v_oncomplete); - __Pyx_INCREF(__pyx_v_onsafe); - __Pyx_GIVEREF(__pyx_v_onsafe); - PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_4, __pyx_v_onsafe); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1876, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5rados_Completion))))) __PYX_ERR(0, 1876, __pyx_L1_error) - __pyx_v_completion = ((struct __pyx_obj_5rados_Completion *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":1877 - * - * completion = self.__get_completion(oncomplete, onsafe) - * self.__track_completion(completion) # <<<<<<<<<<<<<< - * with nogil: - * ret = rados_aio_write_full(self.io, _object_name, - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_track_completion); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1877, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (!__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_completion)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1877, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1877, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - __Pyx_INCREF(((PyObject *)__pyx_v_completion)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_completion)); - PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_completion)); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1877, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":1878 - * completion = self.__get_completion(oncomplete, onsafe) - * self.__track_completion(completion) - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_aio_write_full(self.io, _object_name, - * completion.rados_comp, - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1879 - * self.__track_completion(completion) - * with nogil: - * ret = rados_aio_write_full(self.io, _object_name, # <<<<<<<<<<<<<< - * completion.rados_comp, - * _to_write, size) - */ - __pyx_v_ret = rados_aio_write_full(__pyx_v_self->io, __pyx_v__object_name, __pyx_v_completion->rados_comp, __pyx_v__to_write, __pyx_v_size); - } - - /* "rados.pyx":1878 - * completion = self.__get_completion(oncomplete, onsafe) - * self.__track_completion(completion) - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_aio_write_full(self.io, _object_name, - * completion.rados_comp, - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":1882 - * completion.rados_comp, - * _to_write, size) - * if ret < 0: # <<<<<<<<<<<<<< - * completion._cleanup() - * raise make_ex(ret, "error writing object %s" % object_name) - */ - __pyx_t_7 = ((__pyx_v_ret < 0) != 0); - if (__pyx_t_7) { - - /* "rados.pyx":1883 - * _to_write, size) - * if ret < 0: - * completion._cleanup() # <<<<<<<<<<<<<< - * raise make_ex(ret, "error writing object %s" % object_name) - * return completion - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_completion), __pyx_n_s_cleanup); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1883, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_5) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1883, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1883, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":1884 - * if ret < 0: - * completion._cleanup() - * raise make_ex(ret, "error writing object %s" % object_name) # <<<<<<<<<<<<<< - * return completion - * - */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1884, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_error_writing_object_s, __pyx_v_object_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1884, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __pyx_f_5rados_make_ex(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1884, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 1884, __pyx_L1_error) - - /* "rados.pyx":1882 - * completion.rados_comp, - * _to_write, size) - * if ret < 0: # <<<<<<<<<<<<<< - * completion._cleanup() - * raise make_ex(ret, "error writing object %s" % object_name) - */ - } - - /* "rados.pyx":1885 - * completion._cleanup() - * raise make_ex(ret, "error writing object %s" % object_name) - * return completion # <<<<<<<<<<<<<< - * - * def aio_append(self, object_name, to_append, oncomplete=None, onsafe=None): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_completion)); - __pyx_r = ((PyObject *)__pyx_v_completion); - goto __pyx_L0; - - /* "rados.pyx":1844 - * return completion - * - * def aio_write_full(self, object_name, to_write, # <<<<<<<<<<<<<< - * oncomplete=None, onsafe=None): - * """ - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.Ioctx.aio_write_full", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_completion); - __Pyx_XDECREF(__pyx_v_object_name); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1887 - * return completion - * - * def aio_append(self, object_name, to_append, oncomplete=None, onsafe=None): # <<<<<<<<<<<<<< - * """ - * Asychronously append data to an object - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_17aio_append(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_16aio_append[] = "Ioctx.aio_append(self, object_name, to_append, oncomplete=None, onsafe=None)\n\n Asychronously append data to an object\n\n Queues the write and returns.\n\n :param object_name: name of the object\n :type object_name: str\n :param to_append: data to append\n :type to_append: str\n :param offset: byte offset in the object to begin writing at\n :type offset: int\n :param oncomplete: what to do when the write is safe and complete in memory\n on all replicas\n :type oncomplete: completion\n :param onsafe: what to do when the write is safe and complete on storage\n on all replicas\n :type onsafe: completion\n\n :raises: :class:`Error`\n :returns: completion object\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_17aio_append(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_object_name = 0; - PyObject *__pyx_v_to_append = 0; - PyObject *__pyx_v_oncomplete = 0; - PyObject *__pyx_v_onsafe = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("aio_append (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_object_name,&__pyx_n_s_to_append,&__pyx_n_s_oncomplete,&__pyx_n_s_onsafe,0}; - PyObject* values[4] = {0,0,0,0}; - values[2] = ((PyObject *)Py_None); - values[3] = ((PyObject *)Py_None); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_object_name)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_to_append)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("aio_append", 0, 2, 4, 1); __PYX_ERR(0, 1887, __pyx_L3_error) - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_oncomplete); - if (value) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_onsafe); - if (value) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "aio_append") < 0)) __PYX_ERR(0, 1887, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_object_name = values[0]; - __pyx_v_to_append = values[1]; - __pyx_v_oncomplete = values[2]; - __pyx_v_onsafe = values[3]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("aio_append", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1887, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Ioctx.aio_append", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Ioctx_16aio_append(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), __pyx_v_object_name, __pyx_v_to_append, __pyx_v_oncomplete, __pyx_v_onsafe); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_16aio_append(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_object_name, PyObject *__pyx_v_to_append, PyObject *__pyx_v_oncomplete, PyObject *__pyx_v_onsafe) { - struct __pyx_obj_5rados_Completion *__pyx_v_completion = 0; - char *__pyx_v__object_name; - char *__pyx_v__to_append; - size_t __pyx_v_size; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - int __pyx_t_7; - __Pyx_RefNannySetupContext("aio_append", 0); - __Pyx_INCREF(__pyx_v_object_name); - - /* "rados.pyx":1909 - * :returns: completion object - * """ - * object_name = cstr(object_name, 'object_name') # <<<<<<<<<<<<<< - * - * cdef: - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1909, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1909, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_object_name); - __Pyx_GIVEREF(__pyx_v_object_name); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_object_name); - __Pyx_INCREF(__pyx_n_s_object_name); - __Pyx_GIVEREF(__pyx_n_s_object_name); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_object_name); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1909, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_object_name, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":1913 - * cdef: - * Completion completion - * char* _object_name = object_name # <<<<<<<<<<<<<< - * char* _to_append = to_append - * size_t size = len(to_append) - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_object_name); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 1913, __pyx_L1_error) - __pyx_v__object_name = __pyx_t_6; - - /* "rados.pyx":1914 - * Completion completion - * char* _object_name = object_name - * char* _to_append = to_append # <<<<<<<<<<<<<< - * size_t size = len(to_append) - * - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_to_append); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 1914, __pyx_L1_error) - __pyx_v__to_append = __pyx_t_6; - - /* "rados.pyx":1915 - * char* _object_name = object_name - * char* _to_append = to_append - * size_t size = len(to_append) # <<<<<<<<<<<<<< - * - * completion = self.__get_completion(oncomplete, onsafe) - */ - __pyx_t_4 = PyObject_Length(__pyx_v_to_append); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1915, __pyx_L1_error) - __pyx_v_size = __pyx_t_4; - - /* "rados.pyx":1917 - * size_t size = len(to_append) - * - * completion = self.__get_completion(oncomplete, onsafe) # <<<<<<<<<<<<<< - * self.__track_completion(completion) - * with nogil: - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_completion); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1917, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_3 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1917, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL; - } - __Pyx_INCREF(__pyx_v_oncomplete); - __Pyx_GIVEREF(__pyx_v_oncomplete); - PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_4, __pyx_v_oncomplete); - __Pyx_INCREF(__pyx_v_onsafe); - __Pyx_GIVEREF(__pyx_v_onsafe); - PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_4, __pyx_v_onsafe); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1917, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5rados_Completion))))) __PYX_ERR(0, 1917, __pyx_L1_error) - __pyx_v_completion = ((struct __pyx_obj_5rados_Completion *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":1918 - * - * completion = self.__get_completion(oncomplete, onsafe) - * self.__track_completion(completion) # <<<<<<<<<<<<<< - * with nogil: - * ret = rados_aio_append(self.io, _object_name, - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_track_completion); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1918, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (!__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_completion)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1918, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1918, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - __Pyx_INCREF(((PyObject *)__pyx_v_completion)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_completion)); - PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_completion)); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1918, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":1919 - * completion = self.__get_completion(oncomplete, onsafe) - * self.__track_completion(completion) - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_aio_append(self.io, _object_name, - * completion.rados_comp, - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1920 - * self.__track_completion(completion) - * with nogil: - * ret = rados_aio_append(self.io, _object_name, # <<<<<<<<<<<<<< - * completion.rados_comp, - * _to_append, size) - */ - __pyx_v_ret = rados_aio_append(__pyx_v_self->io, __pyx_v__object_name, __pyx_v_completion->rados_comp, __pyx_v__to_append, __pyx_v_size); - } - - /* "rados.pyx":1919 - * completion = self.__get_completion(oncomplete, onsafe) - * self.__track_completion(completion) - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_aio_append(self.io, _object_name, - * completion.rados_comp, - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":1923 - * completion.rados_comp, - * _to_append, size) - * if ret < 0: # <<<<<<<<<<<<<< - * completion._cleanup() - * raise make_ex(ret, "error appending object %s" % object_name) - */ - __pyx_t_7 = ((__pyx_v_ret < 0) != 0); - if (__pyx_t_7) { - - /* "rados.pyx":1924 - * _to_append, size) - * if ret < 0: - * completion._cleanup() # <<<<<<<<<<<<<< - * raise make_ex(ret, "error appending object %s" % object_name) - * return completion - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_completion), __pyx_n_s_cleanup); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1924, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_5) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1924, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1924, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":1925 - * if ret < 0: - * completion._cleanup() - * raise make_ex(ret, "error appending object %s" % object_name) # <<<<<<<<<<<<<< - * return completion - * - */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1925, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_error_appending_object_s, __pyx_v_object_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1925, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __pyx_f_5rados_make_ex(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1925, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 1925, __pyx_L1_error) - - /* "rados.pyx":1923 - * completion.rados_comp, - * _to_append, size) - * if ret < 0: # <<<<<<<<<<<<<< - * completion._cleanup() - * raise make_ex(ret, "error appending object %s" % object_name) - */ - } - - /* "rados.pyx":1926 - * completion._cleanup() - * raise make_ex(ret, "error appending object %s" % object_name) - * return completion # <<<<<<<<<<<<<< - * - * def aio_flush(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_completion)); - __pyx_r = ((PyObject *)__pyx_v_completion); - goto __pyx_L0; - - /* "rados.pyx":1887 - * return completion - * - * def aio_append(self, object_name, to_append, oncomplete=None, onsafe=None): # <<<<<<<<<<<<<< - * """ - * Asychronously append data to an object - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.Ioctx.aio_append", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_completion); - __Pyx_XDECREF(__pyx_v_object_name); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1928 - * return completion - * - * def aio_flush(self): # <<<<<<<<<<<<<< - * """ - * Block until all pending writes in an io context are safe - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_19aio_flush(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_18aio_flush[] = "Ioctx.aio_flush(self)\n\n Block until all pending writes in an io context are safe\n\n :raises: :class:`Error`\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_19aio_flush(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("aio_flush (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_18aio_flush(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_18aio_flush(struct __pyx_obj_5rados_Ioctx *__pyx_v_self) { - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("aio_flush", 0); - - /* "rados.pyx":1934 - * :raises: :class:`Error` - * """ - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_aio_flush(self.io) - * if ret < 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1935 - * """ - * with nogil: - * ret = rados_aio_flush(self.io) # <<<<<<<<<<<<<< - * if ret < 0: - * raise make_ex(ret, "error flushing") - */ - __pyx_v_ret = rados_aio_flush(__pyx_v_self->io); - } - - /* "rados.pyx":1934 - * :raises: :class:`Error` - * """ - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_aio_flush(self.io) - * if ret < 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":1936 - * with nogil: - * ret = rados_aio_flush(self.io) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error flushing") - * - */ - __pyx_t_1 = ((__pyx_v_ret < 0) != 0); - if (__pyx_t_1) { - - /* "rados.pyx":1937 - * ret = rados_aio_flush(self.io) - * if ret < 0: - * raise make_ex(ret, "error flushing") # <<<<<<<<<<<<<< - * - * def aio_read(self, object_name, length, offset, oncomplete): - */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1937, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_f_5rados_make_ex(__pyx_t_2, __pyx_kp_s_error_flushing); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1937, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 1937, __pyx_L1_error) - - /* "rados.pyx":1936 - * with nogil: - * ret = rados_aio_flush(self.io) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error flushing") - * - */ - } - - /* "rados.pyx":1928 - * return completion - * - * def aio_flush(self): # <<<<<<<<<<<<<< - * """ - * Block until all pending writes in an io context are safe - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("rados.Ioctx.aio_flush", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1939 - * raise make_ex(ret, "error flushing") - * - * def aio_read(self, object_name, length, offset, oncomplete): # <<<<<<<<<<<<<< - * """ - * Asychronously read data from an object - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_21aio_read(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_20aio_read[] = "Ioctx.aio_read(self, object_name, length, offset, oncomplete)\n\n Asychronously read data from an object\n\n oncomplete will be called with the returned read value as\n well as the completion:\n\n oncomplete(completion, data_read)\n\n :param object_name: name of the object to read from\n :type object_name: str\n :param length: the number of bytes to read\n :type length: int\n :param offset: byte offset in the object to begin reading from\n :type offset: int\n :param oncomplete: what to do when the read is complete\n :type oncomplete: completion\n\n :raises: :class:`Error`\n :returns: completion object\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_21aio_read(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_object_name = 0; - PyObject *__pyx_v_length = 0; - PyObject *__pyx_v_offset = 0; - PyObject *__pyx_v_oncomplete = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("aio_read (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_object_name,&__pyx_n_s_length,&__pyx_n_s_offset,&__pyx_n_s_oncomplete,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_object_name)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_length)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("aio_read", 1, 4, 4, 1); __PYX_ERR(0, 1939, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_offset)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("aio_read", 1, 4, 4, 2); __PYX_ERR(0, 1939, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_oncomplete)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("aio_read", 1, 4, 4, 3); __PYX_ERR(0, 1939, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "aio_read") < 0)) __PYX_ERR(0, 1939, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_object_name = values[0]; - __pyx_v_length = values[1]; - __pyx_v_offset = values[2]; - __pyx_v_oncomplete = values[3]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("aio_read", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1939, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Ioctx.aio_read", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Ioctx_20aio_read(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), __pyx_v_object_name, __pyx_v_length, __pyx_v_offset, __pyx_v_oncomplete); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1971 - * size_t _length = length - * - * def oncomplete_(completion_v): # <<<<<<<<<<<<<< - * cdef Completion _completion_v = completion_v - * return_value = _completion_v.get_return_value() - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_8aio_read_1oncomplete_(PyObject *__pyx_self, PyObject *__pyx_v_completion_v); /*proto*/ -static PyMethodDef __pyx_mdef_5rados_5Ioctx_8aio_read_1oncomplete_ = {"oncomplete_", (PyCFunction)__pyx_pw_5rados_5Ioctx_8aio_read_1oncomplete_, METH_O, 0}; -static PyObject *__pyx_pw_5rados_5Ioctx_8aio_read_1oncomplete_(PyObject *__pyx_self, PyObject *__pyx_v_completion_v) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("oncomplete_ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_8aio_read_oncomplete_(__pyx_self, ((PyObject *)__pyx_v_completion_v)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_8aio_read_oncomplete_(PyObject *__pyx_self, PyObject *__pyx_v_completion_v) { - struct __pyx_obj_5rados___pyx_scope_struct_7_aio_read *__pyx_cur_scope; - struct __pyx_obj_5rados___pyx_scope_struct_7_aio_read *__pyx_outer_scope; - struct __pyx_obj_5rados_Completion *__pyx_v__completion_v = 0; - PyObject *__pyx_v_return_value = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - Py_ssize_t __pyx_t_6; - int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - __Pyx_RefNannySetupContext("oncomplete_", 0); - __pyx_outer_scope = (struct __pyx_obj_5rados___pyx_scope_struct_7_aio_read *) __Pyx_CyFunction_GetClosure(__pyx_self); - __pyx_cur_scope = __pyx_outer_scope; - - /* "rados.pyx":1972 - * - * def oncomplete_(completion_v): - * cdef Completion _completion_v = completion_v # <<<<<<<<<<<<<< - * return_value = _completion_v.get_return_value() - * if return_value > 0 and return_value != length: - */ - if (!(likely(((__pyx_v_completion_v) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_completion_v, __pyx_ptype_5rados_Completion))))) __PYX_ERR(0, 1972, __pyx_L1_error) - __pyx_t_1 = __pyx_v_completion_v; - __Pyx_INCREF(__pyx_t_1); - __pyx_v__completion_v = ((struct __pyx_obj_5rados_Completion *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":1973 - * def oncomplete_(completion_v): - * cdef Completion _completion_v = completion_v - * return_value = _completion_v.get_return_value() # <<<<<<<<<<<<<< - * if return_value > 0 and return_value != length: - * _PyBytes_Resize(&_completion_v.buf, return_value) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v__completion_v), __pyx_n_s_get_return_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1973, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1973, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1973, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_return_value = __pyx_t_1; - __pyx_t_1 = 0; - - /* "rados.pyx":1974 - * cdef Completion _completion_v = completion_v - * return_value = _completion_v.get_return_value() - * if return_value > 0 and return_value != length: # <<<<<<<<<<<<<< - * _PyBytes_Resize(&_completion_v.buf, return_value) - * return oncomplete(_completion_v, _completion_v.buf if return_value >= 0 else None) - */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_return_value, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1974, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1974, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_5) { - } else { - __pyx_t_4 = __pyx_t_5; - goto __pyx_L4_bool_binop_done; - } - if (unlikely(!__pyx_cur_scope->__pyx_v_length)) { __Pyx_RaiseClosureNameError("length"); __PYX_ERR(0, 1974, __pyx_L1_error) } - __pyx_t_1 = PyObject_RichCompare(__pyx_v_return_value, __pyx_cur_scope->__pyx_v_length, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1974, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1974, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __pyx_t_5; - __pyx_L4_bool_binop_done:; - if (__pyx_t_4) { - - /* "rados.pyx":1975 - * return_value = _completion_v.get_return_value() - * if return_value > 0 and return_value != length: - * _PyBytes_Resize(&_completion_v.buf, return_value) # <<<<<<<<<<<<<< - * return oncomplete(_completion_v, _completion_v.buf if return_value >= 0 else None) - * - */ - __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_return_value); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1975, __pyx_L1_error) - __pyx_t_7 = _PyBytes_Resize((&__pyx_v__completion_v->buf), __pyx_t_6); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 1975, __pyx_L1_error) - - /* "rados.pyx":1974 - * cdef Completion _completion_v = completion_v - * return_value = _completion_v.get_return_value() - * if return_value > 0 and return_value != length: # <<<<<<<<<<<<<< - * _PyBytes_Resize(&_completion_v.buf, return_value) - * return oncomplete(_completion_v, _completion_v.buf if return_value >= 0 else None) - */ - } - - /* "rados.pyx":1976 - * if return_value > 0 and return_value != length: - * _PyBytes_Resize(&_completion_v.buf, return_value) - * return oncomplete(_completion_v, _completion_v.buf if return_value >= 0 else None) # <<<<<<<<<<<<<< - * - * completion = self.__get_completion(oncomplete_, None) - */ - __Pyx_XDECREF(__pyx_r); - if (unlikely(!__pyx_cur_scope->__pyx_v_oncomplete)) { __Pyx_RaiseClosureNameError("oncomplete"); __PYX_ERR(0, 1976, __pyx_L1_error) } - __pyx_t_3 = PyObject_RichCompare(__pyx_v_return_value, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1976, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1976, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_4) { - __Pyx_INCREF(((PyObject *)__pyx_v__completion_v->buf)); - __pyx_t_2 = ((PyObject *)__pyx_v__completion_v->buf); - } else { - __Pyx_INCREF(Py_None); - __pyx_t_2 = Py_None; - } - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_oncomplete); - __pyx_t_3 = __pyx_cur_scope->__pyx_v_oncomplete; __pyx_t_8 = NULL; - __pyx_t_6 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_6 = 1; - } - } - __pyx_t_9 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1976, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - if (__pyx_t_8) { - __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; - } - __Pyx_INCREF(((PyObject *)__pyx_v__completion_v)); - __Pyx_GIVEREF(((PyObject *)__pyx_v__completion_v)); - PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_6, ((PyObject *)__pyx_v__completion_v)); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_6, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1976, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "rados.pyx":1971 - * size_t _length = length - * - * def oncomplete_(completion_v): # <<<<<<<<<<<<<< - * cdef Completion _completion_v = completion_v - * return_value = _completion_v.get_return_value() - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("rados.Ioctx.aio_read.oncomplete_", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v__completion_v); - __Pyx_XDECREF(__pyx_v_return_value); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1939 - * raise make_ex(ret, "error flushing") - * - * def aio_read(self, object_name, length, offset, oncomplete): # <<<<<<<<<<<<<< - * """ - * Asychronously read data from an object - */ - -static PyObject *__pyx_pf_5rados_5Ioctx_20aio_read(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_object_name, PyObject *__pyx_v_length, PyObject *__pyx_v_offset, PyObject *__pyx_v_oncomplete) { - struct __pyx_obj_5rados___pyx_scope_struct_7_aio_read *__pyx_cur_scope; - struct __pyx_obj_5rados_Completion *__pyx_v_completion = 0; - char *__pyx_v__object_name; - uint64_t __pyx_v__offset; - size_t __pyx_v__length; - PyObject *__pyx_v_oncomplete_ = 0; - char *__pyx_v_ret_buf; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - uint64_t __pyx_t_7; - size_t __pyx_t_8; - PyObject *__pyx_t_9; - int __pyx_t_10; - __Pyx_RefNannySetupContext("aio_read", 0); - __pyx_cur_scope = (struct __pyx_obj_5rados___pyx_scope_struct_7_aio_read *)__pyx_tp_new_5rados___pyx_scope_struct_7_aio_read(__pyx_ptype_5rados___pyx_scope_struct_7_aio_read, __pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __Pyx_RefNannyFinishContext(); - return NULL; - } - __Pyx_GOTREF(__pyx_cur_scope); - __pyx_cur_scope->__pyx_v_length = __pyx_v_length; - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_length); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_length); - __pyx_cur_scope->__pyx_v_oncomplete = __pyx_v_oncomplete; - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_oncomplete); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_oncomplete); - __Pyx_INCREF(__pyx_v_object_name); - - /* "rados.pyx":1961 - * """ - * - * object_name = cstr(object_name, 'object_name') # <<<<<<<<<<<<<< - * - * cdef: - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1961, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1961, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_object_name); - __Pyx_GIVEREF(__pyx_v_object_name); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_object_name); - __Pyx_INCREF(__pyx_n_s_object_name); - __Pyx_GIVEREF(__pyx_n_s_object_name); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_object_name); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1961, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_object_name, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":1965 - * cdef: - * Completion completion - * char* _object_name = object_name # <<<<<<<<<<<<<< - * uint64_t _offset = offset - * - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_object_name); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 1965, __pyx_L1_error) - __pyx_v__object_name = __pyx_t_6; - - /* "rados.pyx":1966 - * Completion completion - * char* _object_name = object_name - * uint64_t _offset = offset # <<<<<<<<<<<<<< - * - * char *ref_buf - */ - __pyx_t_7 = __Pyx_PyInt_As_uint64_t(__pyx_v_offset); if (unlikely((__pyx_t_7 == (uint64_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1966, __pyx_L1_error) - __pyx_v__offset = __pyx_t_7; - - /* "rados.pyx":1969 - * - * char *ref_buf - * size_t _length = length # <<<<<<<<<<<<<< - * - * def oncomplete_(completion_v): - */ - __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_cur_scope->__pyx_v_length); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1969, __pyx_L1_error) - __pyx_v__length = __pyx_t_8; - - /* "rados.pyx":1971 - * size_t _length = length - * - * def oncomplete_(completion_v): # <<<<<<<<<<<<<< - * cdef Completion _completion_v = completion_v - * return_value = _completion_v.get_return_value() - */ - __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5rados_5Ioctx_8aio_read_1oncomplete_, 0, __pyx_n_s_aio_read_locals_oncomplete, ((PyObject*)__pyx_cur_scope), __pyx_n_s_rados, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1971, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_oncomplete_ = __pyx_t_1; - __pyx_t_1 = 0; - - /* "rados.pyx":1978 - * return oncomplete(_completion_v, _completion_v.buf if return_value >= 0 else None) - * - * completion = self.__get_completion(oncomplete_, None) # <<<<<<<<<<<<<< - * completion.buf = PyBytes_FromStringAndSize(NULL, length) - * ret_buf = PyBytes_AsString(completion.buf) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_completion); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1978, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_3 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1978, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL; - } - __Pyx_INCREF(__pyx_v_oncomplete_); - __Pyx_GIVEREF(__pyx_v_oncomplete_); - PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_4, __pyx_v_oncomplete_); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_4, Py_None); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1978, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5rados_Completion))))) __PYX_ERR(0, 1978, __pyx_L1_error) - __pyx_v_completion = ((struct __pyx_obj_5rados_Completion *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":1979 - * - * completion = self.__get_completion(oncomplete_, None) - * completion.buf = PyBytes_FromStringAndSize(NULL, length) # <<<<<<<<<<<<<< - * ret_buf = PyBytes_AsString(completion.buf) - * self.__track_completion(completion) - */ - __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_cur_scope->__pyx_v_length); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1979, __pyx_L1_error) - __pyx_t_9 = PyBytes_FromStringAndSize(NULL, __pyx_t_4); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(0, 1979, __pyx_L1_error) - __pyx_v_completion->buf = __pyx_t_9; - - /* "rados.pyx":1980 - * completion = self.__get_completion(oncomplete_, None) - * completion.buf = PyBytes_FromStringAndSize(NULL, length) - * ret_buf = PyBytes_AsString(completion.buf) # <<<<<<<<<<<<<< - * self.__track_completion(completion) - * with nogil: - */ - __pyx_t_6 = PyBytes_AsString(__pyx_v_completion->buf); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(0, 1980, __pyx_L1_error) - __pyx_v_ret_buf = __pyx_t_6; - - /* "rados.pyx":1981 - * completion.buf = PyBytes_FromStringAndSize(NULL, length) - * ret_buf = PyBytes_AsString(completion.buf) - * self.__track_completion(completion) # <<<<<<<<<<<<<< - * with nogil: - * ret = rados_aio_read(self.io, _object_name, completion.rados_comp, - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_track_completion); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1981, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (!__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_completion)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1981, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1981, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - __Pyx_INCREF(((PyObject *)__pyx_v_completion)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_completion)); - PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_completion)); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1981, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":1982 - * ret_buf = PyBytes_AsString(completion.buf) - * self.__track_completion(completion) - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_aio_read(self.io, _object_name, completion.rados_comp, - * ret_buf, _length, _offset) - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":1983 - * self.__track_completion(completion) - * with nogil: - * ret = rados_aio_read(self.io, _object_name, completion.rados_comp, # <<<<<<<<<<<<<< - * ret_buf, _length, _offset) - * if ret < 0: - */ - __pyx_v_ret = rados_aio_read(__pyx_v_self->io, __pyx_v__object_name, __pyx_v_completion->rados_comp, __pyx_v_ret_buf, __pyx_v__length, __pyx_v__offset); - } - - /* "rados.pyx":1982 - * ret_buf = PyBytes_AsString(completion.buf) - * self.__track_completion(completion) - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_aio_read(self.io, _object_name, completion.rados_comp, - * ret_buf, _length, _offset) - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":1985 - * ret = rados_aio_read(self.io, _object_name, completion.rados_comp, - * ret_buf, _length, _offset) - * if ret < 0: # <<<<<<<<<<<<<< - * completion._cleanup() - * raise make_ex(ret, "error reading %s" % object_name) - */ - __pyx_t_10 = ((__pyx_v_ret < 0) != 0); - if (__pyx_t_10) { - - /* "rados.pyx":1986 - * ret_buf, _length, _offset) - * if ret < 0: - * completion._cleanup() # <<<<<<<<<<<<<< - * raise make_ex(ret, "error reading %s" % object_name) - * return completion - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_completion), __pyx_n_s_cleanup); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1986, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_5) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1986, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1986, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":1987 - * if ret < 0: - * completion._cleanup() - * raise make_ex(ret, "error reading %s" % object_name) # <<<<<<<<<<<<<< - * return completion - * - */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1987, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_error_reading_s, __pyx_v_object_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1987, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __pyx_f_5rados_make_ex(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1987, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 1987, __pyx_L1_error) - - /* "rados.pyx":1985 - * ret = rados_aio_read(self.io, _object_name, completion.rados_comp, - * ret_buf, _length, _offset) - * if ret < 0: # <<<<<<<<<<<<<< - * completion._cleanup() - * raise make_ex(ret, "error reading %s" % object_name) - */ - } - - /* "rados.pyx":1988 - * completion._cleanup() - * raise make_ex(ret, "error reading %s" % object_name) - * return completion # <<<<<<<<<<<<<< - * - * def aio_remove(self, object_name, oncomplete=None, onsafe=None): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_completion)); - __pyx_r = ((PyObject *)__pyx_v_completion); - goto __pyx_L0; - - /* "rados.pyx":1939 - * raise make_ex(ret, "error flushing") - * - * def aio_read(self, object_name, length, offset, oncomplete): # <<<<<<<<<<<<<< - * """ - * Asychronously read data from an object - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.Ioctx.aio_read", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_completion); - __Pyx_XDECREF(__pyx_v_oncomplete_); - __Pyx_XDECREF(__pyx_v_object_name); - __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":1990 - * return completion - * - * def aio_remove(self, object_name, oncomplete=None, onsafe=None): # <<<<<<<<<<<<<< - * """ - * Asychronously remove an object - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_23aio_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_22aio_remove[] = "Ioctx.aio_remove(self, object_name, oncomplete=None, onsafe=None)\n\n Asychronously remove an object\n\n :param object_name: name of the object to remove\n :type object_name: str\n :param oncomplete: what to do when the remove is safe and complete in memory\n on all replicas\n :type oncomplete: completion\n :param onsafe: what to do when the remove is safe and complete on storage\n on all replicas\n :type onsafe: completion\n\n :raises: :class:`Error`\n :returns: completion object\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_23aio_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_object_name = 0; - PyObject *__pyx_v_oncomplete = 0; - PyObject *__pyx_v_onsafe = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("aio_remove (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_object_name,&__pyx_n_s_oncomplete,&__pyx_n_s_onsafe,0}; - PyObject* values[3] = {0,0,0}; - values[1] = ((PyObject *)Py_None); - values[2] = ((PyObject *)Py_None); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_object_name)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_oncomplete); - if (value) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_onsafe); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "aio_remove") < 0)) __PYX_ERR(0, 1990, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_object_name = values[0]; - __pyx_v_oncomplete = values[1]; - __pyx_v_onsafe = values[2]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("aio_remove", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1990, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Ioctx.aio_remove", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Ioctx_22aio_remove(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), __pyx_v_object_name, __pyx_v_oncomplete, __pyx_v_onsafe); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_22aio_remove(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_object_name, PyObject *__pyx_v_oncomplete, PyObject *__pyx_v_onsafe) { - struct __pyx_obj_5rados_Completion *__pyx_v_completion = 0; - char *__pyx_v__object_name; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - int __pyx_t_7; - __Pyx_RefNannySetupContext("aio_remove", 0); - __Pyx_INCREF(__pyx_v_object_name); - - /* "rados.pyx":2006 - * :returns: completion object - * """ - * object_name = cstr(object_name, 'object_name') # <<<<<<<<<<<<<< - * - * cdef: - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2006, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2006, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_object_name); - __Pyx_GIVEREF(__pyx_v_object_name); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_object_name); - __Pyx_INCREF(__pyx_n_s_object_name); - __Pyx_GIVEREF(__pyx_n_s_object_name); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_object_name); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2006, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_object_name, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2010 - * cdef: - * Completion completion - * char* _object_name = object_name # <<<<<<<<<<<<<< - * - * completion = self.__get_completion(oncomplete, onsafe) - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_object_name); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2010, __pyx_L1_error) - __pyx_v__object_name = __pyx_t_6; - - /* "rados.pyx":2012 - * char* _object_name = object_name - * - * completion = self.__get_completion(oncomplete, onsafe) # <<<<<<<<<<<<<< - * self.__track_completion(completion) - * with nogil: - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_completion); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2012, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_3 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2012, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL; - } - __Pyx_INCREF(__pyx_v_oncomplete); - __Pyx_GIVEREF(__pyx_v_oncomplete); - PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_4, __pyx_v_oncomplete); - __Pyx_INCREF(__pyx_v_onsafe); - __Pyx_GIVEREF(__pyx_v_onsafe); - PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_4, __pyx_v_onsafe); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2012, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5rados_Completion))))) __PYX_ERR(0, 2012, __pyx_L1_error) - __pyx_v_completion = ((struct __pyx_obj_5rados_Completion *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2013 - * - * completion = self.__get_completion(oncomplete, onsafe) - * self.__track_completion(completion) # <<<<<<<<<<<<<< - * with nogil: - * ret = rados_aio_remove(self.io, _object_name, - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_track_completion); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2013, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (!__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_completion)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2013, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2013, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - __Pyx_INCREF(((PyObject *)__pyx_v_completion)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_completion)); - PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_completion)); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2013, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":2014 - * completion = self.__get_completion(oncomplete, onsafe) - * self.__track_completion(completion) - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_aio_remove(self.io, _object_name, - * completion.rados_comp) - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":2015 - * self.__track_completion(completion) - * with nogil: - * ret = rados_aio_remove(self.io, _object_name, # <<<<<<<<<<<<<< - * completion.rados_comp) - * if ret < 0: - */ - __pyx_v_ret = rados_aio_remove(__pyx_v_self->io, __pyx_v__object_name, __pyx_v_completion->rados_comp); - } - - /* "rados.pyx":2014 - * completion = self.__get_completion(oncomplete, onsafe) - * self.__track_completion(completion) - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_aio_remove(self.io, _object_name, - * completion.rados_comp) - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":2017 - * ret = rados_aio_remove(self.io, _object_name, - * completion.rados_comp) - * if ret < 0: # <<<<<<<<<<<<<< - * completion._cleanup() - * raise make_ex(ret, "error removing %s" % object_name) - */ - __pyx_t_7 = ((__pyx_v_ret < 0) != 0); - if (__pyx_t_7) { - - /* "rados.pyx":2018 - * completion.rados_comp) - * if ret < 0: - * completion._cleanup() # <<<<<<<<<<<<<< - * raise make_ex(ret, "error removing %s" % object_name) - * return completion - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_completion), __pyx_n_s_cleanup); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2018, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_5) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2018, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2018, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":2019 - * if ret < 0: - * completion._cleanup() - * raise make_ex(ret, "error removing %s" % object_name) # <<<<<<<<<<<<<< - * return completion - * - */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2019, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_error_removing_s, __pyx_v_object_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2019, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __pyx_f_5rados_make_ex(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2019, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 2019, __pyx_L1_error) - - /* "rados.pyx":2017 - * ret = rados_aio_remove(self.io, _object_name, - * completion.rados_comp) - * if ret < 0: # <<<<<<<<<<<<<< - * completion._cleanup() - * raise make_ex(ret, "error removing %s" % object_name) - */ - } - - /* "rados.pyx":2020 - * completion._cleanup() - * raise make_ex(ret, "error removing %s" % object_name) - * return completion # <<<<<<<<<<<<<< - * - * def require_ioctx_open(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_completion)); - __pyx_r = ((PyObject *)__pyx_v_completion); - goto __pyx_L0; - - /* "rados.pyx":1990 - * return completion - * - * def aio_remove(self, object_name, oncomplete=None, onsafe=None): # <<<<<<<<<<<<<< - * """ - * Asychronously remove an object - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.Ioctx.aio_remove", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_completion); - __Pyx_XDECREF(__pyx_v_object_name); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2022 - * return completion - * - * def require_ioctx_open(self): # <<<<<<<<<<<<<< - * """ - * Checks if the rados.Ioctx object state is 'open' - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_25require_ioctx_open(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_24require_ioctx_open[] = "Ioctx.require_ioctx_open(self)\n\n Checks if the rados.Ioctx object state is 'open'\n\n :raises: IoctxStateError\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_25require_ioctx_open(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("require_ioctx_open (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_24require_ioctx_open(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_24require_ioctx_open(struct __pyx_obj_5rados_Ioctx *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - __Pyx_RefNannySetupContext("require_ioctx_open", 0); - - /* "rados.pyx":2028 - * :raises: IoctxStateError - * """ - * if self.state != "open": # <<<<<<<<<<<<<< - * raise IoctxStateError("The pool is %s" % self.state) - * - */ - __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->state, __pyx_n_s_open, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 2028, __pyx_L1_error) - if (__pyx_t_1) { - - /* "rados.pyx":2029 - * """ - * if self.state != "open": - * raise IoctxStateError("The pool is %s" % self.state) # <<<<<<<<<<<<<< - * - * def change_auid(self, auid): - */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_IoctxStateError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2029, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_The_pool_is_s, __pyx_v_self->state); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2029, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - } - } - if (!__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2029, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2029, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2029, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2029, __pyx_L1_error) - - /* "rados.pyx":2028 - * :raises: IoctxStateError - * """ - * if self.state != "open": # <<<<<<<<<<<<<< - * raise IoctxStateError("The pool is %s" % self.state) - * - */ - } - - /* "rados.pyx":2022 - * return completion - * - * def require_ioctx_open(self): # <<<<<<<<<<<<<< - * """ - * Checks if the rados.Ioctx object state is 'open' - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("rados.Ioctx.require_ioctx_open", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2031 - * raise IoctxStateError("The pool is %s" % self.state) - * - * def change_auid(self, auid): # <<<<<<<<<<<<<< - * """ - * Attempt to change an io context's associated auid "owner." - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_27change_auid(PyObject *__pyx_v_self, PyObject *__pyx_v_auid); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_26change_auid[] = "Ioctx.change_auid(self, auid)\n\n Attempt to change an io context's associated auid \"owner.\"\n\n Requires that you have write permission on both the current and new\n auid.\n\n :raises: :class:`Error`\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_27change_auid(PyObject *__pyx_v_self, PyObject *__pyx_v_auid) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("change_auid (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_26change_auid(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), ((PyObject *)__pyx_v_auid)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_26change_auid(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_auid) { - uint64_t __pyx_v__auid; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - uint64_t __pyx_t_4; - int __pyx_t_5; - __Pyx_RefNannySetupContext("change_auid", 0); - - /* "rados.pyx":2040 - * :raises: :class:`Error` - * """ - * self.require_ioctx_open() # <<<<<<<<<<<<<< - * - * cdef: - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_ioctx_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2040, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2040, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2040, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":2043 - * - * cdef: - * uint64_t _auid = auid # <<<<<<<<<<<<<< - * - * with nogil: - */ - __pyx_t_4 = __Pyx_PyInt_As_uint64_t(__pyx_v_auid); if (unlikely((__pyx_t_4 == (uint64_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2043, __pyx_L1_error) - __pyx_v__auid = __pyx_t_4; - - /* "rados.pyx":2045 - * uint64_t _auid = auid - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_ioctx_pool_set_auid(self.io, _auid) - * if ret < 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":2046 - * - * with nogil: - * ret = rados_ioctx_pool_set_auid(self.io, _auid) # <<<<<<<<<<<<<< - * if ret < 0: - * raise make_ex(ret, "error changing auid of '%s' to %d" - */ - __pyx_v_ret = rados_ioctx_pool_set_auid(__pyx_v_self->io, __pyx_v__auid); - } - - /* "rados.pyx":2045 - * uint64_t _auid = auid - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_ioctx_pool_set_auid(self.io, _auid) - * if ret < 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":2047 - * with nogil: - * ret = rados_ioctx_pool_set_auid(self.io, _auid) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error changing auid of '%s' to %d" - * % (self.name, auid)) - */ - __pyx_t_5 = ((__pyx_v_ret < 0) != 0); - if (__pyx_t_5) { - - /* "rados.pyx":2048 - * ret = rados_ioctx_pool_set_auid(self.io, _auid) - * if ret < 0: - * raise make_ex(ret, "error changing auid of '%s' to %d" # <<<<<<<<<<<<<< - * % (self.name, auid)) - * - */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2048, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - - /* "rados.pyx":2049 - * if ret < 0: - * raise make_ex(ret, "error changing auid of '%s' to %d" - * % (self.name, auid)) # <<<<<<<<<<<<<< - * - * @requires(('loc_key', str_type)) - */ - __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2049, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2049, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); - __Pyx_INCREF(__pyx_v_auid); - __Pyx_GIVEREF(__pyx_v_auid); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_auid); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_error_changing_auid_of_s_to_d, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2049, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "rados.pyx":2048 - * ret = rados_ioctx_pool_set_auid(self.io, _auid) - * if ret < 0: - * raise make_ex(ret, "error changing auid of '%s' to %d" # <<<<<<<<<<<<<< - * % (self.name, auid)) - * - */ - __pyx_t_3 = __pyx_f_5rados_make_ex(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2048, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 2048, __pyx_L1_error) - - /* "rados.pyx":2047 - * with nogil: - * ret = rados_ioctx_pool_set_auid(self.io, _auid) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "error changing auid of '%s' to %d" - * % (self.name, auid)) - */ - } - - /* "rados.pyx":2031 - * raise IoctxStateError("The pool is %s" % self.state) - * - * def change_auid(self, auid): # <<<<<<<<<<<<<< - * """ - * Attempt to change an io context's associated auid "owner." - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("rados.Ioctx.change_auid", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2052 - * - * @requires(('loc_key', str_type)) - * def set_locator_key(self, loc_key): # <<<<<<<<<<<<<< - * """ - * Set the key for mapping objects to pgs within an io context. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_29set_locator_key(PyObject *__pyx_v_self, PyObject *__pyx_v_loc_key); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_28set_locator_key[] = "Ioctx.set_locator_key(self, loc_key)\n\n Set the key for mapping objects to pgs within an io context.\n\n The key is used instead of the object name to determine which\n placement groups an object is put in. This affects all subsequent\n operations of the io context - until a different locator key is\n set, all objects in this io context will be placed in the same pg.\n\n :param loc_key: the key to use as the object locator, or NULL to discard\n any previously set key\n :type loc_key: str\n\n :raises: :class:`TypeError`\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_29set_locator_key(PyObject *__pyx_v_self, PyObject *__pyx_v_loc_key) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("set_locator_key (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_28set_locator_key(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), ((PyObject *)__pyx_v_loc_key)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_28set_locator_key(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_loc_key) { - PyObject *__pyx_v_cloc_key = NULL; - char *__pyx_v__loc_key; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - __Pyx_RefNannySetupContext("set_locator_key", 0); - - /* "rados.pyx":2067 - * :raises: :class:`TypeError` - * """ - * self.require_ioctx_open() # <<<<<<<<<<<<<< - * cloc_key = cstr(loc_key, 'loc_key') - * cdef char *_loc_key = cloc_key - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_ioctx_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2067, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2067, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2067, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":2068 - * """ - * self.require_ioctx_open() - * cloc_key = cstr(loc_key, 'loc_key') # <<<<<<<<<<<<<< - * cdef char *_loc_key = cloc_key - * with nogil: - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2068, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2068, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_loc_key); - __Pyx_GIVEREF(__pyx_v_loc_key); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_loc_key); - __Pyx_INCREF(__pyx_n_s_loc_key); - __Pyx_GIVEREF(__pyx_n_s_loc_key); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_loc_key); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2068, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_cloc_key = __pyx_t_1; - __pyx_t_1 = 0; - - /* "rados.pyx":2069 - * self.require_ioctx_open() - * cloc_key = cstr(loc_key, 'loc_key') - * cdef char *_loc_key = cloc_key # <<<<<<<<<<<<<< - * with nogil: - * rados_ioctx_locator_set_key(self.io, _loc_key) - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_cloc_key); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2069, __pyx_L1_error) - __pyx_v__loc_key = __pyx_t_6; - - /* "rados.pyx":2070 - * cloc_key = cstr(loc_key, 'loc_key') - * cdef char *_loc_key = cloc_key - * with nogil: # <<<<<<<<<<<<<< - * rados_ioctx_locator_set_key(self.io, _loc_key) - * self.locator_key = loc_key - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":2071 - * cdef char *_loc_key = cloc_key - * with nogil: - * rados_ioctx_locator_set_key(self.io, _loc_key) # <<<<<<<<<<<<<< - * self.locator_key = loc_key - * - */ - rados_ioctx_locator_set_key(__pyx_v_self->io, __pyx_v__loc_key); - } - - /* "rados.pyx":2070 - * cloc_key = cstr(loc_key, 'loc_key') - * cdef char *_loc_key = cloc_key - * with nogil: # <<<<<<<<<<<<<< - * rados_ioctx_locator_set_key(self.io, _loc_key) - * self.locator_key = loc_key - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":2072 - * with nogil: - * rados_ioctx_locator_set_key(self.io, _loc_key) - * self.locator_key = loc_key # <<<<<<<<<<<<<< - * - * def get_locator_key(self): - */ - __Pyx_INCREF(__pyx_v_loc_key); - __Pyx_GIVEREF(__pyx_v_loc_key); - __Pyx_GOTREF(__pyx_v_self->locator_key); - __Pyx_DECREF(__pyx_v_self->locator_key); - __pyx_v_self->locator_key = __pyx_v_loc_key; - - /* "rados.pyx":2052 - * - * @requires(('loc_key', str_type)) - * def set_locator_key(self, loc_key): # <<<<<<<<<<<<<< - * """ - * Set the key for mapping objects to pgs within an io context. - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.Ioctx.set_locator_key", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_cloc_key); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2074 - * self.locator_key = loc_key - * - * def get_locator_key(self): # <<<<<<<<<<<<<< - * """ - * Get the locator_key of context - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_31get_locator_key(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_30get_locator_key[] = "Ioctx.get_locator_key(self)\n\n Get the locator_key of context\n\n :returns: locator_key\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_31get_locator_key(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("get_locator_key (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_30get_locator_key(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_30get_locator_key(struct __pyx_obj_5rados_Ioctx *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("get_locator_key", 0); - - /* "rados.pyx":2080 - * :returns: locator_key - * """ - * return self.locator_key # <<<<<<<<<<<<<< - * - * @requires(('snap_id', long)) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->locator_key); - __pyx_r = __pyx_v_self->locator_key; - goto __pyx_L0; - - /* "rados.pyx":2074 - * self.locator_key = loc_key - * - * def get_locator_key(self): # <<<<<<<<<<<<<< - * """ - * Get the locator_key of context - */ - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2083 - * - * @requires(('snap_id', long)) - * def set_read(self, snap_id): # <<<<<<<<<<<<<< - * """ - * Set the snapshot for reading objects. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_33set_read(PyObject *__pyx_v_self, PyObject *__pyx_v_snap_id); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_32set_read[] = "Ioctx.set_read(self, snap_id)\n\n Set the snapshot for reading objects.\n\n To stop to read from snapshot, use set_read(LIBRADOS_SNAP_HEAD)\n\n :param snap_id: the snapshot Id\n :type snap_id: int\n\n :raises: :class:`TypeError`\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_33set_read(PyObject *__pyx_v_self, PyObject *__pyx_v_snap_id) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("set_read (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_32set_read(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), ((PyObject *)__pyx_v_snap_id)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_32set_read(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_snap_id) { - rados_snap_t __pyx_v__snap_id; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - rados_snap_t __pyx_t_4; - __Pyx_RefNannySetupContext("set_read", 0); - - /* "rados.pyx":2094 - * :raises: :class:`TypeError` - * """ - * self.require_ioctx_open() # <<<<<<<<<<<<<< - * cdef rados_snap_t _snap_id = snap_id - * with nogil: - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_ioctx_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2094, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2094, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2094, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":2095 - * """ - * self.require_ioctx_open() - * cdef rados_snap_t _snap_id = snap_id # <<<<<<<<<<<<<< - * with nogil: - * rados_ioctx_snap_set_read(self.io, _snap_id) - */ - __pyx_t_4 = __Pyx_PyInt_As_uint64_t(__pyx_v_snap_id); if (unlikely((__pyx_t_4 == (rados_snap_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2095, __pyx_L1_error) - __pyx_v__snap_id = __pyx_t_4; - - /* "rados.pyx":2096 - * self.require_ioctx_open() - * cdef rados_snap_t _snap_id = snap_id - * with nogil: # <<<<<<<<<<<<<< - * rados_ioctx_snap_set_read(self.io, _snap_id) - * - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":2097 - * cdef rados_snap_t _snap_id = snap_id - * with nogil: - * rados_ioctx_snap_set_read(self.io, _snap_id) # <<<<<<<<<<<<<< - * - * @requires(('nspace', str_type)) - */ - rados_ioctx_snap_set_read(__pyx_v_self->io, __pyx_v__snap_id); - } - - /* "rados.pyx":2096 - * self.require_ioctx_open() - * cdef rados_snap_t _snap_id = snap_id - * with nogil: # <<<<<<<<<<<<<< - * rados_ioctx_snap_set_read(self.io, _snap_id) - * - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":2083 - * - * @requires(('snap_id', long)) - * def set_read(self, snap_id): # <<<<<<<<<<<<<< - * """ - * Set the snapshot for reading objects. - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("rados.Ioctx.set_read", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2100 - * - * @requires(('nspace', str_type)) - * def set_namespace(self, nspace): # <<<<<<<<<<<<<< - * """ - * Set the namespace for objects within an io context. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_35set_namespace(PyObject *__pyx_v_self, PyObject *__pyx_v_nspace); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_34set_namespace[] = "Ioctx.set_namespace(self, nspace)\n\n Set the namespace for objects within an io context.\n\n The namespace in addition to the object name fully identifies\n an object. This affects all subsequent operations of the io context\n - until a different namespace is set, all objects in this io context\n will be placed in the same namespace.\n\n :param nspace: the namespace to use, or None/\"\" for the default namespace\n :type nspace: str\n\n :raises: :class:`TypeError`\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_35set_namespace(PyObject *__pyx_v_self, PyObject *__pyx_v_nspace) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("set_namespace (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_34set_namespace(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), ((PyObject *)__pyx_v_nspace)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_34set_namespace(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_nspace) { - PyObject *__pyx_v_cnspace = NULL; - char *__pyx_v__nspace; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - Py_ssize_t __pyx_t_6; - PyObject *__pyx_t_7 = NULL; - char *__pyx_t_8; - __Pyx_RefNannySetupContext("set_namespace", 0); - __Pyx_INCREF(__pyx_v_nspace); - - /* "rados.pyx":2114 - * :raises: :class:`TypeError` - * """ - * self.require_ioctx_open() # <<<<<<<<<<<<<< - * if nspace is None: - * nspace = "" - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_ioctx_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2114, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2114, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2114, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":2115 - * """ - * self.require_ioctx_open() - * if nspace is None: # <<<<<<<<<<<<<< - * nspace = "" - * cnspace = cstr(nspace, 'nspace') - */ - __pyx_t_4 = (__pyx_v_nspace == Py_None); - __pyx_t_5 = (__pyx_t_4 != 0); - if (__pyx_t_5) { - - /* "rados.pyx":2116 - * self.require_ioctx_open() - * if nspace is None: - * nspace = "" # <<<<<<<<<<<<<< - * cnspace = cstr(nspace, 'nspace') - * cdef char *_nspace = cnspace - */ - __Pyx_INCREF(__pyx_kp_s__13); - __Pyx_DECREF_SET(__pyx_v_nspace, __pyx_kp_s__13); - - /* "rados.pyx":2115 - * """ - * self.require_ioctx_open() - * if nspace is None: # <<<<<<<<<<<<<< - * nspace = "" - * cnspace = cstr(nspace, 'nspace') - */ - } - - /* "rados.pyx":2117 - * if nspace is None: - * nspace = "" - * cnspace = cstr(nspace, 'nspace') # <<<<<<<<<<<<<< - * cdef char *_nspace = cnspace - * with nogil: - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2117, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_6 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_6 = 1; - } - } - __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2117, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_nspace); - __Pyx_GIVEREF(__pyx_v_nspace); - PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_nspace); - __Pyx_INCREF(__pyx_n_s_nspace); - __Pyx_GIVEREF(__pyx_n_s_nspace); - PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_n_s_nspace); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2117, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_cnspace = __pyx_t_1; - __pyx_t_1 = 0; - - /* "rados.pyx":2118 - * nspace = "" - * cnspace = cstr(nspace, 'nspace') - * cdef char *_nspace = cnspace # <<<<<<<<<<<<<< - * with nogil: - * rados_ioctx_set_namespace(self.io, _nspace) - */ - __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_cnspace); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 2118, __pyx_L1_error) - __pyx_v__nspace = __pyx_t_8; - - /* "rados.pyx":2119 - * cnspace = cstr(nspace, 'nspace') - * cdef char *_nspace = cnspace - * with nogil: # <<<<<<<<<<<<<< - * rados_ioctx_set_namespace(self.io, _nspace) - * self.nspace = nspace - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":2120 - * cdef char *_nspace = cnspace - * with nogil: - * rados_ioctx_set_namespace(self.io, _nspace) # <<<<<<<<<<<<<< - * self.nspace = nspace - * - */ - rados_ioctx_set_namespace(__pyx_v_self->io, __pyx_v__nspace); - } - - /* "rados.pyx":2119 - * cnspace = cstr(nspace, 'nspace') - * cdef char *_nspace = cnspace - * with nogil: # <<<<<<<<<<<<<< - * rados_ioctx_set_namespace(self.io, _nspace) - * self.nspace = nspace - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L6; - } - __pyx_L6:; - } - } - - /* "rados.pyx":2121 - * with nogil: - * rados_ioctx_set_namespace(self.io, _nspace) - * self.nspace = nspace # <<<<<<<<<<<<<< - * - * def get_namespace(self): - */ - __Pyx_INCREF(__pyx_v_nspace); - __Pyx_GIVEREF(__pyx_v_nspace); - __Pyx_GOTREF(__pyx_v_self->nspace); - __Pyx_DECREF(__pyx_v_self->nspace); - __pyx_v_self->nspace = __pyx_v_nspace; - - /* "rados.pyx":2100 - * - * @requires(('nspace', str_type)) - * def set_namespace(self, nspace): # <<<<<<<<<<<<<< - * """ - * Set the namespace for objects within an io context. - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("rados.Ioctx.set_namespace", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_cnspace); - __Pyx_XDECREF(__pyx_v_nspace); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2123 - * self.nspace = nspace - * - * def get_namespace(self): # <<<<<<<<<<<<<< - * """ - * Get the namespace of context - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_37get_namespace(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_36get_namespace[] = "Ioctx.get_namespace(self)\n\n Get the namespace of context\n\n :returns: namespace\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_37get_namespace(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("get_namespace (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_36get_namespace(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_36get_namespace(struct __pyx_obj_5rados_Ioctx *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("get_namespace", 0); - - /* "rados.pyx":2129 - * :returns: namespace - * """ - * return self.nspace # <<<<<<<<<<<<<< - * - * def close(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->nspace); - __pyx_r = __pyx_v_self->nspace; - goto __pyx_L0; - - /* "rados.pyx":2123 - * self.nspace = nspace - * - * def get_namespace(self): # <<<<<<<<<<<<<< - * """ - * Get the namespace of context - */ - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2131 - * return self.nspace - * - * def close(self): # <<<<<<<<<<<<<< - * """ - * Close a rados.Ioctx object. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_39close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_38close[] = "Ioctx.close(self)\n\n Close a rados.Ioctx object.\n\n This just tells librados that you no longer need to use the io context.\n It may not be freed immediately if there are pending asynchronous\n requests on it, but you should not use an io context again after\n calling this function on it.\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_39close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("close (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_38close(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_38close(struct __pyx_obj_5rados_Ioctx *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("close", 0); - - /* "rados.pyx":2140 - * calling this function on it. - * """ - * if self.state == "open": # <<<<<<<<<<<<<< - * self.require_ioctx_open() - * with nogil: - */ - __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->state, __pyx_n_s_open, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 2140, __pyx_L1_error) - if (__pyx_t_1) { - - /* "rados.pyx":2141 - * """ - * if self.state == "open": - * self.require_ioctx_open() # <<<<<<<<<<<<<< - * with nogil: - * rados_ioctx_destroy(self.io) - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_ioctx_open); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2141, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - } - } - if (__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2141, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2141, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":2142 - * if self.state == "open": - * self.require_ioctx_open() - * with nogil: # <<<<<<<<<<<<<< - * rados_ioctx_destroy(self.io) - * self.state = "closed" - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":2143 - * self.require_ioctx_open() - * with nogil: - * rados_ioctx_destroy(self.io) # <<<<<<<<<<<<<< - * self.state = "closed" - * - */ - rados_ioctx_destroy(__pyx_v_self->io); - } - - /* "rados.pyx":2142 - * if self.state == "open": - * self.require_ioctx_open() - * with nogil: # <<<<<<<<<<<<<< - * rados_ioctx_destroy(self.io) - * self.state = "closed" - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L6; - } - __pyx_L6:; - } - } - - /* "rados.pyx":2144 - * with nogil: - * rados_ioctx_destroy(self.io) - * self.state = "closed" # <<<<<<<<<<<<<< - * - * - */ - __Pyx_INCREF(__pyx_n_s_closed); - __Pyx_GIVEREF(__pyx_n_s_closed); - __Pyx_GOTREF(__pyx_v_self->state); - __Pyx_DECREF(__pyx_v_self->state); - __pyx_v_self->state = __pyx_n_s_closed; - - /* "rados.pyx":2140 - * calling this function on it. - * """ - * if self.state == "open": # <<<<<<<<<<<<<< - * self.require_ioctx_open() - * with nogil: - */ - } - - /* "rados.pyx":2131 - * return self.nspace - * - * def close(self): # <<<<<<<<<<<<<< - * """ - * Close a rados.Ioctx object. - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("rados.Ioctx.close", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2148 - * - * @requires(('key', str_type), ('data', bytes)) - * def write(self, key, data, offset=0): # <<<<<<<<<<<<<< - * """ - * Write data to an object synchronously - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_41write(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_40write[] = "Ioctx.write(self, key, data, offset=0)\n\n Write data to an object synchronously\n\n :param key: name of the object\n :type key: str\n :param data: data to write\n :type data: bytes\n :param offset: byte offset in the object to begin writing at\n :type offset: int\n\n :raises: :class:`TypeError`\n :raises: :class:`LogicError`\n :returns: int - 0 on success\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_41write(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_key = 0; - PyObject *__pyx_v_data = 0; - PyObject *__pyx_v_offset = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("write (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_data,&__pyx_n_s_offset,0}; - PyObject* values[3] = {0,0,0}; - values[2] = ((PyObject *)__pyx_int_0); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("write", 0, 2, 3, 1); __PYX_ERR(0, 2148, __pyx_L3_error) - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_offset); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write") < 0)) __PYX_ERR(0, 2148, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_key = values[0]; - __pyx_v_data = values[1]; - __pyx_v_offset = values[2]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("write", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2148, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Ioctx.write", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Ioctx_40write(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), __pyx_v_key, __pyx_v_data, __pyx_v_offset); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_40write(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_data, PyObject *__pyx_v_offset) { - char *__pyx_v__key; - char *__pyx_v__data; - size_t __pyx_v_length; - uint64_t __pyx_v__offset; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - uint64_t __pyx_t_7; - int __pyx_t_8; - PyObject *__pyx_t_9 = NULL; - __Pyx_RefNannySetupContext("write", 0); - __Pyx_INCREF(__pyx_v_key); - - /* "rados.pyx":2163 - * :returns: int - 0 on success - * """ - * self.require_ioctx_open() # <<<<<<<<<<<<<< - * - * key = cstr(key, 'key') - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_ioctx_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2163, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2163, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2163, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":2165 - * self.require_ioctx_open() - * - * key = cstr(key, 'key') # <<<<<<<<<<<<<< - * cdef: - * char *_key = key - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_key); - __Pyx_INCREF(__pyx_n_s_key); - __Pyx_GIVEREF(__pyx_n_s_key); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_key); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2167 - * key = cstr(key, 'key') - * cdef: - * char *_key = key # <<<<<<<<<<<<<< - * char *_data = data - * size_t length = len(data) - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_key); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2167, __pyx_L1_error) - __pyx_v__key = __pyx_t_6; - - /* "rados.pyx":2168 - * cdef: - * char *_key = key - * char *_data = data # <<<<<<<<<<<<<< - * size_t length = len(data) - * uint64_t _offset = offset - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_data); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2168, __pyx_L1_error) - __pyx_v__data = __pyx_t_6; - - /* "rados.pyx":2169 - * char *_key = key - * char *_data = data - * size_t length = len(data) # <<<<<<<<<<<<<< - * uint64_t _offset = offset - * - */ - __pyx_t_4 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 2169, __pyx_L1_error) - __pyx_v_length = __pyx_t_4; - - /* "rados.pyx":2170 - * char *_data = data - * size_t length = len(data) - * uint64_t _offset = offset # <<<<<<<<<<<<<< - * - * with nogil: - */ - __pyx_t_7 = __Pyx_PyInt_As_uint64_t(__pyx_v_offset); if (unlikely((__pyx_t_7 == (uint64_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2170, __pyx_L1_error) - __pyx_v__offset = __pyx_t_7; - - /* "rados.pyx":2172 - * uint64_t _offset = offset - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_write(self.io, _key, _data, length, _offset) - * if ret == 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":2173 - * - * with nogil: - * ret = rados_write(self.io, _key, _data, length, _offset) # <<<<<<<<<<<<<< - * if ret == 0: - * return ret - */ - __pyx_v_ret = rados_write(__pyx_v_self->io, __pyx_v__key, __pyx_v__data, __pyx_v_length, __pyx_v__offset); - } - - /* "rados.pyx":2172 - * uint64_t _offset = offset - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_write(self.io, _key, _data, length, _offset) - * if ret == 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":2174 - * with nogil: - * ret = rados_write(self.io, _key, _data, length, _offset) - * if ret == 0: # <<<<<<<<<<<<<< - * return ret - * elif ret < 0: - */ - __pyx_t_8 = ((__pyx_v_ret == 0) != 0); - if (__pyx_t_8) { - - /* "rados.pyx":2175 - * ret = rados_write(self.io, _key, _data, length, _offset) - * if ret == 0: - * return ret # <<<<<<<<<<<<<< - * elif ret < 0: - * raise make_ex(ret, "Ioctx.write(%s): failed to write %s" - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "rados.pyx":2174 - * with nogil: - * ret = rados_write(self.io, _key, _data, length, _offset) - * if ret == 0: # <<<<<<<<<<<<<< - * return ret - * elif ret < 0: - */ - } - - /* "rados.pyx":2176 - * if ret == 0: - * return ret - * elif ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Ioctx.write(%s): failed to write %s" - * % (self.name, key)) - */ - __pyx_t_8 = ((__pyx_v_ret < 0) != 0); - if (__pyx_t_8) { - - /* "rados.pyx":2177 - * return ret - * elif ret < 0: - * raise make_ex(ret, "Ioctx.write(%s): failed to write %s" # <<<<<<<<<<<<<< - * % (self.name, key)) - * else: - */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2177, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - - /* "rados.pyx":2178 - * elif ret < 0: - * raise make_ex(ret, "Ioctx.write(%s): failed to write %s" - * % (self.name, key)) # <<<<<<<<<<<<<< - * else: - * raise LogicError("Ioctx.write(%s): rados_write \ - */ - __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2178, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2178, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); - __Pyx_INCREF(__pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_key); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Ioctx_write_s_failed_to_write_s, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2178, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "rados.pyx":2177 - * return ret - * elif ret < 0: - * raise make_ex(ret, "Ioctx.write(%s): failed to write %s" # <<<<<<<<<<<<<< - * % (self.name, key)) - * else: - */ - __pyx_t_5 = __pyx_f_5rados_make_ex(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2177, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 2177, __pyx_L1_error) - - /* "rados.pyx":2176 - * if ret == 0: - * return ret - * elif ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Ioctx.write(%s): failed to write %s" - * % (self.name, key)) - */ - } - - /* "rados.pyx":2180 - * % (self.name, key)) - * else: - * raise LogicError("Ioctx.write(%s): rados_write \ # <<<<<<<<<<<<<< - * returned %d, but should return zero on success." % (self.name, ret)) - * - */ - /*else*/ { - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_LogicError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2180, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - - /* "rados.pyx":2181 - * else: - * raise LogicError("Ioctx.write(%s): rados_write \ - * returned %d, but should return zero on success." % (self.name, ret)) # <<<<<<<<<<<<<< - * - * @requires(('key', str_type), ('data', bytes)) - */ - __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_3); - __pyx_t_1 = 0; - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Ioctx_write_s_rados_write_return, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (!__pyx_t_9) { - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2180, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GOTREF(__pyx_t_5); - } else { - __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2180, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9); __pyx_t_9 = NULL; - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2180, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 2180, __pyx_L1_error) - } - - /* "rados.pyx":2148 - * - * @requires(('key', str_type), ('data', bytes)) - * def write(self, key, data, offset=0): # <<<<<<<<<<<<<< - * """ - * Write data to an object synchronously - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("rados.Ioctx.write", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_key); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2184 - * - * @requires(('key', str_type), ('data', bytes)) - * def write_full(self, key, data): # <<<<<<<<<<<<<< - * """ - * Write an entire object synchronously. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_43write_full(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_42write_full[] = "Ioctx.write_full(self, key, data)\n\n Write an entire object synchronously.\n\n The object is filled with the provided data. If the object exists,\n it is atomically truncated and then written.\n\n :param key: name of the object\n :type key: str\n :param data: data to write\n :type data: bytes\n\n :raises: :class:`TypeError`\n :raises: :class:`Error`\n :returns: int - 0 on success\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_43write_full(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_key = 0; - PyObject *__pyx_v_data = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("write_full (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_data,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("write_full", 1, 2, 2, 1); __PYX_ERR(0, 2184, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_full") < 0)) __PYX_ERR(0, 2184, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_key = values[0]; - __pyx_v_data = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("write_full", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2184, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Ioctx.write_full", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Ioctx_42write_full(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), __pyx_v_key, __pyx_v_data); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_42write_full(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_data) { - char *__pyx_v__key; - char *__pyx_v__data; - size_t __pyx_v_length; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - __Pyx_RefNannySetupContext("write_full", 0); - __Pyx_INCREF(__pyx_v_key); - - /* "rados.pyx":2200 - * :returns: int - 0 on success - * """ - * self.require_ioctx_open() # <<<<<<<<<<<<<< - * key = cstr(key, 'key') - * cdef: - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_ioctx_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2200, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2200, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2200, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":2201 - * """ - * self.require_ioctx_open() - * key = cstr(key, 'key') # <<<<<<<<<<<<<< - * cdef: - * char *_key = key - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_key); - __Pyx_INCREF(__pyx_n_s_key); - __Pyx_GIVEREF(__pyx_n_s_key); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_key); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2203 - * key = cstr(key, 'key') - * cdef: - * char *_key = key # <<<<<<<<<<<<<< - * char *_data = data - * size_t length = len(data) - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_key); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2203, __pyx_L1_error) - __pyx_v__key = __pyx_t_6; - - /* "rados.pyx":2204 - * cdef: - * char *_key = key - * char *_data = data # <<<<<<<<<<<<<< - * size_t length = len(data) - * - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_data); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2204, __pyx_L1_error) - __pyx_v__data = __pyx_t_6; - - /* "rados.pyx":2205 - * char *_key = key - * char *_data = data - * size_t length = len(data) # <<<<<<<<<<<<<< - * - * with nogil: - */ - __pyx_t_4 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 2205, __pyx_L1_error) - __pyx_v_length = __pyx_t_4; - - /* "rados.pyx":2207 - * size_t length = len(data) - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_write_full(self.io, _key, _data, length) - * if ret == 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":2208 - * - * with nogil: - * ret = rados_write_full(self.io, _key, _data, length) # <<<<<<<<<<<<<< - * if ret == 0: - * return ret - */ - __pyx_v_ret = rados_write_full(__pyx_v_self->io, __pyx_v__key, __pyx_v__data, __pyx_v_length); - } - - /* "rados.pyx":2207 - * size_t length = len(data) - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_write_full(self.io, _key, _data, length) - * if ret == 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":2209 - * with nogil: - * ret = rados_write_full(self.io, _key, _data, length) - * if ret == 0: # <<<<<<<<<<<<<< - * return ret - * elif ret < 0: - */ - __pyx_t_7 = ((__pyx_v_ret == 0) != 0); - if (__pyx_t_7) { - - /* "rados.pyx":2210 - * ret = rados_write_full(self.io, _key, _data, length) - * if ret == 0: - * return ret # <<<<<<<<<<<<<< - * elif ret < 0: - * raise make_ex(ret, "Ioctx.write_full(%s): failed to write %s" - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2210, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "rados.pyx":2209 - * with nogil: - * ret = rados_write_full(self.io, _key, _data, length) - * if ret == 0: # <<<<<<<<<<<<<< - * return ret - * elif ret < 0: - */ - } - - /* "rados.pyx":2211 - * if ret == 0: - * return ret - * elif ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Ioctx.write_full(%s): failed to write %s" - * % (self.name, key)) - */ - __pyx_t_7 = ((__pyx_v_ret < 0) != 0); - if (__pyx_t_7) { - - /* "rados.pyx":2212 - * return ret - * elif ret < 0: - * raise make_ex(ret, "Ioctx.write_full(%s): failed to write %s" # <<<<<<<<<<<<<< - * % (self.name, key)) - * else: - */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2212, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - - /* "rados.pyx":2213 - * elif ret < 0: - * raise make_ex(ret, "Ioctx.write_full(%s): failed to write %s" - * % (self.name, key)) # <<<<<<<<<<<<<< - * else: - * raise LogicError("Ioctx.write_full(%s): rados_write_full \ - */ - __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2213, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2213, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); - __Pyx_INCREF(__pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_key); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Ioctx_write_full_s_failed_to_wri, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2213, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "rados.pyx":2212 - * return ret - * elif ret < 0: - * raise make_ex(ret, "Ioctx.write_full(%s): failed to write %s" # <<<<<<<<<<<<<< - * % (self.name, key)) - * else: - */ - __pyx_t_5 = __pyx_f_5rados_make_ex(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2212, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 2212, __pyx_L1_error) - - /* "rados.pyx":2211 - * if ret == 0: - * return ret - * elif ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Ioctx.write_full(%s): failed to write %s" - * % (self.name, key)) - */ - } - - /* "rados.pyx":2215 - * % (self.name, key)) - * else: - * raise LogicError("Ioctx.write_full(%s): rados_write_full \ # <<<<<<<<<<<<<< - * returned %d, but should return zero on success." % (self.name, ret)) - * - */ - /*else*/ { - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_LogicError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - - /* "rados.pyx":2216 - * else: - * raise LogicError("Ioctx.write_full(%s): rados_write_full \ - * returned %d, but should return zero on success." % (self.name, ret)) # <<<<<<<<<<<<<< - * - * @requires(('key', str_type), ('data', bytes)) - */ - __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3); - __pyx_t_1 = 0; - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Ioctx_write_full_s_rados_write_f, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (!__pyx_t_8) { - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2215, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GOTREF(__pyx_t_5); - } else { - __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8); __pyx_t_8 = NULL; - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 2215, __pyx_L1_error) - } - - /* "rados.pyx":2184 - * - * @requires(('key', str_type), ('data', bytes)) - * def write_full(self, key, data): # <<<<<<<<<<<<<< - * """ - * Write an entire object synchronously. - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("rados.Ioctx.write_full", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_key); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2219 - * - * @requires(('key', str_type), ('data', bytes)) - * def append(self, key, data): # <<<<<<<<<<<<<< - * """ - * Append data to an object synchronously - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_45append(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_44append[] = "Ioctx.append(self, key, data)\n\n Append data to an object synchronously\n\n :param key: name of the object\n :type key: str\n :param data: data to write\n :type data: bytes\n\n :raises: :class:`TypeError`\n :raises: :class:`LogicError`\n :returns: int - 0 on success\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_45append(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_key = 0; - PyObject *__pyx_v_data = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("append (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_data,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("append", 1, 2, 2, 1); __PYX_ERR(0, 2219, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "append") < 0)) __PYX_ERR(0, 2219, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_key = values[0]; - __pyx_v_data = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("append", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2219, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Ioctx.append", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Ioctx_44append(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), __pyx_v_key, __pyx_v_data); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_44append(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_data) { - char *__pyx_v__key; - char *__pyx_v__data; - size_t __pyx_v_length; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - __Pyx_RefNannySetupContext("append", 0); - __Pyx_INCREF(__pyx_v_key); - - /* "rados.pyx":2232 - * :returns: int - 0 on success - * """ - * self.require_ioctx_open() # <<<<<<<<<<<<<< - * key = cstr(key, 'key') - * cdef: - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_ioctx_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2232, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2232, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2232, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":2233 - * """ - * self.require_ioctx_open() - * key = cstr(key, 'key') # <<<<<<<<<<<<<< - * cdef: - * char *_key = key - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2233, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2233, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_key); - __Pyx_INCREF(__pyx_n_s_key); - __Pyx_GIVEREF(__pyx_n_s_key); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_key); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2233, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2235 - * key = cstr(key, 'key') - * cdef: - * char *_key = key # <<<<<<<<<<<<<< - * char *_data = data - * size_t length = len(data) - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_key); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2235, __pyx_L1_error) - __pyx_v__key = __pyx_t_6; - - /* "rados.pyx":2236 - * cdef: - * char *_key = key - * char *_data = data # <<<<<<<<<<<<<< - * size_t length = len(data) - * - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_data); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2236, __pyx_L1_error) - __pyx_v__data = __pyx_t_6; - - /* "rados.pyx":2237 - * char *_key = key - * char *_data = data - * size_t length = len(data) # <<<<<<<<<<<<<< - * - * with nogil: - */ - __pyx_t_4 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 2237, __pyx_L1_error) - __pyx_v_length = __pyx_t_4; - - /* "rados.pyx":2239 - * size_t length = len(data) - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_append(self.io, _key, _data, length) - * if ret == 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":2240 - * - * with nogil: - * ret = rados_append(self.io, _key, _data, length) # <<<<<<<<<<<<<< - * if ret == 0: - * return ret - */ - __pyx_v_ret = rados_append(__pyx_v_self->io, __pyx_v__key, __pyx_v__data, __pyx_v_length); - } - - /* "rados.pyx":2239 - * size_t length = len(data) - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_append(self.io, _key, _data, length) - * if ret == 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":2241 - * with nogil: - * ret = rados_append(self.io, _key, _data, length) - * if ret == 0: # <<<<<<<<<<<<<< - * return ret - * elif ret < 0: - */ - __pyx_t_7 = ((__pyx_v_ret == 0) != 0); - if (__pyx_t_7) { - - /* "rados.pyx":2242 - * ret = rados_append(self.io, _key, _data, length) - * if ret == 0: - * return ret # <<<<<<<<<<<<<< - * elif ret < 0: - * raise make_ex(ret, "Ioctx.append(%s): failed to append %s" - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "rados.pyx":2241 - * with nogil: - * ret = rados_append(self.io, _key, _data, length) - * if ret == 0: # <<<<<<<<<<<<<< - * return ret - * elif ret < 0: - */ - } - - /* "rados.pyx":2243 - * if ret == 0: - * return ret - * elif ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Ioctx.append(%s): failed to append %s" - * % (self.name, key)) - */ - __pyx_t_7 = ((__pyx_v_ret < 0) != 0); - if (__pyx_t_7) { - - /* "rados.pyx":2244 - * return ret - * elif ret < 0: - * raise make_ex(ret, "Ioctx.append(%s): failed to append %s" # <<<<<<<<<<<<<< - * % (self.name, key)) - * else: - */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2244, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - - /* "rados.pyx":2245 - * elif ret < 0: - * raise make_ex(ret, "Ioctx.append(%s): failed to append %s" - * % (self.name, key)) # <<<<<<<<<<<<<< - * else: - * raise LogicError("Ioctx.append(%s): rados_append \ - */ - __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); - __Pyx_INCREF(__pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_key); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Ioctx_append_s_failed_to_append, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "rados.pyx":2244 - * return ret - * elif ret < 0: - * raise make_ex(ret, "Ioctx.append(%s): failed to append %s" # <<<<<<<<<<<<<< - * % (self.name, key)) - * else: - */ - __pyx_t_5 = __pyx_f_5rados_make_ex(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2244, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 2244, __pyx_L1_error) - - /* "rados.pyx":2243 - * if ret == 0: - * return ret - * elif ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Ioctx.append(%s): failed to append %s" - * % (self.name, key)) - */ - } - - /* "rados.pyx":2247 - * % (self.name, key)) - * else: - * raise LogicError("Ioctx.append(%s): rados_append \ # <<<<<<<<<<<<<< - * returned %d, but should return zero on success." % (self.name, ret)) - * - */ - /*else*/ { - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_LogicError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2247, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - - /* "rados.pyx":2248 - * else: - * raise LogicError("Ioctx.append(%s): rados_append \ - * returned %d, but should return zero on success." % (self.name, ret)) # <<<<<<<<<<<<<< - * - * @requires(('key', str_type)) - */ - __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2248, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2248, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2248, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3); - __pyx_t_1 = 0; - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Ioctx_append_s_rados_append_retu, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2248, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (!__pyx_t_8) { - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2247, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GOTREF(__pyx_t_5); - } else { - __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2247, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8); __pyx_t_8 = NULL; - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2247, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 2247, __pyx_L1_error) - } - - /* "rados.pyx":2219 - * - * @requires(('key', str_type), ('data', bytes)) - * def append(self, key, data): # <<<<<<<<<<<<<< - * """ - * Append data to an object synchronously - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("rados.Ioctx.append", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_key); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2251 - * - * @requires(('key', str_type)) - * def read(self, key, length=8192, offset=0): # <<<<<<<<<<<<<< - * """ - * Read data from an object synchronously - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_47read(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_46read[] = "Ioctx.read(self, key, length=8192, offset=0)\n\n Read data from an object synchronously\n\n :param key: name of the object\n :type key: str\n :param length: the number of bytes to read (default=8192)\n :type length: int\n :param offset: byte offset in the object to begin reading at\n :type offset: int\n\n :raises: :class:`TypeError`\n :raises: :class:`Error`\n :returns: str - data read from object\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_47read(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_key = 0; - PyObject *__pyx_v_length = 0; - PyObject *__pyx_v_offset = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("read (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_length,&__pyx_n_s_offset,0}; - PyObject* values[3] = {0,0,0}; - values[1] = ((PyObject *)__pyx_int_8192); - values[2] = ((PyObject *)__pyx_int_0); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_length); - if (value) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_offset); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read") < 0)) __PYX_ERR(0, 2251, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_key = values[0]; - __pyx_v_length = values[1]; - __pyx_v_offset = values[2]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("read", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2251, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Ioctx.read", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Ioctx_46read(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), __pyx_v_key, __pyx_v_length, __pyx_v_offset); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_46read(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_length, PyObject *__pyx_v_offset) { - char *__pyx_v__key; - char *__pyx_v_ret_buf; - uint64_t __pyx_v__offset; - size_t __pyx_v__length; - PyObject *__pyx_v_ret_s; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - uint64_t __pyx_t_7; - size_t __pyx_t_8; - PyObject *__pyx_t_9; - int __pyx_t_10; - int __pyx_t_11; - int __pyx_t_12; - char const *__pyx_t_13; - PyObject *__pyx_t_14 = NULL; - PyObject *__pyx_t_15 = NULL; - PyObject *__pyx_t_16 = NULL; - PyObject *__pyx_t_17 = NULL; - PyObject *__pyx_t_18 = NULL; - PyObject *__pyx_t_19 = NULL; - __Pyx_RefNannySetupContext("read", 0); - __Pyx_INCREF(__pyx_v_key); - - /* "rados.pyx":2266 - * :returns: str - data read from object - * """ - * self.require_ioctx_open() # <<<<<<<<<<<<<< - * key = cstr(key, 'key') - * cdef: - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_ioctx_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2266, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2266, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2266, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":2267 - * """ - * self.require_ioctx_open() - * key = cstr(key, 'key') # <<<<<<<<<<<<<< - * cdef: - * char *_key = key - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2267, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2267, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_key); - __Pyx_INCREF(__pyx_n_s_key); - __Pyx_GIVEREF(__pyx_n_s_key); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_key); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2267, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2269 - * key = cstr(key, 'key') - * cdef: - * char *_key = key # <<<<<<<<<<<<<< - * char *ret_buf - * uint64_t _offset = offset - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_key); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2269, __pyx_L1_error) - __pyx_v__key = __pyx_t_6; - - /* "rados.pyx":2271 - * char *_key = key - * char *ret_buf - * uint64_t _offset = offset # <<<<<<<<<<<<<< - * size_t _length = length - * PyObject* ret_s = NULL - */ - __pyx_t_7 = __Pyx_PyInt_As_uint64_t(__pyx_v_offset); if (unlikely((__pyx_t_7 == (uint64_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2271, __pyx_L1_error) - __pyx_v__offset = __pyx_t_7; - - /* "rados.pyx":2272 - * char *ret_buf - * uint64_t _offset = offset - * size_t _length = length # <<<<<<<<<<<<<< - * PyObject* ret_s = NULL - * - */ - __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_v_length); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2272, __pyx_L1_error) - __pyx_v__length = __pyx_t_8; - - /* "rados.pyx":2273 - * uint64_t _offset = offset - * size_t _length = length - * PyObject* ret_s = NULL # <<<<<<<<<<<<<< - * - * ret_s = PyBytes_FromStringAndSize(NULL, length) - */ - __pyx_v_ret_s = NULL; - - /* "rados.pyx":2275 - * PyObject* ret_s = NULL - * - * ret_s = PyBytes_FromStringAndSize(NULL, length) # <<<<<<<<<<<<<< - * try: - * ret_buf = PyBytes_AsString(ret_s) - */ - __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_v_length); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2275, __pyx_L1_error) - __pyx_t_9 = PyBytes_FromStringAndSize(NULL, __pyx_t_4); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(0, 2275, __pyx_L1_error) - __pyx_v_ret_s = __pyx_t_9; - - /* "rados.pyx":2276 - * - * ret_s = PyBytes_FromStringAndSize(NULL, length) - * try: # <<<<<<<<<<<<<< - * ret_buf = PyBytes_AsString(ret_s) - * with nogil: - */ - /*try:*/ { - - /* "rados.pyx":2277 - * ret_s = PyBytes_FromStringAndSize(NULL, length) - * try: - * ret_buf = PyBytes_AsString(ret_s) # <<<<<<<<<<<<<< - * with nogil: - * ret = rados_read(self.io, _key, ret_buf, _length, _offset) - */ - __pyx_t_6 = PyBytes_AsString(__pyx_v_ret_s); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(0, 2277, __pyx_L4_error) - __pyx_v_ret_buf = __pyx_t_6; - - /* "rados.pyx":2278 - * try: - * ret_buf = PyBytes_AsString(ret_s) - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_read(self.io, _key, ret_buf, _length, _offset) - * if ret < 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":2279 - * ret_buf = PyBytes_AsString(ret_s) - * with nogil: - * ret = rados_read(self.io, _key, ret_buf, _length, _offset) # <<<<<<<<<<<<<< - * if ret < 0: - * raise make_ex(ret, "Ioctx.read(%s): failed to read %s" % (self.name, key)) - */ - __pyx_v_ret = rados_read(__pyx_v_self->io, __pyx_v__key, __pyx_v_ret_buf, __pyx_v__length, __pyx_v__offset); - } - - /* "rados.pyx":2278 - * try: - * ret_buf = PyBytes_AsString(ret_s) - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_read(self.io, _key, ret_buf, _length, _offset) - * if ret < 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L8; - } - __pyx_L8:; - } - } - - /* "rados.pyx":2280 - * with nogil: - * ret = rados_read(self.io, _key, ret_buf, _length, _offset) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Ioctx.read(%s): failed to read %s" % (self.name, key)) - * - */ - __pyx_t_10 = ((__pyx_v_ret < 0) != 0); - if (__pyx_t_10) { - - /* "rados.pyx":2281 - * ret = rados_read(self.io, _key, ret_buf, _length, _offset) - * if ret < 0: - * raise make_ex(ret, "Ioctx.read(%s): failed to read %s" % (self.name, key)) # <<<<<<<<<<<<<< - * - * if ret != length: - */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2281, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2281, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2281, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); - __Pyx_INCREF(__pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_key); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Ioctx_read_s_failed_to_read_s, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2281, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __pyx_f_5rados_make_ex(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2281, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 2281, __pyx_L4_error) - - /* "rados.pyx":2280 - * with nogil: - * ret = rados_read(self.io, _key, ret_buf, _length, _offset) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Ioctx.read(%s): failed to read %s" % (self.name, key)) - * - */ - } - - /* "rados.pyx":2283 - * raise make_ex(ret, "Ioctx.read(%s): failed to read %s" % (self.name, key)) - * - * if ret != length: # <<<<<<<<<<<<<< - * _PyBytes_Resize(&ret_s, ret) - * - */ - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2283, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_5, __pyx_v_length, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2283, __pyx_L4_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 2283, __pyx_L4_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_10) { - - /* "rados.pyx":2284 - * - * if ret != length: - * _PyBytes_Resize(&ret_s, ret) # <<<<<<<<<<<<<< - * - * return ret_s - */ - __pyx_t_11 = _PyBytes_Resize((&__pyx_v_ret_s), __pyx_v_ret); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 2284, __pyx_L4_error) - - /* "rados.pyx":2283 - * raise make_ex(ret, "Ioctx.read(%s): failed to read %s" % (self.name, key)) - * - * if ret != length: # <<<<<<<<<<<<<< - * _PyBytes_Resize(&ret_s, ret) - * - */ - } - - /* "rados.pyx":2286 - * _PyBytes_Resize(&ret_s, ret) - * - * return ret_s # <<<<<<<<<<<<<< - * finally: - * # We DECREF unconditionally: the cast to object above will have - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_ret_s)); - __pyx_r = ((PyObject *)__pyx_v_ret_s); - goto __pyx_L3_return; - } - - /* "rados.pyx":2292 - * # including if _PyString_Resize fails (that will free the string - * # itself and set ret_s to NULL, hence XDECREF). - * ref.Py_XDECREF(ret_s) # <<<<<<<<<<<<<< - * - * @requires(('key', str_type), ('cls', str_type), ('method', str_type), ('data', bytes)) - */ - /*finally:*/ { - /*exception exit:*/{ - __Pyx_PyThreadState_declare - __pyx_L4_error:; - __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; - __Pyx_PyThreadState_assign - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); - if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); - __Pyx_XGOTREF(__pyx_t_14); - __Pyx_XGOTREF(__pyx_t_15); - __Pyx_XGOTREF(__pyx_t_16); - __Pyx_XGOTREF(__pyx_t_17); - __Pyx_XGOTREF(__pyx_t_18); - __Pyx_XGOTREF(__pyx_t_19); - __pyx_t_11 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename; - { - Py_XDECREF(__pyx_v_ret_s); - } - __Pyx_PyThreadState_assign - if (PY_MAJOR_VERSION >= 3) { - __Pyx_XGIVEREF(__pyx_t_17); - __Pyx_XGIVEREF(__pyx_t_18); - __Pyx_XGIVEREF(__pyx_t_19); - __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19); - } - __Pyx_XGIVEREF(__pyx_t_14); - __Pyx_XGIVEREF(__pyx_t_15); - __Pyx_XGIVEREF(__pyx_t_16); - __Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16); - __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; - __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13; - goto __pyx_L1_error; - } - __pyx_L3_return: { - __pyx_t_19 = __pyx_r; - __pyx_r = 0; - Py_XDECREF(__pyx_v_ret_s); - __pyx_r = __pyx_t_19; - __pyx_t_19 = 0; - goto __pyx_L0; - } - } - - /* "rados.pyx":2251 - * - * @requires(('key', str_type)) - * def read(self, key, length=8192, offset=0): # <<<<<<<<<<<<<< - * """ - * Read data from an object synchronously - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.Ioctx.read", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_key); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2295 - * - * @requires(('key', str_type), ('cls', str_type), ('method', str_type), ('data', bytes)) - * def execute(self, key, cls, method, data, length=8192): # <<<<<<<<<<<<<< - * """ - * Execute an OSD class method on an object. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_49execute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_48execute[] = "Ioctx.execute(self, key, cls, method, data, length=8192)\n\n Execute an OSD class method on an object.\n\n :param key: name of the object\n :type key: str\n :param cls: name of the object class\n :type cls: str\n :param method: name of the method\n :type method: str\n :param data: input data\n :type data: bytes\n :param length: size of output buffer in bytes (default=8291)\n :type length: int\n\n :raises: :class:`TypeError`\n :raises: :class:`Error`\n :returns: (ret, method output)\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_49execute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_key = 0; - PyObject *__pyx_v_cls = 0; - PyObject *__pyx_v_method = 0; - PyObject *__pyx_v_data = 0; - PyObject *__pyx_v_length = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("execute (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_cls,&__pyx_n_s_method,&__pyx_n_s_data,&__pyx_n_s_length,0}; - PyObject* values[5] = {0,0,0,0,0}; - values[4] = ((PyObject *)__pyx_int_8192); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("execute", 0, 4, 5, 1); __PYX_ERR(0, 2295, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("execute", 0, 4, 5, 2); __PYX_ERR(0, 2295, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("execute", 0, 4, 5, 3); __PYX_ERR(0, 2295, __pyx_L3_error) - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_length); - if (value) { values[4] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "execute") < 0)) __PYX_ERR(0, 2295, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_key = values[0]; - __pyx_v_cls = values[1]; - __pyx_v_method = values[2]; - __pyx_v_data = values[3]; - __pyx_v_length = values[4]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("execute", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2295, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Ioctx.execute", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Ioctx_48execute(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), __pyx_v_key, __pyx_v_cls, __pyx_v_method, __pyx_v_data, __pyx_v_length); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_48execute(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_cls, PyObject *__pyx_v_method, PyObject *__pyx_v_data, PyObject *__pyx_v_length) { - char *__pyx_v__key; - char *__pyx_v__cls; - char *__pyx_v__method; - char *__pyx_v__data; - size_t __pyx_v__data_len; - size_t __pyx_v__length; - PyObject *__pyx_v_ret_s; - char *__pyx_v_ret_buf; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - size_t __pyx_t_7; - PyObject *__pyx_t_8; - int __pyx_t_9; - int __pyx_t_10; - int __pyx_t_11; - char const *__pyx_t_12; - PyObject *__pyx_t_13 = NULL; - PyObject *__pyx_t_14 = NULL; - PyObject *__pyx_t_15 = NULL; - PyObject *__pyx_t_16 = NULL; - PyObject *__pyx_t_17 = NULL; - PyObject *__pyx_t_18 = NULL; - __Pyx_RefNannySetupContext("execute", 0); - __Pyx_INCREF(__pyx_v_key); - __Pyx_INCREF(__pyx_v_cls); - __Pyx_INCREF(__pyx_v_method); - - /* "rados.pyx":2314 - * :returns: (ret, method output) - * """ - * self.require_ioctx_open() # <<<<<<<<<<<<<< - * - * key = cstr(key, 'key') - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_ioctx_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2314, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2314, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2314, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":2316 - * self.require_ioctx_open() - * - * key = cstr(key, 'key') # <<<<<<<<<<<<<< - * cls = cstr(cls, 'cls') - * method = cstr(method, 'method') - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2316, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2316, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_key); - __Pyx_INCREF(__pyx_n_s_key); - __Pyx_GIVEREF(__pyx_n_s_key); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_key); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2316, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2317 - * - * key = cstr(key, 'key') - * cls = cstr(cls, 'cls') # <<<<<<<<<<<<<< - * method = cstr(method, 'method') - * cdef: - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2317, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_3 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2317, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL; - } - __Pyx_INCREF(__pyx_v_cls); - __Pyx_GIVEREF(__pyx_v_cls); - PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_4, __pyx_v_cls); - __Pyx_INCREF(__pyx_n_s_cls); - __Pyx_GIVEREF(__pyx_n_s_cls); - PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_4, __pyx_n_s_cls); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2317, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_cls, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2318 - * key = cstr(key, 'key') - * cls = cstr(cls, 'cls') - * method = cstr(method, 'method') # <<<<<<<<<<<<<< - * cdef: - * char *_key = key - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2318, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2318, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_method); - __Pyx_GIVEREF(__pyx_v_method); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_method); - __Pyx_INCREF(__pyx_n_s_method); - __Pyx_GIVEREF(__pyx_n_s_method); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_method); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2318, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_method, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2320 - * method = cstr(method, 'method') - * cdef: - * char *_key = key # <<<<<<<<<<<<<< - * char *_cls = cls - * char *_method = method - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_key); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2320, __pyx_L1_error) - __pyx_v__key = __pyx_t_6; - - /* "rados.pyx":2321 - * cdef: - * char *_key = key - * char *_cls = cls # <<<<<<<<<<<<<< - * char *_method = method - * char *_data = data - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_cls); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2321, __pyx_L1_error) - __pyx_v__cls = __pyx_t_6; - - /* "rados.pyx":2322 - * char *_key = key - * char *_cls = cls - * char *_method = method # <<<<<<<<<<<<<< - * char *_data = data - * size_t _data_len = len(data) - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_method); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2322, __pyx_L1_error) - __pyx_v__method = __pyx_t_6; - - /* "rados.pyx":2323 - * char *_cls = cls - * char *_method = method - * char *_data = data # <<<<<<<<<<<<<< - * size_t _data_len = len(data) - * - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_data); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2323, __pyx_L1_error) - __pyx_v__data = __pyx_t_6; - - /* "rados.pyx":2324 - * char *_method = method - * char *_data = data - * size_t _data_len = len(data) # <<<<<<<<<<<<<< - * - * char *ref_buf - */ - __pyx_t_4 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 2324, __pyx_L1_error) - __pyx_v__data_len = __pyx_t_4; - - /* "rados.pyx":2327 - * - * char *ref_buf - * size_t _length = length # <<<<<<<<<<<<<< - * PyObject* ret_s = NULL - * - */ - __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_v_length); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2327, __pyx_L1_error) - __pyx_v__length = __pyx_t_7; - - /* "rados.pyx":2328 - * char *ref_buf - * size_t _length = length - * PyObject* ret_s = NULL # <<<<<<<<<<<<<< - * - * ret_s = PyBytes_FromStringAndSize(NULL, length) - */ - __pyx_v_ret_s = NULL; - - /* "rados.pyx":2330 - * PyObject* ret_s = NULL - * - * ret_s = PyBytes_FromStringAndSize(NULL, length) # <<<<<<<<<<<<<< - * try: - * ret_buf = PyBytes_AsString(ret_s) - */ - __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_v_length); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2330, __pyx_L1_error) - __pyx_t_8 = PyBytes_FromStringAndSize(NULL, __pyx_t_4); if (unlikely(__pyx_t_8 == NULL)) __PYX_ERR(0, 2330, __pyx_L1_error) - __pyx_v_ret_s = __pyx_t_8; - - /* "rados.pyx":2331 - * - * ret_s = PyBytes_FromStringAndSize(NULL, length) - * try: # <<<<<<<<<<<<<< - * ret_buf = PyBytes_AsString(ret_s) - * with nogil: - */ - /*try:*/ { - - /* "rados.pyx":2332 - * ret_s = PyBytes_FromStringAndSize(NULL, length) - * try: - * ret_buf = PyBytes_AsString(ret_s) # <<<<<<<<<<<<<< - * with nogil: - * ret = rados_exec(self.io, _key, _cls, _method, _data, - */ - __pyx_t_6 = PyBytes_AsString(__pyx_v_ret_s); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(0, 2332, __pyx_L4_error) - __pyx_v_ret_buf = __pyx_t_6; - - /* "rados.pyx":2333 - * try: - * ret_buf = PyBytes_AsString(ret_s) - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_exec(self.io, _key, _cls, _method, _data, - * _data_len, ret_buf, _length) - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":2334 - * ret_buf = PyBytes_AsString(ret_s) - * with nogil: - * ret = rados_exec(self.io, _key, _cls, _method, _data, # <<<<<<<<<<<<<< - * _data_len, ret_buf, _length) - * if ret < 0: - */ - __pyx_v_ret = rados_exec(__pyx_v_self->io, __pyx_v__key, __pyx_v__cls, __pyx_v__method, __pyx_v__data, __pyx_v__data_len, __pyx_v_ret_buf, __pyx_v__length); - } - - /* "rados.pyx":2333 - * try: - * ret_buf = PyBytes_AsString(ret_s) - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_exec(self.io, _key, _cls, _method, _data, - * _data_len, ret_buf, _length) - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L8; - } - __pyx_L8:; - } - } - - /* "rados.pyx":2336 - * ret = rados_exec(self.io, _key, _cls, _method, _data, - * _data_len, ret_buf, _length) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Ioctx.read(%s): failed to read %s" % (self.name, key)) - * - */ - __pyx_t_9 = ((__pyx_v_ret < 0) != 0); - if (__pyx_t_9) { - - /* "rados.pyx":2337 - * _data_len, ret_buf, _length) - * if ret < 0: - * raise make_ex(ret, "Ioctx.read(%s): failed to read %s" % (self.name, key)) # <<<<<<<<<<<<<< - * - * if ret != length: - */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2337, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2337, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2337, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); - __Pyx_INCREF(__pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_key); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Ioctx_read_s_failed_to_read_s, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2337, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __pyx_f_5rados_make_ex(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2337, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 2337, __pyx_L4_error) - - /* "rados.pyx":2336 - * ret = rados_exec(self.io, _key, _cls, _method, _data, - * _data_len, ret_buf, _length) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Ioctx.read(%s): failed to read %s" % (self.name, key)) - * - */ - } - - /* "rados.pyx":2339 - * raise make_ex(ret, "Ioctx.read(%s): failed to read %s" % (self.name, key)) - * - * if ret != length: # <<<<<<<<<<<<<< - * _PyBytes_Resize(&ret_s, ret) - * - */ - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2339, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_5, __pyx_v_length, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2339, __pyx_L4_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2339, __pyx_L4_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_9) { - - /* "rados.pyx":2340 - * - * if ret != length: - * _PyBytes_Resize(&ret_s, ret) # <<<<<<<<<<<<<< - * - * return ret, ret_s - */ - __pyx_t_10 = _PyBytes_Resize((&__pyx_v_ret_s), __pyx_v_ret); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 2340, __pyx_L4_error) - - /* "rados.pyx":2339 - * raise make_ex(ret, "Ioctx.read(%s): failed to read %s" % (self.name, key)) - * - * if ret != length: # <<<<<<<<<<<<<< - * _PyBytes_Resize(&ret_s, ret) - * - */ - } - - /* "rados.pyx":2342 - * _PyBytes_Resize(&ret_s, ret) - * - * return ret, ret_s # <<<<<<<<<<<<<< - * finally: - * # We DECREF unconditionally: the cast to object above will have - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2342, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2342, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_v_ret_s)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_ret_s)); - PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_ret_s)); - __pyx_t_2 = 0; - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; - goto __pyx_L3_return; - } - - /* "rados.pyx":2348 - * # including if _PyString_Resize fails (that will free the string - * # itself and set ret_s to NULL, hence XDECREF). - * ref.Py_XDECREF(ret_s) # <<<<<<<<<<<<<< - * - * def get_stats(self): - */ - /*finally:*/ { - /*exception exit:*/{ - __Pyx_PyThreadState_declare - __pyx_L4_error:; - __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; - __Pyx_PyThreadState_assign - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); - if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); - __Pyx_XGOTREF(__pyx_t_13); - __Pyx_XGOTREF(__pyx_t_14); - __Pyx_XGOTREF(__pyx_t_15); - __Pyx_XGOTREF(__pyx_t_16); - __Pyx_XGOTREF(__pyx_t_17); - __Pyx_XGOTREF(__pyx_t_18); - __pyx_t_10 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename; - { - Py_XDECREF(__pyx_v_ret_s); - } - __Pyx_PyThreadState_assign - if (PY_MAJOR_VERSION >= 3) { - __Pyx_XGIVEREF(__pyx_t_16); - __Pyx_XGIVEREF(__pyx_t_17); - __Pyx_XGIVEREF(__pyx_t_18); - __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); - } - __Pyx_XGIVEREF(__pyx_t_13); - __Pyx_XGIVEREF(__pyx_t_14); - __Pyx_XGIVEREF(__pyx_t_15); - __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15); - __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; - __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12; - goto __pyx_L1_error; - } - __pyx_L3_return: { - __pyx_t_18 = __pyx_r; - __pyx_r = 0; - Py_XDECREF(__pyx_v_ret_s); - __pyx_r = __pyx_t_18; - __pyx_t_18 = 0; - goto __pyx_L0; - } - } - - /* "rados.pyx":2295 - * - * @requires(('key', str_type), ('cls', str_type), ('method', str_type), ('data', bytes)) - * def execute(self, key, cls, method, data, length=8192): # <<<<<<<<<<<<<< - * """ - * Execute an OSD class method on an object. - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.Ioctx.execute", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_key); - __Pyx_XDECREF(__pyx_v_cls); - __Pyx_XDECREF(__pyx_v_method); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2350 - * ref.Py_XDECREF(ret_s) - * - * def get_stats(self): # <<<<<<<<<<<<<< - * """ - * Get pool usage statistics - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_51get_stats(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_50get_stats[] = "Ioctx.get_stats(self)\n\n Get pool usage statistics\n\n :returns: dict - contains the following keys:\n\n - ``num_bytes`` (int) - size of pool in bytes\n\n - ``num_kb`` (int) - size of pool in kbytes\n\n - ``num_objects`` (int) - number of objects in the pool\n\n - ``num_object_clones`` (int) - number of object clones\n\n - ``num_object_copies`` (int) - number of object copies\n\n - ``num_objects_missing_on_primary`` (int) - number of objets\n missing on primary\n\n - ``num_objects_unfound`` (int) - number of unfound objects\n\n - ``num_objects_degraded`` (int) - number of degraded objects\n\n - ``num_rd`` (int) - bytes read\n\n - ``num_rd_kb`` (int) - kbytes read\n\n - ``num_wr`` (int) - bytes written\n\n - ``num_wr_kb`` (int) - kbytes written\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_51get_stats(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("get_stats (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_50get_stats(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_50get_stats(struct __pyx_obj_5rados_Ioctx *__pyx_v_self) { - struct rados_pool_stat_t __pyx_v_stats; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - __Pyx_RefNannySetupContext("get_stats", 0); - - /* "rados.pyx":2381 - * - ``num_wr_kb`` (int) - kbytes written - * """ - * self.require_ioctx_open() # <<<<<<<<<<<<<< - * cdef rados_pool_stat_t stats - * with nogil: - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_ioctx_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2381, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2381, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2381, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":2383 - * self.require_ioctx_open() - * cdef rados_pool_stat_t stats - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_ioctx_pool_stat(self.io, &stats) - * if ret < 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":2384 - * cdef rados_pool_stat_t stats - * with nogil: - * ret = rados_ioctx_pool_stat(self.io, &stats) # <<<<<<<<<<<<<< - * if ret < 0: - * raise make_ex(ret, "Ioctx.get_stats(%s): get_stats failed" % self.name) - */ - __pyx_v_ret = rados_ioctx_pool_stat(__pyx_v_self->io, (&__pyx_v_stats)); - } - - /* "rados.pyx":2383 - * self.require_ioctx_open() - * cdef rados_pool_stat_t stats - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_ioctx_pool_stat(self.io, &stats) - * if ret < 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":2385 - * with nogil: - * ret = rados_ioctx_pool_stat(self.io, &stats) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Ioctx.get_stats(%s): get_stats failed" % self.name) - * return {'num_bytes': stats.num_bytes, - */ - __pyx_t_4 = ((__pyx_v_ret < 0) != 0); - if (__pyx_t_4) { - - /* "rados.pyx":2386 - * ret = rados_ioctx_pool_stat(self.io, &stats) - * if ret < 0: - * raise make_ex(ret, "Ioctx.get_stats(%s): get_stats failed" % self.name) # <<<<<<<<<<<<<< - * return {'num_bytes': stats.num_bytes, - * 'num_kb': stats.num_kb, - */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2386, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2386, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Ioctx_get_stats_s_get_stats_fail, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2386, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_f_5rados_make_ex(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2386, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2386, __pyx_L1_error) - - /* "rados.pyx":2385 - * with nogil: - * ret = rados_ioctx_pool_stat(self.io, &stats) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Ioctx.get_stats(%s): get_stats failed" % self.name) - * return {'num_bytes': stats.num_bytes, - */ - } - - /* "rados.pyx":2387 - * if ret < 0: - * raise make_ex(ret, "Ioctx.get_stats(%s): get_stats failed" % self.name) - * return {'num_bytes': stats.num_bytes, # <<<<<<<<<<<<<< - * 'num_kb': stats.num_kb, - * 'num_objects': stats.num_objects, - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2387, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_stats.num_bytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2387, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_num_bytes, __pyx_t_3) < 0) __PYX_ERR(0, 2387, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "rados.pyx":2388 - * raise make_ex(ret, "Ioctx.get_stats(%s): get_stats failed" % self.name) - * return {'num_bytes': stats.num_bytes, - * 'num_kb': stats.num_kb, # <<<<<<<<<<<<<< - * 'num_objects': stats.num_objects, - * 'num_object_clones': stats.num_object_clones, - */ - __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_stats.num_kb); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2388, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_num_kb, __pyx_t_3) < 0) __PYX_ERR(0, 2387, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "rados.pyx":2389 - * return {'num_bytes': stats.num_bytes, - * 'num_kb': stats.num_kb, - * 'num_objects': stats.num_objects, # <<<<<<<<<<<<<< - * 'num_object_clones': stats.num_object_clones, - * 'num_object_copies': stats.num_object_copies, - */ - __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_stats.num_objects); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2389, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_num_objects, __pyx_t_3) < 0) __PYX_ERR(0, 2387, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "rados.pyx":2390 - * 'num_kb': stats.num_kb, - * 'num_objects': stats.num_objects, - * 'num_object_clones': stats.num_object_clones, # <<<<<<<<<<<<<< - * 'num_object_copies': stats.num_object_copies, - * "num_objects_missing_on_primary": stats.num_objects_missing_on_primary, - */ - __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_stats.num_object_clones); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2390, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_num_object_clones, __pyx_t_3) < 0) __PYX_ERR(0, 2387, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "rados.pyx":2391 - * 'num_objects': stats.num_objects, - * 'num_object_clones': stats.num_object_clones, - * 'num_object_copies': stats.num_object_copies, # <<<<<<<<<<<<<< - * "num_objects_missing_on_primary": stats.num_objects_missing_on_primary, - * "num_objects_unfound": stats.num_objects_unfound, - */ - __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_stats.num_object_copies); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2391, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_num_object_copies, __pyx_t_3) < 0) __PYX_ERR(0, 2387, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "rados.pyx":2392 - * 'num_object_clones': stats.num_object_clones, - * 'num_object_copies': stats.num_object_copies, - * "num_objects_missing_on_primary": stats.num_objects_missing_on_primary, # <<<<<<<<<<<<<< - * "num_objects_unfound": stats.num_objects_unfound, - * "num_objects_degraded": stats.num_objects_degraded, - */ - __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_stats.num_objects_missing_on_primary); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2392, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_num_objects_missing_on_primary, __pyx_t_3) < 0) __PYX_ERR(0, 2387, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "rados.pyx":2393 - * 'num_object_copies': stats.num_object_copies, - * "num_objects_missing_on_primary": stats.num_objects_missing_on_primary, - * "num_objects_unfound": stats.num_objects_unfound, # <<<<<<<<<<<<<< - * "num_objects_degraded": stats.num_objects_degraded, - * "num_rd": stats.num_rd, - */ - __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_stats.num_objects_unfound); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2393, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_num_objects_unfound, __pyx_t_3) < 0) __PYX_ERR(0, 2387, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "rados.pyx":2394 - * "num_objects_missing_on_primary": stats.num_objects_missing_on_primary, - * "num_objects_unfound": stats.num_objects_unfound, - * "num_objects_degraded": stats.num_objects_degraded, # <<<<<<<<<<<<<< - * "num_rd": stats.num_rd, - * "num_rd_kb": stats.num_rd_kb, - */ - __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_stats.num_objects_degraded); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2394, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_num_objects_degraded, __pyx_t_3) < 0) __PYX_ERR(0, 2387, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "rados.pyx":2395 - * "num_objects_unfound": stats.num_objects_unfound, - * "num_objects_degraded": stats.num_objects_degraded, - * "num_rd": stats.num_rd, # <<<<<<<<<<<<<< - * "num_rd_kb": stats.num_rd_kb, - * "num_wr": stats.num_wr, - */ - __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_stats.num_rd); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2395, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_num_rd, __pyx_t_3) < 0) __PYX_ERR(0, 2387, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "rados.pyx":2396 - * "num_objects_degraded": stats.num_objects_degraded, - * "num_rd": stats.num_rd, - * "num_rd_kb": stats.num_rd_kb, # <<<<<<<<<<<<<< - * "num_wr": stats.num_wr, - * "num_wr_kb": stats.num_wr_kb} - */ - __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_stats.num_rd_kb); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2396, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_num_rd_kb, __pyx_t_3) < 0) __PYX_ERR(0, 2387, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "rados.pyx":2397 - * "num_rd": stats.num_rd, - * "num_rd_kb": stats.num_rd_kb, - * "num_wr": stats.num_wr, # <<<<<<<<<<<<<< - * "num_wr_kb": stats.num_wr_kb} - * - */ - __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_stats.num_wr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2397, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_num_wr, __pyx_t_3) < 0) __PYX_ERR(0, 2387, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "rados.pyx":2398 - * "num_rd_kb": stats.num_rd_kb, - * "num_wr": stats.num_wr, - * "num_wr_kb": stats.num_wr_kb} # <<<<<<<<<<<<<< - * - * @requires(('key', str_type)) - */ - __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_stats.num_wr_kb); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2398, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_num_wr_kb, __pyx_t_3) < 0) __PYX_ERR(0, 2387, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "rados.pyx":2350 - * ref.Py_XDECREF(ret_s) - * - * def get_stats(self): # <<<<<<<<<<<<<< - * """ - * Get pool usage statistics - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("rados.Ioctx.get_stats", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2401 - * - * @requires(('key', str_type)) - * def remove_object(self, key): # <<<<<<<<<<<<<< - * """ - * Delete an object - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_53remove_object(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_52remove_object[] = "Ioctx.remove_object(self, key)\n\n Delete an object\n\n This does not delete any snapshots of the object.\n\n :param key: the name of the object to delete\n :type key: str\n\n :raises: :class:`TypeError`\n :raises: :class:`Error`\n :returns: bool - True on success\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_53remove_object(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("remove_object (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_52remove_object(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), ((PyObject *)__pyx_v_key)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_52remove_object(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_key) { - char *__pyx_v__key; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - int __pyx_t_7; - __Pyx_RefNannySetupContext("remove_object", 0); - __Pyx_INCREF(__pyx_v_key); - - /* "rados.pyx":2414 - * :returns: bool - True on success - * """ - * self.require_ioctx_open() # <<<<<<<<<<<<<< - * key = cstr(key, 'key') - * cdef: - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_ioctx_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2414, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2414, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2414, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":2415 - * """ - * self.require_ioctx_open() - * key = cstr(key, 'key') # <<<<<<<<<<<<<< - * cdef: - * char *_key = key - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2415, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2415, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_key); - __Pyx_INCREF(__pyx_n_s_key); - __Pyx_GIVEREF(__pyx_n_s_key); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_key); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2415, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2417 - * key = cstr(key, 'key') - * cdef: - * char *_key = key # <<<<<<<<<<<<<< - * - * with nogil: - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_key); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2417, __pyx_L1_error) - __pyx_v__key = __pyx_t_6; - - /* "rados.pyx":2419 - * char *_key = key - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_remove(self.io, _key) - * if ret < 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":2420 - * - * with nogil: - * ret = rados_remove(self.io, _key) # <<<<<<<<<<<<<< - * if ret < 0: - * raise make_ex(ret, "Failed to remove '%s'" % key) - */ - __pyx_v_ret = rados_remove(__pyx_v_self->io, __pyx_v__key); - } - - /* "rados.pyx":2419 - * char *_key = key - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_remove(self.io, _key) - * if ret < 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":2421 - * with nogil: - * ret = rados_remove(self.io, _key) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Failed to remove '%s'" % key) - * return True - */ - __pyx_t_7 = ((__pyx_v_ret < 0) != 0); - if (__pyx_t_7) { - - /* "rados.pyx":2422 - * ret = rados_remove(self.io, _key) - * if ret < 0: - * raise make_ex(ret, "Failed to remove '%s'" % key) # <<<<<<<<<<<<<< - * return True - * - */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2422, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Failed_to_remove_s, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2422, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __pyx_f_5rados_make_ex(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2422, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 2422, __pyx_L1_error) - - /* "rados.pyx":2421 - * with nogil: - * ret = rados_remove(self.io, _key) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Failed to remove '%s'" % key) - * return True - */ - } - - /* "rados.pyx":2423 - * if ret < 0: - * raise make_ex(ret, "Failed to remove '%s'" % key) - * return True # <<<<<<<<<<<<<< - * - * @requires(('key', str_type)) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_True); - __pyx_r = Py_True; - goto __pyx_L0; - - /* "rados.pyx":2401 - * - * @requires(('key', str_type)) - * def remove_object(self, key): # <<<<<<<<<<<<<< - * """ - * Delete an object - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.Ioctx.remove_object", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_key); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2426 - * - * @requires(('key', str_type)) - * def trunc(self, key, size): # <<<<<<<<<<<<<< - * """ - * Resize an object - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_55trunc(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_54trunc[] = "Ioctx.trunc(self, key, size)\n\n Resize an object\n\n If this enlarges the object, the new area is logically filled with\n zeroes. If this shrinks the object, the excess data is removed.\n\n :param key: the name of the object to resize\n :type key: str\n :param size: the new size of the object in bytes\n :type size: int\n\n :raises: :class:`TypeError`\n :raises: :class:`Error`\n :returns: int - 0 on success, otherwise raises error\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_55trunc(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_key = 0; - PyObject *__pyx_v_size = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("trunc (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_size,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("trunc", 1, 2, 2, 1); __PYX_ERR(0, 2426, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "trunc") < 0)) __PYX_ERR(0, 2426, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_key = values[0]; - __pyx_v_size = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("trunc", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2426, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Ioctx.trunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Ioctx_54trunc(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), __pyx_v_key, __pyx_v_size); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_54trunc(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_size) { - char *__pyx_v__key; - uint64_t __pyx_v__size; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - uint64_t __pyx_t_7; - int __pyx_t_8; - __Pyx_RefNannySetupContext("trunc", 0); - __Pyx_INCREF(__pyx_v_key); - - /* "rados.pyx":2443 - * """ - * - * self.require_ioctx_open() # <<<<<<<<<<<<<< - * key = cstr(key, 'key') - * cdef: - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_ioctx_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2443, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2443, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2443, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":2444 - * - * self.require_ioctx_open() - * key = cstr(key, 'key') # <<<<<<<<<<<<<< - * cdef: - * char *_key = key - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2444, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2444, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_key); - __Pyx_INCREF(__pyx_n_s_key); - __Pyx_GIVEREF(__pyx_n_s_key); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_key); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2444, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2446 - * key = cstr(key, 'key') - * cdef: - * char *_key = key # <<<<<<<<<<<<<< - * uint64_t _size = size - * - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_key); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2446, __pyx_L1_error) - __pyx_v__key = __pyx_t_6; - - /* "rados.pyx":2447 - * cdef: - * char *_key = key - * uint64_t _size = size # <<<<<<<<<<<<<< - * - * with nogil: - */ - __pyx_t_7 = __Pyx_PyInt_As_uint64_t(__pyx_v_size); if (unlikely((__pyx_t_7 == (uint64_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2447, __pyx_L1_error) - __pyx_v__size = __pyx_t_7; - - /* "rados.pyx":2449 - * uint64_t _size = size - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_trunc(self.io, _key, _size) - * if ret < 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":2450 - * - * with nogil: - * ret = rados_trunc(self.io, _key, _size) # <<<<<<<<<<<<<< - * if ret < 0: - * raise make_ex(ret, "Ioctx.trunc(%s): failed to truncate %s" % (self.name, key)) - */ - __pyx_v_ret = rados_trunc(__pyx_v_self->io, __pyx_v__key, __pyx_v__size); - } - - /* "rados.pyx":2449 - * uint64_t _size = size - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_trunc(self.io, _key, _size) - * if ret < 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":2451 - * with nogil: - * ret = rados_trunc(self.io, _key, _size) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Ioctx.trunc(%s): failed to truncate %s" % (self.name, key)) - * return ret - */ - __pyx_t_8 = ((__pyx_v_ret < 0) != 0); - if (__pyx_t_8) { - - /* "rados.pyx":2452 - * ret = rados_trunc(self.io, _key, _size) - * if ret < 0: - * raise make_ex(ret, "Ioctx.trunc(%s): failed to truncate %s" % (self.name, key)) # <<<<<<<<<<<<<< - * return ret - * - */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); - __Pyx_INCREF(__pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_key); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Ioctx_trunc_s_failed_to_truncate, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __pyx_f_5rados_make_ex(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 2452, __pyx_L1_error) - - /* "rados.pyx":2451 - * with nogil: - * ret = rados_trunc(self.io, _key, _size) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Ioctx.trunc(%s): failed to truncate %s" % (self.name, key)) - * return ret - */ - } - - /* "rados.pyx":2453 - * if ret < 0: - * raise make_ex(ret, "Ioctx.trunc(%s): failed to truncate %s" % (self.name, key)) - * return ret # <<<<<<<<<<<<<< - * - * @requires(('key', str_type)) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2453, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; - goto __pyx_L0; - - /* "rados.pyx":2426 - * - * @requires(('key', str_type)) - * def trunc(self, key, size): # <<<<<<<<<<<<<< - * """ - * Resize an object - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.Ioctx.trunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_key); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2456 - * - * @requires(('key', str_type)) - * def stat(self, key): # <<<<<<<<<<<<<< - * """ - * Get object stats (size/mtime) - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_57stat(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_56stat[] = "Ioctx.stat(self, key)\n\n Get object stats (size/mtime)\n\n :param key: the name of the object to get stats from\n :type key: str\n\n :raises: :class:`TypeError`\n :raises: :class:`Error`\n :returns: (size,timestamp)\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_57stat(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("stat (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_56stat(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), ((PyObject *)__pyx_v_key)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_56stat(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_key) { - char *__pyx_v__key; - uint64_t __pyx_v_psize; - time_t __pyx_v_pmtime; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - __Pyx_RefNannySetupContext("stat", 0); - __Pyx_INCREF(__pyx_v_key); - - /* "rados.pyx":2467 - * :returns: (size,timestamp) - * """ - * self.require_ioctx_open() # <<<<<<<<<<<<<< - * - * key = cstr(key, 'key') - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_ioctx_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2467, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2467, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2467, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":2469 - * self.require_ioctx_open() - * - * key = cstr(key, 'key') # <<<<<<<<<<<<<< - * cdef: - * char *_key = key - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2469, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2469, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_key); - __Pyx_INCREF(__pyx_n_s_key); - __Pyx_GIVEREF(__pyx_n_s_key); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_key); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2469, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2471 - * key = cstr(key, 'key') - * cdef: - * char *_key = key # <<<<<<<<<<<<<< - * uint64_t psize - * time_t pmtime - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_key); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2471, __pyx_L1_error) - __pyx_v__key = __pyx_t_6; - - /* "rados.pyx":2475 - * time_t pmtime - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_stat(self.io, _key, &psize, &pmtime) - * if ret < 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":2476 - * - * with nogil: - * ret = rados_stat(self.io, _key, &psize, &pmtime) # <<<<<<<<<<<<<< - * if ret < 0: - * raise make_ex(ret, "Failed to stat %r" % key) - */ - __pyx_v_ret = rados_stat(__pyx_v_self->io, __pyx_v__key, (&__pyx_v_psize), (&__pyx_v_pmtime)); - } - - /* "rados.pyx":2475 - * time_t pmtime - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_stat(self.io, _key, &psize, &pmtime) - * if ret < 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":2477 - * with nogil: - * ret = rados_stat(self.io, _key, &psize, &pmtime) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Failed to stat %r" % key) - * return psize, time.localtime(pmtime) - */ - __pyx_t_7 = ((__pyx_v_ret < 0) != 0); - if (__pyx_t_7) { - - /* "rados.pyx":2478 - * ret = rados_stat(self.io, _key, &psize, &pmtime) - * if ret < 0: - * raise make_ex(ret, "Failed to stat %r" % key) # <<<<<<<<<<<<<< - * return psize, time.localtime(pmtime) - * - */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2478, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Failed_to_stat_r, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2478, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __pyx_f_5rados_make_ex(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2478, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 2478, __pyx_L1_error) - - /* "rados.pyx":2477 - * with nogil: - * ret = rados_stat(self.io, _key, &psize, &pmtime) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Failed to stat %r" % key) - * return psize, time.localtime(pmtime) - */ - } - - /* "rados.pyx":2479 - * if ret < 0: - * raise make_ex(ret, "Failed to stat %r" % key) - * return psize, time.localtime(pmtime) # <<<<<<<<<<<<<< - * - * @requires(('key', str_type), ('xattr_name', str_type)) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __Pyx_PyInt_From_uint64_t(__pyx_v_psize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2479, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2479, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_localtime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2479, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_time_t(__pyx_v_pmtime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2479, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - } - } - if (!__pyx_t_8) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2479, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2479, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2479, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2479, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); - __pyx_t_5 = 0; - __pyx_t_2 = 0; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - - /* "rados.pyx":2456 - * - * @requires(('key', str_type)) - * def stat(self, key): # <<<<<<<<<<<<<< - * """ - * Get object stats (size/mtime) - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("rados.Ioctx.stat", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_key); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2482 - * - * @requires(('key', str_type), ('xattr_name', str_type)) - * def get_xattr(self, key, xattr_name): # <<<<<<<<<<<<<< - * """ - * Get the value of an extended attribute on an object. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_59get_xattr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_58get_xattr[] = "Ioctx.get_xattr(self, key, xattr_name)\n\n Get the value of an extended attribute on an object.\n\n :param key: the name of the object to get xattr from\n :type key: str\n :param xattr_name: which extended attribute to read\n :type xattr_name: str\n\n :raises: :class:`TypeError`\n :raises: :class:`Error`\n :returns: str - value of the xattr\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_59get_xattr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_key = 0; - PyObject *__pyx_v_xattr_name = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("get_xattr (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_xattr_name,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xattr_name)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("get_xattr", 1, 2, 2, 1); __PYX_ERR(0, 2482, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_xattr") < 0)) __PYX_ERR(0, 2482, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_key = values[0]; - __pyx_v_xattr_name = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_xattr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2482, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Ioctx.get_xattr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Ioctx_58get_xattr(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), __pyx_v_key, __pyx_v_xattr_name); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_58get_xattr(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_xattr_name) { - char *__pyx_v__key; - char *__pyx_v__xattr_name; - size_t __pyx_v_ret_length; - char *__pyx_v_ret_buf; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - int __pyx_t_7; - void *__pyx_t_8; - int __pyx_t_9; - int __pyx_t_10; - char const *__pyx_t_11; - PyObject *__pyx_t_12 = NULL; - PyObject *__pyx_t_13 = NULL; - PyObject *__pyx_t_14 = NULL; - PyObject *__pyx_t_15 = NULL; - PyObject *__pyx_t_16 = NULL; - PyObject *__pyx_t_17 = NULL; - __Pyx_RefNannySetupContext("get_xattr", 0); - __Pyx_INCREF(__pyx_v_key); - __Pyx_INCREF(__pyx_v_xattr_name); - - /* "rados.pyx":2495 - * :returns: str - value of the xattr - * """ - * self.require_ioctx_open() # <<<<<<<<<<<<<< - * - * key = cstr(key, 'key') - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_ioctx_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2495, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2495, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2495, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":2497 - * self.require_ioctx_open() - * - * key = cstr(key, 'key') # <<<<<<<<<<<<<< - * xattr_name = cstr(xattr_name, 'xattr_name') - * cdef: - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2497, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2497, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_key); - __Pyx_INCREF(__pyx_n_s_key); - __Pyx_GIVEREF(__pyx_n_s_key); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_key); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2497, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2498 - * - * key = cstr(key, 'key') - * xattr_name = cstr(xattr_name, 'xattr_name') # <<<<<<<<<<<<<< - * cdef: - * char *_key = key - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2498, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_3 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2498, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL; - } - __Pyx_INCREF(__pyx_v_xattr_name); - __Pyx_GIVEREF(__pyx_v_xattr_name); - PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_4, __pyx_v_xattr_name); - __Pyx_INCREF(__pyx_n_s_xattr_name); - __Pyx_GIVEREF(__pyx_n_s_xattr_name); - PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_4, __pyx_n_s_xattr_name); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2498, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_xattr_name, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2500 - * xattr_name = cstr(xattr_name, 'xattr_name') - * cdef: - * char *_key = key # <<<<<<<<<<<<<< - * char *_xattr_name = xattr_name - * size_t ret_length = 4096 - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_key); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2500, __pyx_L1_error) - __pyx_v__key = __pyx_t_6; - - /* "rados.pyx":2501 - * cdef: - * char *_key = key - * char *_xattr_name = xattr_name # <<<<<<<<<<<<<< - * size_t ret_length = 4096 - * char *ret_buf = NULL - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_xattr_name); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2501, __pyx_L1_error) - __pyx_v__xattr_name = __pyx_t_6; - - /* "rados.pyx":2502 - * char *_key = key - * char *_xattr_name = xattr_name - * size_t ret_length = 4096 # <<<<<<<<<<<<<< - * char *ret_buf = NULL - * - */ - __pyx_v_ret_length = 0x1000; - - /* "rados.pyx":2503 - * char *_xattr_name = xattr_name - * size_t ret_length = 4096 - * char *ret_buf = NULL # <<<<<<<<<<<<<< - * - * try: - */ - __pyx_v_ret_buf = NULL; - - /* "rados.pyx":2505 - * char *ret_buf = NULL - * - * try: # <<<<<<<<<<<<<< - * while ret_length < 4096 * 1024 * 1024: - * ret_buf = realloc_chk(ret_buf, ret_length) - */ - /*try:*/ { - - /* "rados.pyx":2506 - * - * try: - * while ret_length < 4096 * 1024 * 1024: # <<<<<<<<<<<<<< - * ret_buf = realloc_chk(ret_buf, ret_length) - * with nogil: - */ - while (1) { - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_ret_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2506, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_4294967296, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2506, __pyx_L4_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 2506, __pyx_L4_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!__pyx_t_7) break; - - /* "rados.pyx":2507 - * try: - * while ret_length < 4096 * 1024 * 1024: - * ret_buf = realloc_chk(ret_buf, ret_length) # <<<<<<<<<<<<<< - * with nogil: - * ret = rados_getxattr(self.io, _key, _xattr_name, ret_buf, ret_length) - */ - __pyx_t_8 = __pyx_f_5rados_realloc_chk(__pyx_v_ret_buf, __pyx_v_ret_length); if (unlikely(__pyx_t_8 == NULL)) __PYX_ERR(0, 2507, __pyx_L4_error) - __pyx_v_ret_buf = ((char *)__pyx_t_8); - - /* "rados.pyx":2508 - * while ret_length < 4096 * 1024 * 1024: - * ret_buf = realloc_chk(ret_buf, ret_length) - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_getxattr(self.io, _key, _xattr_name, ret_buf, ret_length) - * if ret == -errno.ERANGE: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":2509 - * ret_buf = realloc_chk(ret_buf, ret_length) - * with nogil: - * ret = rados_getxattr(self.io, _key, _xattr_name, ret_buf, ret_length) # <<<<<<<<<<<<<< - * if ret == -errno.ERANGE: - * ret_length *= 2 - */ - __pyx_v_ret = rados_getxattr(__pyx_v_self->io, __pyx_v__key, __pyx_v__xattr_name, __pyx_v_ret_buf, __pyx_v_ret_length); - } - - /* "rados.pyx":2508 - * while ret_length < 4096 * 1024 * 1024: - * ret_buf = realloc_chk(ret_buf, ret_length) - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_getxattr(self.io, _key, _xattr_name, ret_buf, ret_length) - * if ret == -errno.ERANGE: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L12; - } - __pyx_L12:; - } - } - - /* "rados.pyx":2510 - * with nogil: - * ret = rados_getxattr(self.io, _key, _xattr_name, ret_buf, ret_length) - * if ret == -errno.ERANGE: # <<<<<<<<<<<<<< - * ret_length *= 2 - * elif ret < 0: - */ - __pyx_t_7 = ((__pyx_v_ret == (-ERANGE)) != 0); - if (__pyx_t_7) { - - /* "rados.pyx":2511 - * ret = rados_getxattr(self.io, _key, _xattr_name, ret_buf, ret_length) - * if ret == -errno.ERANGE: - * ret_length *= 2 # <<<<<<<<<<<<<< - * elif ret < 0: - * raise make_ex(ret, "Failed to get xattr %r" % xattr_name) - */ - __pyx_v_ret_length = (__pyx_v_ret_length * 2); - - /* "rados.pyx":2510 - * with nogil: - * ret = rados_getxattr(self.io, _key, _xattr_name, ret_buf, ret_length) - * if ret == -errno.ERANGE: # <<<<<<<<<<<<<< - * ret_length *= 2 - * elif ret < 0: - */ - goto __pyx_L13; - } - - /* "rados.pyx":2512 - * if ret == -errno.ERANGE: - * ret_length *= 2 - * elif ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Failed to get xattr %r" % xattr_name) - * else: - */ - __pyx_t_7 = ((__pyx_v_ret < 0) != 0); - if (__pyx_t_7) { - - /* "rados.pyx":2513 - * ret_length *= 2 - * elif ret < 0: - * raise make_ex(ret, "Failed to get xattr %r" % xattr_name) # <<<<<<<<<<<<<< - * else: - * break - */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2513, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Failed_to_get_xattr_r, __pyx_v_xattr_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2513, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __pyx_f_5rados_make_ex(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2513, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 2513, __pyx_L4_error) - - /* "rados.pyx":2512 - * if ret == -errno.ERANGE: - * ret_length *= 2 - * elif ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Failed to get xattr %r" % xattr_name) - * else: - */ - } - - /* "rados.pyx":2515 - * raise make_ex(ret, "Failed to get xattr %r" % xattr_name) - * else: - * break # <<<<<<<<<<<<<< - * return ret_buf[:ret] - * finally: - */ - /*else*/ { - goto __pyx_L7_break; - } - __pyx_L13:; - } - __pyx_L7_break:; - - /* "rados.pyx":2516 - * else: - * break - * return ret_buf[:ret] # <<<<<<<<<<<<<< - * finally: - * free(ret_buf) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_ret_buf + 0, __pyx_v_ret - 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2516, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L3_return; - } - - /* "rados.pyx":2518 - * return ret_buf[:ret] - * finally: - * free(ret_buf) # <<<<<<<<<<<<<< - * - * @requires(('oid', str_type)) - */ - /*finally:*/ { - /*exception exit:*/{ - __Pyx_PyThreadState_declare - __pyx_L4_error:; - __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; - __Pyx_PyThreadState_assign - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); - if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); - __Pyx_XGOTREF(__pyx_t_12); - __Pyx_XGOTREF(__pyx_t_13); - __Pyx_XGOTREF(__pyx_t_14); - __Pyx_XGOTREF(__pyx_t_15); - __Pyx_XGOTREF(__pyx_t_16); - __Pyx_XGOTREF(__pyx_t_17); - __pyx_t_9 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename; - { - free(__pyx_v_ret_buf); - } - __Pyx_PyThreadState_assign - if (PY_MAJOR_VERSION >= 3) { - __Pyx_XGIVEREF(__pyx_t_15); - __Pyx_XGIVEREF(__pyx_t_16); - __Pyx_XGIVEREF(__pyx_t_17); - __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); - } - __Pyx_XGIVEREF(__pyx_t_12); - __Pyx_XGIVEREF(__pyx_t_13); - __Pyx_XGIVEREF(__pyx_t_14); - __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14); - __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; - __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11; - goto __pyx_L1_error; - } - __pyx_L3_return: { - __pyx_t_17 = __pyx_r; - __pyx_r = 0; - free(__pyx_v_ret_buf); - __pyx_r = __pyx_t_17; - __pyx_t_17 = 0; - goto __pyx_L0; - } - } - - /* "rados.pyx":2482 - * - * @requires(('key', str_type), ('xattr_name', str_type)) - * def get_xattr(self, key, xattr_name): # <<<<<<<<<<<<<< - * """ - * Get the value of an extended attribute on an object. - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.Ioctx.get_xattr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_key); - __Pyx_XDECREF(__pyx_v_xattr_name); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2521 - * - * @requires(('oid', str_type)) - * def get_xattrs(self, oid): # <<<<<<<<<<<<<< - * """ - * Start iterating over xattrs on an object. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_61get_xattrs(PyObject *__pyx_v_self, PyObject *__pyx_v_oid); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_60get_xattrs[] = "Ioctx.get_xattrs(self, oid)\n\n Start iterating over xattrs on an object.\n\n :param oid: the name of the object to get xattrs from\n :type oid: str\n\n :raises: :class:`TypeError`\n :raises: :class:`Error`\n :returns: XattrIterator\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_61get_xattrs(PyObject *__pyx_v_self, PyObject *__pyx_v_oid) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("get_xattrs (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_60get_xattrs(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), ((PyObject *)__pyx_v_oid)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_60get_xattrs(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_oid) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("get_xattrs", 0); - - /* "rados.pyx":2532 - * :returns: XattrIterator - * """ - * self.require_ioctx_open() # <<<<<<<<<<<<<< - * return XattrIterator(self, oid) - * - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_ioctx_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2532, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2532, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2532, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":2533 - * """ - * self.require_ioctx_open() - * return XattrIterator(self, oid) # <<<<<<<<<<<<<< - * - * @requires(('key', str_type), ('xattr_name', str_type), ('xattr_value', bytes)) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2533, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); - __Pyx_INCREF(__pyx_v_oid); - __Pyx_GIVEREF(__pyx_v_oid); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_oid); - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5rados_XattrIterator), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2533, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "rados.pyx":2521 - * - * @requires(('oid', str_type)) - * def get_xattrs(self, oid): # <<<<<<<<<<<<<< - * """ - * Start iterating over xattrs on an object. - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("rados.Ioctx.get_xattrs", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2536 - * - * @requires(('key', str_type), ('xattr_name', str_type), ('xattr_value', bytes)) - * def set_xattr(self, key, xattr_name, xattr_value): # <<<<<<<<<<<<<< - * """ - * Set an extended attribute on an object. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_63set_xattr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_62set_xattr[] = "Ioctx.set_xattr(self, key, xattr_name, xattr_value)\n\n Set an extended attribute on an object.\n\n :param key: the name of the object to set xattr to\n :type key: str\n :param xattr_name: which extended attribute to set\n :type xattr_name: str\n :param xattr_value: the value of the extended attribute\n :type xattr_value: bytes\n\n :raises: :class:`TypeError`\n :raises: :class:`Error`\n :returns: bool - True on success, otherwise raise an error\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_63set_xattr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_key = 0; - PyObject *__pyx_v_xattr_name = 0; - PyObject *__pyx_v_xattr_value = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("set_xattr (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_xattr_name,&__pyx_n_s_xattr_value,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xattr_name)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("set_xattr", 1, 3, 3, 1); __PYX_ERR(0, 2536, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xattr_value)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("set_xattr", 1, 3, 3, 2); __PYX_ERR(0, 2536, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_xattr") < 0)) __PYX_ERR(0, 2536, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - } - __pyx_v_key = values[0]; - __pyx_v_xattr_name = values[1]; - __pyx_v_xattr_value = values[2]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("set_xattr", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2536, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Ioctx.set_xattr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Ioctx_62set_xattr(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), __pyx_v_key, __pyx_v_xattr_name, __pyx_v_xattr_value); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_62set_xattr(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_xattr_name, PyObject *__pyx_v_xattr_value) { - char *__pyx_v__key; - char *__pyx_v__xattr_name; - char *__pyx_v__xattr_value; - size_t __pyx_v__xattr_value_len; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - int __pyx_t_7; - __Pyx_RefNannySetupContext("set_xattr", 0); - __Pyx_INCREF(__pyx_v_key); - __Pyx_INCREF(__pyx_v_xattr_name); - - /* "rados.pyx":2551 - * :returns: bool - True on success, otherwise raise an error - * """ - * self.require_ioctx_open() # <<<<<<<<<<<<<< - * - * key = cstr(key, 'key') - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_ioctx_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2551, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2551, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2551, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":2553 - * self.require_ioctx_open() - * - * key = cstr(key, 'key') # <<<<<<<<<<<<<< - * xattr_name = cstr(xattr_name, 'xattr_name') - * cdef: - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_key); - __Pyx_INCREF(__pyx_n_s_key); - __Pyx_GIVEREF(__pyx_n_s_key); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_key); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2554 - * - * key = cstr(key, 'key') - * xattr_name = cstr(xattr_name, 'xattr_name') # <<<<<<<<<<<<<< - * cdef: - * char *_key = key - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2554, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_3 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2554, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL; - } - __Pyx_INCREF(__pyx_v_xattr_name); - __Pyx_GIVEREF(__pyx_v_xattr_name); - PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_4, __pyx_v_xattr_name); - __Pyx_INCREF(__pyx_n_s_xattr_name); - __Pyx_GIVEREF(__pyx_n_s_xattr_name); - PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_4, __pyx_n_s_xattr_name); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2554, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_xattr_name, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2556 - * xattr_name = cstr(xattr_name, 'xattr_name') - * cdef: - * char *_key = key # <<<<<<<<<<<<<< - * char *_xattr_name = xattr_name - * char *_xattr_value = xattr_value - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_key); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2556, __pyx_L1_error) - __pyx_v__key = __pyx_t_6; - - /* "rados.pyx":2557 - * cdef: - * char *_key = key - * char *_xattr_name = xattr_name # <<<<<<<<<<<<<< - * char *_xattr_value = xattr_value - * size_t _xattr_value_len = len(xattr_value) - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_xattr_name); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2557, __pyx_L1_error) - __pyx_v__xattr_name = __pyx_t_6; - - /* "rados.pyx":2558 - * char *_key = key - * char *_xattr_name = xattr_name - * char *_xattr_value = xattr_value # <<<<<<<<<<<<<< - * size_t _xattr_value_len = len(xattr_value) - * - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_xattr_value); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2558, __pyx_L1_error) - __pyx_v__xattr_value = __pyx_t_6; - - /* "rados.pyx":2559 - * char *_xattr_name = xattr_name - * char *_xattr_value = xattr_value - * size_t _xattr_value_len = len(xattr_value) # <<<<<<<<<<<<<< - * - * with nogil: - */ - __pyx_t_4 = PyObject_Length(__pyx_v_xattr_value); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 2559, __pyx_L1_error) - __pyx_v__xattr_value_len = __pyx_t_4; - - /* "rados.pyx":2561 - * size_t _xattr_value_len = len(xattr_value) - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_setxattr(self.io, _key, _xattr_name, - * _xattr_value, _xattr_value_len) - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":2562 - * - * with nogil: - * ret = rados_setxattr(self.io, _key, _xattr_name, # <<<<<<<<<<<<<< - * _xattr_value, _xattr_value_len) - * if ret < 0: - */ - __pyx_v_ret = rados_setxattr(__pyx_v_self->io, __pyx_v__key, __pyx_v__xattr_name, __pyx_v__xattr_value, __pyx_v__xattr_value_len); - } - - /* "rados.pyx":2561 - * size_t _xattr_value_len = len(xattr_value) - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_setxattr(self.io, _key, _xattr_name, - * _xattr_value, _xattr_value_len) - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":2564 - * ret = rados_setxattr(self.io, _key, _xattr_name, - * _xattr_value, _xattr_value_len) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Failed to set xattr %r" % xattr_name) - * return True - */ - __pyx_t_7 = ((__pyx_v_ret < 0) != 0); - if (__pyx_t_7) { - - /* "rados.pyx":2565 - * _xattr_value, _xattr_value_len) - * if ret < 0: - * raise make_ex(ret, "Failed to set xattr %r" % xattr_name) # <<<<<<<<<<<<<< - * return True - * - */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2565, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Failed_to_set_xattr_r, __pyx_v_xattr_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2565, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_f_5rados_make_ex(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2565, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 2565, __pyx_L1_error) - - /* "rados.pyx":2564 - * ret = rados_setxattr(self.io, _key, _xattr_name, - * _xattr_value, _xattr_value_len) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Failed to set xattr %r" % xattr_name) - * return True - */ - } - - /* "rados.pyx":2566 - * if ret < 0: - * raise make_ex(ret, "Failed to set xattr %r" % xattr_name) - * return True # <<<<<<<<<<<<<< - * - * @requires(('key', str_type), ('xattr_name', str_type)) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_True); - __pyx_r = Py_True; - goto __pyx_L0; - - /* "rados.pyx":2536 - * - * @requires(('key', str_type), ('xattr_name', str_type), ('xattr_value', bytes)) - * def set_xattr(self, key, xattr_name, xattr_value): # <<<<<<<<<<<<<< - * """ - * Set an extended attribute on an object. - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.Ioctx.set_xattr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_key); - __Pyx_XDECREF(__pyx_v_xattr_name); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2569 - * - * @requires(('key', str_type), ('xattr_name', str_type)) - * def rm_xattr(self, key, xattr_name): # <<<<<<<<<<<<<< - * """ - * Removes an extended attribute on from an object. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_65rm_xattr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_64rm_xattr[] = "Ioctx.rm_xattr(self, key, xattr_name)\n\n Removes an extended attribute on from an object.\n\n :param key: the name of the object to remove xattr from\n :type key: str\n :param xattr_name: which extended attribute to remove\n :type xattr_name: str\n\n :raises: :class:`TypeError`\n :raises: :class:`Error`\n :returns: bool - True on success, otherwise raise an error\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_65rm_xattr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_key = 0; - PyObject *__pyx_v_xattr_name = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("rm_xattr (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_xattr_name,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xattr_name)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("rm_xattr", 1, 2, 2, 1); __PYX_ERR(0, 2569, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rm_xattr") < 0)) __PYX_ERR(0, 2569, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_key = values[0]; - __pyx_v_xattr_name = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("rm_xattr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2569, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Ioctx.rm_xattr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Ioctx_64rm_xattr(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), __pyx_v_key, __pyx_v_xattr_name); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_64rm_xattr(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_xattr_name) { - char *__pyx_v__key; - char *__pyx_v__xattr_name; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - int __pyx_t_7; - __Pyx_RefNannySetupContext("rm_xattr", 0); - __Pyx_INCREF(__pyx_v_key); - __Pyx_INCREF(__pyx_v_xattr_name); - - /* "rados.pyx":2582 - * :returns: bool - True on success, otherwise raise an error - * """ - * self.require_ioctx_open() # <<<<<<<<<<<<<< - * - * key = cstr(key, 'key') - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_ioctx_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2582, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2582, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2582, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":2584 - * self.require_ioctx_open() - * - * key = cstr(key, 'key') # <<<<<<<<<<<<<< - * xattr_name = cstr(xattr_name, 'xattr_name') - * cdef: - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2584, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2584, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_key); - __Pyx_INCREF(__pyx_n_s_key); - __Pyx_GIVEREF(__pyx_n_s_key); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_key); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2584, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2585 - * - * key = cstr(key, 'key') - * xattr_name = cstr(xattr_name, 'xattr_name') # <<<<<<<<<<<<<< - * cdef: - * char *_key = key - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2585, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_3 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2585, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL; - } - __Pyx_INCREF(__pyx_v_xattr_name); - __Pyx_GIVEREF(__pyx_v_xattr_name); - PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_4, __pyx_v_xattr_name); - __Pyx_INCREF(__pyx_n_s_xattr_name); - __Pyx_GIVEREF(__pyx_n_s_xattr_name); - PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_4, __pyx_n_s_xattr_name); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2585, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_xattr_name, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2587 - * xattr_name = cstr(xattr_name, 'xattr_name') - * cdef: - * char *_key = key # <<<<<<<<<<<<<< - * char *_xattr_name = xattr_name - * - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_key); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2587, __pyx_L1_error) - __pyx_v__key = __pyx_t_6; - - /* "rados.pyx":2588 - * cdef: - * char *_key = key - * char *_xattr_name = xattr_name # <<<<<<<<<<<<<< - * - * with nogil: - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_xattr_name); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2588, __pyx_L1_error) - __pyx_v__xattr_name = __pyx_t_6; - - /* "rados.pyx":2590 - * char *_xattr_name = xattr_name - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_rmxattr(self.io, _key, _xattr_name) - * if ret < 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":2591 - * - * with nogil: - * ret = rados_rmxattr(self.io, _key, _xattr_name) # <<<<<<<<<<<<<< - * if ret < 0: - * raise make_ex(ret, "Failed to delete key %r xattr %r" % - */ - __pyx_v_ret = rados_rmxattr(__pyx_v_self->io, __pyx_v__key, __pyx_v__xattr_name); - } - - /* "rados.pyx":2590 - * char *_xattr_name = xattr_name - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_rmxattr(self.io, _key, _xattr_name) - * if ret < 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":2592 - * with nogil: - * ret = rados_rmxattr(self.io, _key, _xattr_name) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Failed to delete key %r xattr %r" % - * (key, xattr_name)) - */ - __pyx_t_7 = ((__pyx_v_ret < 0) != 0); - if (__pyx_t_7) { - - /* "rados.pyx":2593 - * ret = rados_rmxattr(self.io, _key, _xattr_name) - * if ret < 0: - * raise make_ex(ret, "Failed to delete key %r xattr %r" % # <<<<<<<<<<<<<< - * (key, xattr_name)) - * return True - */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - - /* "rados.pyx":2594 - * if ret < 0: - * raise make_ex(ret, "Failed to delete key %r xattr %r" % - * (key, xattr_name)) # <<<<<<<<<<<<<< - * return True - * - */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2594, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key); - __Pyx_INCREF(__pyx_v_xattr_name); - __Pyx_GIVEREF(__pyx_v_xattr_name); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_xattr_name); - - /* "rados.pyx":2593 - * ret = rados_rmxattr(self.io, _key, _xattr_name) - * if ret < 0: - * raise make_ex(ret, "Failed to delete key %r xattr %r" % # <<<<<<<<<<<<<< - * (key, xattr_name)) - * return True - */ - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Failed_to_delete_key_r_xattr_r, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_f_5rados_make_ex(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 2593, __pyx_L1_error) - - /* "rados.pyx":2592 - * with nogil: - * ret = rados_rmxattr(self.io, _key, _xattr_name) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Failed to delete key %r xattr %r" % - * (key, xattr_name)) - */ - } - - /* "rados.pyx":2595 - * raise make_ex(ret, "Failed to delete key %r xattr %r" % - * (key, xattr_name)) - * return True # <<<<<<<<<<<<<< - * - * def list_objects(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_True); - __pyx_r = Py_True; - goto __pyx_L0; - - /* "rados.pyx":2569 - * - * @requires(('key', str_type), ('xattr_name', str_type)) - * def rm_xattr(self, key, xattr_name): # <<<<<<<<<<<<<< - * """ - * Removes an extended attribute on from an object. - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.Ioctx.rm_xattr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_key); - __Pyx_XDECREF(__pyx_v_xattr_name); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2597 - * return True - * - * def list_objects(self): # <<<<<<<<<<<<<< - * """ - * Get ObjectIterator on rados.Ioctx object. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_67list_objects(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_66list_objects[] = "Ioctx.list_objects(self)\n\n Get ObjectIterator on rados.Ioctx object.\n\n :returns: ObjectIterator\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_67list_objects(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("list_objects (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_66list_objects(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_66list_objects(struct __pyx_obj_5rados_Ioctx *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("list_objects", 0); - - /* "rados.pyx":2603 - * :returns: ObjectIterator - * """ - * self.require_ioctx_open() # <<<<<<<<<<<<<< - * return ObjectIterator(self) - * - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_ioctx_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2603, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2603, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2603, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":2604 - * """ - * self.require_ioctx_open() - * return ObjectIterator(self) # <<<<<<<<<<<<<< - * - * def list_snaps(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2604, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5rados_ObjectIterator), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2604, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "rados.pyx":2597 - * return True - * - * def list_objects(self): # <<<<<<<<<<<<<< - * """ - * Get ObjectIterator on rados.Ioctx object. - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("rados.Ioctx.list_objects", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2606 - * return ObjectIterator(self) - * - * def list_snaps(self): # <<<<<<<<<<<<<< - * """ - * Get SnapIterator on rados.Ioctx object. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_69list_snaps(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_68list_snaps[] = "Ioctx.list_snaps(self)\n\n Get SnapIterator on rados.Ioctx object.\n\n :returns: SnapIterator\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_69list_snaps(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("list_snaps (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_68list_snaps(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_68list_snaps(struct __pyx_obj_5rados_Ioctx *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("list_snaps", 0); - - /* "rados.pyx":2612 - * :returns: SnapIterator - * """ - * self.require_ioctx_open() # <<<<<<<<<<<<<< - * return SnapIterator(self) - * - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_ioctx_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2612, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2612, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2612, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":2613 - * """ - * self.require_ioctx_open() - * return SnapIterator(self) # <<<<<<<<<<<<<< - * - * @requires(('snap_name', str_type)) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2613, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5rados_SnapIterator), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2613, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "rados.pyx":2606 - * return ObjectIterator(self) - * - * def list_snaps(self): # <<<<<<<<<<<<<< - * """ - * Get SnapIterator on rados.Ioctx object. - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("rados.Ioctx.list_snaps", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2616 - * - * @requires(('snap_name', str_type)) - * def create_snap(self, snap_name): # <<<<<<<<<<<<<< - * """ - * Create a pool-wide snapshot - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_71create_snap(PyObject *__pyx_v_self, PyObject *__pyx_v_snap_name); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_70create_snap[] = "Ioctx.create_snap(self, snap_name)\n\n Create a pool-wide snapshot\n\n :param snap_name: the name of the snapshot\n :type snap_name: str\n\n :raises: :class:`TypeError`\n :raises: :class:`Error`\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_71create_snap(PyObject *__pyx_v_self, PyObject *__pyx_v_snap_name) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("create_snap (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_70create_snap(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), ((PyObject *)__pyx_v_snap_name)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_70create_snap(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_snap_name) { - char *__pyx_v__snap_name; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - int __pyx_t_7; - __Pyx_RefNannySetupContext("create_snap", 0); - __Pyx_INCREF(__pyx_v_snap_name); - - /* "rados.pyx":2626 - * :raises: :class:`Error` - * """ - * self.require_ioctx_open() # <<<<<<<<<<<<<< - * snap_name = cstr(snap_name, 'snap_name') - * cdef char *_snap_name = snap_name - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_ioctx_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2626, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2626, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":2627 - * """ - * self.require_ioctx_open() - * snap_name = cstr(snap_name, 'snap_name') # <<<<<<<<<<<<<< - * cdef char *_snap_name = snap_name - * - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2627, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2627, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_snap_name); - __Pyx_GIVEREF(__pyx_v_snap_name); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_snap_name); - __Pyx_INCREF(__pyx_n_s_snap_name); - __Pyx_GIVEREF(__pyx_n_s_snap_name); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_snap_name); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2627, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_snap_name, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2628 - * self.require_ioctx_open() - * snap_name = cstr(snap_name, 'snap_name') - * cdef char *_snap_name = snap_name # <<<<<<<<<<<<<< - * - * with nogil: - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_snap_name); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2628, __pyx_L1_error) - __pyx_v__snap_name = __pyx_t_6; - - /* "rados.pyx":2630 - * cdef char *_snap_name = snap_name - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_ioctx_snap_create(self.io, _snap_name) - * if ret != 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":2631 - * - * with nogil: - * ret = rados_ioctx_snap_create(self.io, _snap_name) # <<<<<<<<<<<<<< - * if ret != 0: - * raise make_ex(ret, "Failed to create snap %s" % snap_name) - */ - __pyx_v_ret = rados_ioctx_snap_create(__pyx_v_self->io, __pyx_v__snap_name); - } - - /* "rados.pyx":2630 - * cdef char *_snap_name = snap_name - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_ioctx_snap_create(self.io, _snap_name) - * if ret != 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":2632 - * with nogil: - * ret = rados_ioctx_snap_create(self.io, _snap_name) - * if ret != 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Failed to create snap %s" % snap_name) - * - */ - __pyx_t_7 = ((__pyx_v_ret != 0) != 0); - if (__pyx_t_7) { - - /* "rados.pyx":2633 - * ret = rados_ioctx_snap_create(self.io, _snap_name) - * if ret != 0: - * raise make_ex(ret, "Failed to create snap %s" % snap_name) # <<<<<<<<<<<<<< - * - * @requires(('snap_name', str_type)) - */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2633, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Failed_to_create_snap_s, __pyx_v_snap_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2633, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __pyx_f_5rados_make_ex(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2633, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 2633, __pyx_L1_error) - - /* "rados.pyx":2632 - * with nogil: - * ret = rados_ioctx_snap_create(self.io, _snap_name) - * if ret != 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Failed to create snap %s" % snap_name) - * - */ - } - - /* "rados.pyx":2616 - * - * @requires(('snap_name', str_type)) - * def create_snap(self, snap_name): # <<<<<<<<<<<<<< - * """ - * Create a pool-wide snapshot - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.Ioctx.create_snap", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_snap_name); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2636 - * - * @requires(('snap_name', str_type)) - * def remove_snap(self, snap_name): # <<<<<<<<<<<<<< - * """ - * Removes a pool-wide snapshot - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_73remove_snap(PyObject *__pyx_v_self, PyObject *__pyx_v_snap_name); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_72remove_snap[] = "Ioctx.remove_snap(self, snap_name)\n\n Removes a pool-wide snapshot\n\n :param snap_name: the name of the snapshot\n :type snap_name: str\n\n :raises: :class:`TypeError`\n :raises: :class:`Error`\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_73remove_snap(PyObject *__pyx_v_self, PyObject *__pyx_v_snap_name) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("remove_snap (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_72remove_snap(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), ((PyObject *)__pyx_v_snap_name)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_72remove_snap(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_snap_name) { - char *__pyx_v__snap_name; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - int __pyx_t_7; - __Pyx_RefNannySetupContext("remove_snap", 0); - __Pyx_INCREF(__pyx_v_snap_name); - - /* "rados.pyx":2646 - * :raises: :class:`Error` - * """ - * self.require_ioctx_open() # <<<<<<<<<<<<<< - * snap_name = cstr(snap_name, 'snap_name') - * cdef char *_snap_name = snap_name - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_ioctx_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2646, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2646, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2646, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":2647 - * """ - * self.require_ioctx_open() - * snap_name = cstr(snap_name, 'snap_name') # <<<<<<<<<<<<<< - * cdef char *_snap_name = snap_name - * - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2647, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2647, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_snap_name); - __Pyx_GIVEREF(__pyx_v_snap_name); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_snap_name); - __Pyx_INCREF(__pyx_n_s_snap_name); - __Pyx_GIVEREF(__pyx_n_s_snap_name); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_snap_name); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2647, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_snap_name, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2648 - * self.require_ioctx_open() - * snap_name = cstr(snap_name, 'snap_name') - * cdef char *_snap_name = snap_name # <<<<<<<<<<<<<< - * - * with nogil: - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_snap_name); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2648, __pyx_L1_error) - __pyx_v__snap_name = __pyx_t_6; - - /* "rados.pyx":2650 - * cdef char *_snap_name = snap_name - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_ioctx_snap_remove(self.io, _snap_name) - * if ret != 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":2651 - * - * with nogil: - * ret = rados_ioctx_snap_remove(self.io, _snap_name) # <<<<<<<<<<<<<< - * if ret != 0: - * raise make_ex(ret, "Failed to remove snap %s" % snap_name) - */ - __pyx_v_ret = rados_ioctx_snap_remove(__pyx_v_self->io, __pyx_v__snap_name); - } - - /* "rados.pyx":2650 - * cdef char *_snap_name = snap_name - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_ioctx_snap_remove(self.io, _snap_name) - * if ret != 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":2652 - * with nogil: - * ret = rados_ioctx_snap_remove(self.io, _snap_name) - * if ret != 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Failed to remove snap %s" % snap_name) - * - */ - __pyx_t_7 = ((__pyx_v_ret != 0) != 0); - if (__pyx_t_7) { - - /* "rados.pyx":2653 - * ret = rados_ioctx_snap_remove(self.io, _snap_name) - * if ret != 0: - * raise make_ex(ret, "Failed to remove snap %s" % snap_name) # <<<<<<<<<<<<<< - * - * @requires(('snap_name', str_type)) - */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2653, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Failed_to_remove_snap_s, __pyx_v_snap_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2653, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __pyx_f_5rados_make_ex(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2653, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 2653, __pyx_L1_error) - - /* "rados.pyx":2652 - * with nogil: - * ret = rados_ioctx_snap_remove(self.io, _snap_name) - * if ret != 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Failed to remove snap %s" % snap_name) - * - */ - } - - /* "rados.pyx":2636 - * - * @requires(('snap_name', str_type)) - * def remove_snap(self, snap_name): # <<<<<<<<<<<<<< - * """ - * Removes a pool-wide snapshot - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.Ioctx.remove_snap", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_snap_name); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2656 - * - * @requires(('snap_name', str_type)) - * def lookup_snap(self, snap_name): # <<<<<<<<<<<<<< - * """ - * Get the id of a pool snapshot - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_75lookup_snap(PyObject *__pyx_v_self, PyObject *__pyx_v_snap_name); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_74lookup_snap[] = "Ioctx.lookup_snap(self, snap_name)\n\n Get the id of a pool snapshot\n\n :param snap_name: the name of the snapshot to lookop\n :type snap_name: str\n\n :raises: :class:`TypeError`\n :raises: :class:`Error`\n :returns: Snap - on success\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_75lookup_snap(PyObject *__pyx_v_self, PyObject *__pyx_v_snap_name) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("lookup_snap (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_74lookup_snap(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), ((PyObject *)__pyx_v_snap_name)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_74lookup_snap(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_snap_name) { - PyObject *__pyx_v_csnap_name = NULL; - char *__pyx_v__snap_name; - rados_snap_t __pyx_v_snap_id; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - int __pyx_t_7; - __Pyx_RefNannySetupContext("lookup_snap", 0); - - /* "rados.pyx":2667 - * :returns: Snap - on success - * """ - * self.require_ioctx_open() # <<<<<<<<<<<<<< - * csnap_name = cstr(snap_name, 'snap_name') - * cdef: - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_ioctx_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2667, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2667, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2667, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":2668 - * """ - * self.require_ioctx_open() - * csnap_name = cstr(snap_name, 'snap_name') # <<<<<<<<<<<<<< - * cdef: - * char *_snap_name = csnap_name - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_snap_name); - __Pyx_GIVEREF(__pyx_v_snap_name); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_snap_name); - __Pyx_INCREF(__pyx_n_s_snap_name); - __Pyx_GIVEREF(__pyx_n_s_snap_name); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_snap_name); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_csnap_name = __pyx_t_1; - __pyx_t_1 = 0; - - /* "rados.pyx":2670 - * csnap_name = cstr(snap_name, 'snap_name') - * cdef: - * char *_snap_name = csnap_name # <<<<<<<<<<<<<< - * rados_snap_t snap_id - * - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_csnap_name); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2670, __pyx_L1_error) - __pyx_v__snap_name = __pyx_t_6; - - /* "rados.pyx":2673 - * rados_snap_t snap_id - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_ioctx_snap_lookup(self.io, _snap_name, &snap_id) - * if ret != 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":2674 - * - * with nogil: - * ret = rados_ioctx_snap_lookup(self.io, _snap_name, &snap_id) # <<<<<<<<<<<<<< - * if ret != 0: - * raise make_ex(ret, "Failed to lookup snap %s" % snap_name) - */ - __pyx_v_ret = rados_ioctx_snap_lookup(__pyx_v_self->io, __pyx_v__snap_name, (&__pyx_v_snap_id)); - } - - /* "rados.pyx":2673 - * rados_snap_t snap_id - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_ioctx_snap_lookup(self.io, _snap_name, &snap_id) - * if ret != 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":2675 - * with nogil: - * ret = rados_ioctx_snap_lookup(self.io, _snap_name, &snap_id) - * if ret != 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Failed to lookup snap %s" % snap_name) - * return Snap(self, snap_name, int(snap_id)) - */ - __pyx_t_7 = ((__pyx_v_ret != 0) != 0); - if (__pyx_t_7) { - - /* "rados.pyx":2676 - * ret = rados_ioctx_snap_lookup(self.io, _snap_name, &snap_id) - * if ret != 0: - * raise make_ex(ret, "Failed to lookup snap %s" % snap_name) # <<<<<<<<<<<<<< - * return Snap(self, snap_name, int(snap_id)) - * - */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2676, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Failed_to_lookup_snap_s, __pyx_v_snap_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2676, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __pyx_f_5rados_make_ex(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2676, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 2676, __pyx_L1_error) - - /* "rados.pyx":2675 - * with nogil: - * ret = rados_ioctx_snap_lookup(self.io, _snap_name, &snap_id) - * if ret != 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Failed to lookup snap %s" % snap_name) - * return Snap(self, snap_name, int(snap_id)) - */ - } - - /* "rados.pyx":2677 - * if ret != 0: - * raise make_ex(ret, "Failed to lookup snap %s" % snap_name) - * return Snap(self, snap_name, int(snap_id)) # <<<<<<<<<<<<<< - * - * @requires(('oid', str_type), ('snap_name', str_type)) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __Pyx_PyInt_From_uint64_t(__pyx_v_snap_id); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2677, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2677, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2677, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2677, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); - __Pyx_INCREF(__pyx_v_snap_name); - __Pyx_GIVEREF(__pyx_v_snap_name); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_snap_name); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5rados_Snap), __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2677, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; - goto __pyx_L0; - - /* "rados.pyx":2656 - * - * @requires(('snap_name', str_type)) - * def lookup_snap(self, snap_name): # <<<<<<<<<<<<<< - * """ - * Get the id of a pool snapshot - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.Ioctx.lookup_snap", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_csnap_name); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2680 - * - * @requires(('oid', str_type), ('snap_name', str_type)) - * def snap_rollback(self, oid, snap_name): # <<<<<<<<<<<<<< - * """ - * Rollback an object to a snapshot - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_77snap_rollback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_76snap_rollback[] = "Ioctx.snap_rollback(self, oid, snap_name)\n\n Rollback an object to a snapshot\n\n :param oid: the name of the object\n :type oid: str\n :param snap_name: the name of the snapshot\n :type snap_name: str\n\n :raises: :class:`TypeError`\n :raises: :class:`Error`\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_77snap_rollback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_oid = 0; - PyObject *__pyx_v_snap_name = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("snap_rollback (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_oid,&__pyx_n_s_snap_name,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_oid)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_snap_name)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("snap_rollback", 1, 2, 2, 1); __PYX_ERR(0, 2680, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "snap_rollback") < 0)) __PYX_ERR(0, 2680, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_oid = values[0]; - __pyx_v_snap_name = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("snap_rollback", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2680, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Ioctx.snap_rollback", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Ioctx_76snap_rollback(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), __pyx_v_oid, __pyx_v_snap_name); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_76snap_rollback(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_oid, PyObject *__pyx_v_snap_name) { - char *__pyx_v__snap_name; - char *__pyx_v__oid; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - int __pyx_t_7; - __Pyx_RefNannySetupContext("snap_rollback", 0); - __Pyx_INCREF(__pyx_v_oid); - __Pyx_INCREF(__pyx_v_snap_name); - - /* "rados.pyx":2692 - * :raises: :class:`Error` - * """ - * self.require_ioctx_open() # <<<<<<<<<<<<<< - * oid = cstr(oid, 'oid') - * snap_name = cstr(snap_name, 'snap_name') - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_ioctx_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2692, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2692, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2692, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":2693 - * """ - * self.require_ioctx_open() - * oid = cstr(oid, 'oid') # <<<<<<<<<<<<<< - * snap_name = cstr(snap_name, 'snap_name') - * cdef: - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2693, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2693, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_oid); - __Pyx_GIVEREF(__pyx_v_oid); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_oid); - __Pyx_INCREF(__pyx_n_s_oid); - __Pyx_GIVEREF(__pyx_n_s_oid); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_oid); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2693, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_oid, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2694 - * self.require_ioctx_open() - * oid = cstr(oid, 'oid') - * snap_name = cstr(snap_name, 'snap_name') # <<<<<<<<<<<<<< - * cdef: - * char *_snap_name = snap_name - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2694, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_3 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2694, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL; - } - __Pyx_INCREF(__pyx_v_snap_name); - __Pyx_GIVEREF(__pyx_v_snap_name); - PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_4, __pyx_v_snap_name); - __Pyx_INCREF(__pyx_n_s_snap_name); - __Pyx_GIVEREF(__pyx_n_s_snap_name); - PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_4, __pyx_n_s_snap_name); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2694, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_snap_name, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2696 - * snap_name = cstr(snap_name, 'snap_name') - * cdef: - * char *_snap_name = snap_name # <<<<<<<<<<<<<< - * char *_oid = oid - * - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_snap_name); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2696, __pyx_L1_error) - __pyx_v__snap_name = __pyx_t_6; - - /* "rados.pyx":2697 - * cdef: - * char *_snap_name = snap_name - * char *_oid = oid # <<<<<<<<<<<<<< - * - * with nogil: - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_oid); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2697, __pyx_L1_error) - __pyx_v__oid = __pyx_t_6; - - /* "rados.pyx":2699 - * char *_oid = oid - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_ioctx_snap_rollback(self.io, _oid, _snap_name) - * if ret != 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":2700 - * - * with nogil: - * ret = rados_ioctx_snap_rollback(self.io, _oid, _snap_name) # <<<<<<<<<<<<<< - * if ret != 0: - * raise make_ex(ret, "Failed to rollback %s" % oid) - */ - __pyx_v_ret = rados_ioctx_snap_rollback(__pyx_v_self->io, __pyx_v__oid, __pyx_v__snap_name); - } - - /* "rados.pyx":2699 - * char *_oid = oid - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_ioctx_snap_rollback(self.io, _oid, _snap_name) - * if ret != 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":2701 - * with nogil: - * ret = rados_ioctx_snap_rollback(self.io, _oid, _snap_name) - * if ret != 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Failed to rollback %s" % oid) - * - */ - __pyx_t_7 = ((__pyx_v_ret != 0) != 0); - if (__pyx_t_7) { - - /* "rados.pyx":2702 - * ret = rados_ioctx_snap_rollback(self.io, _oid, _snap_name) - * if ret != 0: - * raise make_ex(ret, "Failed to rollback %s" % oid) # <<<<<<<<<<<<<< - * - * def get_last_version(self): - */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2702, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Failed_to_rollback_s, __pyx_v_oid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2702, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_f_5rados_make_ex(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2702, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 2702, __pyx_L1_error) - - /* "rados.pyx":2701 - * with nogil: - * ret = rados_ioctx_snap_rollback(self.io, _oid, _snap_name) - * if ret != 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Failed to rollback %s" % oid) - * - */ - } - - /* "rados.pyx":2680 - * - * @requires(('oid', str_type), ('snap_name', str_type)) - * def snap_rollback(self, oid, snap_name): # <<<<<<<<<<<<<< - * """ - * Rollback an object to a snapshot - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.Ioctx.snap_rollback", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_oid); - __Pyx_XDECREF(__pyx_v_snap_name); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2704 - * raise make_ex(ret, "Failed to rollback %s" % oid) - * - * def get_last_version(self): # <<<<<<<<<<<<<< - * """ - * Return the version of the last object read or written to. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_79get_last_version(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_78get_last_version[] = "Ioctx.get_last_version(self)\n\n Return the version of the last object read or written to.\n\n This exposes the internal version number of the last object read or\n written via this io context\n\n :returns: version of the last object used\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_79get_last_version(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("get_last_version (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_78get_last_version(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_78get_last_version(struct __pyx_obj_5rados_Ioctx *__pyx_v_self) { - uint64_t __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("get_last_version", 0); - - /* "rados.pyx":2713 - * :returns: version of the last object used - * """ - * self.require_ioctx_open() # <<<<<<<<<<<<<< - * with nogil: - * ret = rados_get_last_version(self.io) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_ioctx_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2713, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2713, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2713, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":2714 - * """ - * self.require_ioctx_open() - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_get_last_version(self.io) - * return int(ret) - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":2715 - * self.require_ioctx_open() - * with nogil: - * ret = rados_get_last_version(self.io) # <<<<<<<<<<<<<< - * return int(ret) - * - */ - __pyx_v_ret = rados_get_last_version(__pyx_v_self->io); - } - - /* "rados.pyx":2714 - * """ - * self.require_ioctx_open() - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_get_last_version(self.io) - * return int(ret) - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":2716 - * with nogil: - * ret = rados_get_last_version(self.io) - * return int(ret) # <<<<<<<<<<<<<< - * - * def create_write_op(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2716, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2716, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2716, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "rados.pyx":2704 - * raise make_ex(ret, "Failed to rollback %s" % oid) - * - * def get_last_version(self): # <<<<<<<<<<<<<< - * """ - * Return the version of the last object read or written to. - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("rados.Ioctx.get_last_version", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2718 - * return int(ret) - * - * def create_write_op(self): # <<<<<<<<<<<<<< - * """ - * create write operation object. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_81create_write_op(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_80create_write_op[] = "Ioctx.create_write_op(self)\n\n create write operation object.\n need call release_write_op after use\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_81create_write_op(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("create_write_op (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_80create_write_op(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_80create_write_op(CYTHON_UNUSED struct __pyx_obj_5rados_Ioctx *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("create_write_op", 0); - - /* "rados.pyx":2723 - * need call release_write_op after use - * """ - * return WriteOp().create() # <<<<<<<<<<<<<< - * - * def create_read_op(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5rados_WriteOp), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2723, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_create); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2723, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - } - } - if (__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2723, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2723, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "rados.pyx":2718 - * return int(ret) - * - * def create_write_op(self): # <<<<<<<<<<<<<< - * """ - * create write operation object. - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("rados.Ioctx.create_write_op", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2725 - * return WriteOp().create() - * - * def create_read_op(self): # <<<<<<<<<<<<<< - * """ - * create read operation object. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_83create_read_op(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_82create_read_op[] = "Ioctx.create_read_op(self)\n\n create read operation object.\n need call release_read_op after use\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_83create_read_op(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("create_read_op (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_82create_read_op(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_82create_read_op(CYTHON_UNUSED struct __pyx_obj_5rados_Ioctx *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("create_read_op", 0); - - /* "rados.pyx":2730 - * need call release_read_op after use - * """ - * return ReadOp().create() # <<<<<<<<<<<<<< - * - * def release_write_op(self, write_op): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5rados_ReadOp), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2730, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_create); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2730, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - } - } - if (__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2730, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2730, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "rados.pyx":2725 - * return WriteOp().create() - * - * def create_read_op(self): # <<<<<<<<<<<<<< - * """ - * create read operation object. - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("rados.Ioctx.create_read_op", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2732 - * return ReadOp().create() - * - * def release_write_op(self, write_op): # <<<<<<<<<<<<<< - * """ - * release memory alloc by create_write_op - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_85release_write_op(PyObject *__pyx_v_self, PyObject *__pyx_v_write_op); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_84release_write_op[] = "Ioctx.release_write_op(self, write_op)\n\n release memory alloc by create_write_op\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_85release_write_op(PyObject *__pyx_v_self, PyObject *__pyx_v_write_op) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("release_write_op (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_84release_write_op(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), ((PyObject *)__pyx_v_write_op)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_84release_write_op(CYTHON_UNUSED struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_write_op) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("release_write_op", 0); - - /* "rados.pyx":2736 - * release memory alloc by create_write_op - * """ - * write_op.release() # <<<<<<<<<<<<<< - * - * def release_read_op(self, read_op): - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_write_op, __pyx_n_s_release); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2736, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2736, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2736, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":2732 - * return ReadOp().create() - * - * def release_write_op(self, write_op): # <<<<<<<<<<<<<< - * """ - * release memory alloc by create_write_op - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("rados.Ioctx.release_write_op", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2738 - * write_op.release() - * - * def release_read_op(self, read_op): # <<<<<<<<<<<<<< - * """ - * release memory alloc by create_read_op - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_87release_read_op(PyObject *__pyx_v_self, PyObject *__pyx_v_read_op); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_86release_read_op[] = "Ioctx.release_read_op(self, read_op)\n\n release memory alloc by create_read_op\n :para read_op: read_op object\n :type: int\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_87release_read_op(PyObject *__pyx_v_self, PyObject *__pyx_v_read_op) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("release_read_op (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_86release_read_op(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), ((PyObject *)__pyx_v_read_op)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_86release_read_op(CYTHON_UNUSED struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_read_op) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("release_read_op", 0); - - /* "rados.pyx":2744 - * :type: int - * """ - * read_op.release() # <<<<<<<<<<<<<< - * - * @requires(('write_op', WriteOp), ('keys', tuple), ('values', tuple)) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_read_op, __pyx_n_s_release); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2744, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2744, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2744, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":2738 - * write_op.release() - * - * def release_read_op(self, read_op): # <<<<<<<<<<<<<< - * """ - * release memory alloc by create_read_op - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("rados.Ioctx.release_read_op", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2747 - * - * @requires(('write_op', WriteOp), ('keys', tuple), ('values', tuple)) - * def set_omap(self, write_op, keys, values): # <<<<<<<<<<<<<< - * """ - * set keys values to write_op - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_89set_omap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_88set_omap[] = "Ioctx.set_omap(self, write_op, keys, values)\n\n set keys values to write_op\n :para write_op: write_operation object\n :type write_op: WriteOp\n :para keys: a tuple of keys\n :type keys: tuple\n :para values: a tuple of values\n :type values: tuple\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_89set_omap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_write_op = 0; - PyObject *__pyx_v_keys = 0; - PyObject *__pyx_v_values = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("set_omap (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_write_op,&__pyx_n_s_keys,&__pyx_n_s_values,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_write_op)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_keys)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("set_omap", 1, 3, 3, 1); __PYX_ERR(0, 2747, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("set_omap", 1, 3, 3, 2); __PYX_ERR(0, 2747, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_omap") < 0)) __PYX_ERR(0, 2747, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - } - __pyx_v_write_op = values[0]; - __pyx_v_keys = values[1]; - __pyx_v_values = values[2]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("set_omap", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2747, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Ioctx.set_omap", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Ioctx_88set_omap(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), __pyx_v_write_op, __pyx_v_keys, __pyx_v_values); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_88set_omap(CYTHON_UNUSED struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_write_op, PyObject *__pyx_v_keys, PyObject *__pyx_v_values) { - struct __pyx_obj_5rados_WriteOp *__pyx_v__write_op = 0; - size_t __pyx_v_key_num; - char **__pyx_v__keys; - char **__pyx_v__values; - size_t *__pyx_v__lens; - PyObject *__pyx_v_v = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - Py_ssize_t __pyx_t_1; - Py_ssize_t __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *(*__pyx_t_8)(PyObject *); - __Pyx_RefNannySetupContext("set_omap", 0); - __Pyx_INCREF(__pyx_v_keys); - - /* "rados.pyx":2758 - * """ - * - * if len(keys) != len(values): # <<<<<<<<<<<<<< - * raise Error("Rados(): keys and values must have the same number of items") - * - */ - __pyx_t_1 = PyObject_Length(__pyx_v_keys); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2758, __pyx_L1_error) - __pyx_t_2 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2758, __pyx_L1_error) - __pyx_t_3 = ((__pyx_t_1 != __pyx_t_2) != 0); - if (__pyx_t_3) { - - /* "rados.pyx":2759 - * - * if len(keys) != len(values): - * raise Error("Rados(): keys and values must have the same number of items") # <<<<<<<<<<<<<< - * - * keys = cstr_list(keys, 'keys') - */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2759, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2759, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 2759, __pyx_L1_error) - - /* "rados.pyx":2758 - * """ - * - * if len(keys) != len(values): # <<<<<<<<<<<<<< - * raise Error("Rados(): keys and values must have the same number of items") - * - */ - } - - /* "rados.pyx":2761 - * raise Error("Rados(): keys and values must have the same number of items") - * - * keys = cstr_list(keys, 'keys') # <<<<<<<<<<<<<< - * cdef: - * WriteOp _write_op = write_op - */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr_list); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2761, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = NULL; - __pyx_t_2 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_2 = 1; - } - } - __pyx_t_7 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2761, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (__pyx_t_6) { - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; - } - __Pyx_INCREF(__pyx_v_keys); - __Pyx_GIVEREF(__pyx_v_keys); - PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_2, __pyx_v_keys); - __Pyx_INCREF(__pyx_n_s_keys); - __Pyx_GIVEREF(__pyx_n_s_keys); - PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_2, __pyx_n_s_keys); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2761, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF_SET(__pyx_v_keys, __pyx_t_5); - __pyx_t_5 = 0; - - /* "rados.pyx":2763 - * keys = cstr_list(keys, 'keys') - * cdef: - * WriteOp _write_op = write_op # <<<<<<<<<<<<<< - * size_t key_num = len(keys) - * char **_keys = to_bytes_array(keys) - */ - if (!(likely(((__pyx_v_write_op) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_write_op, __pyx_ptype_5rados_WriteOp))))) __PYX_ERR(0, 2763, __pyx_L1_error) - __pyx_t_5 = __pyx_v_write_op; - __Pyx_INCREF(__pyx_t_5); - __pyx_v__write_op = ((struct __pyx_obj_5rados_WriteOp *)__pyx_t_5); - __pyx_t_5 = 0; - - /* "rados.pyx":2764 - * cdef: - * WriteOp _write_op = write_op - * size_t key_num = len(keys) # <<<<<<<<<<<<<< - * char **_keys = to_bytes_array(keys) - * char **_values = to_bytes_array(values) - */ - __pyx_t_2 = PyObject_Length(__pyx_v_keys); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2764, __pyx_L1_error) - __pyx_v_key_num = __pyx_t_2; - - /* "rados.pyx":2765 - * WriteOp _write_op = write_op - * size_t key_num = len(keys) - * char **_keys = to_bytes_array(keys) # <<<<<<<<<<<<<< - * char **_values = to_bytes_array(values) - * size_t *_lens = to_csize_t_array([len(v) for v in values]) - */ - __pyx_v__keys = __pyx_f_5rados_to_bytes_array(__pyx_v_keys); - - /* "rados.pyx":2766 - * size_t key_num = len(keys) - * char **_keys = to_bytes_array(keys) - * char **_values = to_bytes_array(values) # <<<<<<<<<<<<<< - * size_t *_lens = to_csize_t_array([len(v) for v in values]) - * - */ - __pyx_v__values = __pyx_f_5rados_to_bytes_array(__pyx_v_values); - - /* "rados.pyx":2767 - * char **_keys = to_bytes_array(keys) - * char **_values = to_bytes_array(values) - * size_t *_lens = to_csize_t_array([len(v) for v in values]) # <<<<<<<<<<<<<< - * - * try: - */ - __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2767, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (likely(PyList_CheckExact(__pyx_v_values)) || PyTuple_CheckExact(__pyx_v_values)) { - __pyx_t_4 = __pyx_v_values; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0; - __pyx_t_8 = NULL; - } else { - __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2767, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2767, __pyx_L1_error) - } - for (;;) { - if (likely(!__pyx_t_8)) { - if (likely(PyList_CheckExact(__pyx_t_4))) { - if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2767, __pyx_L1_error) - #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2767, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - #endif - } else { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2767, __pyx_L1_error) - #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2767, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - #endif - } - } else { - __pyx_t_7 = __pyx_t_8(__pyx_t_4); - if (unlikely(!__pyx_t_7)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2767, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_7); - } - __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_1 = PyObject_Length(__pyx_v_v); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2767, __pyx_L1_error) - __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2767, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 2767, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v__lens = __pyx_f_5rados_to_csize_t_array(__pyx_t_5); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "rados.pyx":2769 - * size_t *_lens = to_csize_t_array([len(v) for v in values]) - * - * try: # <<<<<<<<<<<<<< - * with nogil: - * rados_write_op_omap_set(_write_op.write_op, - */ - /*try:*/ { - - /* "rados.pyx":2770 - * - * try: - * with nogil: # <<<<<<<<<<<<<< - * rados_write_op_omap_set(_write_op.write_op, - * _keys, - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":2771 - * try: - * with nogil: - * rados_write_op_omap_set(_write_op.write_op, # <<<<<<<<<<<<<< - * _keys, - * _values, - */ - rados_write_op_omap_set(__pyx_v__write_op->write_op, ((char const **)__pyx_v__keys), ((char const **)__pyx_v__values), ((size_t const *)__pyx_v__lens), __pyx_v_key_num); - } - - /* "rados.pyx":2770 - * - * try: - * with nogil: # <<<<<<<<<<<<<< - * rados_write_op_omap_set(_write_op.write_op, - * _keys, - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L11; - } - __pyx_L11:; - } - } - } - - /* "rados.pyx":2776 - * _lens, key_num) - * finally: - * free(_keys) # <<<<<<<<<<<<<< - * free(_values) - * free(_lens) - */ - /*finally:*/ { - /*normal exit:*/{ - free(__pyx_v__keys); - - /* "rados.pyx":2777 - * finally: - * free(_keys) - * free(_values) # <<<<<<<<<<<<<< - * free(_lens) - * - */ - free(__pyx_v__values); - - /* "rados.pyx":2778 - * free(_keys) - * free(_values) - * free(_lens) # <<<<<<<<<<<<<< - * - * @requires(('write_op', WriteOp), ('oid', str_type), ('mtime', opt(int)), ('flags', opt(int))) - */ - free(__pyx_v__lens); - goto __pyx_L8; - } - __pyx_L8:; - } - - /* "rados.pyx":2747 - * - * @requires(('write_op', WriteOp), ('keys', tuple), ('values', tuple)) - * def set_omap(self, write_op, keys, values): # <<<<<<<<<<<<<< - * """ - * set keys values to write_op - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("rados.Ioctx.set_omap", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v__write_op); - __Pyx_XDECREF(__pyx_v_v); - __Pyx_XDECREF(__pyx_v_keys); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2781 - * - * @requires(('write_op', WriteOp), ('oid', str_type), ('mtime', opt(int)), ('flags', opt(int))) - * def operate_write_op(self, write_op, oid, mtime=0, flags=LIBRADOS_OPERATION_NOFLAG): # <<<<<<<<<<<<<< - * """ - * excute the real write operation - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_91operate_write_op(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_90operate_write_op[] = "Ioctx.operate_write_op(self, write_op, oid, mtime=0, flags=LIBRADOS_OPERATION_NOFLAG)\n\n excute the real write operation\n :para write_op: write operation object\n :type write_op: WriteOp\n :para oid: object name\n :type oid: str\n :para mtime: the time to set the mtime to, 0 for the current time\n :type mtime: int\n :para flags: flags to apply to the entire operation\n :type flags: int\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_91operate_write_op(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_write_op = 0; - PyObject *__pyx_v_oid = 0; - PyObject *__pyx_v_mtime = 0; - PyObject *__pyx_v_flags = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("operate_write_op (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_write_op,&__pyx_n_s_oid,&__pyx_n_s_mtime,&__pyx_n_s_flags,0}; - PyObject* values[4] = {0,0,0,0}; - values[2] = ((PyObject *)__pyx_int_0); - values[3] = __pyx_k__49; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_write_op)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_oid)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("operate_write_op", 0, 2, 4, 1); __PYX_ERR(0, 2781, __pyx_L3_error) - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mtime); - if (value) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags); - if (value) { values[3] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "operate_write_op") < 0)) __PYX_ERR(0, 2781, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_write_op = values[0]; - __pyx_v_oid = values[1]; - __pyx_v_mtime = values[2]; - __pyx_v_flags = values[3]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("operate_write_op", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2781, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Ioctx.operate_write_op", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Ioctx_90operate_write_op(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), __pyx_v_write_op, __pyx_v_oid, __pyx_v_mtime, __pyx_v_flags); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_90operate_write_op(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_write_op, PyObject *__pyx_v_oid, PyObject *__pyx_v_mtime, PyObject *__pyx_v_flags) { - struct __pyx_obj_5rados_WriteOp *__pyx_v__write_op = 0; - char *__pyx_v__oid; - time_t __pyx_v__mtime; - int __pyx_v__flags; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - time_t __pyx_t_7; - int __pyx_t_8; - int __pyx_t_9; - __Pyx_RefNannySetupContext("operate_write_op", 0); - __Pyx_INCREF(__pyx_v_oid); - - /* "rados.pyx":2794 - * """ - * - * oid = cstr(oid, 'oid') # <<<<<<<<<<<<<< - * cdef: - * WriteOp _write_op = write_op - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2794, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2794, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_oid); - __Pyx_GIVEREF(__pyx_v_oid); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_oid); - __Pyx_INCREF(__pyx_n_s_oid); - __Pyx_GIVEREF(__pyx_n_s_oid); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_oid); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2794, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_oid, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2796 - * oid = cstr(oid, 'oid') - * cdef: - * WriteOp _write_op = write_op # <<<<<<<<<<<<<< - * char *_oid = oid - * time_t _mtime = mtime - */ - if (!(likely(((__pyx_v_write_op) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_write_op, __pyx_ptype_5rados_WriteOp))))) __PYX_ERR(0, 2796, __pyx_L1_error) - __pyx_t_1 = __pyx_v_write_op; - __Pyx_INCREF(__pyx_t_1); - __pyx_v__write_op = ((struct __pyx_obj_5rados_WriteOp *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2797 - * cdef: - * WriteOp _write_op = write_op - * char *_oid = oid # <<<<<<<<<<<<<< - * time_t _mtime = mtime - * int _flags = flags - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_oid); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2797, __pyx_L1_error) - __pyx_v__oid = __pyx_t_6; - - /* "rados.pyx":2798 - * WriteOp _write_op = write_op - * char *_oid = oid - * time_t _mtime = mtime # <<<<<<<<<<<<<< - * int _flags = flags - * - */ - __pyx_t_7 = __Pyx_PyInt_As_time_t(__pyx_v_mtime); if (unlikely((__pyx_t_7 == (time_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2798, __pyx_L1_error) - __pyx_v__mtime = __pyx_t_7; - - /* "rados.pyx":2799 - * char *_oid = oid - * time_t _mtime = mtime - * int _flags = flags # <<<<<<<<<<<<<< - * - * with nogil: - */ - __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_flags); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2799, __pyx_L1_error) - __pyx_v__flags = __pyx_t_8; - - /* "rados.pyx":2801 - * int _flags = flags - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_write_op_operate(_write_op.write_op, self.io, _oid, &_mtime, _flags) - * if ret != 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":2802 - * - * with nogil: - * ret = rados_write_op_operate(_write_op.write_op, self.io, _oid, &_mtime, _flags) # <<<<<<<<<<<<<< - * if ret != 0: - * raise make_ex(ret, "Failed to operate write op for oid %s" % oid) - */ - __pyx_v_ret = rados_write_op_operate(__pyx_v__write_op->write_op, __pyx_v_self->io, __pyx_v__oid, (&__pyx_v__mtime), __pyx_v__flags); - } - - /* "rados.pyx":2801 - * int _flags = flags - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_write_op_operate(_write_op.write_op, self.io, _oid, &_mtime, _flags) - * if ret != 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":2803 - * with nogil: - * ret = rados_write_op_operate(_write_op.write_op, self.io, _oid, &_mtime, _flags) - * if ret != 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Failed to operate write op for oid %s" % oid) - * - */ - __pyx_t_9 = ((__pyx_v_ret != 0) != 0); - if (__pyx_t_9) { - - /* "rados.pyx":2804 - * ret = rados_write_op_operate(_write_op.write_op, self.io, _oid, &_mtime, _flags) - * if ret != 0: - * raise make_ex(ret, "Failed to operate write op for oid %s" % oid) # <<<<<<<<<<<<<< - * - * @requires(('read_op', ReadOp), ('oid', str_type), ('flag', opt(int))) - */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2804, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Failed_to_operate_write_op_for_o, __pyx_v_oid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2804, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __pyx_f_5rados_make_ex(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2804, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 2804, __pyx_L1_error) - - /* "rados.pyx":2803 - * with nogil: - * ret = rados_write_op_operate(_write_op.write_op, self.io, _oid, &_mtime, _flags) - * if ret != 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Failed to operate write op for oid %s" % oid) - * - */ - } - - /* "rados.pyx":2781 - * - * @requires(('write_op', WriteOp), ('oid', str_type), ('mtime', opt(int)), ('flags', opt(int))) - * def operate_write_op(self, write_op, oid, mtime=0, flags=LIBRADOS_OPERATION_NOFLAG): # <<<<<<<<<<<<<< - * """ - * excute the real write operation - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.Ioctx.operate_write_op", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v__write_op); - __Pyx_XDECREF(__pyx_v_oid); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2807 - * - * @requires(('read_op', ReadOp), ('oid', str_type), ('flag', opt(int))) - * def operate_read_op(self, read_op, oid, flag=LIBRADOS_OPERATION_NOFLAG): # <<<<<<<<<<<<<< - * """ - * excute the real read operation - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_93operate_read_op(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_92operate_read_op[] = "Ioctx.operate_read_op(self, read_op, oid, flag=LIBRADOS_OPERATION_NOFLAG)\n\n excute the real read operation\n :para read_op: read operation object\n :type read_op: ReadOp\n :para oid: object name\n :type oid: str\n :para flag: flags to apply to the entire operation\n :type flag: int\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_93operate_read_op(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_read_op = 0; - PyObject *__pyx_v_oid = 0; - PyObject *__pyx_v_flag = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("operate_read_op (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_read_op,&__pyx_n_s_oid,&__pyx_n_s_flag,0}; - PyObject* values[3] = {0,0,0}; - values[2] = __pyx_k__50; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_read_op)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_oid)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("operate_read_op", 0, 2, 3, 1); __PYX_ERR(0, 2807, __pyx_L3_error) - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "operate_read_op") < 0)) __PYX_ERR(0, 2807, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_read_op = values[0]; - __pyx_v_oid = values[1]; - __pyx_v_flag = values[2]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("operate_read_op", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2807, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Ioctx.operate_read_op", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Ioctx_92operate_read_op(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), __pyx_v_read_op, __pyx_v_oid, __pyx_v_flag); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_92operate_read_op(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_read_op, PyObject *__pyx_v_oid, PyObject *__pyx_v_flag) { - struct __pyx_obj_5rados_ReadOp *__pyx_v__read_op = 0; - char *__pyx_v__oid; - int __pyx_v__flag; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - int __pyx_t_7; - int __pyx_t_8; - __Pyx_RefNannySetupContext("operate_read_op", 0); - __Pyx_INCREF(__pyx_v_oid); - - /* "rados.pyx":2817 - * :type flag: int - * """ - * oid = cstr(oid, 'oid') # <<<<<<<<<<<<<< - * cdef: - * ReadOp _read_op = read_op - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2817, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2817, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_oid); - __Pyx_GIVEREF(__pyx_v_oid); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_oid); - __Pyx_INCREF(__pyx_n_s_oid); - __Pyx_GIVEREF(__pyx_n_s_oid); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_oid); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2817, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_oid, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2819 - * oid = cstr(oid, 'oid') - * cdef: - * ReadOp _read_op = read_op # <<<<<<<<<<<<<< - * char *_oid = oid - * int _flag = flag - */ - if (!(likely(((__pyx_v_read_op) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_read_op, __pyx_ptype_5rados_ReadOp))))) __PYX_ERR(0, 2819, __pyx_L1_error) - __pyx_t_1 = __pyx_v_read_op; - __Pyx_INCREF(__pyx_t_1); - __pyx_v__read_op = ((struct __pyx_obj_5rados_ReadOp *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2820 - * cdef: - * ReadOp _read_op = read_op - * char *_oid = oid # <<<<<<<<<<<<<< - * int _flag = flag - * - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_oid); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2820, __pyx_L1_error) - __pyx_v__oid = __pyx_t_6; - - /* "rados.pyx":2821 - * ReadOp _read_op = read_op - * char *_oid = oid - * int _flag = flag # <<<<<<<<<<<<<< - * - * with nogil: - */ - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_flag); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2821, __pyx_L1_error) - __pyx_v__flag = __pyx_t_7; - - /* "rados.pyx":2823 - * int _flag = flag - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_read_op_operate(_read_op.read_op, self.io, _oid, _flag) - * if ret != 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":2824 - * - * with nogil: - * ret = rados_read_op_operate(_read_op.read_op, self.io, _oid, _flag) # <<<<<<<<<<<<<< - * if ret != 0: - * raise make_ex(ret, "Failed to operate read op for oid %s" % oid) - */ - __pyx_v_ret = rados_read_op_operate(__pyx_v__read_op->read_op, __pyx_v_self->io, __pyx_v__oid, __pyx_v__flag); - } - - /* "rados.pyx":2823 - * int _flag = flag - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_read_op_operate(_read_op.read_op, self.io, _oid, _flag) - * if ret != 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":2825 - * with nogil: - * ret = rados_read_op_operate(_read_op.read_op, self.io, _oid, _flag) - * if ret != 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Failed to operate read op for oid %s" % oid) - * - */ - __pyx_t_8 = ((__pyx_v_ret != 0) != 0); - if (__pyx_t_8) { - - /* "rados.pyx":2826 - * ret = rados_read_op_operate(_read_op.read_op, self.io, _oid, _flag) - * if ret != 0: - * raise make_ex(ret, "Failed to operate read op for oid %s" % oid) # <<<<<<<<<<<<<< - * - * @requires(('read_op', ReadOp), ('start_after', str_type), ('filter_prefix', str_type), ('max_return', int)) - */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2826, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Failed_to_operate_read_op_for_oi, __pyx_v_oid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2826, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __pyx_f_5rados_make_ex(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2826, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 2826, __pyx_L1_error) - - /* "rados.pyx":2825 - * with nogil: - * ret = rados_read_op_operate(_read_op.read_op, self.io, _oid, _flag) - * if ret != 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Failed to operate read op for oid %s" % oid) - * - */ - } - - /* "rados.pyx":2807 - * - * @requires(('read_op', ReadOp), ('oid', str_type), ('flag', opt(int))) - * def operate_read_op(self, read_op, oid, flag=LIBRADOS_OPERATION_NOFLAG): # <<<<<<<<<<<<<< - * """ - * excute the real read operation - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.Ioctx.operate_read_op", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v__read_op); - __Pyx_XDECREF(__pyx_v_oid); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2829 - * - * @requires(('read_op', ReadOp), ('start_after', str_type), ('filter_prefix', str_type), ('max_return', int)) - * def get_omap_vals(self, read_op, start_after, filter_prefix, max_return): # <<<<<<<<<<<<<< - * """ - * get the omap values - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_95get_omap_vals(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_94get_omap_vals[] = "Ioctx.get_omap_vals(self, read_op, start_after, filter_prefix, max_return)\n\n get the omap values\n :para read_op: read operation object\n :type read_op: ReadOp\n :para start_after: list keys starting after start_after\n :type start_after: str\n :para filter_prefix: list only keys beginning with filter_prefix\n :type filter_prefix: str\n :para max_return: list no more than max_return key/value pairs\n :type max_return: int\n :returns: an iterator over the requested omap values, return value from this action\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_95get_omap_vals(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_read_op = 0; - PyObject *__pyx_v_start_after = 0; - PyObject *__pyx_v_filter_prefix = 0; - PyObject *__pyx_v_max_return = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("get_omap_vals (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_read_op,&__pyx_n_s_start_after,&__pyx_n_s_filter_prefix,&__pyx_n_s_max_return,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_read_op)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start_after)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("get_omap_vals", 1, 4, 4, 1); __PYX_ERR(0, 2829, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filter_prefix)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("get_omap_vals", 1, 4, 4, 2); __PYX_ERR(0, 2829, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_return)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("get_omap_vals", 1, 4, 4, 3); __PYX_ERR(0, 2829, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_omap_vals") < 0)) __PYX_ERR(0, 2829, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_read_op = values[0]; - __pyx_v_start_after = values[1]; - __pyx_v_filter_prefix = values[2]; - __pyx_v_max_return = values[3]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_omap_vals", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2829, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Ioctx.get_omap_vals", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Ioctx_94get_omap_vals(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), __pyx_v_read_op, __pyx_v_start_after, __pyx_v_filter_prefix, __pyx_v_max_return); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_94get_omap_vals(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_read_op, PyObject *__pyx_v_start_after, PyObject *__pyx_v_filter_prefix, PyObject *__pyx_v_max_return) { - char *__pyx_v__start_after; - char *__pyx_v__filter_prefix; - struct __pyx_obj_5rados_ReadOp *__pyx_v__read_op = 0; - rados_omap_iter_t __pyx_v_iter_addr; - int __pyx_v__max_return; - int __pyx_v_prval; - struct __pyx_obj_5rados_OmapIterator *__pyx_v_it = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - Py_ssize_t __pyx_t_6; - PyObject *__pyx_t_7 = NULL; - char *__pyx_t_8; - int __pyx_t_9; - __Pyx_RefNannySetupContext("get_omap_vals", 0); - __Pyx_INCREF(__pyx_v_start_after); - __Pyx_INCREF(__pyx_v_filter_prefix); - - /* "rados.pyx":2843 - * """ - * - * start_after = cstr(start_after, 'start_after') if start_after else None # <<<<<<<<<<<<<< - * filter_prefix = cstr(filter_prefix, 'filter_prefix') if filter_prefix else None - * cdef: - */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_start_after); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2843, __pyx_L1_error) - if (__pyx_t_2) { - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2843, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - __pyx_t_6 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_6 = 1; - } - } - __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2843, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; - } - __Pyx_INCREF(__pyx_v_start_after); - __Pyx_GIVEREF(__pyx_v_start_after); - PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_start_after); - __Pyx_INCREF(__pyx_n_s_start_after); - __Pyx_GIVEREF(__pyx_n_s_start_after); - PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_n_s_start_after); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2843, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __pyx_t_3; - __pyx_t_3 = 0; - } else { - __Pyx_INCREF(Py_None); - __pyx_t_1 = Py_None; - } - __Pyx_DECREF_SET(__pyx_v_start_after, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2844 - * - * start_after = cstr(start_after, 'start_after') if start_after else None - * filter_prefix = cstr(filter_prefix, 'filter_prefix') if filter_prefix else None # <<<<<<<<<<<<<< - * cdef: - * char *_start_after = opt_str(start_after) - */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_filter_prefix); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2844, __pyx_L1_error) - if (__pyx_t_2) { - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = NULL; - __pyx_t_6 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_6 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_7) { - __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL; - } - __Pyx_INCREF(__pyx_v_filter_prefix); - __Pyx_GIVEREF(__pyx_v_filter_prefix); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_v_filter_prefix); - __Pyx_INCREF(__pyx_n_s_filter_prefix); - __Pyx_GIVEREF(__pyx_n_s_filter_prefix); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_n_s_filter_prefix); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __pyx_t_3; - __pyx_t_3 = 0; - } else { - __Pyx_INCREF(Py_None); - __pyx_t_1 = Py_None; - } - __Pyx_DECREF_SET(__pyx_v_filter_prefix, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2846 - * filter_prefix = cstr(filter_prefix, 'filter_prefix') if filter_prefix else None - * cdef: - * char *_start_after = opt_str(start_after) # <<<<<<<<<<<<<< - * char *_filter_prefix = opt_str(filter_prefix) - * ReadOp _read_op = read_op - */ - __pyx_t_8 = __pyx_f_5rados_opt_str(__pyx_v_start_after); if (unlikely(__pyx_t_8 == NULL && PyErr_Occurred())) __PYX_ERR(0, 2846, __pyx_L1_error) - __pyx_v__start_after = __pyx_t_8; - - /* "rados.pyx":2847 - * cdef: - * char *_start_after = opt_str(start_after) - * char *_filter_prefix = opt_str(filter_prefix) # <<<<<<<<<<<<<< - * ReadOp _read_op = read_op - * rados_omap_iter_t iter_addr = NULL - */ - __pyx_t_8 = __pyx_f_5rados_opt_str(__pyx_v_filter_prefix); if (unlikely(__pyx_t_8 == NULL && PyErr_Occurred())) __PYX_ERR(0, 2847, __pyx_L1_error) - __pyx_v__filter_prefix = __pyx_t_8; - - /* "rados.pyx":2848 - * char *_start_after = opt_str(start_after) - * char *_filter_prefix = opt_str(filter_prefix) - * ReadOp _read_op = read_op # <<<<<<<<<<<<<< - * rados_omap_iter_t iter_addr = NULL - * int _max_return = max_return - */ - if (!(likely(((__pyx_v_read_op) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_read_op, __pyx_ptype_5rados_ReadOp))))) __PYX_ERR(0, 2848, __pyx_L1_error) - __pyx_t_1 = __pyx_v_read_op; - __Pyx_INCREF(__pyx_t_1); - __pyx_v__read_op = ((struct __pyx_obj_5rados_ReadOp *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2849 - * char *_filter_prefix = opt_str(filter_prefix) - * ReadOp _read_op = read_op - * rados_omap_iter_t iter_addr = NULL # <<<<<<<<<<<<<< - * int _max_return = max_return - * int prval = 0 - */ - __pyx_v_iter_addr = NULL; - - /* "rados.pyx":2850 - * ReadOp _read_op = read_op - * rados_omap_iter_t iter_addr = NULL - * int _max_return = max_return # <<<<<<<<<<<<<< - * int prval = 0 - * - */ - __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_max_return); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2850, __pyx_L1_error) - __pyx_v__max_return = __pyx_t_9; - - /* "rados.pyx":2851 - * rados_omap_iter_t iter_addr = NULL - * int _max_return = max_return - * int prval = 0 # <<<<<<<<<<<<<< - * - * with nogil: - */ - __pyx_v_prval = 0; - - /* "rados.pyx":2853 - * int prval = 0 - * - * with nogil: # <<<<<<<<<<<<<< - * rados_read_op_omap_get_vals(_read_op.read_op, _start_after, _filter_prefix, - * _max_return, &iter_addr, &prval) - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":2854 - * - * with nogil: - * rados_read_op_omap_get_vals(_read_op.read_op, _start_after, _filter_prefix, # <<<<<<<<<<<<<< - * _max_return, &iter_addr, &prval) - * it = OmapIterator(self) - */ - rados_read_op_omap_get_vals(__pyx_v__read_op->read_op, __pyx_v__start_after, __pyx_v__filter_prefix, __pyx_v__max_return, (&__pyx_v_iter_addr), (&__pyx_v_prval)); - } - - /* "rados.pyx":2853 - * int prval = 0 - * - * with nogil: # <<<<<<<<<<<<<< - * rados_read_op_omap_get_vals(_read_op.read_op, _start_after, _filter_prefix, - * _max_return, &iter_addr, &prval) - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":2856 - * rados_read_op_omap_get_vals(_read_op.read_op, _start_after, _filter_prefix, - * _max_return, &iter_addr, &prval) - * it = OmapIterator(self) # <<<<<<<<<<<<<< - * it.ctx = iter_addr - * return it, int(prval) - */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2856, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5rados_OmapIterator), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2856, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_it = ((struct __pyx_obj_5rados_OmapIterator *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "rados.pyx":2857 - * _max_return, &iter_addr, &prval) - * it = OmapIterator(self) - * it.ctx = iter_addr # <<<<<<<<<<<<<< - * return it, int(prval) - * - */ - __pyx_v_it->ctx = __pyx_v_iter_addr; - - /* "rados.pyx":2858 - * it = OmapIterator(self) - * it.ctx = iter_addr - * return it, int(prval) # <<<<<<<<<<<<<< - * - * @requires(('read_op', ReadOp), ('start_after', str_type), ('max_return', int)) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_prval); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2858, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2858, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2858, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2858, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_v_it)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_it)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_it)); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "rados.pyx":2829 - * - * @requires(('read_op', ReadOp), ('start_after', str_type), ('filter_prefix', str_type), ('max_return', int)) - * def get_omap_vals(self, read_op, start_after, filter_prefix, max_return): # <<<<<<<<<<<<<< - * """ - * get the omap values - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("rados.Ioctx.get_omap_vals", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v__read_op); - __Pyx_XDECREF((PyObject *)__pyx_v_it); - __Pyx_XDECREF(__pyx_v_start_after); - __Pyx_XDECREF(__pyx_v_filter_prefix); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2861 - * - * @requires(('read_op', ReadOp), ('start_after', str_type), ('max_return', int)) - * def get_omap_keys(self, read_op, start_after, max_return): # <<<<<<<<<<<<<< - * """ - * get the omap keys - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_97get_omap_keys(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_96get_omap_keys[] = "Ioctx.get_omap_keys(self, read_op, start_after, max_return)\n\n get the omap keys\n :para read_op: read operation object\n :type read_op: ReadOp\n :para start_after: list keys starting after start_after\n :type start_after: str\n :para max_return: list no more than max_return key/value pairs\n :type max_return: int\n :returns: an iterator over the requested omap values, return value from this action\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_97get_omap_keys(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_read_op = 0; - PyObject *__pyx_v_start_after = 0; - PyObject *__pyx_v_max_return = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("get_omap_keys (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_read_op,&__pyx_n_s_start_after,&__pyx_n_s_max_return,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_read_op)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start_after)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("get_omap_keys", 1, 3, 3, 1); __PYX_ERR(0, 2861, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_return)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("get_omap_keys", 1, 3, 3, 2); __PYX_ERR(0, 2861, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_omap_keys") < 0)) __PYX_ERR(0, 2861, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - } - __pyx_v_read_op = values[0]; - __pyx_v_start_after = values[1]; - __pyx_v_max_return = values[2]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_omap_keys", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2861, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Ioctx.get_omap_keys", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Ioctx_96get_omap_keys(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), __pyx_v_read_op, __pyx_v_start_after, __pyx_v_max_return); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_96get_omap_keys(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_read_op, PyObject *__pyx_v_start_after, PyObject *__pyx_v_max_return) { - char *__pyx_v__start_after; - struct __pyx_obj_5rados_ReadOp *__pyx_v__read_op = 0; - rados_omap_iter_t __pyx_v_iter_addr; - int __pyx_v__max_return; - int __pyx_v_prval; - struct __pyx_obj_5rados_OmapIterator *__pyx_v_it = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - Py_ssize_t __pyx_t_6; - PyObject *__pyx_t_7 = NULL; - char *__pyx_t_8; - int __pyx_t_9; - __Pyx_RefNannySetupContext("get_omap_keys", 0); - __Pyx_INCREF(__pyx_v_start_after); - - /* "rados.pyx":2872 - * :returns: an iterator over the requested omap values, return value from this action - * """ - * start_after = cstr(start_after, 'start_after') if start_after else None # <<<<<<<<<<<<<< - * cdef: - * char *_start_after = opt_str(start_after) - */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_start_after); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2872, __pyx_L1_error) - if (__pyx_t_2) { - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2872, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - __pyx_t_6 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_6 = 1; - } - } - __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2872, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; - } - __Pyx_INCREF(__pyx_v_start_after); - __Pyx_GIVEREF(__pyx_v_start_after); - PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_start_after); - __Pyx_INCREF(__pyx_n_s_start_after); - __Pyx_GIVEREF(__pyx_n_s_start_after); - PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_n_s_start_after); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2872, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __pyx_t_3; - __pyx_t_3 = 0; - } else { - __Pyx_INCREF(Py_None); - __pyx_t_1 = Py_None; - } - __Pyx_DECREF_SET(__pyx_v_start_after, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2874 - * start_after = cstr(start_after, 'start_after') if start_after else None - * cdef: - * char *_start_after = opt_str(start_after) # <<<<<<<<<<<<<< - * ReadOp _read_op = read_op - * rados_omap_iter_t iter_addr = NULL - */ - __pyx_t_8 = __pyx_f_5rados_opt_str(__pyx_v_start_after); if (unlikely(__pyx_t_8 == NULL && PyErr_Occurred())) __PYX_ERR(0, 2874, __pyx_L1_error) - __pyx_v__start_after = __pyx_t_8; - - /* "rados.pyx":2875 - * cdef: - * char *_start_after = opt_str(start_after) - * ReadOp _read_op = read_op # <<<<<<<<<<<<<< - * rados_omap_iter_t iter_addr = NULL - * int _max_return = max_return - */ - if (!(likely(((__pyx_v_read_op) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_read_op, __pyx_ptype_5rados_ReadOp))))) __PYX_ERR(0, 2875, __pyx_L1_error) - __pyx_t_1 = __pyx_v_read_op; - __Pyx_INCREF(__pyx_t_1); - __pyx_v__read_op = ((struct __pyx_obj_5rados_ReadOp *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2876 - * char *_start_after = opt_str(start_after) - * ReadOp _read_op = read_op - * rados_omap_iter_t iter_addr = NULL # <<<<<<<<<<<<<< - * int _max_return = max_return - * int prval = 0 - */ - __pyx_v_iter_addr = NULL; - - /* "rados.pyx":2877 - * ReadOp _read_op = read_op - * rados_omap_iter_t iter_addr = NULL - * int _max_return = max_return # <<<<<<<<<<<<<< - * int prval = 0 - * - */ - __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_max_return); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2877, __pyx_L1_error) - __pyx_v__max_return = __pyx_t_9; - - /* "rados.pyx":2878 - * rados_omap_iter_t iter_addr = NULL - * int _max_return = max_return - * int prval = 0 # <<<<<<<<<<<<<< - * - * with nogil: - */ - __pyx_v_prval = 0; - - /* "rados.pyx":2880 - * int prval = 0 - * - * with nogil: # <<<<<<<<<<<<<< - * rados_read_op_omap_get_keys(_read_op.read_op, _start_after, - * _max_return, &iter_addr, &prval) - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":2881 - * - * with nogil: - * rados_read_op_omap_get_keys(_read_op.read_op, _start_after, # <<<<<<<<<<<<<< - * _max_return, &iter_addr, &prval) - * it = OmapIterator(self) - */ - rados_read_op_omap_get_keys(__pyx_v__read_op->read_op, __pyx_v__start_after, __pyx_v__max_return, (&__pyx_v_iter_addr), (&__pyx_v_prval)); - } - - /* "rados.pyx":2880 - * int prval = 0 - * - * with nogil: # <<<<<<<<<<<<<< - * rados_read_op_omap_get_keys(_read_op.read_op, _start_after, - * _max_return, &iter_addr, &prval) - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":2883 - * rados_read_op_omap_get_keys(_read_op.read_op, _start_after, - * _max_return, &iter_addr, &prval) - * it = OmapIterator(self) # <<<<<<<<<<<<<< - * it.ctx = iter_addr - * return it, int(prval) - */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2883, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5rados_OmapIterator), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2883, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_it = ((struct __pyx_obj_5rados_OmapIterator *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "rados.pyx":2884 - * _max_return, &iter_addr, &prval) - * it = OmapIterator(self) - * it.ctx = iter_addr # <<<<<<<<<<<<<< - * return it, int(prval) - * - */ - __pyx_v_it->ctx = __pyx_v_iter_addr; - - /* "rados.pyx":2885 - * it = OmapIterator(self) - * it.ctx = iter_addr - * return it, int(prval) # <<<<<<<<<<<<<< - * - * @requires(('read_op', ReadOp), ('keys', tuple)) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_prval); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2885, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2885, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2885, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2885, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_v_it)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_it)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_it)); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "rados.pyx":2861 - * - * @requires(('read_op', ReadOp), ('start_after', str_type), ('max_return', int)) - * def get_omap_keys(self, read_op, start_after, max_return): # <<<<<<<<<<<<<< - * """ - * get the omap keys - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("rados.Ioctx.get_omap_keys", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v__read_op); - __Pyx_XDECREF((PyObject *)__pyx_v_it); - __Pyx_XDECREF(__pyx_v_start_after); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2888 - * - * @requires(('read_op', ReadOp), ('keys', tuple)) - * def get_omap_vals_by_keys(self, read_op, keys): # <<<<<<<<<<<<<< - * """ - * get the omap values by keys - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_99get_omap_vals_by_keys(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_98get_omap_vals_by_keys[] = "Ioctx.get_omap_vals_by_keys(self, read_op, keys)\n\n get the omap values by keys\n :para read_op: read operation object\n :type read_op: ReadOp\n :para keys: input key tuple\n :type keys: tuple\n :returns: an iterator over the requested omap values, return value from this action\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_99get_omap_vals_by_keys(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_read_op = 0; - PyObject *__pyx_v_keys = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("get_omap_vals_by_keys (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_read_op,&__pyx_n_s_keys,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_read_op)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_keys)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("get_omap_vals_by_keys", 1, 2, 2, 1); __PYX_ERR(0, 2888, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_omap_vals_by_keys") < 0)) __PYX_ERR(0, 2888, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_read_op = values[0]; - __pyx_v_keys = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_omap_vals_by_keys", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2888, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Ioctx.get_omap_vals_by_keys", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Ioctx_98get_omap_vals_by_keys(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), __pyx_v_read_op, __pyx_v_keys); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_98get_omap_vals_by_keys(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_read_op, PyObject *__pyx_v_keys) { - struct __pyx_obj_5rados_ReadOp *__pyx_v__read_op = 0; - rados_omap_iter_t __pyx_v_iter_addr; - char **__pyx_v__keys; - size_t __pyx_v_key_num; - int __pyx_v_prval; - struct __pyx_obj_5rados_OmapIterator *__pyx_v_it = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; - int __pyx_t_7; - char const *__pyx_t_8; - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - PyObject *__pyx_t_11 = NULL; - PyObject *__pyx_t_12 = NULL; - PyObject *__pyx_t_13 = NULL; - PyObject *__pyx_t_14 = NULL; - __Pyx_RefNannySetupContext("get_omap_vals_by_keys", 0); - __Pyx_INCREF(__pyx_v_keys); - - /* "rados.pyx":2897 - * :returns: an iterator over the requested omap values, return value from this action - * """ - * keys = cstr_list(keys, 'keys') # <<<<<<<<<<<<<< - * cdef: - * ReadOp _read_op = read_op - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr_list); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2897, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2897, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_keys); - __Pyx_GIVEREF(__pyx_v_keys); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_keys); - __Pyx_INCREF(__pyx_n_s_keys); - __Pyx_GIVEREF(__pyx_n_s_keys); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_keys); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2897, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_keys, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2899 - * keys = cstr_list(keys, 'keys') - * cdef: - * ReadOp _read_op = read_op # <<<<<<<<<<<<<< - * rados_omap_iter_t iter_addr - * char **_keys = to_bytes_array(keys) - */ - if (!(likely(((__pyx_v_read_op) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_read_op, __pyx_ptype_5rados_ReadOp))))) __PYX_ERR(0, 2899, __pyx_L1_error) - __pyx_t_1 = __pyx_v_read_op; - __Pyx_INCREF(__pyx_t_1); - __pyx_v__read_op = ((struct __pyx_obj_5rados_ReadOp *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2901 - * ReadOp _read_op = read_op - * rados_omap_iter_t iter_addr - * char **_keys = to_bytes_array(keys) # <<<<<<<<<<<<<< - * size_t key_num = len(keys) - * int prval = 0 - */ - __pyx_v__keys = __pyx_f_5rados_to_bytes_array(__pyx_v_keys); - - /* "rados.pyx":2902 - * rados_omap_iter_t iter_addr - * char **_keys = to_bytes_array(keys) - * size_t key_num = len(keys) # <<<<<<<<<<<<<< - * int prval = 0 - * - */ - __pyx_t_4 = PyObject_Length(__pyx_v_keys); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 2902, __pyx_L1_error) - __pyx_v_key_num = __pyx_t_4; - - /* "rados.pyx":2903 - * char **_keys = to_bytes_array(keys) - * size_t key_num = len(keys) - * int prval = 0 # <<<<<<<<<<<<<< - * - * try: - */ - __pyx_v_prval = 0; - - /* "rados.pyx":2905 - * int prval = 0 - * - * try: # <<<<<<<<<<<<<< - * with nogil: - * rados_read_op_omap_get_vals_by_keys(_read_op.read_op, - */ - /*try:*/ { - - /* "rados.pyx":2906 - * - * try: - * with nogil: # <<<<<<<<<<<<<< - * rados_read_op_omap_get_vals_by_keys(_read_op.read_op, - * _keys, - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":2907 - * try: - * with nogil: - * rados_read_op_omap_get_vals_by_keys(_read_op.read_op, # <<<<<<<<<<<<<< - * _keys, - * key_num, &iter_addr, &prval) - */ - rados_read_op_omap_get_vals_by_keys(__pyx_v__read_op->read_op, ((char const **)__pyx_v__keys), __pyx_v_key_num, (&__pyx_v_iter_addr), (&__pyx_v_prval)); - } - - /* "rados.pyx":2906 - * - * try: - * with nogil: # <<<<<<<<<<<<<< - * rados_read_op_omap_get_vals_by_keys(_read_op.read_op, - * _keys, - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L8; - } - __pyx_L8:; - } - } - - /* "rados.pyx":2910 - * _keys, - * key_num, &iter_addr, &prval) - * it = OmapIterator(self) # <<<<<<<<<<<<<< - * it.ctx = iter_addr - * return it, int(prval) - */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2910, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5rados_OmapIterator), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2910, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_it = ((struct __pyx_obj_5rados_OmapIterator *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "rados.pyx":2911 - * key_num, &iter_addr, &prval) - * it = OmapIterator(self) - * it.ctx = iter_addr # <<<<<<<<<<<<<< - * return it, int(prval) - * finally: - */ - __pyx_v_it->ctx = __pyx_v_iter_addr; - - /* "rados.pyx":2912 - * it = OmapIterator(self) - * it.ctx = iter_addr - * return it, int(prval) # <<<<<<<<<<<<<< - * finally: - * free(_keys) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_prval); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2912, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2912, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2912, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2912, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_v_it)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_it)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_it)); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L3_return; - } - - /* "rados.pyx":2914 - * return it, int(prval) - * finally: - * free(_keys) # <<<<<<<<<<<<<< - * - * @requires(('write_op', WriteOp), ('keys', tuple)) - */ - /*finally:*/ { - /*exception exit:*/{ - __Pyx_PyThreadState_declare - __pyx_L4_error:; - __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; - __Pyx_PyThreadState_assign - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); - if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); - __Pyx_XGOTREF(__pyx_t_9); - __Pyx_XGOTREF(__pyx_t_10); - __Pyx_XGOTREF(__pyx_t_11); - __Pyx_XGOTREF(__pyx_t_12); - __Pyx_XGOTREF(__pyx_t_13); - __Pyx_XGOTREF(__pyx_t_14); - __pyx_t_6 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_8 = __pyx_filename; - { - free(__pyx_v__keys); - } - __Pyx_PyThreadState_assign - if (PY_MAJOR_VERSION >= 3) { - __Pyx_XGIVEREF(__pyx_t_12); - __Pyx_XGIVEREF(__pyx_t_13); - __Pyx_XGIVEREF(__pyx_t_14); - __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); - } - __Pyx_XGIVEREF(__pyx_t_9); - __Pyx_XGIVEREF(__pyx_t_10); - __Pyx_XGIVEREF(__pyx_t_11); - __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11); - __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; - __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8; - goto __pyx_L1_error; - } - __pyx_L3_return: { - __pyx_t_14 = __pyx_r; - __pyx_r = 0; - free(__pyx_v__keys); - __pyx_r = __pyx_t_14; - __pyx_t_14 = 0; - goto __pyx_L0; - } - } - - /* "rados.pyx":2888 - * - * @requires(('read_op', ReadOp), ('keys', tuple)) - * def get_omap_vals_by_keys(self, read_op, keys): # <<<<<<<<<<<<<< - * """ - * get the omap values by keys - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.Ioctx.get_omap_vals_by_keys", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v__read_op); - __Pyx_XDECREF((PyObject *)__pyx_v_it); - __Pyx_XDECREF(__pyx_v_keys); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2917 - * - * @requires(('write_op', WriteOp), ('keys', tuple)) - * def remove_omap_keys(self, write_op, keys): # <<<<<<<<<<<<<< - * """ - * remove omap keys specifiled - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_101remove_omap_keys(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_100remove_omap_keys[] = "Ioctx.remove_omap_keys(self, write_op, keys)\n\n remove omap keys specifiled\n :para write_op: write operation object\n :type write_op: WriteOp\n :para keys: input key tuple\n :type keys: tuple\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_101remove_omap_keys(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_write_op = 0; - PyObject *__pyx_v_keys = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("remove_omap_keys (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_write_op,&__pyx_n_s_keys,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_write_op)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_keys)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("remove_omap_keys", 1, 2, 2, 1); __PYX_ERR(0, 2917, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remove_omap_keys") < 0)) __PYX_ERR(0, 2917, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_write_op = values[0]; - __pyx_v_keys = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("remove_omap_keys", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2917, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Ioctx.remove_omap_keys", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Ioctx_100remove_omap_keys(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), __pyx_v_write_op, __pyx_v_keys); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_100remove_omap_keys(CYTHON_UNUSED struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_write_op, PyObject *__pyx_v_keys) { - struct __pyx_obj_5rados_WriteOp *__pyx_v__write_op = 0; - size_t __pyx_v_key_num; - char **__pyx_v__keys; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - __Pyx_RefNannySetupContext("remove_omap_keys", 0); - __Pyx_INCREF(__pyx_v_keys); - - /* "rados.pyx":2926 - * """ - * - * keys = cstr_list(keys, 'keys') # <<<<<<<<<<<<<< - * cdef: - * WriteOp _write_op = write_op - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr_list); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2926, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2926, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_keys); - __Pyx_GIVEREF(__pyx_v_keys); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_keys); - __Pyx_INCREF(__pyx_n_s_keys); - __Pyx_GIVEREF(__pyx_n_s_keys); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_keys); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2926, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_keys, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2928 - * keys = cstr_list(keys, 'keys') - * cdef: - * WriteOp _write_op = write_op # <<<<<<<<<<<<<< - * size_t key_num = len(keys) - * char **_keys = to_bytes_array(keys) - */ - if (!(likely(((__pyx_v_write_op) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_write_op, __pyx_ptype_5rados_WriteOp))))) __PYX_ERR(0, 2928, __pyx_L1_error) - __pyx_t_1 = __pyx_v_write_op; - __Pyx_INCREF(__pyx_t_1); - __pyx_v__write_op = ((struct __pyx_obj_5rados_WriteOp *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2929 - * cdef: - * WriteOp _write_op = write_op - * size_t key_num = len(keys) # <<<<<<<<<<<<<< - * char **_keys = to_bytes_array(keys) - * - */ - __pyx_t_4 = PyObject_Length(__pyx_v_keys); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 2929, __pyx_L1_error) - __pyx_v_key_num = __pyx_t_4; - - /* "rados.pyx":2930 - * WriteOp _write_op = write_op - * size_t key_num = len(keys) - * char **_keys = to_bytes_array(keys) # <<<<<<<<<<<<<< - * - * try: - */ - __pyx_v__keys = __pyx_f_5rados_to_bytes_array(__pyx_v_keys); - - /* "rados.pyx":2932 - * char **_keys = to_bytes_array(keys) - * - * try: # <<<<<<<<<<<<<< - * with nogil: - * rados_write_op_omap_rm_keys(_write_op.write_op, _keys, key_num) - */ - /*try:*/ { - - /* "rados.pyx":2933 - * - * try: - * with nogil: # <<<<<<<<<<<<<< - * rados_write_op_omap_rm_keys(_write_op.write_op, _keys, key_num) - * finally: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":2934 - * try: - * with nogil: - * rados_write_op_omap_rm_keys(_write_op.write_op, _keys, key_num) # <<<<<<<<<<<<<< - * finally: - * free(_keys) - */ - rados_write_op_omap_rm_keys(__pyx_v__write_op->write_op, ((char const **)__pyx_v__keys), __pyx_v_key_num); - } - - /* "rados.pyx":2933 - * - * try: - * with nogil: # <<<<<<<<<<<<<< - * rados_write_op_omap_rm_keys(_write_op.write_op, _keys, key_num) - * finally: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L8; - } - __pyx_L8:; - } - } - } - - /* "rados.pyx":2936 - * rados_write_op_omap_rm_keys(_write_op.write_op, _keys, key_num) - * finally: - * free(_keys) # <<<<<<<<<<<<<< - * - * @requires(('write_op', WriteOp)) - */ - /*finally:*/ { - /*normal exit:*/{ - free(__pyx_v__keys); - goto __pyx_L5; - } - __pyx_L5:; - } - - /* "rados.pyx":2917 - * - * @requires(('write_op', WriteOp), ('keys', tuple)) - * def remove_omap_keys(self, write_op, keys): # <<<<<<<<<<<<<< - * """ - * remove omap keys specifiled - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.Ioctx.remove_omap_keys", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v__write_op); - __Pyx_XDECREF(__pyx_v_keys); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2939 - * - * @requires(('write_op', WriteOp)) - * def clear_omap(self, write_op): # <<<<<<<<<<<<<< - * """ - * Remove all key/value pairs from an object - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_103clear_omap(PyObject *__pyx_v_self, PyObject *__pyx_v_write_op); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_102clear_omap[] = "Ioctx.clear_omap(self, write_op)\n\n Remove all key/value pairs from an object\n :para write_op: write operation object\n :type write_op: WriteOp\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_103clear_omap(PyObject *__pyx_v_self, PyObject *__pyx_v_write_op) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("clear_omap (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_102clear_omap(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), ((PyObject *)__pyx_v_write_op)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_102clear_omap(CYTHON_UNUSED struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_write_op) { - struct __pyx_obj_5rados_WriteOp *__pyx_v__write_op = 0; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("clear_omap", 0); - - /* "rados.pyx":2947 - * - * cdef: - * WriteOp _write_op = write_op # <<<<<<<<<<<<<< - * - * with nogil: - */ - if (!(likely(((__pyx_v_write_op) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_write_op, __pyx_ptype_5rados_WriteOp))))) __PYX_ERR(0, 2947, __pyx_L1_error) - __pyx_t_1 = __pyx_v_write_op; - __Pyx_INCREF(__pyx_t_1); - __pyx_v__write_op = ((struct __pyx_obj_5rados_WriteOp *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2949 - * WriteOp _write_op = write_op - * - * with nogil: # <<<<<<<<<<<<<< - * rados_write_op_omap_clear(_write_op.write_op) - * - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":2950 - * - * with nogil: - * rados_write_op_omap_clear(_write_op.write_op) # <<<<<<<<<<<<<< - * - * @requires(('key', str_type), ('name', str_type), ('cookie', str_type), ('desc', str_type), - */ - rados_write_op_omap_clear(__pyx_v__write_op->write_op); - } - - /* "rados.pyx":2949 - * WriteOp _write_op = write_op - * - * with nogil: # <<<<<<<<<<<<<< - * rados_write_op_omap_clear(_write_op.write_op) - * - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":2939 - * - * @requires(('write_op', WriteOp)) - * def clear_omap(self, write_op): # <<<<<<<<<<<<<< - * """ - * Remove all key/value pairs from an object - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rados.Ioctx.clear_omap", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v__write_op); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":2954 - * @requires(('key', str_type), ('name', str_type), ('cookie', str_type), ('desc', str_type), - * ('duration', opt(int)), ('flags', int)) - * def lock_exclusive(self, key, name, cookie, desc="", duration=None, flags=0): # <<<<<<<<<<<<<< - * - * """ - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_105lock_exclusive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_104lock_exclusive[] = "Ioctx.lock_exclusive(self, key, name, cookie, desc='', duration=None, flags=0)\n\n Take an exclusive lock on an object\n\n :param key: name of the object\n :type key: str\n :param name: name of the lock\n :type name: str\n :param cookie: cookie of the lock\n :type cookie: str\n :param desc: description of the lock\n :type desc: str\n :param duration: duration of the lock in seconds\n :type duration: int\n :param flags: flags\n :type flags: int\n\n :raises: :class:`TypeError`\n :raises: :class:`Error`\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_105lock_exclusive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_key = 0; - PyObject *__pyx_v_name = 0; - PyObject *__pyx_v_cookie = 0; - PyObject *__pyx_v_desc = 0; - PyObject *__pyx_v_duration = 0; - PyObject *__pyx_v_flags = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("lock_exclusive (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_name_2,&__pyx_n_s_cookie,&__pyx_n_s_desc,&__pyx_n_s_duration,&__pyx_n_s_flags,0}; - PyObject* values[6] = {0,0,0,0,0,0}; - values[3] = ((PyObject *)__pyx_kp_s__13); - values[4] = ((PyObject *)Py_None); - values[5] = ((PyObject *)__pyx_int_0); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name_2)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("lock_exclusive", 0, 3, 6, 1); __PYX_ERR(0, 2954, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cookie)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("lock_exclusive", 0, 3, 6, 2); __PYX_ERR(0, 2954, __pyx_L3_error) - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_desc); - if (value) { values[3] = value; kw_args--; } - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_duration); - if (value) { values[4] = value; kw_args--; } - } - case 5: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags); - if (value) { values[5] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lock_exclusive") < 0)) __PYX_ERR(0, 2954, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_key = values[0]; - __pyx_v_name = values[1]; - __pyx_v_cookie = values[2]; - __pyx_v_desc = values[3]; - __pyx_v_duration = values[4]; - __pyx_v_flags = values[5]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lock_exclusive", 0, 3, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2954, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Ioctx.lock_exclusive", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Ioctx_104lock_exclusive(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), __pyx_v_key, __pyx_v_name, __pyx_v_cookie, __pyx_v_desc, __pyx_v_duration, __pyx_v_flags); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_104lock_exclusive(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_name, PyObject *__pyx_v_cookie, PyObject *__pyx_v_desc, PyObject *__pyx_v_duration, PyObject *__pyx_v_flags) { - char *__pyx_v__key; - char *__pyx_v__name; - char *__pyx_v__cookie; - char *__pyx_v__desc; - uint8_t __pyx_v__flags; - struct timeval __pyx_v__duration; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - uint8_t __pyx_t_7; - int __pyx_t_8; - int __pyx_t_9; - time_t __pyx_t_10; - __Pyx_RefNannySetupContext("lock_exclusive", 0); - __Pyx_INCREF(__pyx_v_key); - __Pyx_INCREF(__pyx_v_name); - __Pyx_INCREF(__pyx_v_cookie); - __Pyx_INCREF(__pyx_v_desc); - - /* "rados.pyx":2975 - * :raises: :class:`Error` - * """ - * self.require_ioctx_open() # <<<<<<<<<<<<<< - * - * key = cstr(key, 'key') - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_ioctx_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2975, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2975, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2975, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":2977 - * self.require_ioctx_open() - * - * key = cstr(key, 'key') # <<<<<<<<<<<<<< - * name = cstr(name, 'name') - * cookie = cstr(cookie, 'cookie') - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2977, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2977, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_key); - __Pyx_INCREF(__pyx_n_s_key); - __Pyx_GIVEREF(__pyx_n_s_key); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_key); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2977, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2978 - * - * key = cstr(key, 'key') - * name = cstr(name, 'name') # <<<<<<<<<<<<<< - * cookie = cstr(cookie, 'cookie') - * desc = cstr(desc, 'desc') - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2978, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_3 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2978, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL; - } - __Pyx_INCREF(__pyx_v_name); - __Pyx_GIVEREF(__pyx_v_name); - PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_4, __pyx_v_name); - __Pyx_INCREF(__pyx_n_s_name_2); - __Pyx_GIVEREF(__pyx_n_s_name_2); - PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_4, __pyx_n_s_name_2); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2978, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2979 - * key = cstr(key, 'key') - * name = cstr(name, 'name') - * cookie = cstr(cookie, 'cookie') # <<<<<<<<<<<<<< - * desc = cstr(desc, 'desc') - * - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2979, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2979, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_cookie); - __Pyx_GIVEREF(__pyx_v_cookie); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_cookie); - __Pyx_INCREF(__pyx_n_s_cookie); - __Pyx_GIVEREF(__pyx_n_s_cookie); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_cookie); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2979, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_cookie, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2980 - * name = cstr(name, 'name') - * cookie = cstr(cookie, 'cookie') - * desc = cstr(desc, 'desc') # <<<<<<<<<<<<<< - * - * cdef: - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2980, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_3 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2980, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL; - } - __Pyx_INCREF(__pyx_v_desc); - __Pyx_GIVEREF(__pyx_v_desc); - PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_4, __pyx_v_desc); - __Pyx_INCREF(__pyx_n_s_desc); - __Pyx_GIVEREF(__pyx_n_s_desc); - PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_4, __pyx_n_s_desc); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2980, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_desc, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":2983 - * - * cdef: - * char* _key = key # <<<<<<<<<<<<<< - * char* _name = name - * char* _cookie = cookie - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_key); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2983, __pyx_L1_error) - __pyx_v__key = __pyx_t_6; - - /* "rados.pyx":2984 - * cdef: - * char* _key = key - * char* _name = name # <<<<<<<<<<<<<< - * char* _cookie = cookie - * char* _desc = desc - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2984, __pyx_L1_error) - __pyx_v__name = __pyx_t_6; - - /* "rados.pyx":2985 - * char* _key = key - * char* _name = name - * char* _cookie = cookie # <<<<<<<<<<<<<< - * char* _desc = desc - * uint8_t _flags = flags - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_cookie); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2985, __pyx_L1_error) - __pyx_v__cookie = __pyx_t_6; - - /* "rados.pyx":2986 - * char* _name = name - * char* _cookie = cookie - * char* _desc = desc # <<<<<<<<<<<<<< - * uint8_t _flags = flags - * timeval _duration - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_desc); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 2986, __pyx_L1_error) - __pyx_v__desc = __pyx_t_6; - - /* "rados.pyx":2987 - * char* _cookie = cookie - * char* _desc = desc - * uint8_t _flags = flags # <<<<<<<<<<<<<< - * timeval _duration - * - */ - __pyx_t_7 = __Pyx_PyInt_As_uint8_t(__pyx_v_flags); if (unlikely((__pyx_t_7 == (uint8_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2987, __pyx_L1_error) - __pyx_v__flags = __pyx_t_7; - - /* "rados.pyx":2990 - * timeval _duration - * - * if duration is None: # <<<<<<<<<<<<<< - * with nogil: - * ret = rados_lock_exclusive(self.io, _key, _name, _cookie, _desc, - */ - __pyx_t_8 = (__pyx_v_duration == Py_None); - __pyx_t_9 = (__pyx_t_8 != 0); - if (__pyx_t_9) { - - /* "rados.pyx":2991 - * - * if duration is None: - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_lock_exclusive(self.io, _key, _name, _cookie, _desc, - * NULL, _flags) - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":2992 - * if duration is None: - * with nogil: - * ret = rados_lock_exclusive(self.io, _key, _name, _cookie, _desc, # <<<<<<<<<<<<<< - * NULL, _flags) - * else: - */ - __pyx_v_ret = rados_lock_exclusive(__pyx_v_self->io, __pyx_v__key, __pyx_v__name, __pyx_v__cookie, __pyx_v__desc, NULL, __pyx_v__flags); - } - - /* "rados.pyx":2991 - * - * if duration is None: - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_lock_exclusive(self.io, _key, _name, _cookie, _desc, - * NULL, _flags) - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L6; - } - __pyx_L6:; - } - } - - /* "rados.pyx":2990 - * timeval _duration - * - * if duration is None: # <<<<<<<<<<<<<< - * with nogil: - * ret = rados_lock_exclusive(self.io, _key, _name, _cookie, _desc, - */ - goto __pyx_L3; - } - - /* "rados.pyx":2995 - * NULL, _flags) - * else: - * _duration.tv_sec = duration # <<<<<<<<<<<<<< - * with nogil: - * ret = rados_lock_exclusive(self.io, _key, _name, _cookie, _desc, - */ - /*else*/ { - __pyx_t_10 = __Pyx_PyInt_As_time_t(__pyx_v_duration); if (unlikely((__pyx_t_10 == (time_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2995, __pyx_L1_error) - __pyx_v__duration.tv_sec = __pyx_t_10; - - /* "rados.pyx":2996 - * else: - * _duration.tv_sec = duration - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_lock_exclusive(self.io, _key, _name, _cookie, _desc, - * &_duration, _flags) - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":2997 - * _duration.tv_sec = duration - * with nogil: - * ret = rados_lock_exclusive(self.io, _key, _name, _cookie, _desc, # <<<<<<<<<<<<<< - * &_duration, _flags) - * - */ - __pyx_v_ret = rados_lock_exclusive(__pyx_v_self->io, __pyx_v__key, __pyx_v__name, __pyx_v__cookie, __pyx_v__desc, (&__pyx_v__duration), __pyx_v__flags); - } - - /* "rados.pyx":2996 - * else: - * _duration.tv_sec = duration - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_lock_exclusive(self.io, _key, _name, _cookie, _desc, - * &_duration, _flags) - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L9; - } - __pyx_L9:; - } - } - } - __pyx_L3:; - - /* "rados.pyx":3000 - * &_duration, _flags) - * - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Ioctx.rados_lock_exclusive(%s): failed to set lock %s on %s" % (self.name, name, key)) - * - */ - __pyx_t_9 = ((__pyx_v_ret < 0) != 0); - if (__pyx_t_9) { - - /* "rados.pyx":3001 - * - * if ret < 0: - * raise make_ex(ret, "Ioctx.rados_lock_exclusive(%s): failed to set lock %s on %s" % (self.name, name, key)) # <<<<<<<<<<<<<< - * - * @requires(('key', str_type), ('name', str_type), ('cookie', str_type), ('tag', str_type), - */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); - __Pyx_INCREF(__pyx_v_name); - __Pyx_GIVEREF(__pyx_v_name); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_name); - __Pyx_INCREF(__pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_key); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Ioctx_rados_lock_exclusive_s_fai, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_f_5rados_make_ex(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 3001, __pyx_L1_error) - - /* "rados.pyx":3000 - * &_duration, _flags) - * - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Ioctx.rados_lock_exclusive(%s): failed to set lock %s on %s" % (self.name, name, key)) - * - */ - } - - /* "rados.pyx":2954 - * @requires(('key', str_type), ('name', str_type), ('cookie', str_type), ('desc', str_type), - * ('duration', opt(int)), ('flags', int)) - * def lock_exclusive(self, key, name, cookie, desc="", duration=None, flags=0): # <<<<<<<<<<<<<< - * - * """ - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.Ioctx.lock_exclusive", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_key); - __Pyx_XDECREF(__pyx_v_name); - __Pyx_XDECREF(__pyx_v_cookie); - __Pyx_XDECREF(__pyx_v_desc); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":3005 - * @requires(('key', str_type), ('name', str_type), ('cookie', str_type), ('tag', str_type), - * ('desc', str_type), ('duration', opt(int)), ('flags', int)) - * def lock_shared(self, key, name, cookie, tag, desc="", duration=None, flags=0): # <<<<<<<<<<<<<< - * - * """ - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_107lock_shared(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_106lock_shared[] = "Ioctx.lock_shared(self, key, name, cookie, tag, desc='', duration=None, flags=0)\n\n Take a shared lock on an object\n\n :param key: name of the object\n :type key: str\n :param name: name of the lock\n :type name: str\n :param cookie: cookie of the lock\n :type cookie: str\n :param tag: tag of the lock\n :type tag: str\n :param desc: description of the lock\n :type desc: str\n :param duration: duration of the lock in seconds\n :type duration: int\n :param flags: flags\n :type flags: int\n\n :raises: :class:`TypeError`\n :raises: :class:`Error`\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_107lock_shared(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_key = 0; - PyObject *__pyx_v_name = 0; - PyObject *__pyx_v_cookie = 0; - PyObject *__pyx_v_tag = 0; - PyObject *__pyx_v_desc = 0; - PyObject *__pyx_v_duration = 0; - PyObject *__pyx_v_flags = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("lock_shared (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_name_2,&__pyx_n_s_cookie,&__pyx_n_s_tag,&__pyx_n_s_desc,&__pyx_n_s_duration,&__pyx_n_s_flags,0}; - PyObject* values[7] = {0,0,0,0,0,0,0}; - values[4] = ((PyObject *)__pyx_kp_s__13); - values[5] = ((PyObject *)Py_None); - values[6] = ((PyObject *)__pyx_int_0); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name_2)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("lock_shared", 0, 4, 7, 1); __PYX_ERR(0, 3005, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cookie)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("lock_shared", 0, 4, 7, 2); __PYX_ERR(0, 3005, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tag)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("lock_shared", 0, 4, 7, 3); __PYX_ERR(0, 3005, __pyx_L3_error) - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_desc); - if (value) { values[4] = value; kw_args--; } - } - case 5: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_duration); - if (value) { values[5] = value; kw_args--; } - } - case 6: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags); - if (value) { values[6] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lock_shared") < 0)) __PYX_ERR(0, 3005, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_key = values[0]; - __pyx_v_name = values[1]; - __pyx_v_cookie = values[2]; - __pyx_v_tag = values[3]; - __pyx_v_desc = values[4]; - __pyx_v_duration = values[5]; - __pyx_v_flags = values[6]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lock_shared", 0, 4, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3005, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Ioctx.lock_shared", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Ioctx_106lock_shared(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), __pyx_v_key, __pyx_v_name, __pyx_v_cookie, __pyx_v_tag, __pyx_v_desc, __pyx_v_duration, __pyx_v_flags); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_106lock_shared(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_name, PyObject *__pyx_v_cookie, PyObject *__pyx_v_tag, PyObject *__pyx_v_desc, PyObject *__pyx_v_duration, PyObject *__pyx_v_flags) { - char *__pyx_v__key; - char *__pyx_v__tag; - char *__pyx_v__name; - char *__pyx_v__cookie; - char *__pyx_v__desc; - uint8_t __pyx_v__flags; - struct timeval __pyx_v__duration; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - uint8_t __pyx_t_7; - int __pyx_t_8; - int __pyx_t_9; - time_t __pyx_t_10; - __Pyx_RefNannySetupContext("lock_shared", 0); - __Pyx_INCREF(__pyx_v_key); - __Pyx_INCREF(__pyx_v_name); - __Pyx_INCREF(__pyx_v_cookie); - __Pyx_INCREF(__pyx_v_tag); - __Pyx_INCREF(__pyx_v_desc); - - /* "rados.pyx":3028 - * :raises: :class:`Error` - * """ - * self.require_ioctx_open() # <<<<<<<<<<<<<< - * - * key = cstr(key, 'key') - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_ioctx_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3028, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3028, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3028, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":3030 - * self.require_ioctx_open() - * - * key = cstr(key, 'key') # <<<<<<<<<<<<<< - * tag = cstr(tag, 'tag') - * name = cstr(name, 'name') - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3030, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3030, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_key); - __Pyx_INCREF(__pyx_n_s_key); - __Pyx_GIVEREF(__pyx_n_s_key); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_key); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3030, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":3031 - * - * key = cstr(key, 'key') - * tag = cstr(tag, 'tag') # <<<<<<<<<<<<<< - * name = cstr(name, 'name') - * cookie = cstr(cookie, 'cookie') - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3031, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_3 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3031, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL; - } - __Pyx_INCREF(__pyx_v_tag); - __Pyx_GIVEREF(__pyx_v_tag); - PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_4, __pyx_v_tag); - __Pyx_INCREF(__pyx_n_s_tag); - __Pyx_GIVEREF(__pyx_n_s_tag); - PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_4, __pyx_n_s_tag); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3031, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_tag, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":3032 - * key = cstr(key, 'key') - * tag = cstr(tag, 'tag') - * name = cstr(name, 'name') # <<<<<<<<<<<<<< - * cookie = cstr(cookie, 'cookie') - * desc = cstr(desc, 'desc') - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3032, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3032, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_name); - __Pyx_GIVEREF(__pyx_v_name); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_name); - __Pyx_INCREF(__pyx_n_s_name_2); - __Pyx_GIVEREF(__pyx_n_s_name_2); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_name_2); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3032, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":3033 - * tag = cstr(tag, 'tag') - * name = cstr(name, 'name') - * cookie = cstr(cookie, 'cookie') # <<<<<<<<<<<<<< - * desc = cstr(desc, 'desc') - * - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3033, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_3 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3033, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL; - } - __Pyx_INCREF(__pyx_v_cookie); - __Pyx_GIVEREF(__pyx_v_cookie); - PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_4, __pyx_v_cookie); - __Pyx_INCREF(__pyx_n_s_cookie); - __Pyx_GIVEREF(__pyx_n_s_cookie); - PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_4, __pyx_n_s_cookie); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3033, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_cookie, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":3034 - * name = cstr(name, 'name') - * cookie = cstr(cookie, 'cookie') - * desc = cstr(desc, 'desc') # <<<<<<<<<<<<<< - * - * cdef: - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3034, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3034, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_desc); - __Pyx_GIVEREF(__pyx_v_desc); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_desc); - __Pyx_INCREF(__pyx_n_s_desc); - __Pyx_GIVEREF(__pyx_n_s_desc); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_desc); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3034, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_desc, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":3037 - * - * cdef: - * char* _key = key # <<<<<<<<<<<<<< - * char* _tag = tag - * char* _name = name - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_key); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 3037, __pyx_L1_error) - __pyx_v__key = __pyx_t_6; - - /* "rados.pyx":3038 - * cdef: - * char* _key = key - * char* _tag = tag # <<<<<<<<<<<<<< - * char* _name = name - * char* _cookie = cookie - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_tag); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 3038, __pyx_L1_error) - __pyx_v__tag = __pyx_t_6; - - /* "rados.pyx":3039 - * char* _key = key - * char* _tag = tag - * char* _name = name # <<<<<<<<<<<<<< - * char* _cookie = cookie - * char* _desc = desc - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 3039, __pyx_L1_error) - __pyx_v__name = __pyx_t_6; - - /* "rados.pyx":3040 - * char* _tag = tag - * char* _name = name - * char* _cookie = cookie # <<<<<<<<<<<<<< - * char* _desc = desc - * uint8_t _flags = flags - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_cookie); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 3040, __pyx_L1_error) - __pyx_v__cookie = __pyx_t_6; - - /* "rados.pyx":3041 - * char* _name = name - * char* _cookie = cookie - * char* _desc = desc # <<<<<<<<<<<<<< - * uint8_t _flags = flags - * timeval _duration - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_desc); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 3041, __pyx_L1_error) - __pyx_v__desc = __pyx_t_6; - - /* "rados.pyx":3042 - * char* _cookie = cookie - * char* _desc = desc - * uint8_t _flags = flags # <<<<<<<<<<<<<< - * timeval _duration - * - */ - __pyx_t_7 = __Pyx_PyInt_As_uint8_t(__pyx_v_flags); if (unlikely((__pyx_t_7 == (uint8_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3042, __pyx_L1_error) - __pyx_v__flags = __pyx_t_7; - - /* "rados.pyx":3045 - * timeval _duration - * - * if duration is None: # <<<<<<<<<<<<<< - * with nogil: - * ret = rados_lock_shared(self.io, _key, _name, _cookie, _tag, _desc, - */ - __pyx_t_8 = (__pyx_v_duration == Py_None); - __pyx_t_9 = (__pyx_t_8 != 0); - if (__pyx_t_9) { - - /* "rados.pyx":3046 - * - * if duration is None: - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_lock_shared(self.io, _key, _name, _cookie, _tag, _desc, - * NULL, _flags) - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":3047 - * if duration is None: - * with nogil: - * ret = rados_lock_shared(self.io, _key, _name, _cookie, _tag, _desc, # <<<<<<<<<<<<<< - * NULL, _flags) - * else: - */ - __pyx_v_ret = rados_lock_shared(__pyx_v_self->io, __pyx_v__key, __pyx_v__name, __pyx_v__cookie, __pyx_v__tag, __pyx_v__desc, NULL, __pyx_v__flags); - } - - /* "rados.pyx":3046 - * - * if duration is None: - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_lock_shared(self.io, _key, _name, _cookie, _tag, _desc, - * NULL, _flags) - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L6; - } - __pyx_L6:; - } - } - - /* "rados.pyx":3045 - * timeval _duration - * - * if duration is None: # <<<<<<<<<<<<<< - * with nogil: - * ret = rados_lock_shared(self.io, _key, _name, _cookie, _tag, _desc, - */ - goto __pyx_L3; - } - - /* "rados.pyx":3050 - * NULL, _flags) - * else: - * _duration.tv_sec = duration # <<<<<<<<<<<<<< - * with nogil: - * ret = rados_lock_shared(self.io, _key, _name, _cookie, _tag, _desc, - */ - /*else*/ { - __pyx_t_10 = __Pyx_PyInt_As_time_t(__pyx_v_duration); if (unlikely((__pyx_t_10 == (time_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3050, __pyx_L1_error) - __pyx_v__duration.tv_sec = __pyx_t_10; - - /* "rados.pyx":3051 - * else: - * _duration.tv_sec = duration - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_lock_shared(self.io, _key, _name, _cookie, _tag, _desc, - * &_duration, _flags) - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":3052 - * _duration.tv_sec = duration - * with nogil: - * ret = rados_lock_shared(self.io, _key, _name, _cookie, _tag, _desc, # <<<<<<<<<<<<<< - * &_duration, _flags) - * if ret < 0: - */ - __pyx_v_ret = rados_lock_shared(__pyx_v_self->io, __pyx_v__key, __pyx_v__name, __pyx_v__cookie, __pyx_v__tag, __pyx_v__desc, (&__pyx_v__duration), __pyx_v__flags); - } - - /* "rados.pyx":3051 - * else: - * _duration.tv_sec = duration - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_lock_shared(self.io, _key, _name, _cookie, _tag, _desc, - * &_duration, _flags) - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L9; - } - __pyx_L9:; - } - } - } - __pyx_L3:; - - /* "rados.pyx":3054 - * ret = rados_lock_shared(self.io, _key, _name, _cookie, _tag, _desc, - * &_duration, _flags) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Ioctx.rados_lock_exclusive(%s): failed to set lock %s on %s" % (self.name, name, key)) - * - */ - __pyx_t_9 = ((__pyx_v_ret < 0) != 0); - if (__pyx_t_9) { - - /* "rados.pyx":3055 - * &_duration, _flags) - * if ret < 0: - * raise make_ex(ret, "Ioctx.rados_lock_exclusive(%s): failed to set lock %s on %s" % (self.name, name, key)) # <<<<<<<<<<<<<< - * - * @requires(('key', str_type), ('name', str_type), ('cookie', str_type)) - */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3055, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3055, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3055, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); - __Pyx_INCREF(__pyx_v_name); - __Pyx_GIVEREF(__pyx_v_name); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_name); - __Pyx_INCREF(__pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_key); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Ioctx_rados_lock_exclusive_s_fai, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3055, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __pyx_f_5rados_make_ex(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3055, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 3055, __pyx_L1_error) - - /* "rados.pyx":3054 - * ret = rados_lock_shared(self.io, _key, _name, _cookie, _tag, _desc, - * &_duration, _flags) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Ioctx.rados_lock_exclusive(%s): failed to set lock %s on %s" % (self.name, name, key)) - * - */ - } - - /* "rados.pyx":3005 - * @requires(('key', str_type), ('name', str_type), ('cookie', str_type), ('tag', str_type), - * ('desc', str_type), ('duration', opt(int)), ('flags', int)) - * def lock_shared(self, key, name, cookie, tag, desc="", duration=None, flags=0): # <<<<<<<<<<<<<< - * - * """ - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.Ioctx.lock_shared", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_key); - __Pyx_XDECREF(__pyx_v_name); - __Pyx_XDECREF(__pyx_v_cookie); - __Pyx_XDECREF(__pyx_v_tag); - __Pyx_XDECREF(__pyx_v_desc); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":3058 - * - * @requires(('key', str_type), ('name', str_type), ('cookie', str_type)) - * def unlock(self, key, name, cookie): # <<<<<<<<<<<<<< - * - * """ - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_109unlock(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_5Ioctx_108unlock[] = "Ioctx.unlock(self, key, name, cookie)\n\n Release a shared or exclusive lock on an object\n\n :param key: name of the object\n :type key: str\n :param name: name of the lock\n :type name: str\n :param cookie: cookie of the lock\n :type cookie: str\n\n :raises: :class:`TypeError`\n :raises: :class:`Error`\n "; -static PyObject *__pyx_pw_5rados_5Ioctx_109unlock(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_key = 0; - PyObject *__pyx_v_name = 0; - PyObject *__pyx_v_cookie = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("unlock (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_name_2,&__pyx_n_s_cookie,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name_2)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("unlock", 1, 3, 3, 1); __PYX_ERR(0, 3058, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cookie)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("unlock", 1, 3, 3, 2); __PYX_ERR(0, 3058, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unlock") < 0)) __PYX_ERR(0, 3058, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - } - __pyx_v_key = values[0]; - __pyx_v_name = values[1]; - __pyx_v_cookie = values[2]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("unlock", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3058, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Ioctx.unlock", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_5Ioctx_108unlock(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), __pyx_v_key, __pyx_v_name, __pyx_v_cookie); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_108unlock(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_name, PyObject *__pyx_v_cookie) { - char *__pyx_v__key; - char *__pyx_v__name; - char *__pyx_v__cookie; - int __pyx_v_ret; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - int __pyx_t_7; - __Pyx_RefNannySetupContext("unlock", 0); - __Pyx_INCREF(__pyx_v_key); - __Pyx_INCREF(__pyx_v_name); - __Pyx_INCREF(__pyx_v_cookie); - - /* "rados.pyx":3073 - * :raises: :class:`Error` - * """ - * self.require_ioctx_open() # <<<<<<<<<<<<<< - * - * key = cstr(key, 'key') - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_require_ioctx_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3073, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3073, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3073, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":3075 - * self.require_ioctx_open() - * - * key = cstr(key, 'key') # <<<<<<<<<<<<<< - * name = cstr(name, 'name') - * cookie = cstr(cookie, 'cookie') - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3075, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3075, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_key); - __Pyx_INCREF(__pyx_n_s_key); - __Pyx_GIVEREF(__pyx_n_s_key); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_key); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3075, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":3076 - * - * key = cstr(key, 'key') - * name = cstr(name, 'name') # <<<<<<<<<<<<<< - * cookie = cstr(cookie, 'cookie') - * - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3076, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_3 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3076, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL; - } - __Pyx_INCREF(__pyx_v_name); - __Pyx_GIVEREF(__pyx_v_name); - PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_4, __pyx_v_name); - __Pyx_INCREF(__pyx_n_s_name_2); - __Pyx_GIVEREF(__pyx_n_s_name_2); - PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_4, __pyx_n_s_name_2); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3076, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":3077 - * key = cstr(key, 'key') - * name = cstr(name, 'name') - * cookie = cstr(cookie, 'cookie') # <<<<<<<<<<<<<< - * - * cdef: - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_cstr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3077, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3077, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_INCREF(__pyx_v_cookie); - __Pyx_GIVEREF(__pyx_v_cookie); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_cookie); - __Pyx_INCREF(__pyx_n_s_cookie); - __Pyx_GIVEREF(__pyx_n_s_cookie); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_cookie); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3077, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_cookie, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rados.pyx":3080 - * - * cdef: - * char* _key = key # <<<<<<<<<<<<<< - * char* _name = name - * char* _cookie = cookie - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_key); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 3080, __pyx_L1_error) - __pyx_v__key = __pyx_t_6; - - /* "rados.pyx":3081 - * cdef: - * char* _key = key - * char* _name = name # <<<<<<<<<<<<<< - * char* _cookie = cookie - * - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 3081, __pyx_L1_error) - __pyx_v__name = __pyx_t_6; - - /* "rados.pyx":3082 - * char* _key = key - * char* _name = name - * char* _cookie = cookie # <<<<<<<<<<<<<< - * - * with nogil: - */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_cookie); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 3082, __pyx_L1_error) - __pyx_v__cookie = __pyx_t_6; - - /* "rados.pyx":3084 - * char* _cookie = cookie - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_unlock(self.io, _key, _name, _cookie) - * if ret < 0: - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - #endif - /*try:*/ { - - /* "rados.pyx":3085 - * - * with nogil: - * ret = rados_unlock(self.io, _key, _name, _cookie) # <<<<<<<<<<<<<< - * if ret < 0: - * raise make_ex(ret, "Ioctx.rados_lock_exclusive(%s): failed to set lock %s on %s" % (self.name, name, key)) - */ - __pyx_v_ret = rados_unlock(__pyx_v_self->io, __pyx_v__key, __pyx_v__name, __pyx_v__cookie); - } - - /* "rados.pyx":3084 - * char* _cookie = cookie - * - * with nogil: # <<<<<<<<<<<<<< - * ret = rados_unlock(self.io, _key, _name, _cookie) - * if ret < 0: - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } - - /* "rados.pyx":3086 - * with nogil: - * ret = rados_unlock(self.io, _key, _name, _cookie) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Ioctx.rados_lock_exclusive(%s): failed to set lock %s on %s" % (self.name, name, key)) - * - */ - __pyx_t_7 = ((__pyx_v_ret < 0) != 0); - if (__pyx_t_7) { - - /* "rados.pyx":3087 - * ret = rados_unlock(self.io, _key, _name, _cookie) - * if ret < 0: - * raise make_ex(ret, "Ioctx.rados_lock_exclusive(%s): failed to set lock %s on %s" % (self.name, name, key)) # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3087, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3087, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3087, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); - __Pyx_INCREF(__pyx_v_name); - __Pyx_GIVEREF(__pyx_v_name); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_name); - __Pyx_INCREF(__pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_key); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Ioctx_rados_lock_exclusive_s_fai, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3087, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __pyx_f_5rados_make_ex(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3087, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 3087, __pyx_L1_error) - - /* "rados.pyx":3086 - * with nogil: - * ret = rados_unlock(self.io, _key, _name, _cookie) - * if ret < 0: # <<<<<<<<<<<<<< - * raise make_ex(ret, "Ioctx.rados_lock_exclusive(%s): failed to set lock %s on %s" % (self.name, name, key)) - * - */ - } - - /* "rados.pyx":3058 - * - * @requires(('key', str_type), ('name', str_type), ('cookie', str_type)) - * def unlock(self, key, name, cookie): # <<<<<<<<<<<<<< - * - * """ - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.Ioctx.unlock", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_key); - __Pyx_XDECREF(__pyx_v_name); - __Pyx_XDECREF(__pyx_v_cookie); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pxd":28 - * cdef: - * rados_ioctx_t io - * public char *name # <<<<<<<<<<<<<< - * public object state - * public object locator_key - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_4name_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_5rados_5Ioctx_4name_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_4name___get__(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_4name___get__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 28, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rados.Ioctx.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_5Ioctx_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_5rados_5Ioctx_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_4name_2__set__(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_5Ioctx_4name_2__set__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - char *__pyx_t_1; - __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_value); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(1, 28, __pyx_L1_error) - __pyx_v_self->name = __pyx_t_1; - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("rados.Ioctx.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pxd":29 - * rados_ioctx_t io - * public char *name - * public object state # <<<<<<<<<<<<<< - * public object locator_key - * public object nspace - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_5state_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_5rados_5Ioctx_5state_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_5state___get__(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_5state___get__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->state); - __pyx_r = __pyx_v_self->state; - goto __pyx_L0; - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_5Ioctx_5state_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_5rados_5Ioctx_5state_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_5state_2__set__(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_5Ioctx_5state_2__set__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__", 0); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __Pyx_GOTREF(__pyx_v_self->state); - __Pyx_DECREF(__pyx_v_self->state); - __pyx_v_self->state = __pyx_v_value; - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_5Ioctx_5state_5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_5rados_5Ioctx_5state_5__del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_5state_4__del__(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_5Ioctx_5state_4__del__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__", 0); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_self->state); - __Pyx_DECREF(__pyx_v_self->state); - __pyx_v_self->state = Py_None; - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pxd":30 - * public char *name - * public object state - * public object locator_key # <<<<<<<<<<<<<< - * public object nspace - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_11locator_key_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_5rados_5Ioctx_11locator_key_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_11locator_key___get__(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_11locator_key___get__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->locator_key); - __pyx_r = __pyx_v_self->locator_key; - goto __pyx_L0; - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_5Ioctx_11locator_key_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_5rados_5Ioctx_11locator_key_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_11locator_key_2__set__(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_5Ioctx_11locator_key_2__set__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__", 0); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __Pyx_GOTREF(__pyx_v_self->locator_key); - __Pyx_DECREF(__pyx_v_self->locator_key); - __pyx_v_self->locator_key = __pyx_v_value; - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_5Ioctx_11locator_key_5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_5rados_5Ioctx_11locator_key_5__del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_11locator_key_4__del__(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_5Ioctx_11locator_key_4__del__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__", 0); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_self->locator_key); - __Pyx_DECREF(__pyx_v_self->locator_key); - __pyx_v_self->locator_key = Py_None; - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pxd":31 - * public object state - * public object locator_key - * public object nspace # <<<<<<<<<<<<<< - * - * # TODO(sileht): we need to track leaving completion objects - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_6nspace_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_5rados_5Ioctx_6nspace_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_6nspace___get__(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_6nspace___get__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->nspace); - __pyx_r = __pyx_v_self->nspace; - goto __pyx_L0; - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_5Ioctx_6nspace_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_5rados_5Ioctx_6nspace_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_6nspace_2__set__(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_5Ioctx_6nspace_2__set__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__", 0); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __Pyx_GOTREF(__pyx_v_self->nspace); - __Pyx_DECREF(__pyx_v_self->nspace); - __pyx_v_self->nspace = __pyx_v_value; - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_5Ioctx_6nspace_5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_5rados_5Ioctx_6nspace_5__del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_6nspace_4__del__(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_5Ioctx_6nspace_4__del__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__", 0); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_self->nspace); - __Pyx_DECREF(__pyx_v_self->nspace); - __pyx_v_self->nspace = Py_None; - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pxd":36 - * # I guess we can do that in a lighter ways, but keep code simple - * # as before for now - * public object safe_completions # <<<<<<<<<<<<<< - * public object complete_completions - * public object lock - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_16safe_completions_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_5rados_5Ioctx_16safe_completions_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_16safe_completions___get__(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_16safe_completions___get__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->safe_completions); - __pyx_r = __pyx_v_self->safe_completions; - goto __pyx_L0; - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_5Ioctx_16safe_completions_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_5rados_5Ioctx_16safe_completions_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_16safe_completions_2__set__(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_5Ioctx_16safe_completions_2__set__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__", 0); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __Pyx_GOTREF(__pyx_v_self->safe_completions); - __Pyx_DECREF(__pyx_v_self->safe_completions); - __pyx_v_self->safe_completions = __pyx_v_value; - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_5Ioctx_16safe_completions_5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_5rados_5Ioctx_16safe_completions_5__del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_16safe_completions_4__del__(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_5Ioctx_16safe_completions_4__del__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__", 0); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_self->safe_completions); - __Pyx_DECREF(__pyx_v_self->safe_completions); - __pyx_v_self->safe_completions = Py_None; - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pxd":37 - * # as before for now - * public object safe_completions - * public object complete_completions # <<<<<<<<<<<<<< - * public object lock - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_20complete_completions_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_5rados_5Ioctx_20complete_completions_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_20complete_completions___get__(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_20complete_completions___get__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->complete_completions); - __pyx_r = __pyx_v_self->complete_completions; - goto __pyx_L0; - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_5Ioctx_20complete_completions_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_5rados_5Ioctx_20complete_completions_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_20complete_completions_2__set__(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_5Ioctx_20complete_completions_2__set__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__", 0); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __Pyx_GOTREF(__pyx_v_self->complete_completions); - __Pyx_DECREF(__pyx_v_self->complete_completions); - __pyx_v_self->complete_completions = __pyx_v_value; - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_5Ioctx_20complete_completions_5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_5rados_5Ioctx_20complete_completions_5__del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_20complete_completions_4__del__(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_5Ioctx_20complete_completions_4__del__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__", 0); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_self->complete_completions); - __Pyx_DECREF(__pyx_v_self->complete_completions); - __pyx_v_self->complete_completions = Py_None; - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pxd":38 - * public object safe_completions - * public object complete_completions - * public object lock # <<<<<<<<<<<<<< - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_5Ioctx_4lock_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_5rados_5Ioctx_4lock_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_4lock___get__(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_5Ioctx_4lock___get__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->lock); - __pyx_r = __pyx_v_self->lock; - goto __pyx_L0; - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_5Ioctx_4lock_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_5rados_5Ioctx_4lock_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_4lock_2__set__(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_5Ioctx_4lock_2__set__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__", 0); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __Pyx_GOTREF(__pyx_v_self->lock); - __Pyx_DECREF(__pyx_v_self->lock); - __pyx_v_self->lock = __pyx_v_value; - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_5rados_5Ioctx_4lock_5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_5rados_5Ioctx_4lock_5__del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_5Ioctx_4lock_4__del__(((struct __pyx_obj_5rados_Ioctx *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5rados_5Ioctx_4lock_4__del__(struct __pyx_obj_5rados_Ioctx *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__", 0); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_self->lock); - __Pyx_DECREF(__pyx_v_self->lock); - __pyx_v_self->lock = Py_None; - - /* function exit code */ - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":3090 - * - * - * def set_object_locator(func): # <<<<<<<<<<<<<< - * def retfunc(self, *args, **kwargs): - * if self.locator_key is not None: - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_11set_object_locator(PyObject *__pyx_self, PyObject *__pyx_v_func); /*proto*/ -static char __pyx_doc_5rados_10set_object_locator[] = "set_object_locator(func)"; -static PyMethodDef __pyx_mdef_5rados_11set_object_locator = {"set_object_locator", (PyCFunction)__pyx_pw_5rados_11set_object_locator, METH_O, __pyx_doc_5rados_10set_object_locator}; -static PyObject *__pyx_pw_5rados_11set_object_locator(PyObject *__pyx_self, PyObject *__pyx_v_func) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("set_object_locator (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_10set_object_locator(__pyx_self, ((PyObject *)__pyx_v_func)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":3091 - * - * def set_object_locator(func): - * def retfunc(self, *args, **kwargs): # <<<<<<<<<<<<<< - * if self.locator_key is not None: - * old_locator = self.ioctx.get_locator_key() - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_18set_object_locator_1retfunc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_5rados_18set_object_locator_1retfunc = {"retfunc", (PyCFunction)__pyx_pw_5rados_18set_object_locator_1retfunc, METH_VARARGS|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5rados_18set_object_locator_1retfunc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_args = 0; - PyObject *__pyx_v_kwargs = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("retfunc (wrapper)", 0); - __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; - __Pyx_GOTREF(__pyx_v_kwargs); - if (PyTuple_GET_SIZE(__pyx_args) > 1) { - __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); - if (unlikely(!__pyx_v_args)) { - __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; - __Pyx_RefNannyFinishContext(); - return NULL; - } - __Pyx_GOTREF(__pyx_v_args); - } else { - __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); - } - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; - PyObject* values[1] = {0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - default: - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "retfunc") < 0)) __PYX_ERR(0, 3091, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - } - __pyx_v_self = values[0]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("retfunc", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3091, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; - __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; - __Pyx_AddTraceback("rados.set_object_locator.retfunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_18set_object_locator_retfunc(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kwargs); - - /* function exit code */ - __Pyx_XDECREF(__pyx_v_args); - __Pyx_XDECREF(__pyx_v_kwargs); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_18set_object_locator_retfunc(PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { - struct __pyx_obj_5rados___pyx_scope_struct_8_set_object_locator *__pyx_cur_scope; - struct __pyx_obj_5rados___pyx_scope_struct_8_set_object_locator *__pyx_outer_scope; - PyObject *__pyx_v_old_locator = NULL; - PyObject *__pyx_v_retval = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - __Pyx_RefNannySetupContext("retfunc", 0); - __pyx_outer_scope = (struct __pyx_obj_5rados___pyx_scope_struct_8_set_object_locator *) __Pyx_CyFunction_GetClosure(__pyx_self); - __pyx_cur_scope = __pyx_outer_scope; - - /* "rados.pyx":3092 - * def set_object_locator(func): - * def retfunc(self, *args, **kwargs): - * if self.locator_key is not None: # <<<<<<<<<<<<<< - * old_locator = self.ioctx.get_locator_key() - * self.ioctx.set_locator_key(self.locator_key) - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_locator_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3092, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = (__pyx_t_1 != Py_None); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = (__pyx_t_2 != 0); - if (__pyx_t_3) { - - /* "rados.pyx":3093 - * def retfunc(self, *args, **kwargs): - * if self.locator_key is not None: - * old_locator = self.ioctx.get_locator_key() # <<<<<<<<<<<<<< - * self.ioctx.set_locator_key(self.locator_key) - * retval = func(self, *args, **kwargs) - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ioctx); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3093, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get_locator_key); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3093, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - } - } - if (__pyx_t_4) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3093, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3093, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_old_locator = __pyx_t_1; - __pyx_t_1 = 0; - - /* "rados.pyx":3094 - * if self.locator_key is not None: - * old_locator = self.ioctx.get_locator_key() - * self.ioctx.set_locator_key(self.locator_key) # <<<<<<<<<<<<<< - * retval = func(self, *args, **kwargs) - * self.ioctx.set_locator_key(old_locator) - */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ioctx); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3094, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_set_locator_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3094, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_locator_key); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3094, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - } - } - if (!__pyx_t_6) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3094, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3094, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3094, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":3095 - * old_locator = self.ioctx.get_locator_key() - * self.ioctx.set_locator_key(self.locator_key) - * retval = func(self, *args, **kwargs) # <<<<<<<<<<<<<< - * self.ioctx.set_locator_key(old_locator) - * return retval - */ - if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); __PYX_ERR(0, 3095, __pyx_L1_error) } - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3095, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_self); - __Pyx_GIVEREF(__pyx_v_self); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); - __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3095, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_4, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3095, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_retval = __pyx_t_1; - __pyx_t_1 = 0; - - /* "rados.pyx":3096 - * self.ioctx.set_locator_key(self.locator_key) - * retval = func(self, *args, **kwargs) - * self.ioctx.set_locator_key(old_locator) # <<<<<<<<<<<<<< - * return retval - * else: - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ioctx); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3096, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_set_locator_key); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3096, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - } - } - if (!__pyx_t_4) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_old_locator); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3096, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3096, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; - __Pyx_INCREF(__pyx_v_old_locator); - __Pyx_GIVEREF(__pyx_v_old_locator); - PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_old_locator); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3096, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":3097 - * retval = func(self, *args, **kwargs) - * self.ioctx.set_locator_key(old_locator) - * return retval # <<<<<<<<<<<<<< - * else: - * return func(self, *args, **kwargs) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_retval); - __pyx_r = __pyx_v_retval; - goto __pyx_L0; - - /* "rados.pyx":3092 - * def set_object_locator(func): - * def retfunc(self, *args, **kwargs): - * if self.locator_key is not None: # <<<<<<<<<<<<<< - * old_locator = self.ioctx.get_locator_key() - * self.ioctx.set_locator_key(self.locator_key) - */ - } - - /* "rados.pyx":3099 - * return retval - * else: - * return func(self, *args, **kwargs) # <<<<<<<<<<<<<< - * return retfunc - * - */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); __PYX_ERR(0, 3099, __pyx_L1_error) } - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3099, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_self); - __Pyx_GIVEREF(__pyx_v_self); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); - __pyx_t_7 = PyNumber_Add(__pyx_t_1, __pyx_v_args); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3099, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_7, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3099, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - } - - /* "rados.pyx":3091 - * - * def set_object_locator(func): - * def retfunc(self, *args, **kwargs): # <<<<<<<<<<<<<< - * if self.locator_key is not None: - * old_locator = self.ioctx.get_locator_key() - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("rados.set_object_locator.retfunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_old_locator); - __Pyx_XDECREF(__pyx_v_retval); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":3090 - * - * - * def set_object_locator(func): # <<<<<<<<<<<<<< - * def retfunc(self, *args, **kwargs): - * if self.locator_key is not None: - */ - -static PyObject *__pyx_pf_5rados_10set_object_locator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func) { - struct __pyx_obj_5rados___pyx_scope_struct_8_set_object_locator *__pyx_cur_scope; - PyObject *__pyx_v_retfunc = 0; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("set_object_locator", 0); - __pyx_cur_scope = (struct __pyx_obj_5rados___pyx_scope_struct_8_set_object_locator *)__pyx_tp_new_5rados___pyx_scope_struct_8_set_object_locator(__pyx_ptype_5rados___pyx_scope_struct_8_set_object_locator, __pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __Pyx_RefNannyFinishContext(); - return NULL; - } - __Pyx_GOTREF(__pyx_cur_scope); - __pyx_cur_scope->__pyx_v_func = __pyx_v_func; - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); - - /* "rados.pyx":3091 - * - * def set_object_locator(func): - * def retfunc(self, *args, **kwargs): # <<<<<<<<<<<<<< - * if self.locator_key is not None: - * old_locator = self.ioctx.get_locator_key() - */ - __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5rados_18set_object_locator_1retfunc, 0, __pyx_n_s_set_object_locator_locals_retfun, ((PyObject*)__pyx_cur_scope), __pyx_n_s_rados, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3091, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_retfunc = __pyx_t_1; - __pyx_t_1 = 0; - - /* "rados.pyx":3100 - * else: - * return func(self, *args, **kwargs) - * return retfunc # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_retfunc); - __pyx_r = __pyx_v_retfunc; - goto __pyx_L0; - - /* "rados.pyx":3090 - * - * - * def set_object_locator(func): # <<<<<<<<<<<<<< - * def retfunc(self, *args, **kwargs): - * if self.locator_key is not None: - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rados.set_object_locator", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_retfunc); - __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":3103 - * - * - * def set_object_namespace(func): # <<<<<<<<<<<<<< - * def retfunc(self, *args, **kwargs): - * if self.nspace is None: - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_13set_object_namespace(PyObject *__pyx_self, PyObject *__pyx_v_func); /*proto*/ -static char __pyx_doc_5rados_12set_object_namespace[] = "set_object_namespace(func)"; -static PyMethodDef __pyx_mdef_5rados_13set_object_namespace = {"set_object_namespace", (PyCFunction)__pyx_pw_5rados_13set_object_namespace, METH_O, __pyx_doc_5rados_12set_object_namespace}; -static PyObject *__pyx_pw_5rados_13set_object_namespace(PyObject *__pyx_self, PyObject *__pyx_v_func) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("set_object_namespace (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_12set_object_namespace(__pyx_self, ((PyObject *)__pyx_v_func)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":3104 - * - * def set_object_namespace(func): - * def retfunc(self, *args, **kwargs): # <<<<<<<<<<<<<< - * if self.nspace is None: - * raise LogicError("Namespace not set properly in context") - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_20set_object_namespace_1retfunc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_5rados_20set_object_namespace_1retfunc = {"retfunc", (PyCFunction)__pyx_pw_5rados_20set_object_namespace_1retfunc, METH_VARARGS|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_5rados_20set_object_namespace_1retfunc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_args = 0; - PyObject *__pyx_v_kwargs = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("retfunc (wrapper)", 0); - __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; - __Pyx_GOTREF(__pyx_v_kwargs); - if (PyTuple_GET_SIZE(__pyx_args) > 1) { - __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); - if (unlikely(!__pyx_v_args)) { - __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; - __Pyx_RefNannyFinishContext(); - return NULL; - } - __Pyx_GOTREF(__pyx_v_args); - } else { - __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); - } - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; - PyObject* values[1] = {0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - default: - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "retfunc") < 0)) __PYX_ERR(0, 3104, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - } - __pyx_v_self = values[0]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("retfunc", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3104, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; - __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; - __Pyx_AddTraceback("rados.set_object_namespace.retfunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_20set_object_namespace_retfunc(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kwargs); - - /* function exit code */ - __Pyx_XDECREF(__pyx_v_args); - __Pyx_XDECREF(__pyx_v_kwargs); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_20set_object_namespace_retfunc(PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { - struct __pyx_obj_5rados___pyx_scope_struct_9_set_object_namespace *__pyx_cur_scope; - struct __pyx_obj_5rados___pyx_scope_struct_9_set_object_namespace *__pyx_outer_scope; - PyObject *__pyx_v_old_nspace = NULL; - PyObject *__pyx_v_retval = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - __Pyx_RefNannySetupContext("retfunc", 0); - __pyx_outer_scope = (struct __pyx_obj_5rados___pyx_scope_struct_9_set_object_namespace *) __Pyx_CyFunction_GetClosure(__pyx_self); - __pyx_cur_scope = __pyx_outer_scope; - - /* "rados.pyx":3105 - * def set_object_namespace(func): - * def retfunc(self, *args, **kwargs): - * if self.nspace is None: # <<<<<<<<<<<<<< - * raise LogicError("Namespace not set properly in context") - * old_nspace = self.ioctx.get_namespace() - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nspace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3105, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = (__pyx_t_1 == Py_None); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = (__pyx_t_2 != 0); - if (__pyx_t_3) { - - /* "rados.pyx":3106 - * def retfunc(self, *args, **kwargs): - * if self.nspace is None: - * raise LogicError("Namespace not set properly in context") # <<<<<<<<<<<<<< - * old_nspace = self.ioctx.get_namespace() - * self.ioctx.set_namespace(self.nspace) - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_LogicError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3106, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3106, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 3106, __pyx_L1_error) - - /* "rados.pyx":3105 - * def set_object_namespace(func): - * def retfunc(self, *args, **kwargs): - * if self.nspace is None: # <<<<<<<<<<<<<< - * raise LogicError("Namespace not set properly in context") - * old_nspace = self.ioctx.get_namespace() - */ - } - - /* "rados.pyx":3107 - * if self.nspace is None: - * raise LogicError("Namespace not set properly in context") - * old_nspace = self.ioctx.get_namespace() # <<<<<<<<<<<<<< - * self.ioctx.set_namespace(self.nspace) - * retval = func(self, *args, **kwargs) - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ioctx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3107, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get_namespace); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3107, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - } - } - if (__pyx_t_1) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3107, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } else { - __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3107, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_old_nspace = __pyx_t_4; - __pyx_t_4 = 0; - - /* "rados.pyx":3108 - * raise LogicError("Namespace not set properly in context") - * old_nspace = self.ioctx.get_namespace() - * self.ioctx.set_namespace(self.nspace) # <<<<<<<<<<<<<< - * retval = func(self, *args, **kwargs) - * self.ioctx.set_namespace(old_nspace) - */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ioctx); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3108, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_set_namespace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3108, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nspace); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3108, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_6) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3108, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_4); - } else { - __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3108, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3108, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "rados.pyx":3109 - * old_nspace = self.ioctx.get_namespace() - * self.ioctx.set_namespace(self.nspace) - * retval = func(self, *args, **kwargs) # <<<<<<<<<<<<<< - * self.ioctx.set_namespace(old_nspace) - * return retval - */ - if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); __PYX_ERR(0, 3109, __pyx_L1_error) } - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3109, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_v_self); - __Pyx_GIVEREF(__pyx_v_self); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self); - __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3109, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_1, __pyx_v_kwargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3109, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_retval = __pyx_t_4; - __pyx_t_4 = 0; - - /* "rados.pyx":3110 - * self.ioctx.set_namespace(self.nspace) - * retval = func(self, *args, **kwargs) - * self.ioctx.set_namespace(old_nspace) # <<<<<<<<<<<<<< - * return retval - * return retfunc - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ioctx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3110, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_set_namespace); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3110, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - } - } - if (!__pyx_t_1) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_old_nspace); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3110, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3110, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL; - __Pyx_INCREF(__pyx_v_old_nspace); - __Pyx_GIVEREF(__pyx_v_old_nspace); - PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_old_nspace); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3110, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "rados.pyx":3111 - * retval = func(self, *args, **kwargs) - * self.ioctx.set_namespace(old_nspace) - * return retval # <<<<<<<<<<<<<< - * return retfunc - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_retval); - __pyx_r = __pyx_v_retval; - goto __pyx_L0; - - /* "rados.pyx":3104 - * - * def set_object_namespace(func): - * def retfunc(self, *args, **kwargs): # <<<<<<<<<<<<<< - * if self.nspace is None: - * raise LogicError("Namespace not set properly in context") - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("rados.set_object_namespace.retfunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_old_nspace); - __Pyx_XDECREF(__pyx_v_retval); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":3103 - * - * - * def set_object_namespace(func): # <<<<<<<<<<<<<< - * def retfunc(self, *args, **kwargs): - * if self.nspace is None: - */ - -static PyObject *__pyx_pf_5rados_12set_object_namespace(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func) { - struct __pyx_obj_5rados___pyx_scope_struct_9_set_object_namespace *__pyx_cur_scope; - PyObject *__pyx_v_retfunc = 0; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("set_object_namespace", 0); - __pyx_cur_scope = (struct __pyx_obj_5rados___pyx_scope_struct_9_set_object_namespace *)__pyx_tp_new_5rados___pyx_scope_struct_9_set_object_namespace(__pyx_ptype_5rados___pyx_scope_struct_9_set_object_namespace, __pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __Pyx_RefNannyFinishContext(); - return NULL; - } - __Pyx_GOTREF(__pyx_cur_scope); - __pyx_cur_scope->__pyx_v_func = __pyx_v_func; - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); - - /* "rados.pyx":3104 - * - * def set_object_namespace(func): - * def retfunc(self, *args, **kwargs): # <<<<<<<<<<<<<< - * if self.nspace is None: - * raise LogicError("Namespace not set properly in context") - */ - __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5rados_20set_object_namespace_1retfunc, 0, __pyx_n_s_set_object_namespace_locals_retf, ((PyObject*)__pyx_cur_scope), __pyx_n_s_rados, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_retfunc = __pyx_t_1; - __pyx_t_1 = 0; - - /* "rados.pyx":3112 - * self.ioctx.set_namespace(old_nspace) - * return retval - * return retfunc # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_retfunc); - __pyx_r = __pyx_v_retfunc; - goto __pyx_L0; - - /* "rados.pyx":3103 - * - * - * def set_object_namespace(func): # <<<<<<<<<<<<<< - * def retfunc(self, *args, **kwargs): - * if self.nspace is None: - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rados.set_object_namespace", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_retfunc); - __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":3117 - * class Object(object): - * """Rados object wrapper, makes the object look like a file""" - * def __init__(self, ioctx, key, locator_key=None, nspace=None): # <<<<<<<<<<<<<< - * self.key = key - * self.ioctx = ioctx - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_6Object_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_6Object___init__[] = "Object.__init__(self, ioctx, key, locator_key=None, nspace=None)"; -static PyMethodDef __pyx_mdef_5rados_6Object_1__init__ = {"__init__", (PyCFunction)__pyx_pw_5rados_6Object_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_6Object___init__}; -static PyObject *__pyx_pw_5rados_6Object_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_ioctx = 0; - PyObject *__pyx_v_key = 0; - PyObject *__pyx_v_locator_key = 0; - PyObject *__pyx_v_nspace = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ioctx,&__pyx_n_s_key,&__pyx_n_s_locator_key,&__pyx_n_s_nspace,0}; - PyObject* values[5] = {0,0,0,0,0}; - values[3] = ((PyObject *)((PyObject *)Py_None)); - values[4] = ((PyObject *)((PyObject *)Py_None)); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ioctx)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 1); __PYX_ERR(0, 3117, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 2); __PYX_ERR(0, 3117, __pyx_L3_error) - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_locator_key); - if (value) { values[3] = value; kw_args--; } - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nspace); - if (value) { values[4] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 3117, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_self = values[0]; - __pyx_v_ioctx = values[1]; - __pyx_v_key = values[2]; - __pyx_v_locator_key = values[3]; - __pyx_v_nspace = values[4]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3117, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Object.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_6Object___init__(__pyx_self, __pyx_v_self, __pyx_v_ioctx, __pyx_v_key, __pyx_v_locator_key, __pyx_v_nspace); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_6Object___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_ioctx, PyObject *__pyx_v_key, PyObject *__pyx_v_locator_key, PyObject *__pyx_v_nspace) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - __Pyx_RefNannySetupContext("__init__", 0); - - /* "rados.pyx":3118 - * """Rados object wrapper, makes the object look like a file""" - * def __init__(self, ioctx, key, locator_key=None, nspace=None): - * self.key = key # <<<<<<<<<<<<<< - * self.ioctx = ioctx - * self.offset = 0 - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_key, __pyx_v_key) < 0) __PYX_ERR(0, 3118, __pyx_L1_error) - - /* "rados.pyx":3119 - * def __init__(self, ioctx, key, locator_key=None, nspace=None): - * self.key = key - * self.ioctx = ioctx # <<<<<<<<<<<<<< - * self.offset = 0 - * self.state = "exists" - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ioctx, __pyx_v_ioctx) < 0) __PYX_ERR(0, 3119, __pyx_L1_error) - - /* "rados.pyx":3120 - * self.key = key - * self.ioctx = ioctx - * self.offset = 0 # <<<<<<<<<<<<<< - * self.state = "exists" - * self.locator_key = locator_key - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_offset, __pyx_int_0) < 0) __PYX_ERR(0, 3120, __pyx_L1_error) - - /* "rados.pyx":3121 - * self.ioctx = ioctx - * self.offset = 0 - * self.state = "exists" # <<<<<<<<<<<<<< - * self.locator_key = locator_key - * self.nspace = "" if nspace is None else nspace - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_state, __pyx_n_s_exists) < 0) __PYX_ERR(0, 3121, __pyx_L1_error) - - /* "rados.pyx":3122 - * self.offset = 0 - * self.state = "exists" - * self.locator_key = locator_key # <<<<<<<<<<<<<< - * self.nspace = "" if nspace is None else nspace - * - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_locator_key, __pyx_v_locator_key) < 0) __PYX_ERR(0, 3122, __pyx_L1_error) - - /* "rados.pyx":3123 - * self.state = "exists" - * self.locator_key = locator_key - * self.nspace = "" if nspace is None else nspace # <<<<<<<<<<<<<< - * - * def __str__(self): - */ - __pyx_t_2 = (__pyx_v_nspace == Py_None); - if ((__pyx_t_2 != 0)) { - __Pyx_INCREF(__pyx_kp_s__13); - __pyx_t_1 = __pyx_kp_s__13; - } else { - __Pyx_INCREF(__pyx_v_nspace); - __pyx_t_1 = __pyx_v_nspace; - } - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nspace, __pyx_t_1) < 0) __PYX_ERR(0, 3123, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":3117 - * class Object(object): - * """Rados object wrapper, makes the object look like a file""" - * def __init__(self, ioctx, key, locator_key=None, nspace=None): # <<<<<<<<<<<<<< - * self.key = key - * self.ioctx = ioctx - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rados.Object.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":3125 - * self.nspace = "" if nspace is None else nspace - * - * def __str__(self): # <<<<<<<<<<<<<< - * return "rados.Object(ioctx=%s,key=%s,nspace=%s,locator=%s)" % \ - * (str(self.ioctx), self.key, "--default--" - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_6Object_3__str__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ -static char __pyx_doc_5rados_6Object_2__str__[] = "Object.__str__(self)"; -static PyMethodDef __pyx_mdef_5rados_6Object_3__str__ = {"__str__", (PyCFunction)__pyx_pw_5rados_6Object_3__str__, METH_O, __pyx_doc_5rados_6Object_2__str__}; -static PyObject *__pyx_pw_5rados_6Object_3__str__(PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_6Object_2__str__(__pyx_self, ((PyObject *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_6Object_2__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - __Pyx_RefNannySetupContext("__str__", 0); - - /* "rados.pyx":3126 - * - * def __str__(self): - * return "rados.Object(ioctx=%s,key=%s,nspace=%s,locator=%s)" % \ # <<<<<<<<<<<<<< - * (str(self.ioctx), self.key, "--default--" - * if self.nspace is "" else self.nspace, self.locator_key) - */ - __Pyx_XDECREF(__pyx_r); - - /* "rados.pyx":3127 - * def __str__(self): - * return "rados.Object(ioctx=%s,key=%s,nspace=%s,locator=%s)" % \ - * (str(self.ioctx), self.key, "--default--" # <<<<<<<<<<<<<< - * if self.nspace is "" else self.nspace, self.locator_key) - * - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ioctx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3127, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3127, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3127, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3127, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - - /* "rados.pyx":3128 - * return "rados.Object(ioctx=%s,key=%s,nspace=%s,locator=%s)" % \ - * (str(self.ioctx), self.key, "--default--" - * if self.nspace is "" else self.nspace, self.locator_key) # <<<<<<<<<<<<<< - * - * def require_object_exists(self): - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nspace); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3128, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = (__pyx_t_4 == __pyx_kp_s__13); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if ((__pyx_t_5 != 0)) { - __Pyx_INCREF(__pyx_kp_s_default); - __pyx_t_3 = __pyx_kp_s_default; - } else { - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nspace); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3128, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __pyx_t_4; - __pyx_t_4 = 0; - } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_locator_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3128, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - - /* "rados.pyx":3127 - * def __str__(self): - * return "rados.Object(ioctx=%s,key=%s,nspace=%s,locator=%s)" % \ - * (str(self.ioctx), self.key, "--default--" # <<<<<<<<<<<<<< - * if self.nspace is "" else self.nspace, self.locator_key) - * - */ - __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3127, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_4); - __pyx_t_1 = 0; - __pyx_t_2 = 0; - __pyx_t_3 = 0; - __pyx_t_4 = 0; - - /* "rados.pyx":3126 - * - * def __str__(self): - * return "rados.Object(ioctx=%s,key=%s,nspace=%s,locator=%s)" % \ # <<<<<<<<<<<<<< - * (str(self.ioctx), self.key, "--default--" - * if self.nspace is "" else self.nspace, self.locator_key) - */ - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_rados_Object_ioctx_s_key_s_nspac, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3126, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - /* "rados.pyx":3125 - * self.nspace = "" if nspace is None else nspace - * - * def __str__(self): # <<<<<<<<<<<<<< - * return "rados.Object(ioctx=%s,key=%s,nspace=%s,locator=%s)" % \ - * (str(self.ioctx), self.key, "--default--" - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("rados.Object.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":3130 - * if self.nspace is "" else self.nspace, self.locator_key) - * - * def require_object_exists(self): # <<<<<<<<<<<<<< - * if self.state != "exists": - * raise ObjectStateError("The object is %s" % self.state) - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_6Object_5require_object_exists(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ -static char __pyx_doc_5rados_6Object_4require_object_exists[] = "Object.require_object_exists(self)"; -static PyMethodDef __pyx_mdef_5rados_6Object_5require_object_exists = {"require_object_exists", (PyCFunction)__pyx_pw_5rados_6Object_5require_object_exists, METH_O, __pyx_doc_5rados_6Object_4require_object_exists}; -static PyObject *__pyx_pw_5rados_6Object_5require_object_exists(PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("require_object_exists (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_6Object_4require_object_exists(__pyx_self, ((PyObject *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_6Object_4require_object_exists(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - __Pyx_RefNannySetupContext("require_object_exists", 0); - - /* "rados.pyx":3131 - * - * def require_object_exists(self): - * if self.state != "exists": # <<<<<<<<<<<<<< - * raise ObjectStateError("The object is %s" % self.state) - * - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3131, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_exists, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3131, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_2) { - - /* "rados.pyx":3132 - * def require_object_exists(self): - * if self.state != "exists": - * raise ObjectStateError("The object is %s" % self.state) # <<<<<<<<<<<<<< - * - * @set_object_locator - */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_ObjectStateError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3132, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_state); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3132, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_The_object_is_s, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3132, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - } - } - if (!__pyx_t_4) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3132, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3132, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3132, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 3132, __pyx_L1_error) - - /* "rados.pyx":3131 - * - * def require_object_exists(self): - * if self.state != "exists": # <<<<<<<<<<<<<< - * raise ObjectStateError("The object is %s" % self.state) - * - */ - } - - /* "rados.pyx":3130 - * if self.nspace is "" else self.nspace, self.locator_key) - * - * def require_object_exists(self): # <<<<<<<<<<<<<< - * if self.state != "exists": - * raise ObjectStateError("The object is %s" % self.state) - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("rados.Object.require_object_exists", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":3136 - * @set_object_locator - * @set_object_namespace - * def read(self, length=1024 * 1024): # <<<<<<<<<<<<<< - * self.require_object_exists() - * ret = self.ioctx.read(self.key, length, self.offset) - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_6Object_7read(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_6Object_6read[] = "Object.read(self, length=1048576)"; -static PyMethodDef __pyx_mdef_5rados_6Object_7read = {"read", (PyCFunction)__pyx_pw_5rados_6Object_7read, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_6Object_6read}; -static PyObject *__pyx_pw_5rados_6Object_7read(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_length = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("read (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_length,0}; - PyObject* values[2] = {0,0}; - values[1] = ((PyObject *)((PyObject *)__pyx_int_1048576)); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_length); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read") < 0)) __PYX_ERR(0, 3136, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_self = values[0]; - __pyx_v_length = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("read", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3136, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Object.read", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_6Object_6read(__pyx_self, __pyx_v_self, __pyx_v_length); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_6Object_6read(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_length) { - PyObject *__pyx_v_ret = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - Py_ssize_t __pyx_t_6; - PyObject *__pyx_t_7 = NULL; - __Pyx_RefNannySetupContext("read", 0); - - /* "rados.pyx":3137 - * @set_object_namespace - * def read(self, length=1024 * 1024): - * self.require_object_exists() # <<<<<<<<<<<<<< - * ret = self.ioctx.read(self.key, length, self.offset) - * self.offset += len(ret) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_require_object_exists); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3137, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3137, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":3138 - * def read(self, length=1024 * 1024): - * self.require_object_exists() - * ret = self.ioctx.read(self.key, length, self.offset) # <<<<<<<<<<<<<< - * self.offset += len(ret) - * return ret - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ioctx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3138, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_read); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3138, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3138, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_offset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3138, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - __pyx_t_6 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_6 = 1; - } - } - __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3138, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; - } - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_2); - __Pyx_INCREF(__pyx_v_length); - __Pyx_GIVEREF(__pyx_v_length); - PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_length); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_t_4); - __pyx_t_2 = 0; - __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3138, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_ret = __pyx_t_1; - __pyx_t_1 = 0; - - /* "rados.pyx":3139 - * self.require_object_exists() - * ret = self.ioctx.read(self.key, length, self.offset) - * self.offset += len(ret) # <<<<<<<<<<<<<< - * return ret - * - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3139, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyObject_Length(__pyx_v_ret); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 3139, __pyx_L1_error) - __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3139, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3139, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_offset, __pyx_t_7) < 0) __PYX_ERR(0, 3139, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - - /* "rados.pyx":3140 - * ret = self.ioctx.read(self.key, length, self.offset) - * self.offset += len(ret) - * return ret # <<<<<<<<<<<<<< - * - * @set_object_locator - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_ret); - __pyx_r = __pyx_v_ret; - goto __pyx_L0; - - /* "rados.pyx":3136 - * @set_object_locator - * @set_object_namespace - * def read(self, length=1024 * 1024): # <<<<<<<<<<<<<< - * self.require_object_exists() - * ret = self.ioctx.read(self.key, length, self.offset) - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("rados.Object.read", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_ret); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":3144 - * @set_object_locator - * @set_object_namespace - * def write(self, string_to_write): # <<<<<<<<<<<<<< - * self.require_object_exists() - * ret = self.ioctx.write(self.key, string_to_write, self.offset) - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_6Object_9write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_6Object_8write[] = "Object.write(self, string_to_write)"; -static PyMethodDef __pyx_mdef_5rados_6Object_9write = {"write", (PyCFunction)__pyx_pw_5rados_6Object_9write, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_6Object_8write}; -static PyObject *__pyx_pw_5rados_6Object_9write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_string_to_write = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("write (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_string_to_write,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_string_to_write)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("write", 1, 2, 2, 1); __PYX_ERR(0, 3144, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write") < 0)) __PYX_ERR(0, 3144, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_self = values[0]; - __pyx_v_string_to_write = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("write", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3144, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Object.write", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_6Object_8write(__pyx_self, __pyx_v_self, __pyx_v_string_to_write); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_6Object_8write(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_string_to_write) { - PyObject *__pyx_v_ret = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - Py_ssize_t __pyx_t_6; - PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; - __Pyx_RefNannySetupContext("write", 0); - - /* "rados.pyx":3145 - * @set_object_namespace - * def write(self, string_to_write): - * self.require_object_exists() # <<<<<<<<<<<<<< - * ret = self.ioctx.write(self.key, string_to_write, self.offset) - * if ret == 0: - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_require_object_exists); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3145, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3145, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3145, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":3146 - * def write(self, string_to_write): - * self.require_object_exists() - * ret = self.ioctx.write(self.key, string_to_write, self.offset) # <<<<<<<<<<<<<< - * if ret == 0: - * self.offset += len(string_to_write) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ioctx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_offset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - __pyx_t_6 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_6 = 1; - } - } - __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; - } - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_2); - __Pyx_INCREF(__pyx_v_string_to_write); - __Pyx_GIVEREF(__pyx_v_string_to_write); - PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_string_to_write); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_t_4); - __pyx_t_2 = 0; - __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_ret = __pyx_t_1; - __pyx_t_1 = 0; - - /* "rados.pyx":3147 - * self.require_object_exists() - * ret = self.ioctx.write(self.key, string_to_write, self.offset) - * if ret == 0: # <<<<<<<<<<<<<< - * self.offset += len(string_to_write) - * return ret - */ - __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_ret, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3147, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 3147, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_8) { - - /* "rados.pyx":3148 - * ret = self.ioctx.write(self.key, string_to_write, self.offset) - * if ret == 0: - * self.offset += len(string_to_write) # <<<<<<<<<<<<<< - * return ret - * - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3148, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyObject_Length(__pyx_v_string_to_write); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 3148, __pyx_L1_error) - __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3148, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3148, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_offset, __pyx_t_7) < 0) __PYX_ERR(0, 3148, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - - /* "rados.pyx":3147 - * self.require_object_exists() - * ret = self.ioctx.write(self.key, string_to_write, self.offset) - * if ret == 0: # <<<<<<<<<<<<<< - * self.offset += len(string_to_write) - * return ret - */ - } - - /* "rados.pyx":3149 - * if ret == 0: - * self.offset += len(string_to_write) - * return ret # <<<<<<<<<<<<<< - * - * @set_object_locator - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_ret); - __pyx_r = __pyx_v_ret; - goto __pyx_L0; - - /* "rados.pyx":3144 - * @set_object_locator - * @set_object_namespace - * def write(self, string_to_write): # <<<<<<<<<<<<<< - * self.require_object_exists() - * ret = self.ioctx.write(self.key, string_to_write, self.offset) - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("rados.Object.write", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_ret); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":3153 - * @set_object_locator - * @set_object_namespace - * def remove(self): # <<<<<<<<<<<<<< - * self.require_object_exists() - * self.ioctx.remove_object(self.key) - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_6Object_11remove(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ -static char __pyx_doc_5rados_6Object_10remove[] = "Object.remove(self)"; -static PyMethodDef __pyx_mdef_5rados_6Object_11remove = {"remove", (PyCFunction)__pyx_pw_5rados_6Object_11remove, METH_O, __pyx_doc_5rados_6Object_10remove}; -static PyObject *__pyx_pw_5rados_6Object_11remove(PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("remove (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_6Object_10remove(__pyx_self, ((PyObject *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_6Object_10remove(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - __Pyx_RefNannySetupContext("remove", 0); - - /* "rados.pyx":3154 - * @set_object_namespace - * def remove(self): - * self.require_object_exists() # <<<<<<<<<<<<<< - * self.ioctx.remove_object(self.key) - * self.state = "removed" - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_require_object_exists); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3154, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3154, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3154, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":3155 - * def remove(self): - * self.require_object_exists() - * self.ioctx.remove_object(self.key) # <<<<<<<<<<<<<< - * self.state = "removed" - * - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ioctx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3155, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_remove_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3155, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3155, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - } - } - if (!__pyx_t_4) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3155, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3155, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3155, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":3156 - * self.require_object_exists() - * self.ioctx.remove_object(self.key) - * self.state = "removed" # <<<<<<<<<<<<<< - * - * @set_object_locator - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_state, __pyx_n_s_removed) < 0) __PYX_ERR(0, 3156, __pyx_L1_error) - - /* "rados.pyx":3153 - * @set_object_locator - * @set_object_namespace - * def remove(self): # <<<<<<<<<<<<<< - * self.require_object_exists() - * self.ioctx.remove_object(self.key) - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.Object.remove", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":3160 - * @set_object_locator - * @set_object_namespace - * def stat(self): # <<<<<<<<<<<<<< - * self.require_object_exists() - * return self.ioctx.stat(self.key) - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_6Object_13stat(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ -static char __pyx_doc_5rados_6Object_12stat[] = "Object.stat(self)"; -static PyMethodDef __pyx_mdef_5rados_6Object_13stat = {"stat", (PyCFunction)__pyx_pw_5rados_6Object_13stat, METH_O, __pyx_doc_5rados_6Object_12stat}; -static PyObject *__pyx_pw_5rados_6Object_13stat(PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("stat (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_6Object_12stat(__pyx_self, ((PyObject *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_6Object_12stat(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - __Pyx_RefNannySetupContext("stat", 0); - - /* "rados.pyx":3161 - * @set_object_namespace - * def stat(self): - * self.require_object_exists() # <<<<<<<<<<<<<< - * return self.ioctx.stat(self.key) - * - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_require_object_exists); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3161, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3161, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3161, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":3162 - * def stat(self): - * self.require_object_exists() - * return self.ioctx.stat(self.key) # <<<<<<<<<<<<<< - * - * def seek(self, position): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ioctx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3162, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stat); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3162, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3162, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - } - } - if (!__pyx_t_4) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3162, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3162, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3162, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "rados.pyx":3160 - * @set_object_locator - * @set_object_namespace - * def stat(self): # <<<<<<<<<<<<<< - * self.require_object_exists() - * return self.ioctx.stat(self.key) - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.Object.stat", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":3164 - * return self.ioctx.stat(self.key) - * - * def seek(self, position): # <<<<<<<<<<<<<< - * self.require_object_exists() - * self.offset = position - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_6Object_15seek(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_6Object_14seek[] = "Object.seek(self, position)"; -static PyMethodDef __pyx_mdef_5rados_6Object_15seek = {"seek", (PyCFunction)__pyx_pw_5rados_6Object_15seek, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_6Object_14seek}; -static PyObject *__pyx_pw_5rados_6Object_15seek(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_position = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("seek (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_position,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_position)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("seek", 1, 2, 2, 1); __PYX_ERR(0, 3164, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "seek") < 0)) __PYX_ERR(0, 3164, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_self = values[0]; - __pyx_v_position = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("seek", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3164, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Object.seek", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_6Object_14seek(__pyx_self, __pyx_v_self, __pyx_v_position); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_6Object_14seek(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_position) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("seek", 0); - - /* "rados.pyx":3165 - * - * def seek(self, position): - * self.require_object_exists() # <<<<<<<<<<<<<< - * self.offset = position - * - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_require_object_exists); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3165, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3165, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":3166 - * def seek(self, position): - * self.require_object_exists() - * self.offset = position # <<<<<<<<<<<<<< - * - * @set_object_locator - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_offset, __pyx_v_position) < 0) __PYX_ERR(0, 3166, __pyx_L1_error) - - /* "rados.pyx":3164 - * return self.ioctx.stat(self.key) - * - * def seek(self, position): # <<<<<<<<<<<<<< - * self.require_object_exists() - * self.offset = position - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("rados.Object.seek", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":3170 - * @set_object_locator - * @set_object_namespace - * def get_xattr(self, xattr_name): # <<<<<<<<<<<<<< - * self.require_object_exists() - * return self.ioctx.get_xattr(self.key, xattr_name) - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_6Object_17get_xattr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_6Object_16get_xattr[] = "Object.get_xattr(self, xattr_name)"; -static PyMethodDef __pyx_mdef_5rados_6Object_17get_xattr = {"get_xattr", (PyCFunction)__pyx_pw_5rados_6Object_17get_xattr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_6Object_16get_xattr}; -static PyObject *__pyx_pw_5rados_6Object_17get_xattr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_xattr_name = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("get_xattr (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_xattr_name,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xattr_name)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("get_xattr", 1, 2, 2, 1); __PYX_ERR(0, 3170, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_xattr") < 0)) __PYX_ERR(0, 3170, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_self = values[0]; - __pyx_v_xattr_name = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_xattr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3170, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Object.get_xattr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_6Object_16get_xattr(__pyx_self, __pyx_v_self, __pyx_v_xattr_name); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_6Object_16get_xattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_xattr_name) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - Py_ssize_t __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - __Pyx_RefNannySetupContext("get_xattr", 0); - - /* "rados.pyx":3171 - * @set_object_namespace - * def get_xattr(self, xattr_name): - * self.require_object_exists() # <<<<<<<<<<<<<< - * return self.ioctx.get_xattr(self.key, xattr_name) - * - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_require_object_exists); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3171, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3171, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3171, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":3172 - * def get_xattr(self, xattr_name): - * self.require_object_exists() - * return self.ioctx.get_xattr(self.key, xattr_name) # <<<<<<<<<<<<<< - * - * @set_object_locator - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ioctx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3172, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get_xattr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3172, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3172, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3172, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (__pyx_t_4) { - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; - } - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_2); - __Pyx_INCREF(__pyx_v_xattr_name); - __Pyx_GIVEREF(__pyx_v_xattr_name); - PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_xattr_name); - __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3172, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "rados.pyx":3170 - * @set_object_locator - * @set_object_namespace - * def get_xattr(self, xattr_name): # <<<<<<<<<<<<<< - * self.require_object_exists() - * return self.ioctx.get_xattr(self.key, xattr_name) - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("rados.Object.get_xattr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":3176 - * @set_object_locator - * @set_object_namespace - * def get_xattrs(self): # <<<<<<<<<<<<<< - * self.require_object_exists() - * return self.ioctx.get_xattrs(self.key) - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_6Object_19get_xattrs(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ -static char __pyx_doc_5rados_6Object_18get_xattrs[] = "Object.get_xattrs(self)"; -static PyMethodDef __pyx_mdef_5rados_6Object_19get_xattrs = {"get_xattrs", (PyCFunction)__pyx_pw_5rados_6Object_19get_xattrs, METH_O, __pyx_doc_5rados_6Object_18get_xattrs}; -static PyObject *__pyx_pw_5rados_6Object_19get_xattrs(PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("get_xattrs (wrapper)", 0); - __pyx_r = __pyx_pf_5rados_6Object_18get_xattrs(__pyx_self, ((PyObject *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_6Object_18get_xattrs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - __Pyx_RefNannySetupContext("get_xattrs", 0); - - /* "rados.pyx":3177 - * @set_object_namespace - * def get_xattrs(self): - * self.require_object_exists() # <<<<<<<<<<<<<< - * return self.ioctx.get_xattrs(self.key) - * - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_require_object_exists); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3177, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3177, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3177, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":3178 - * def get_xattrs(self): - * self.require_object_exists() - * return self.ioctx.get_xattrs(self.key) # <<<<<<<<<<<<<< - * - * @set_object_locator - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ioctx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3178, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get_xattrs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3178, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3178, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - } - } - if (!__pyx_t_4) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3178, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3178, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3178, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "rados.pyx":3176 - * @set_object_locator - * @set_object_namespace - * def get_xattrs(self): # <<<<<<<<<<<<<< - * self.require_object_exists() - * return self.ioctx.get_xattrs(self.key) - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.Object.get_xattrs", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":3182 - * @set_object_locator - * @set_object_namespace - * def set_xattr(self, xattr_name, xattr_value): # <<<<<<<<<<<<<< - * self.require_object_exists() - * return self.ioctx.set_xattr(self.key, xattr_name, xattr_value) - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_6Object_21set_xattr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_6Object_20set_xattr[] = "Object.set_xattr(self, xattr_name, xattr_value)"; -static PyMethodDef __pyx_mdef_5rados_6Object_21set_xattr = {"set_xattr", (PyCFunction)__pyx_pw_5rados_6Object_21set_xattr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_6Object_20set_xattr}; -static PyObject *__pyx_pw_5rados_6Object_21set_xattr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_xattr_name = 0; - PyObject *__pyx_v_xattr_value = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("set_xattr (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_xattr_name,&__pyx_n_s_xattr_value,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xattr_name)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("set_xattr", 1, 3, 3, 1); __PYX_ERR(0, 3182, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xattr_value)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("set_xattr", 1, 3, 3, 2); __PYX_ERR(0, 3182, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_xattr") < 0)) __PYX_ERR(0, 3182, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - } - __pyx_v_self = values[0]; - __pyx_v_xattr_name = values[1]; - __pyx_v_xattr_value = values[2]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("set_xattr", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3182, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Object.set_xattr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_6Object_20set_xattr(__pyx_self, __pyx_v_self, __pyx_v_xattr_name, __pyx_v_xattr_value); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_6Object_20set_xattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_xattr_name, PyObject *__pyx_v_xattr_value) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - Py_ssize_t __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - __Pyx_RefNannySetupContext("set_xattr", 0); - - /* "rados.pyx":3183 - * @set_object_namespace - * def set_xattr(self, xattr_name, xattr_value): - * self.require_object_exists() # <<<<<<<<<<<<<< - * return self.ioctx.set_xattr(self.key, xattr_name, xattr_value) - * - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_require_object_exists); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3183, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3183, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3183, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":3184 - * def set_xattr(self, xattr_name, xattr_value): - * self.require_object_exists() - * return self.ioctx.set_xattr(self.key, xattr_name, xattr_value) # <<<<<<<<<<<<<< - * - * @set_object_locator - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ioctx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3184, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_set_xattr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3184, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3184, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3184, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (__pyx_t_4) { - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; - } - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_2); - __Pyx_INCREF(__pyx_v_xattr_name); - __Pyx_GIVEREF(__pyx_v_xattr_name); - PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_xattr_name); - __Pyx_INCREF(__pyx_v_xattr_value); - __Pyx_GIVEREF(__pyx_v_xattr_value); - PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_xattr_value); - __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3184, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "rados.pyx":3182 - * @set_object_locator - * @set_object_namespace - * def set_xattr(self, xattr_name, xattr_value): # <<<<<<<<<<<<<< - * self.require_object_exists() - * return self.ioctx.set_xattr(self.key, xattr_name, xattr_value) - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("rados.Object.set_xattr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":3188 - * @set_object_locator - * @set_object_namespace - * def rm_xattr(self, xattr_name): # <<<<<<<<<<<<<< - * self.require_object_exists() - * return self.ioctx.rm_xattr(self.key, xattr_name) - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_6Object_23rm_xattr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_6Object_22rm_xattr[] = "Object.rm_xattr(self, xattr_name)"; -static PyMethodDef __pyx_mdef_5rados_6Object_23rm_xattr = {"rm_xattr", (PyCFunction)__pyx_pw_5rados_6Object_23rm_xattr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_6Object_22rm_xattr}; -static PyObject *__pyx_pw_5rados_6Object_23rm_xattr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_xattr_name = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("rm_xattr (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_xattr_name,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xattr_name)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("rm_xattr", 1, 2, 2, 1); __PYX_ERR(0, 3188, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rm_xattr") < 0)) __PYX_ERR(0, 3188, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_self = values[0]; - __pyx_v_xattr_name = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("rm_xattr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3188, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.Object.rm_xattr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_6Object_22rm_xattr(__pyx_self, __pyx_v_self, __pyx_v_xattr_name); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_6Object_22rm_xattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_xattr_name) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - Py_ssize_t __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - __Pyx_RefNannySetupContext("rm_xattr", 0); - - /* "rados.pyx":3189 - * @set_object_namespace - * def rm_xattr(self, xattr_name): - * self.require_object_exists() # <<<<<<<<<<<<<< - * return self.ioctx.rm_xattr(self.key, xattr_name) - * - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_require_object_exists); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3189, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3189, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3189, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":3190 - * def rm_xattr(self, xattr_name): - * self.require_object_exists() - * return self.ioctx.rm_xattr(self.key, xattr_name) # <<<<<<<<<<<<<< - * - * MONITOR_LEVELS = [ - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ioctx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_rm_xattr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (__pyx_t_4) { - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; - } - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_2); - __Pyx_INCREF(__pyx_v_xattr_name); - __Pyx_GIVEREF(__pyx_v_xattr_name); - PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_xattr_name); - __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "rados.pyx":3188 - * @set_object_locator - * @set_object_namespace - * def rm_xattr(self, xattr_name): # <<<<<<<<<<<<<< - * self.require_object_exists() - * return self.ioctx.rm_xattr(self.key, xattr_name) - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("rados.Object.rm_xattr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rados.pyx":3221 - * callback's return value is ignored - * """ - * def __init__(self, cluster, level, callback, arg): # <<<<<<<<<<<<<< - * self.level = level - * self.callback = callback - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_5rados_10MonitorLog_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5rados_10MonitorLog___init__[] = "MonitorLog.__init__(self, cluster, level, callback, arg)"; -static PyMethodDef __pyx_mdef_5rados_10MonitorLog_1__init__ = {"__init__", (PyCFunction)__pyx_pw_5rados_10MonitorLog_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_10MonitorLog___init__}; -static PyObject *__pyx_pw_5rados_10MonitorLog_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_cluster = 0; - PyObject *__pyx_v_level = 0; - PyObject *__pyx_v_callback = 0; - PyObject *__pyx_v_arg = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_cluster,&__pyx_n_s_level,&__pyx_n_s_callback,&__pyx_n_s_arg,0}; - PyObject* values[5] = {0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cluster)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 1); __PYX_ERR(0, 3221, __pyx_L3_error) - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 2); __PYX_ERR(0, 3221, __pyx_L3_error) - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 3); __PYX_ERR(0, 3221, __pyx_L3_error) - } - case 4: - if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arg)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 4); __PYX_ERR(0, 3221, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 3221, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - } - __pyx_v_self = values[0]; - __pyx_v_cluster = values[1]; - __pyx_v_level = values[2]; - __pyx_v_callback = values[3]; - __pyx_v_arg = values[4]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3221, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("rados.MonitorLog.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_5rados_10MonitorLog___init__(__pyx_self, __pyx_v_self, __pyx_v_cluster, __pyx_v_level, __pyx_v_callback, __pyx_v_arg); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_5rados_10MonitorLog___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_cluster, PyObject *__pyx_v_level, PyObject *__pyx_v_callback, PyObject *__pyx_v_arg) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - __Pyx_RefNannySetupContext("__init__", 0); - - /* "rados.pyx":3222 - * """ - * def __init__(self, cluster, level, callback, arg): - * self.level = level # <<<<<<<<<<<<<< - * self.callback = callback - * self.arg = arg - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_level, __pyx_v_level) < 0) __PYX_ERR(0, 3222, __pyx_L1_error) - - /* "rados.pyx":3223 - * def __init__(self, cluster, level, callback, arg): - * self.level = level - * self.callback = callback # <<<<<<<<<<<<<< - * self.arg = arg - * self.cluster = cluster - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_callback, __pyx_v_callback) < 0) __PYX_ERR(0, 3223, __pyx_L1_error) - - /* "rados.pyx":3224 - * self.level = level - * self.callback = callback - * self.arg = arg # <<<<<<<<<<<<<< - * self.cluster = cluster - * self.cluster.monitor_log(level, callback, arg) - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_arg, __pyx_v_arg) < 0) __PYX_ERR(0, 3224, __pyx_L1_error) - - /* "rados.pyx":3225 - * self.callback = callback - * self.arg = arg - * self.cluster = cluster # <<<<<<<<<<<<<< - * self.cluster.monitor_log(level, callback, arg) - * - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cluster, __pyx_v_cluster) < 0) __PYX_ERR(0, 3225, __pyx_L1_error) - - /* "rados.pyx":3226 - * self.arg = arg - * self.cluster = cluster - * self.cluster.monitor_log(level, callback, arg) # <<<<<<<<<<<<<< - * - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cluster); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_monitor_log); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_4 = 1; - } - } - __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_2) { - __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; - } - __Pyx_INCREF(__pyx_v_level); - __Pyx_GIVEREF(__pyx_v_level); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_level); - __Pyx_INCREF(__pyx_v_callback); - __Pyx_GIVEREF(__pyx_v_callback); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_callback); - __Pyx_INCREF(__pyx_v_arg); - __Pyx_GIVEREF(__pyx_v_arg); - PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_arg); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":3221 - * callback's return value is ignored - * """ - * def __init__(self, cluster, level, callback, arg): # <<<<<<<<<<<<<< - * self.level = level - * self.callback = callback - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rados.MonitorLog.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_tp_new_5rados_Rados(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_5rados_Rados *p; - PyObject *o; - if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { - o = (*t->tp_alloc)(t, 0); - } else { - o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); - } - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_5rados_Rados *)o); - p->state = Py_None; Py_INCREF(Py_None); - p->monitor_callback = Py_None; Py_INCREF(Py_None); - p->parsed_args = Py_None; Py_INCREF(Py_None); - p->conf_defaults = Py_None; Py_INCREF(Py_None); - p->conffile = Py_None; Py_INCREF(Py_None); - p->rados_id = Py_None; Py_INCREF(Py_None); - return o; -} - -static void __pyx_tp_dealloc_5rados_Rados(PyObject *o) { - struct __pyx_obj_5rados_Rados *p = (struct __pyx_obj_5rados_Rados *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - PyObject_GC_UnTrack(o); - Py_CLEAR(p->state); - Py_CLEAR(p->monitor_callback); - Py_CLEAR(p->parsed_args); - Py_CLEAR(p->conf_defaults); - Py_CLEAR(p->conffile); - Py_CLEAR(p->rados_id); - (*Py_TYPE(o)->tp_free)(o); -} - -static int __pyx_tp_traverse_5rados_Rados(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_5rados_Rados *p = (struct __pyx_obj_5rados_Rados *)o; - if (p->state) { - e = (*v)(p->state, a); if (e) return e; - } - if (p->monitor_callback) { - e = (*v)(p->monitor_callback, a); if (e) return e; - } - if (p->parsed_args) { - e = (*v)(p->parsed_args, a); if (e) return e; - } - if (p->conf_defaults) { - e = (*v)(p->conf_defaults, a); if (e) return e; - } - if (p->conffile) { - e = (*v)(p->conffile, a); if (e) return e; - } - if (p->rados_id) { - e = (*v)(p->rados_id, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_5rados_Rados(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_5rados_Rados *p = (struct __pyx_obj_5rados_Rados *)o; - tmp = ((PyObject*)p->state); - p->state = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->monitor_callback); - p->monitor_callback = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->parsed_args); - p->parsed_args = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->conf_defaults); - p->conf_defaults = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->conffile); - p->conffile = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->rados_id); - p->rados_id = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyObject *__pyx_getprop_5rados_5Rados_state(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_5rados_5Rados_5state_1__get__(o); -} - -static int __pyx_setprop_5rados_5Rados_state(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_5rados_5Rados_5state_3__set__(o, v); - } - else { - return __pyx_pw_5rados_5Rados_5state_5__del__(o); - } -} - -static PyObject *__pyx_getprop_5rados_5Rados_monitor_callback(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_5rados_5Rados_16monitor_callback_1__get__(o); -} - -static int __pyx_setprop_5rados_5Rados_monitor_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_5rados_5Rados_16monitor_callback_3__set__(o, v); - } - else { - return __pyx_pw_5rados_5Rados_16monitor_callback_5__del__(o); - } -} - -static PyObject *__pyx_getprop_5rados_5Rados_parsed_args(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_5rados_5Rados_11parsed_args_1__get__(o); -} - -static int __pyx_setprop_5rados_5Rados_parsed_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_5rados_5Rados_11parsed_args_3__set__(o, v); - } - else { - return __pyx_pw_5rados_5Rados_11parsed_args_5__del__(o); - } -} - -static PyObject *__pyx_getprop_5rados_5Rados_conf_defaults(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_5rados_5Rados_13conf_defaults_1__get__(o); -} - -static int __pyx_setprop_5rados_5Rados_conf_defaults(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_5rados_5Rados_13conf_defaults_3__set__(o, v); - } - else { - return __pyx_pw_5rados_5Rados_13conf_defaults_5__del__(o); - } -} - -static PyObject *__pyx_getprop_5rados_5Rados_conffile(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_5rados_5Rados_8conffile_1__get__(o); -} - -static int __pyx_setprop_5rados_5Rados_conffile(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_5rados_5Rados_8conffile_3__set__(o, v); - } - else { - return __pyx_pw_5rados_5Rados_8conffile_5__del__(o); - } -} - -static PyObject *__pyx_getprop_5rados_5Rados_rados_id(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_5rados_5Rados_8rados_id_1__get__(o); -} - -static int __pyx_setprop_5rados_5Rados_rados_id(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_5rados_5Rados_8rados_id_3__set__(o, v); - } - else { - return __pyx_pw_5rados_5Rados_8rados_id_5__del__(o); - } -} - -static PyMethodDef __pyx_methods_5rados_Rados[] = { - {"__setup", (PyCFunction)__pyx_pw_5rados_5Rados_3__setup, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Rados_2__setup}, - {"require_state", (PyCFunction)__pyx_pw_5rados_5Rados_5require_state, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Rados_4require_state}, - {"shutdown", (PyCFunction)__pyx_pw_5rados_5Rados_7shutdown, METH_NOARGS, __pyx_doc_5rados_5Rados_6shutdown}, - {"__enter__", (PyCFunction)__pyx_pw_5rados_5Rados_9__enter__, METH_NOARGS, __pyx_doc_5rados_5Rados_8__enter__}, - {"__exit__", (PyCFunction)__pyx_pw_5rados_5Rados_11__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Rados_10__exit__}, - {"version", (PyCFunction)__pyx_pw_5rados_5Rados_13version, METH_NOARGS, __pyx_doc_5rados_5Rados_12version}, - {"conf_read_file", (PyCFunction)__pyx_pw_5rados_5Rados_15conf_read_file, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Rados_14conf_read_file}, - {"conf_parse_argv", (PyCFunction)__pyx_pw_5rados_5Rados_17conf_parse_argv, METH_O, __pyx_doc_5rados_5Rados_16conf_parse_argv}, - {"conf_parse_env", (PyCFunction)__pyx_pw_5rados_5Rados_19conf_parse_env, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Rados_18conf_parse_env}, - {"conf_get", (PyCFunction)__pyx_pw_5rados_5Rados_21conf_get, METH_O, __pyx_doc_5rados_5Rados_20conf_get}, - {"conf_set", (PyCFunction)__pyx_pw_5rados_5Rados_23conf_set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Rados_22conf_set}, - {"ping_monitor", (PyCFunction)__pyx_pw_5rados_5Rados_25ping_monitor, METH_O, __pyx_doc_5rados_5Rados_24ping_monitor}, - {"connect", (PyCFunction)__pyx_pw_5rados_5Rados_27connect, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Rados_26connect}, - {"get_cluster_stats", (PyCFunction)__pyx_pw_5rados_5Rados_29get_cluster_stats, METH_NOARGS, __pyx_doc_5rados_5Rados_28get_cluster_stats}, - {"pool_exists", (PyCFunction)__pyx_pw_5rados_5Rados_31pool_exists, METH_O, __pyx_doc_5rados_5Rados_30pool_exists}, - {"pool_lookup", (PyCFunction)__pyx_pw_5rados_5Rados_33pool_lookup, METH_O, __pyx_doc_5rados_5Rados_32pool_lookup}, - {"pool_reverse_lookup", (PyCFunction)__pyx_pw_5rados_5Rados_35pool_reverse_lookup, METH_O, __pyx_doc_5rados_5Rados_34pool_reverse_lookup}, - {"create_pool", (PyCFunction)__pyx_pw_5rados_5Rados_37create_pool, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Rados_36create_pool}, - {"get_pool_base_tier", (PyCFunction)__pyx_pw_5rados_5Rados_39get_pool_base_tier, METH_O, __pyx_doc_5rados_5Rados_38get_pool_base_tier}, - {"delete_pool", (PyCFunction)__pyx_pw_5rados_5Rados_41delete_pool, METH_O, __pyx_doc_5rados_5Rados_40delete_pool}, - {"get_inconsistent_pgs", (PyCFunction)__pyx_pw_5rados_5Rados_43get_inconsistent_pgs, METH_O, __pyx_doc_5rados_5Rados_42get_inconsistent_pgs}, - {"list_pools", (PyCFunction)__pyx_pw_5rados_5Rados_45list_pools, METH_NOARGS, __pyx_doc_5rados_5Rados_44list_pools}, - {"get_fsid", (PyCFunction)__pyx_pw_5rados_5Rados_47get_fsid, METH_NOARGS, __pyx_doc_5rados_5Rados_46get_fsid}, - {"open_ioctx", (PyCFunction)__pyx_pw_5rados_5Rados_49open_ioctx, METH_O, __pyx_doc_5rados_5Rados_48open_ioctx}, - {"mon_command", (PyCFunction)__pyx_pw_5rados_5Rados_51mon_command, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Rados_50mon_command}, - {"osd_command", (PyCFunction)__pyx_pw_5rados_5Rados_53osd_command, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Rados_52osd_command}, - {"pg_command", (PyCFunction)__pyx_pw_5rados_5Rados_55pg_command, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Rados_54pg_command}, - {"wait_for_latest_osdmap", (PyCFunction)__pyx_pw_5rados_5Rados_57wait_for_latest_osdmap, METH_NOARGS, __pyx_doc_5rados_5Rados_56wait_for_latest_osdmap}, - {"blacklist_add", (PyCFunction)__pyx_pw_5rados_5Rados_59blacklist_add, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Rados_58blacklist_add}, - {"monitor_log", (PyCFunction)__pyx_pw_5rados_5Rados_61monitor_log, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Rados_60monitor_log}, - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_5rados_Rados[] = { - {(char *)"state", __pyx_getprop_5rados_5Rados_state, __pyx_setprop_5rados_5Rados_state, (char *)"state: object", 0}, - {(char *)"monitor_callback", __pyx_getprop_5rados_5Rados_monitor_callback, __pyx_setprop_5rados_5Rados_monitor_callback, (char *)"monitor_callback: object", 0}, - {(char *)"parsed_args", __pyx_getprop_5rados_5Rados_parsed_args, __pyx_setprop_5rados_5Rados_parsed_args, (char *)"parsed_args: object", 0}, - {(char *)"conf_defaults", __pyx_getprop_5rados_5Rados_conf_defaults, __pyx_setprop_5rados_5Rados_conf_defaults, (char *)"conf_defaults: object", 0}, - {(char *)"conffile", __pyx_getprop_5rados_5Rados_conffile, __pyx_setprop_5rados_5Rados_conffile, (char *)"conffile: object", 0}, - {(char *)"rados_id", __pyx_getprop_5rados_5Rados_rados_id, __pyx_setprop_5rados_5Rados_rados_id, (char *)"rados_id: object", 0}, - {0, 0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_5rados_Rados = { - PyVarObject_HEAD_INIT(0, 0) - "rados.Rados", /*tp_name*/ - sizeof(struct __pyx_obj_5rados_Rados), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_5rados_Rados, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - "Rados(*args, **kwargs)\nThis class wraps librados functions", /*tp_doc*/ - __pyx_tp_traverse_5rados_Rados, /*tp_traverse*/ - __pyx_tp_clear_5rados_Rados, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_5rados_Rados, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_5rados_Rados, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - __pyx_pw_5rados_5Rados_1__init__, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_5rados_Rados, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - 0, /*tp_finalize*/ - #endif -}; - -static PyObject *__pyx_tp_new_5rados_Ioctx(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_5rados_Ioctx *p; - PyObject *o; - if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { - o = (*t->tp_alloc)(t, 0); - } else { - o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); - } - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_5rados_Ioctx *)o); - p->state = Py_None; Py_INCREF(Py_None); - p->locator_key = Py_None; Py_INCREF(Py_None); - p->nspace = Py_None; Py_INCREF(Py_None); - p->safe_completions = Py_None; Py_INCREF(Py_None); - p->complete_completions = Py_None; Py_INCREF(Py_None); - p->lock = Py_None; Py_INCREF(Py_None); - return o; -} - -static void __pyx_tp_dealloc_5rados_Ioctx(PyObject *o) { - struct __pyx_obj_5rados_Ioctx *p = (struct __pyx_obj_5rados_Ioctx *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - PyObject_GC_UnTrack(o); - Py_CLEAR(p->state); - Py_CLEAR(p->locator_key); - Py_CLEAR(p->nspace); - Py_CLEAR(p->safe_completions); - Py_CLEAR(p->complete_completions); - Py_CLEAR(p->lock); - (*Py_TYPE(o)->tp_free)(o); -} - -static int __pyx_tp_traverse_5rados_Ioctx(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_5rados_Ioctx *p = (struct __pyx_obj_5rados_Ioctx *)o; - if (p->state) { - e = (*v)(p->state, a); if (e) return e; - } - if (p->locator_key) { - e = (*v)(p->locator_key, a); if (e) return e; - } - if (p->nspace) { - e = (*v)(p->nspace, a); if (e) return e; - } - if (p->safe_completions) { - e = (*v)(p->safe_completions, a); if (e) return e; - } - if (p->complete_completions) { - e = (*v)(p->complete_completions, a); if (e) return e; - } - if (p->lock) { - e = (*v)(p->lock, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_5rados_Ioctx(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_5rados_Ioctx *p = (struct __pyx_obj_5rados_Ioctx *)o; - tmp = ((PyObject*)p->state); - p->state = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->locator_key); - p->locator_key = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->nspace); - p->nspace = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->safe_completions); - p->safe_completions = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->complete_completions); - p->complete_completions = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->lock); - p->lock = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyObject *__pyx_getprop_5rados_5Ioctx_name(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_5rados_5Ioctx_4name_1__get__(o); -} - -static int __pyx_setprop_5rados_5Ioctx_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_5rados_5Ioctx_4name_3__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyObject *__pyx_getprop_5rados_5Ioctx_state(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_5rados_5Ioctx_5state_1__get__(o); -} - -static int __pyx_setprop_5rados_5Ioctx_state(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_5rados_5Ioctx_5state_3__set__(o, v); - } - else { - return __pyx_pw_5rados_5Ioctx_5state_5__del__(o); - } -} - -static PyObject *__pyx_getprop_5rados_5Ioctx_locator_key(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_5rados_5Ioctx_11locator_key_1__get__(o); -} - -static int __pyx_setprop_5rados_5Ioctx_locator_key(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_5rados_5Ioctx_11locator_key_3__set__(o, v); - } - else { - return __pyx_pw_5rados_5Ioctx_11locator_key_5__del__(o); - } -} - -static PyObject *__pyx_getprop_5rados_5Ioctx_nspace(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_5rados_5Ioctx_6nspace_1__get__(o); -} - -static int __pyx_setprop_5rados_5Ioctx_nspace(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_5rados_5Ioctx_6nspace_3__set__(o, v); - } - else { - return __pyx_pw_5rados_5Ioctx_6nspace_5__del__(o); - } -} - -static PyObject *__pyx_getprop_5rados_5Ioctx_safe_completions(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_5rados_5Ioctx_16safe_completions_1__get__(o); -} - -static int __pyx_setprop_5rados_5Ioctx_safe_completions(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_5rados_5Ioctx_16safe_completions_3__set__(o, v); - } - else { - return __pyx_pw_5rados_5Ioctx_16safe_completions_5__del__(o); - } -} - -static PyObject *__pyx_getprop_5rados_5Ioctx_complete_completions(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_5rados_5Ioctx_20complete_completions_1__get__(o); -} - -static int __pyx_setprop_5rados_5Ioctx_complete_completions(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_5rados_5Ioctx_20complete_completions_3__set__(o, v); - } - else { - return __pyx_pw_5rados_5Ioctx_20complete_completions_5__del__(o); - } -} - -static PyObject *__pyx_getprop_5rados_5Ioctx_lock(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_5rados_5Ioctx_4lock_1__get__(o); -} - -static int __pyx_setprop_5rados_5Ioctx_lock(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_5rados_5Ioctx_4lock_3__set__(o, v); - } - else { - return __pyx_pw_5rados_5Ioctx_4lock_5__del__(o); - } -} - -static PyMethodDef __pyx_methods_5rados_Ioctx[] = { - {"__enter__", (PyCFunction)__pyx_pw_5rados_5Ioctx_3__enter__, METH_NOARGS, __pyx_doc_5rados_5Ioctx_2__enter__}, - {"__exit__", (PyCFunction)__pyx_pw_5rados_5Ioctx_5__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Ioctx_4__exit__}, - {"__del__", (PyCFunction)__pyx_pw_5rados_5Ioctx_7__del__, METH_NOARGS, __pyx_doc_5rados_5Ioctx_6__del__}, - {"__track_completion", (PyCFunction)__pyx_pw_5rados_5Ioctx_9__track_completion, METH_O, __pyx_doc_5rados_5Ioctx_8__track_completion}, - {"__get_completion", (PyCFunction)__pyx_pw_5rados_5Ioctx_11__get_completion, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Ioctx_10__get_completion}, - {"aio_write", (PyCFunction)__pyx_pw_5rados_5Ioctx_13aio_write, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Ioctx_12aio_write}, - {"aio_write_full", (PyCFunction)__pyx_pw_5rados_5Ioctx_15aio_write_full, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Ioctx_14aio_write_full}, - {"aio_append", (PyCFunction)__pyx_pw_5rados_5Ioctx_17aio_append, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Ioctx_16aio_append}, - {"aio_flush", (PyCFunction)__pyx_pw_5rados_5Ioctx_19aio_flush, METH_NOARGS, __pyx_doc_5rados_5Ioctx_18aio_flush}, - {"aio_read", (PyCFunction)__pyx_pw_5rados_5Ioctx_21aio_read, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Ioctx_20aio_read}, - {"aio_remove", (PyCFunction)__pyx_pw_5rados_5Ioctx_23aio_remove, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Ioctx_22aio_remove}, - {"require_ioctx_open", (PyCFunction)__pyx_pw_5rados_5Ioctx_25require_ioctx_open, METH_NOARGS, __pyx_doc_5rados_5Ioctx_24require_ioctx_open}, - {"change_auid", (PyCFunction)__pyx_pw_5rados_5Ioctx_27change_auid, METH_O, __pyx_doc_5rados_5Ioctx_26change_auid}, - {"set_locator_key", (PyCFunction)__pyx_pw_5rados_5Ioctx_29set_locator_key, METH_O, __pyx_doc_5rados_5Ioctx_28set_locator_key}, - {"get_locator_key", (PyCFunction)__pyx_pw_5rados_5Ioctx_31get_locator_key, METH_NOARGS, __pyx_doc_5rados_5Ioctx_30get_locator_key}, - {"set_read", (PyCFunction)__pyx_pw_5rados_5Ioctx_33set_read, METH_O, __pyx_doc_5rados_5Ioctx_32set_read}, - {"set_namespace", (PyCFunction)__pyx_pw_5rados_5Ioctx_35set_namespace, METH_O, __pyx_doc_5rados_5Ioctx_34set_namespace}, - {"get_namespace", (PyCFunction)__pyx_pw_5rados_5Ioctx_37get_namespace, METH_NOARGS, __pyx_doc_5rados_5Ioctx_36get_namespace}, - {"close", (PyCFunction)__pyx_pw_5rados_5Ioctx_39close, METH_NOARGS, __pyx_doc_5rados_5Ioctx_38close}, - {"write", (PyCFunction)__pyx_pw_5rados_5Ioctx_41write, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Ioctx_40write}, - {"write_full", (PyCFunction)__pyx_pw_5rados_5Ioctx_43write_full, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Ioctx_42write_full}, - {"append", (PyCFunction)__pyx_pw_5rados_5Ioctx_45append, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Ioctx_44append}, - {"read", (PyCFunction)__pyx_pw_5rados_5Ioctx_47read, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Ioctx_46read}, - {"execute", (PyCFunction)__pyx_pw_5rados_5Ioctx_49execute, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Ioctx_48execute}, - {"get_stats", (PyCFunction)__pyx_pw_5rados_5Ioctx_51get_stats, METH_NOARGS, __pyx_doc_5rados_5Ioctx_50get_stats}, - {"remove_object", (PyCFunction)__pyx_pw_5rados_5Ioctx_53remove_object, METH_O, __pyx_doc_5rados_5Ioctx_52remove_object}, - {"trunc", (PyCFunction)__pyx_pw_5rados_5Ioctx_55trunc, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Ioctx_54trunc}, - {"stat", (PyCFunction)__pyx_pw_5rados_5Ioctx_57stat, METH_O, __pyx_doc_5rados_5Ioctx_56stat}, - {"get_xattr", (PyCFunction)__pyx_pw_5rados_5Ioctx_59get_xattr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Ioctx_58get_xattr}, - {"get_xattrs", (PyCFunction)__pyx_pw_5rados_5Ioctx_61get_xattrs, METH_O, __pyx_doc_5rados_5Ioctx_60get_xattrs}, - {"set_xattr", (PyCFunction)__pyx_pw_5rados_5Ioctx_63set_xattr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Ioctx_62set_xattr}, - {"rm_xattr", (PyCFunction)__pyx_pw_5rados_5Ioctx_65rm_xattr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Ioctx_64rm_xattr}, - {"list_objects", (PyCFunction)__pyx_pw_5rados_5Ioctx_67list_objects, METH_NOARGS, __pyx_doc_5rados_5Ioctx_66list_objects}, - {"list_snaps", (PyCFunction)__pyx_pw_5rados_5Ioctx_69list_snaps, METH_NOARGS, __pyx_doc_5rados_5Ioctx_68list_snaps}, - {"create_snap", (PyCFunction)__pyx_pw_5rados_5Ioctx_71create_snap, METH_O, __pyx_doc_5rados_5Ioctx_70create_snap}, - {"remove_snap", (PyCFunction)__pyx_pw_5rados_5Ioctx_73remove_snap, METH_O, __pyx_doc_5rados_5Ioctx_72remove_snap}, - {"lookup_snap", (PyCFunction)__pyx_pw_5rados_5Ioctx_75lookup_snap, METH_O, __pyx_doc_5rados_5Ioctx_74lookup_snap}, - {"snap_rollback", (PyCFunction)__pyx_pw_5rados_5Ioctx_77snap_rollback, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Ioctx_76snap_rollback}, - {"get_last_version", (PyCFunction)__pyx_pw_5rados_5Ioctx_79get_last_version, METH_NOARGS, __pyx_doc_5rados_5Ioctx_78get_last_version}, - {"create_write_op", (PyCFunction)__pyx_pw_5rados_5Ioctx_81create_write_op, METH_NOARGS, __pyx_doc_5rados_5Ioctx_80create_write_op}, - {"create_read_op", (PyCFunction)__pyx_pw_5rados_5Ioctx_83create_read_op, METH_NOARGS, __pyx_doc_5rados_5Ioctx_82create_read_op}, - {"release_write_op", (PyCFunction)__pyx_pw_5rados_5Ioctx_85release_write_op, METH_O, __pyx_doc_5rados_5Ioctx_84release_write_op}, - {"release_read_op", (PyCFunction)__pyx_pw_5rados_5Ioctx_87release_read_op, METH_O, __pyx_doc_5rados_5Ioctx_86release_read_op}, - {"set_omap", (PyCFunction)__pyx_pw_5rados_5Ioctx_89set_omap, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Ioctx_88set_omap}, - {"operate_write_op", (PyCFunction)__pyx_pw_5rados_5Ioctx_91operate_write_op, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Ioctx_90operate_write_op}, - {"operate_read_op", (PyCFunction)__pyx_pw_5rados_5Ioctx_93operate_read_op, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Ioctx_92operate_read_op}, - {"get_omap_vals", (PyCFunction)__pyx_pw_5rados_5Ioctx_95get_omap_vals, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Ioctx_94get_omap_vals}, - {"get_omap_keys", (PyCFunction)__pyx_pw_5rados_5Ioctx_97get_omap_keys, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Ioctx_96get_omap_keys}, - {"get_omap_vals_by_keys", (PyCFunction)__pyx_pw_5rados_5Ioctx_99get_omap_vals_by_keys, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Ioctx_98get_omap_vals_by_keys}, - {"remove_omap_keys", (PyCFunction)__pyx_pw_5rados_5Ioctx_101remove_omap_keys, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Ioctx_100remove_omap_keys}, - {"clear_omap", (PyCFunction)__pyx_pw_5rados_5Ioctx_103clear_omap, METH_O, __pyx_doc_5rados_5Ioctx_102clear_omap}, - {"lock_exclusive", (PyCFunction)__pyx_pw_5rados_5Ioctx_105lock_exclusive, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Ioctx_104lock_exclusive}, - {"lock_shared", (PyCFunction)__pyx_pw_5rados_5Ioctx_107lock_shared, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Ioctx_106lock_shared}, - {"unlock", (PyCFunction)__pyx_pw_5rados_5Ioctx_109unlock, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5rados_5Ioctx_108unlock}, - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_5rados_Ioctx[] = { - {(char *)"name", __pyx_getprop_5rados_5Ioctx_name, __pyx_setprop_5rados_5Ioctx_name, (char *)"name: 'char *'", 0}, - {(char *)"state", __pyx_getprop_5rados_5Ioctx_state, __pyx_setprop_5rados_5Ioctx_state, (char *)"state: object", 0}, - {(char *)"locator_key", __pyx_getprop_5rados_5Ioctx_locator_key, __pyx_setprop_5rados_5Ioctx_locator_key, (char *)"locator_key: object", 0}, - {(char *)"nspace", __pyx_getprop_5rados_5Ioctx_nspace, __pyx_setprop_5rados_5Ioctx_nspace, (char *)"nspace: object", 0}, - {(char *)"safe_completions", __pyx_getprop_5rados_5Ioctx_safe_completions, __pyx_setprop_5rados_5Ioctx_safe_completions, (char *)"safe_completions: object", 0}, - {(char *)"complete_completions", __pyx_getprop_5rados_5Ioctx_complete_completions, __pyx_setprop_5rados_5Ioctx_complete_completions, (char *)"complete_completions: object", 0}, - {(char *)"lock", __pyx_getprop_5rados_5Ioctx_lock, __pyx_setprop_5rados_5Ioctx_lock, (char *)"lock: object", 0}, - {0, 0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_5rados_Ioctx = { - PyVarObject_HEAD_INIT(0, 0) - "rados.Ioctx", /*tp_name*/ - sizeof(struct __pyx_obj_5rados_Ioctx), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_5rados_Ioctx, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - "Ioctx(name)\nrados.Ioctx object", /*tp_doc*/ - __pyx_tp_traverse_5rados_Ioctx, /*tp_traverse*/ - __pyx_tp_clear_5rados_Ioctx, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_5rados_Ioctx, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_5rados_Ioctx, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - __pyx_pw_5rados_5Ioctx_1__init__, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_5rados_Ioctx, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - 0, /*tp_finalize*/ - #endif -}; - -static PyObject *__pyx_tp_new_5rados_OmapIterator(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_5rados_OmapIterator *p; - PyObject *o; - if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { - o = (*t->tp_alloc)(t, 0); - } else { - o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); - } - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_5rados_OmapIterator *)o); - p->ioctx = ((struct __pyx_obj_5rados_Ioctx *)Py_None); Py_INCREF(Py_None); - if (unlikely(__pyx_pw_5rados_12OmapIterator_1__cinit__(o, a, k) < 0)) { - Py_DECREF(o); o = 0; - } - return o; -} - -static void __pyx_tp_dealloc_5rados_OmapIterator(PyObject *o) { - struct __pyx_obj_5rados_OmapIterator *p = (struct __pyx_obj_5rados_OmapIterator *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - PyObject_GC_UnTrack(o); - { - PyObject *etype, *eval, *etb; - PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); - __pyx_pw_5rados_12OmapIterator_7__dealloc__(o); - --Py_REFCNT(o); - PyErr_Restore(etype, eval, etb); - } - Py_CLEAR(p->ioctx); - (*Py_TYPE(o)->tp_free)(o); -} - -static int __pyx_tp_traverse_5rados_OmapIterator(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_5rados_OmapIterator *p = (struct __pyx_obj_5rados_OmapIterator *)o; - if (p->ioctx) { - e = (*v)(((PyObject*)p->ioctx), a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_5rados_OmapIterator(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_5rados_OmapIterator *p = (struct __pyx_obj_5rados_OmapIterator *)o; - tmp = ((PyObject*)p->ioctx); - p->ioctx = ((struct __pyx_obj_5rados_Ioctx *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyObject *__pyx_getprop_5rados_12OmapIterator_ioctx(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_5rados_12OmapIterator_5ioctx_1__get__(o); -} - -static int __pyx_setprop_5rados_12OmapIterator_ioctx(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_5rados_12OmapIterator_5ioctx_3__set__(o, v); - } - else { - return __pyx_pw_5rados_12OmapIterator_5ioctx_5__del__(o); - } -} - -static PyMethodDef __pyx_methods_5rados_OmapIterator[] = { - {"__next__", (PyCFunction)__pyx_pw_5rados_12OmapIterator_5__next__, METH_NOARGS|METH_COEXIST, __pyx_doc_5rados_12OmapIterator_4__next__}, - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_5rados_OmapIterator[] = { - {(char *)"ioctx", __pyx_getprop_5rados_12OmapIterator_ioctx, __pyx_setprop_5rados_12OmapIterator_ioctx, (char *)"ioctx: rados.Ioctx", 0}, - {0, 0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_5rados_OmapIterator = { - PyVarObject_HEAD_INIT(0, 0) - "rados.OmapIterator", /*tp_name*/ - sizeof(struct __pyx_obj_5rados_OmapIterator), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_5rados_OmapIterator, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - "Omap iterator", /*tp_doc*/ - __pyx_tp_traverse_5rados_OmapIterator, /*tp_traverse*/ - __pyx_tp_clear_5rados_OmapIterator, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - __pyx_pw_5rados_12OmapIterator_3__iter__, /*tp_iter*/ - __pyx_pw_5rados_12OmapIterator_5__next__, /*tp_iternext*/ - __pyx_methods_5rados_OmapIterator, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_5rados_OmapIterator, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_5rados_OmapIterator, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - 0, /*tp_finalize*/ - #endif -}; - -static PyObject *__pyx_tp_new_5rados_ObjectIterator(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_5rados_ObjectIterator *p; - PyObject *o; - if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { - o = (*t->tp_alloc)(t, 0); - } else { - o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); - } - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_5rados_ObjectIterator *)o); - p->ioctx = Py_None; Py_INCREF(Py_None); - if (unlikely(__pyx_pw_5rados_14ObjectIterator_1__cinit__(o, a, k) < 0)) { - Py_DECREF(o); o = 0; - } - return o; -} - -static void __pyx_tp_dealloc_5rados_ObjectIterator(PyObject *o) { - struct __pyx_obj_5rados_ObjectIterator *p = (struct __pyx_obj_5rados_ObjectIterator *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - PyObject_GC_UnTrack(o); - { - PyObject *etype, *eval, *etb; - PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); - __pyx_pw_5rados_14ObjectIterator_7__dealloc__(o); - --Py_REFCNT(o); - PyErr_Restore(etype, eval, etb); - } - Py_CLEAR(p->ioctx); - (*Py_TYPE(o)->tp_free)(o); -} - -static int __pyx_tp_traverse_5rados_ObjectIterator(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_5rados_ObjectIterator *p = (struct __pyx_obj_5rados_ObjectIterator *)o; - if (p->ioctx) { - e = (*v)(p->ioctx, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_5rados_ObjectIterator(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_5rados_ObjectIterator *p = (struct __pyx_obj_5rados_ObjectIterator *)o; - tmp = ((PyObject*)p->ioctx); - p->ioctx = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyObject *__pyx_getprop_5rados_14ObjectIterator_ioctx(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_5rados_14ObjectIterator_5ioctx_1__get__(o); -} - -static int __pyx_setprop_5rados_14ObjectIterator_ioctx(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_5rados_14ObjectIterator_5ioctx_3__set__(o, v); - } - else { - return __pyx_pw_5rados_14ObjectIterator_5ioctx_5__del__(o); - } -} - -static PyMethodDef __pyx_methods_5rados_ObjectIterator[] = { - {"__next__", (PyCFunction)__pyx_pw_5rados_14ObjectIterator_5__next__, METH_NOARGS|METH_COEXIST, __pyx_doc_5rados_14ObjectIterator_4__next__}, - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_5rados_ObjectIterator[] = { - {(char *)"ioctx", __pyx_getprop_5rados_14ObjectIterator_ioctx, __pyx_setprop_5rados_14ObjectIterator_ioctx, (char *)"ioctx: object", 0}, - {0, 0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_5rados_ObjectIterator = { - PyVarObject_HEAD_INIT(0, 0) - "rados.ObjectIterator", /*tp_name*/ - sizeof(struct __pyx_obj_5rados_ObjectIterator), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_5rados_ObjectIterator, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - "rados.Ioctx Object iterator", /*tp_doc*/ - __pyx_tp_traverse_5rados_ObjectIterator, /*tp_traverse*/ - __pyx_tp_clear_5rados_ObjectIterator, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - __pyx_pw_5rados_14ObjectIterator_3__iter__, /*tp_iter*/ - __pyx_pw_5rados_14ObjectIterator_5__next__, /*tp_iternext*/ - __pyx_methods_5rados_ObjectIterator, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_5rados_ObjectIterator, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_5rados_ObjectIterator, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - 0, /*tp_finalize*/ - #endif -}; - -static PyObject *__pyx_tp_new_5rados_XattrIterator(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_5rados_XattrIterator *p; - PyObject *o; - if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { - o = (*t->tp_alloc)(t, 0); - } else { - o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); - } - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_5rados_XattrIterator *)o); - p->ioctx = ((struct __pyx_obj_5rados_Ioctx *)Py_None); Py_INCREF(Py_None); - p->oid = Py_None; Py_INCREF(Py_None); - if (unlikely(__pyx_pw_5rados_13XattrIterator_1__cinit__(o, a, k) < 0)) { - Py_DECREF(o); o = 0; - } - return o; -} - -static void __pyx_tp_dealloc_5rados_XattrIterator(PyObject *o) { - struct __pyx_obj_5rados_XattrIterator *p = (struct __pyx_obj_5rados_XattrIterator *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - PyObject_GC_UnTrack(o); - { - PyObject *etype, *eval, *etb; - PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); - __pyx_pw_5rados_13XattrIterator_7__dealloc__(o); - --Py_REFCNT(o); - PyErr_Restore(etype, eval, etb); - } - Py_CLEAR(p->ioctx); - Py_CLEAR(p->oid); - (*Py_TYPE(o)->tp_free)(o); -} - -static int __pyx_tp_traverse_5rados_XattrIterator(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_5rados_XattrIterator *p = (struct __pyx_obj_5rados_XattrIterator *)o; - if (p->ioctx) { - e = (*v)(((PyObject*)p->ioctx), a); if (e) return e; - } - if (p->oid) { - e = (*v)(p->oid, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_5rados_XattrIterator(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_5rados_XattrIterator *p = (struct __pyx_obj_5rados_XattrIterator *)o; - tmp = ((PyObject*)p->ioctx); - p->ioctx = ((struct __pyx_obj_5rados_Ioctx *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->oid); - p->oid = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyObject *__pyx_getprop_5rados_13XattrIterator_ioctx(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_5rados_13XattrIterator_5ioctx_1__get__(o); -} - -static int __pyx_setprop_5rados_13XattrIterator_ioctx(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_5rados_13XattrIterator_5ioctx_3__set__(o, v); - } - else { - return __pyx_pw_5rados_13XattrIterator_5ioctx_5__del__(o); - } -} - -static PyObject *__pyx_getprop_5rados_13XattrIterator_oid(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_5rados_13XattrIterator_3oid_1__get__(o); -} - -static int __pyx_setprop_5rados_13XattrIterator_oid(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_5rados_13XattrIterator_3oid_3__set__(o, v); - } - else { - return __pyx_pw_5rados_13XattrIterator_3oid_5__del__(o); - } -} - -static PyMethodDef __pyx_methods_5rados_XattrIterator[] = { - {"__next__", (PyCFunction)__pyx_pw_5rados_13XattrIterator_5__next__, METH_NOARGS|METH_COEXIST, __pyx_doc_5rados_13XattrIterator_4__next__}, - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_5rados_XattrIterator[] = { - {(char *)"ioctx", __pyx_getprop_5rados_13XattrIterator_ioctx, __pyx_setprop_5rados_13XattrIterator_ioctx, (char *)"ioctx: rados.Ioctx", 0}, - {(char *)"oid", __pyx_getprop_5rados_13XattrIterator_oid, __pyx_setprop_5rados_13XattrIterator_oid, (char *)"oid: object", 0}, - {0, 0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_5rados_XattrIterator = { - PyVarObject_HEAD_INIT(0, 0) - "rados.XattrIterator", /*tp_name*/ - sizeof(struct __pyx_obj_5rados_XattrIterator), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_5rados_XattrIterator, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - "Extended attribute iterator", /*tp_doc*/ - __pyx_tp_traverse_5rados_XattrIterator, /*tp_traverse*/ - __pyx_tp_clear_5rados_XattrIterator, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - __pyx_pw_5rados_13XattrIterator_3__iter__, /*tp_iter*/ - __pyx_pw_5rados_13XattrIterator_5__next__, /*tp_iternext*/ - __pyx_methods_5rados_XattrIterator, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_5rados_XattrIterator, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_5rados_XattrIterator, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - 0, /*tp_finalize*/ - #endif -}; - -static PyObject *__pyx_tp_new_5rados_SnapIterator(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_5rados_SnapIterator *p; - PyObject *o; - if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { - o = (*t->tp_alloc)(t, 0); - } else { - o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); - } - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_5rados_SnapIterator *)o); - p->ioctx = ((struct __pyx_obj_5rados_Ioctx *)Py_None); Py_INCREF(Py_None); - if (unlikely(__pyx_pw_5rados_12SnapIterator_1__cinit__(o, a, k) < 0)) { - Py_DECREF(o); o = 0; - } - return o; -} - -static void __pyx_tp_dealloc_5rados_SnapIterator(PyObject *o) { - struct __pyx_obj_5rados_SnapIterator *p = (struct __pyx_obj_5rados_SnapIterator *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - PyObject_GC_UnTrack(o); - Py_CLEAR(p->ioctx); - (*Py_TYPE(o)->tp_free)(o); -} - -static int __pyx_tp_traverse_5rados_SnapIterator(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_5rados_SnapIterator *p = (struct __pyx_obj_5rados_SnapIterator *)o; - if (p->ioctx) { - e = (*v)(((PyObject*)p->ioctx), a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_5rados_SnapIterator(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_5rados_SnapIterator *p = (struct __pyx_obj_5rados_SnapIterator *)o; - tmp = ((PyObject*)p->ioctx); - p->ioctx = ((struct __pyx_obj_5rados_Ioctx *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyObject *__pyx_getprop_5rados_12SnapIterator_ioctx(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_5rados_12SnapIterator_5ioctx_1__get__(o); -} - -static int __pyx_setprop_5rados_12SnapIterator_ioctx(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_5rados_12SnapIterator_5ioctx_3__set__(o, v); - } - else { - return __pyx_pw_5rados_12SnapIterator_5ioctx_5__del__(o); - } -} - -static PyMethodDef __pyx_methods_5rados_SnapIterator[] = { - {"__next__", (PyCFunction)__pyx_pw_5rados_12SnapIterator_5__next__, METH_NOARGS|METH_COEXIST, __pyx_doc_5rados_12SnapIterator_4__next__}, - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_5rados_SnapIterator[] = { - {(char *)"ioctx", __pyx_getprop_5rados_12SnapIterator_ioctx, __pyx_setprop_5rados_12SnapIterator_ioctx, (char *)"ioctx: rados.Ioctx", 0}, - {0, 0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_5rados_SnapIterator = { - PyVarObject_HEAD_INIT(0, 0) - "rados.SnapIterator", /*tp_name*/ - sizeof(struct __pyx_obj_5rados_SnapIterator), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_5rados_SnapIterator, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - "Snapshot iterator", /*tp_doc*/ - __pyx_tp_traverse_5rados_SnapIterator, /*tp_traverse*/ - __pyx_tp_clear_5rados_SnapIterator, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - __pyx_pw_5rados_12SnapIterator_3__iter__, /*tp_iter*/ - __pyx_pw_5rados_12SnapIterator_5__next__, /*tp_iternext*/ - __pyx_methods_5rados_SnapIterator, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_5rados_SnapIterator, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_5rados_SnapIterator, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - 0, /*tp_finalize*/ - #endif -}; - -static PyObject *__pyx_tp_new_5rados_Snap(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_5rados_Snap *p; - PyObject *o; - if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { - o = (*t->tp_alloc)(t, 0); - } else { - o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); - } - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_5rados_Snap *)o); - p->ioctx = ((struct __pyx_obj_5rados_Ioctx *)Py_None); Py_INCREF(Py_None); - p->name = Py_None; Py_INCREF(Py_None); - if (unlikely(__pyx_pw_5rados_4Snap_1__cinit__(o, a, k) < 0)) { - Py_DECREF(o); o = 0; - } - return o; -} - -static void __pyx_tp_dealloc_5rados_Snap(PyObject *o) { - struct __pyx_obj_5rados_Snap *p = (struct __pyx_obj_5rados_Snap *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - PyObject_GC_UnTrack(o); - Py_CLEAR(p->ioctx); - Py_CLEAR(p->name); - (*Py_TYPE(o)->tp_free)(o); -} - -static int __pyx_tp_traverse_5rados_Snap(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_5rados_Snap *p = (struct __pyx_obj_5rados_Snap *)o; - if (p->ioctx) { - e = (*v)(((PyObject*)p->ioctx), a); if (e) return e; - } - if (p->name) { - e = (*v)(p->name, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_5rados_Snap(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_5rados_Snap *p = (struct __pyx_obj_5rados_Snap *)o; - tmp = ((PyObject*)p->ioctx); - p->ioctx = ((struct __pyx_obj_5rados_Ioctx *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->name); - p->name = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyObject *__pyx_getprop_5rados_4Snap_ioctx(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_5rados_4Snap_5ioctx_1__get__(o); -} - -static int __pyx_setprop_5rados_4Snap_ioctx(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_5rados_4Snap_5ioctx_3__set__(o, v); - } - else { - return __pyx_pw_5rados_4Snap_5ioctx_5__del__(o); - } -} - -static PyObject *__pyx_getprop_5rados_4Snap_name(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_5rados_4Snap_4name_1__get__(o); -} - -static int __pyx_setprop_5rados_4Snap_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_5rados_4Snap_4name_3__set__(o, v); - } - else { - return __pyx_pw_5rados_4Snap_4name_5__del__(o); - } -} - -static PyObject *__pyx_getprop_5rados_4Snap_snap_id(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_5rados_4Snap_7snap_id_1__get__(o); -} - -static int __pyx_setprop_5rados_4Snap_snap_id(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_5rados_4Snap_7snap_id_3__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyMethodDef __pyx_methods_5rados_Snap[] = { - {"get_timestamp", (PyCFunction)__pyx_pw_5rados_4Snap_5get_timestamp, METH_NOARGS, __pyx_doc_5rados_4Snap_4get_timestamp}, - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_5rados_Snap[] = { - {(char *)"ioctx", __pyx_getprop_5rados_4Snap_ioctx, __pyx_setprop_5rados_4Snap_ioctx, (char *)"ioctx: rados.Ioctx", 0}, - {(char *)"name", __pyx_getprop_5rados_4Snap_name, __pyx_setprop_5rados_4Snap_name, (char *)"name: object", 0}, - {(char *)"snap_id", __pyx_getprop_5rados_4Snap_snap_id, __pyx_setprop_5rados_4Snap_snap_id, (char *)"snap_id: 'rados_snap_t'", 0}, - {0, 0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_5rados_Snap = { - PyVarObject_HEAD_INIT(0, 0) - "rados.Snap", /*tp_name*/ - sizeof(struct __pyx_obj_5rados_Snap), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_5rados_Snap, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - __pyx_pw_5rados_4Snap_3__str__, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - "Snapshot object", /*tp_doc*/ - __pyx_tp_traverse_5rados_Snap, /*tp_traverse*/ - __pyx_tp_clear_5rados_Snap, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_5rados_Snap, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_5rados_Snap, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_5rados_Snap, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - 0, /*tp_finalize*/ - #endif -}; - -static PyObject *__pyx_tp_new_5rados_Completion(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_5rados_Completion *p; - PyObject *o; - if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { - o = (*t->tp_alloc)(t, 0); - } else { - o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); - } - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_5rados_Completion *)o); - p->ioctx = ((struct __pyx_obj_5rados_Ioctx *)Py_None); Py_INCREF(Py_None); - p->oncomplete = Py_None; Py_INCREF(Py_None); - p->onsafe = Py_None; Py_INCREF(Py_None); - if (unlikely(__pyx_pw_5rados_10Completion_1__cinit__(o, a, k) < 0)) { - Py_DECREF(o); o = 0; - } - return o; -} - -static void __pyx_tp_dealloc_5rados_Completion(PyObject *o) { - struct __pyx_obj_5rados_Completion *p = (struct __pyx_obj_5rados_Completion *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - PyObject_GC_UnTrack(o); - { - PyObject *etype, *eval, *etb; - PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); - __pyx_pw_5rados_10Completion_17__dealloc__(o); - --Py_REFCNT(o); - PyErr_Restore(etype, eval, etb); - } - Py_CLEAR(p->ioctx); - Py_CLEAR(p->oncomplete); - Py_CLEAR(p->onsafe); - (*Py_TYPE(o)->tp_free)(o); -} - -static int __pyx_tp_traverse_5rados_Completion(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_5rados_Completion *p = (struct __pyx_obj_5rados_Completion *)o; - if (p->ioctx) { - e = (*v)(((PyObject*)p->ioctx), a); if (e) return e; - } - if (p->oncomplete) { - e = (*v)(p->oncomplete, a); if (e) return e; - } - if (p->onsafe) { - e = (*v)(p->onsafe, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_5rados_Completion(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_5rados_Completion *p = (struct __pyx_obj_5rados_Completion *)o; - tmp = ((PyObject*)p->ioctx); - p->ioctx = ((struct __pyx_obj_5rados_Ioctx *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->oncomplete); - p->oncomplete = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->onsafe); - p->onsafe = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyObject *__pyx_getprop_5rados_10Completion_ioctx(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_5rados_10Completion_5ioctx_1__get__(o); -} - -static int __pyx_setprop_5rados_10Completion_ioctx(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_5rados_10Completion_5ioctx_3__set__(o, v); - } - else { - return __pyx_pw_5rados_10Completion_5ioctx_5__del__(o); - } -} - -static PyObject *__pyx_getprop_5rados_10Completion_oncomplete(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_5rados_10Completion_10oncomplete_1__get__(o); -} - -static int __pyx_setprop_5rados_10Completion_oncomplete(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_5rados_10Completion_10oncomplete_3__set__(o, v); - } - else { - return __pyx_pw_5rados_10Completion_10oncomplete_5__del__(o); - } -} - -static PyObject *__pyx_getprop_5rados_10Completion_onsafe(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_5rados_10Completion_6onsafe_1__get__(o); -} - -static int __pyx_setprop_5rados_10Completion_onsafe(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_5rados_10Completion_6onsafe_3__set__(o, v); - } - else { - return __pyx_pw_5rados_10Completion_6onsafe_5__del__(o); - } -} - -static PyMethodDef __pyx_methods_5rados_Completion[] = { - {"is_safe", (PyCFunction)__pyx_pw_5rados_10Completion_3is_safe, METH_NOARGS, __pyx_doc_5rados_10Completion_2is_safe}, - {"is_complete", (PyCFunction)__pyx_pw_5rados_10Completion_5is_complete, METH_NOARGS, __pyx_doc_5rados_10Completion_4is_complete}, - {"wait_for_safe", (PyCFunction)__pyx_pw_5rados_10Completion_7wait_for_safe, METH_NOARGS, __pyx_doc_5rados_10Completion_6wait_for_safe}, - {"wait_for_complete", (PyCFunction)__pyx_pw_5rados_10Completion_9wait_for_complete, METH_NOARGS, __pyx_doc_5rados_10Completion_8wait_for_complete}, - {"wait_for_safe_and_cb", (PyCFunction)__pyx_pw_5rados_10Completion_11wait_for_safe_and_cb, METH_NOARGS, __pyx_doc_5rados_10Completion_10wait_for_safe_and_cb}, - {"wait_for_complete_and_cb", (PyCFunction)__pyx_pw_5rados_10Completion_13wait_for_complete_and_cb, METH_NOARGS, __pyx_doc_5rados_10Completion_12wait_for_complete_and_cb}, - {"get_return_value", (PyCFunction)__pyx_pw_5rados_10Completion_15get_return_value, METH_NOARGS, __pyx_doc_5rados_10Completion_14get_return_value}, - {"_complete", (PyCFunction)__pyx_pw_5rados_10Completion_19_complete, METH_NOARGS, __pyx_doc_5rados_10Completion_18_complete}, - {"_safe", (PyCFunction)__pyx_pw_5rados_10Completion_21_safe, METH_NOARGS, __pyx_doc_5rados_10Completion_20_safe}, - {"_cleanup", (PyCFunction)__pyx_pw_5rados_10Completion_23_cleanup, METH_NOARGS, __pyx_doc_5rados_10Completion_22_cleanup}, - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_5rados_Completion[] = { - {(char *)"ioctx", __pyx_getprop_5rados_10Completion_ioctx, __pyx_setprop_5rados_10Completion_ioctx, (char *)"ioctx: rados.Ioctx", 0}, - {(char *)"oncomplete", __pyx_getprop_5rados_10Completion_oncomplete, __pyx_setprop_5rados_10Completion_oncomplete, (char *)"oncomplete: object", 0}, - {(char *)"onsafe", __pyx_getprop_5rados_10Completion_onsafe, __pyx_setprop_5rados_10Completion_onsafe, (char *)"onsafe: object", 0}, - {0, 0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_5rados_Completion = { - PyVarObject_HEAD_INIT(0, 0) - "rados.Completion", /*tp_name*/ - sizeof(struct __pyx_obj_5rados_Completion), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_5rados_Completion, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - "completion object", /*tp_doc*/ - __pyx_tp_traverse_5rados_Completion, /*tp_traverse*/ - __pyx_tp_clear_5rados_Completion, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_5rados_Completion, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_5rados_Completion, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_5rados_Completion, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - 0, /*tp_finalize*/ - #endif -}; - -static PyObject *__pyx_tp_new_5rados_WriteOp(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - PyObject *o; - if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { - o = (*t->tp_alloc)(t, 0); - } else { - o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); - } - if (unlikely(!o)) return 0; - return o; -} - -static void __pyx_tp_dealloc_5rados_WriteOp(PyObject *o) { - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - (*Py_TYPE(o)->tp_free)(o); -} - -static PyMethodDef __pyx_methods_5rados_WriteOp[] = { - {"create", (PyCFunction)__pyx_pw_5rados_7WriteOp_1create, METH_NOARGS, __pyx_doc_5rados_7WriteOp_create}, - {"release", (PyCFunction)__pyx_pw_5rados_7WriteOp_3release, METH_NOARGS, __pyx_doc_5rados_7WriteOp_2release}, - {0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_5rados_WriteOp = { - PyVarObject_HEAD_INIT(0, 0) - "rados.WriteOp", /*tp_name*/ - sizeof(struct __pyx_obj_5rados_WriteOp), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_5rados_WriteOp, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_5rados_WriteOp, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_5rados_WriteOp, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - 0, /*tp_finalize*/ - #endif -}; - -static PyObject *__pyx_tp_new_5rados_ReadOp(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - PyObject *o; - if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { - o = (*t->tp_alloc)(t, 0); - } else { - o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); - } - if (unlikely(!o)) return 0; - return o; -} - -static void __pyx_tp_dealloc_5rados_ReadOp(PyObject *o) { - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - (*Py_TYPE(o)->tp_free)(o); -} - -static PyMethodDef __pyx_methods_5rados_ReadOp[] = { - {"create", (PyCFunction)__pyx_pw_5rados_6ReadOp_1create, METH_NOARGS, __pyx_doc_5rados_6ReadOp_create}, - {"release", (PyCFunction)__pyx_pw_5rados_6ReadOp_3release, METH_NOARGS, __pyx_doc_5rados_6ReadOp_2release}, - {0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_5rados_ReadOp = { - PyVarObject_HEAD_INIT(0, 0) - "rados.ReadOp", /*tp_name*/ - sizeof(struct __pyx_obj_5rados_ReadOp), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_5rados_ReadOp, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_5rados_ReadOp, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_5rados_ReadOp, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - 0, /*tp_finalize*/ - #endif -}; - -static struct __pyx_obj_5rados___pyx_scope_struct__requires *__pyx_freelist_5rados___pyx_scope_struct__requires[8]; -static int __pyx_freecount_5rados___pyx_scope_struct__requires = 0; - -static PyObject *__pyx_tp_new_5rados___pyx_scope_struct__requires(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - PyObject *o; - if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_5rados___pyx_scope_struct__requires > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5rados___pyx_scope_struct__requires)))) { - o = (PyObject*)__pyx_freelist_5rados___pyx_scope_struct__requires[--__pyx_freecount_5rados___pyx_scope_struct__requires]; - memset(o, 0, sizeof(struct __pyx_obj_5rados___pyx_scope_struct__requires)); - (void) PyObject_INIT(o, t); - PyObject_GC_Track(o); - } else { - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - } - return o; -} - -static void __pyx_tp_dealloc_5rados___pyx_scope_struct__requires(PyObject *o) { - struct __pyx_obj_5rados___pyx_scope_struct__requires *p = (struct __pyx_obj_5rados___pyx_scope_struct__requires *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_check_type); - Py_CLEAR(p->__pyx_v_is_type_of); - Py_CLEAR(p->__pyx_v_types); - if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_5rados___pyx_scope_struct__requires < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5rados___pyx_scope_struct__requires)))) { - __pyx_freelist_5rados___pyx_scope_struct__requires[__pyx_freecount_5rados___pyx_scope_struct__requires++] = ((struct __pyx_obj_5rados___pyx_scope_struct__requires *)o); - } else { - (*Py_TYPE(o)->tp_free)(o); - } -} - -static int __pyx_tp_traverse_5rados___pyx_scope_struct__requires(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_5rados___pyx_scope_struct__requires *p = (struct __pyx_obj_5rados___pyx_scope_struct__requires *)o; - if (p->__pyx_v_check_type) { - e = (*v)(p->__pyx_v_check_type, a); if (e) return e; - } - if (p->__pyx_v_is_type_of) { - e = (*v)(p->__pyx_v_is_type_of, a); if (e) return e; - } - if (p->__pyx_v_types) { - e = (*v)(p->__pyx_v_types, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_5rados___pyx_scope_struct__requires(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_5rados___pyx_scope_struct__requires *p = (struct __pyx_obj_5rados___pyx_scope_struct__requires *)o; - tmp = ((PyObject*)p->__pyx_v_check_type); - p->__pyx_v_check_type = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_is_type_of); - p->__pyx_v_is_type_of = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_types); - p->__pyx_v_types = ((PyObject*)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyTypeObject __pyx_type_5rados___pyx_scope_struct__requires = { - PyVarObject_HEAD_INIT(0, 0) - "rados.__pyx_scope_struct__requires", /*tp_name*/ - sizeof(struct __pyx_obj_5rados___pyx_scope_struct__requires), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_5rados___pyx_scope_struct__requires, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_5rados___pyx_scope_struct__requires, /*tp_traverse*/ - __pyx_tp_clear_5rados___pyx_scope_struct__requires, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_5rados___pyx_scope_struct__requires, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - 0, /*tp_finalize*/ - #endif -}; - -static struct __pyx_obj_5rados___pyx_scope_struct_1_check_type *__pyx_freelist_5rados___pyx_scope_struct_1_check_type[8]; -static int __pyx_freecount_5rados___pyx_scope_struct_1_check_type = 0; - -static PyObject *__pyx_tp_new_5rados___pyx_scope_struct_1_check_type(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - PyObject *o; - if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_5rados___pyx_scope_struct_1_check_type > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5rados___pyx_scope_struct_1_check_type)))) { - o = (PyObject*)__pyx_freelist_5rados___pyx_scope_struct_1_check_type[--__pyx_freecount_5rados___pyx_scope_struct_1_check_type]; - memset(o, 0, sizeof(struct __pyx_obj_5rados___pyx_scope_struct_1_check_type)); - (void) PyObject_INIT(o, t); - PyObject_GC_Track(o); - } else { - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - } - return o; -} - -static void __pyx_tp_dealloc_5rados___pyx_scope_struct_1_check_type(PyObject *o) { - struct __pyx_obj_5rados___pyx_scope_struct_1_check_type *p = (struct __pyx_obj_5rados___pyx_scope_struct_1_check_type *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_v_arg_type); - Py_CLEAR(p->__pyx_v_val); - if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_5rados___pyx_scope_struct_1_check_type < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5rados___pyx_scope_struct_1_check_type)))) { - __pyx_freelist_5rados___pyx_scope_struct_1_check_type[__pyx_freecount_5rados___pyx_scope_struct_1_check_type++] = ((struct __pyx_obj_5rados___pyx_scope_struct_1_check_type *)o); - } else { - (*Py_TYPE(o)->tp_free)(o); - } -} - -static int __pyx_tp_traverse_5rados___pyx_scope_struct_1_check_type(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_5rados___pyx_scope_struct_1_check_type *p = (struct __pyx_obj_5rados___pyx_scope_struct_1_check_type *)o; - if (p->__pyx_outer_scope) { - e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e; - } - if (p->__pyx_v_arg_type) { - e = (*v)(p->__pyx_v_arg_type, a); if (e) return e; - } - if (p->__pyx_v_val) { - e = (*v)(p->__pyx_v_val, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_5rados___pyx_scope_struct_1_check_type(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_5rados___pyx_scope_struct_1_check_type *p = (struct __pyx_obj_5rados___pyx_scope_struct_1_check_type *)o; - tmp = ((PyObject*)p->__pyx_outer_scope); - p->__pyx_outer_scope = ((struct __pyx_obj_5rados___pyx_scope_struct__requires *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_arg_type); - p->__pyx_v_arg_type = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_val); - p->__pyx_v_val = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyTypeObject __pyx_type_5rados___pyx_scope_struct_1_check_type = { - PyVarObject_HEAD_INIT(0, 0) - "rados.__pyx_scope_struct_1_check_type", /*tp_name*/ - sizeof(struct __pyx_obj_5rados___pyx_scope_struct_1_check_type), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_5rados___pyx_scope_struct_1_check_type, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_5rados___pyx_scope_struct_1_check_type, /*tp_traverse*/ - __pyx_tp_clear_5rados___pyx_scope_struct_1_check_type, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_5rados___pyx_scope_struct_1_check_type, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - 0, /*tp_finalize*/ - #endif -}; - -static struct __pyx_obj_5rados___pyx_scope_struct_2_genexpr *__pyx_freelist_5rados___pyx_scope_struct_2_genexpr[8]; -static int __pyx_freecount_5rados___pyx_scope_struct_2_genexpr = 0; - -static PyObject *__pyx_tp_new_5rados___pyx_scope_struct_2_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - PyObject *o; - if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_5rados___pyx_scope_struct_2_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5rados___pyx_scope_struct_2_genexpr)))) { - o = (PyObject*)__pyx_freelist_5rados___pyx_scope_struct_2_genexpr[--__pyx_freecount_5rados___pyx_scope_struct_2_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_5rados___pyx_scope_struct_2_genexpr)); - (void) PyObject_INIT(o, t); - PyObject_GC_Track(o); - } else { - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - } - return o; -} - -static void __pyx_tp_dealloc_5rados___pyx_scope_struct_2_genexpr(PyObject *o) { - struct __pyx_obj_5rados___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_5rados___pyx_scope_struct_2_genexpr *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_v_t); - if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_5rados___pyx_scope_struct_2_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5rados___pyx_scope_struct_2_genexpr)))) { - __pyx_freelist_5rados___pyx_scope_struct_2_genexpr[__pyx_freecount_5rados___pyx_scope_struct_2_genexpr++] = ((struct __pyx_obj_5rados___pyx_scope_struct_2_genexpr *)o); - } else { - (*Py_TYPE(o)->tp_free)(o); - } -} - -static int __pyx_tp_traverse_5rados___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_5rados___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_5rados___pyx_scope_struct_2_genexpr *)o; - if (p->__pyx_outer_scope) { - e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e; - } - if (p->__pyx_v_t) { - e = (*v)(p->__pyx_v_t, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_5rados___pyx_scope_struct_2_genexpr(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_5rados___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_5rados___pyx_scope_struct_2_genexpr *)o; - tmp = ((PyObject*)p->__pyx_outer_scope); - p->__pyx_outer_scope = ((struct __pyx_obj_5rados___pyx_scope_struct_1_check_type *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_t); - p->__pyx_v_t = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyTypeObject __pyx_type_5rados___pyx_scope_struct_2_genexpr = { - PyVarObject_HEAD_INIT(0, 0) - "rados.__pyx_scope_struct_2_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_5rados___pyx_scope_struct_2_genexpr), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_5rados___pyx_scope_struct_2_genexpr, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_5rados___pyx_scope_struct_2_genexpr, /*tp_traverse*/ - __pyx_tp_clear_5rados___pyx_scope_struct_2_genexpr, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_5rados___pyx_scope_struct_2_genexpr, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - 0, /*tp_finalize*/ - #endif -}; - -static struct __pyx_obj_5rados___pyx_scope_struct_3_genexpr *__pyx_freelist_5rados___pyx_scope_struct_3_genexpr[8]; -static int __pyx_freecount_5rados___pyx_scope_struct_3_genexpr = 0; - -static PyObject *__pyx_tp_new_5rados___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - PyObject *o; - if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_5rados___pyx_scope_struct_3_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5rados___pyx_scope_struct_3_genexpr)))) { - o = (PyObject*)__pyx_freelist_5rados___pyx_scope_struct_3_genexpr[--__pyx_freecount_5rados___pyx_scope_struct_3_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_5rados___pyx_scope_struct_3_genexpr)); - (void) PyObject_INIT(o, t); - PyObject_GC_Track(o); - } else { - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - } - return o; -} - -static void __pyx_tp_dealloc_5rados___pyx_scope_struct_3_genexpr(PyObject *o) { - struct __pyx_obj_5rados___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_5rados___pyx_scope_struct_3_genexpr *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_v_t); - Py_CLEAR(p->__pyx_t_0); - if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_5rados___pyx_scope_struct_3_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5rados___pyx_scope_struct_3_genexpr)))) { - __pyx_freelist_5rados___pyx_scope_struct_3_genexpr[__pyx_freecount_5rados___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_5rados___pyx_scope_struct_3_genexpr *)o); - } else { - (*Py_TYPE(o)->tp_free)(o); - } -} - -static int __pyx_tp_traverse_5rados___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_5rados___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_5rados___pyx_scope_struct_3_genexpr *)o; - if (p->__pyx_outer_scope) { - e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e; - } - if (p->__pyx_v_t) { - e = (*v)(p->__pyx_v_t, a); if (e) return e; - } - if (p->__pyx_t_0) { - e = (*v)(p->__pyx_t_0, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_5rados___pyx_scope_struct_3_genexpr(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_5rados___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_5rados___pyx_scope_struct_3_genexpr *)o; - tmp = ((PyObject*)p->__pyx_outer_scope); - p->__pyx_outer_scope = ((struct __pyx_obj_5rados___pyx_scope_struct_1_check_type *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_t); - p->__pyx_v_t = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_t_0); - p->__pyx_t_0 = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyTypeObject __pyx_type_5rados___pyx_scope_struct_3_genexpr = { - PyVarObject_HEAD_INIT(0, 0) - "rados.__pyx_scope_struct_3_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_5rados___pyx_scope_struct_3_genexpr), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_5rados___pyx_scope_struct_3_genexpr, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_5rados___pyx_scope_struct_3_genexpr, /*tp_traverse*/ - __pyx_tp_clear_5rados___pyx_scope_struct_3_genexpr, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_5rados___pyx_scope_struct_3_genexpr, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - 0, /*tp_finalize*/ - #endif -}; - -static struct __pyx_obj_5rados___pyx_scope_struct_4_wrapper *__pyx_freelist_5rados___pyx_scope_struct_4_wrapper[8]; -static int __pyx_freecount_5rados___pyx_scope_struct_4_wrapper = 0; - -static PyObject *__pyx_tp_new_5rados___pyx_scope_struct_4_wrapper(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - PyObject *o; - if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_5rados___pyx_scope_struct_4_wrapper > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5rados___pyx_scope_struct_4_wrapper)))) { - o = (PyObject*)__pyx_freelist_5rados___pyx_scope_struct_4_wrapper[--__pyx_freecount_5rados___pyx_scope_struct_4_wrapper]; - memset(o, 0, sizeof(struct __pyx_obj_5rados___pyx_scope_struct_4_wrapper)); - (void) PyObject_INIT(o, t); - PyObject_GC_Track(o); - } else { - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - } - return o; -} - -static void __pyx_tp_dealloc_5rados___pyx_scope_struct_4_wrapper(PyObject *o) { - struct __pyx_obj_5rados___pyx_scope_struct_4_wrapper *p = (struct __pyx_obj_5rados___pyx_scope_struct_4_wrapper *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_v_f); - if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_5rados___pyx_scope_struct_4_wrapper < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5rados___pyx_scope_struct_4_wrapper)))) { - __pyx_freelist_5rados___pyx_scope_struct_4_wrapper[__pyx_freecount_5rados___pyx_scope_struct_4_wrapper++] = ((struct __pyx_obj_5rados___pyx_scope_struct_4_wrapper *)o); - } else { - (*Py_TYPE(o)->tp_free)(o); - } -} - -static int __pyx_tp_traverse_5rados___pyx_scope_struct_4_wrapper(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_5rados___pyx_scope_struct_4_wrapper *p = (struct __pyx_obj_5rados___pyx_scope_struct_4_wrapper *)o; - if (p->__pyx_outer_scope) { - e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e; - } - if (p->__pyx_v_f) { - e = (*v)(p->__pyx_v_f, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_5rados___pyx_scope_struct_4_wrapper(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_5rados___pyx_scope_struct_4_wrapper *p = (struct __pyx_obj_5rados___pyx_scope_struct_4_wrapper *)o; - tmp = ((PyObject*)p->__pyx_outer_scope); - p->__pyx_outer_scope = ((struct __pyx_obj_5rados___pyx_scope_struct__requires *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_f); - p->__pyx_v_f = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyTypeObject __pyx_type_5rados___pyx_scope_struct_4_wrapper = { - PyVarObject_HEAD_INIT(0, 0) - "rados.__pyx_scope_struct_4_wrapper", /*tp_name*/ - sizeof(struct __pyx_obj_5rados___pyx_scope_struct_4_wrapper), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_5rados___pyx_scope_struct_4_wrapper, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_5rados___pyx_scope_struct_4_wrapper, /*tp_traverse*/ - __pyx_tp_clear_5rados___pyx_scope_struct_4_wrapper, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_5rados___pyx_scope_struct_4_wrapper, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - 0, /*tp_finalize*/ - #endif -}; - -static struct __pyx_obj_5rados___pyx_scope_struct_5_validate_func *__pyx_freelist_5rados___pyx_scope_struct_5_validate_func[8]; -static int __pyx_freecount_5rados___pyx_scope_struct_5_validate_func = 0; - -static PyObject *__pyx_tp_new_5rados___pyx_scope_struct_5_validate_func(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - PyObject *o; - if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_5rados___pyx_scope_struct_5_validate_func > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5rados___pyx_scope_struct_5_validate_func)))) { - o = (PyObject*)__pyx_freelist_5rados___pyx_scope_struct_5_validate_func[--__pyx_freecount_5rados___pyx_scope_struct_5_validate_func]; - memset(o, 0, sizeof(struct __pyx_obj_5rados___pyx_scope_struct_5_validate_func)); - (void) PyObject_INIT(o, t); - PyObject_GC_Track(o); - } else { - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - } - return o; -} - -static void __pyx_tp_dealloc_5rados___pyx_scope_struct_5_validate_func(PyObject *o) { - struct __pyx_obj_5rados___pyx_scope_struct_5_validate_func *p = (struct __pyx_obj_5rados___pyx_scope_struct_5_validate_func *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_v_kwargs); - if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_5rados___pyx_scope_struct_5_validate_func < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5rados___pyx_scope_struct_5_validate_func)))) { - __pyx_freelist_5rados___pyx_scope_struct_5_validate_func[__pyx_freecount_5rados___pyx_scope_struct_5_validate_func++] = ((struct __pyx_obj_5rados___pyx_scope_struct_5_validate_func *)o); - } else { - (*Py_TYPE(o)->tp_free)(o); - } -} - -static int __pyx_tp_traverse_5rados___pyx_scope_struct_5_validate_func(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_5rados___pyx_scope_struct_5_validate_func *p = (struct __pyx_obj_5rados___pyx_scope_struct_5_validate_func *)o; - if (p->__pyx_outer_scope) { - e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e; - } - if (p->__pyx_v_kwargs) { - e = (*v)(p->__pyx_v_kwargs, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_5rados___pyx_scope_struct_5_validate_func(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_5rados___pyx_scope_struct_5_validate_func *p = (struct __pyx_obj_5rados___pyx_scope_struct_5_validate_func *)o; - tmp = ((PyObject*)p->__pyx_outer_scope); - p->__pyx_outer_scope = ((struct __pyx_obj_5rados___pyx_scope_struct_4_wrapper *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_kwargs); - p->__pyx_v_kwargs = ((PyObject*)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyTypeObject __pyx_type_5rados___pyx_scope_struct_5_validate_func = { - PyVarObject_HEAD_INIT(0, 0) - "rados.__pyx_scope_struct_5_validate_func", /*tp_name*/ - sizeof(struct __pyx_obj_5rados___pyx_scope_struct_5_validate_func), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_5rados___pyx_scope_struct_5_validate_func, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_5rados___pyx_scope_struct_5_validate_func, /*tp_traverse*/ - __pyx_tp_clear_5rados___pyx_scope_struct_5_validate_func, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_5rados___pyx_scope_struct_5_validate_func, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - 0, /*tp_finalize*/ - #endif -}; - -static struct __pyx_obj_5rados___pyx_scope_struct_6_genexpr *__pyx_freelist_5rados___pyx_scope_struct_6_genexpr[8]; -static int __pyx_freecount_5rados___pyx_scope_struct_6_genexpr = 0; - -static PyObject *__pyx_tp_new_5rados___pyx_scope_struct_6_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - PyObject *o; - if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_5rados___pyx_scope_struct_6_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5rados___pyx_scope_struct_6_genexpr)))) { - o = (PyObject*)__pyx_freelist_5rados___pyx_scope_struct_6_genexpr[--__pyx_freecount_5rados___pyx_scope_struct_6_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_5rados___pyx_scope_struct_6_genexpr)); - (void) PyObject_INIT(o, t); - PyObject_GC_Track(o); - } else { - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - } - return o; -} - -static void __pyx_tp_dealloc_5rados___pyx_scope_struct_6_genexpr(PyObject *o) { - struct __pyx_obj_5rados___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_5rados___pyx_scope_struct_6_genexpr *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_v_name); - Py_CLEAR(p->__pyx_v_spec); - Py_CLEAR(p->__pyx_t_0); - if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_5rados___pyx_scope_struct_6_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5rados___pyx_scope_struct_6_genexpr)))) { - __pyx_freelist_5rados___pyx_scope_struct_6_genexpr[__pyx_freecount_5rados___pyx_scope_struct_6_genexpr++] = ((struct __pyx_obj_5rados___pyx_scope_struct_6_genexpr *)o); - } else { - (*Py_TYPE(o)->tp_free)(o); - } -} - -static int __pyx_tp_traverse_5rados___pyx_scope_struct_6_genexpr(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_5rados___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_5rados___pyx_scope_struct_6_genexpr *)o; - if (p->__pyx_outer_scope) { - e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e; - } - if (p->__pyx_v_name) { - e = (*v)(p->__pyx_v_name, a); if (e) return e; - } - if (p->__pyx_v_spec) { - e = (*v)(p->__pyx_v_spec, a); if (e) return e; - } - if (p->__pyx_t_0) { - e = (*v)(p->__pyx_t_0, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_5rados___pyx_scope_struct_6_genexpr(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_5rados___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_5rados___pyx_scope_struct_6_genexpr *)o; - tmp = ((PyObject*)p->__pyx_outer_scope); - p->__pyx_outer_scope = ((struct __pyx_obj_5rados___pyx_scope_struct_5_validate_func *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_name); - p->__pyx_v_name = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_spec); - p->__pyx_v_spec = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_t_0); - p->__pyx_t_0 = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyTypeObject __pyx_type_5rados___pyx_scope_struct_6_genexpr = { - PyVarObject_HEAD_INIT(0, 0) - "rados.__pyx_scope_struct_6_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_5rados___pyx_scope_struct_6_genexpr), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_5rados___pyx_scope_struct_6_genexpr, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_5rados___pyx_scope_struct_6_genexpr, /*tp_traverse*/ - __pyx_tp_clear_5rados___pyx_scope_struct_6_genexpr, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_5rados___pyx_scope_struct_6_genexpr, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - 0, /*tp_finalize*/ - #endif -}; - -static struct __pyx_obj_5rados___pyx_scope_struct_7_aio_read *__pyx_freelist_5rados___pyx_scope_struct_7_aio_read[8]; -static int __pyx_freecount_5rados___pyx_scope_struct_7_aio_read = 0; - -static PyObject *__pyx_tp_new_5rados___pyx_scope_struct_7_aio_read(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - PyObject *o; - if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_5rados___pyx_scope_struct_7_aio_read > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5rados___pyx_scope_struct_7_aio_read)))) { - o = (PyObject*)__pyx_freelist_5rados___pyx_scope_struct_7_aio_read[--__pyx_freecount_5rados___pyx_scope_struct_7_aio_read]; - memset(o, 0, sizeof(struct __pyx_obj_5rados___pyx_scope_struct_7_aio_read)); - (void) PyObject_INIT(o, t); - PyObject_GC_Track(o); - } else { - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - } - return o; -} - -static void __pyx_tp_dealloc_5rados___pyx_scope_struct_7_aio_read(PyObject *o) { - struct __pyx_obj_5rados___pyx_scope_struct_7_aio_read *p = (struct __pyx_obj_5rados___pyx_scope_struct_7_aio_read *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_length); - Py_CLEAR(p->__pyx_v_oncomplete); - if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_5rados___pyx_scope_struct_7_aio_read < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5rados___pyx_scope_struct_7_aio_read)))) { - __pyx_freelist_5rados___pyx_scope_struct_7_aio_read[__pyx_freecount_5rados___pyx_scope_struct_7_aio_read++] = ((struct __pyx_obj_5rados___pyx_scope_struct_7_aio_read *)o); - } else { - (*Py_TYPE(o)->tp_free)(o); - } -} - -static int __pyx_tp_traverse_5rados___pyx_scope_struct_7_aio_read(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_5rados___pyx_scope_struct_7_aio_read *p = (struct __pyx_obj_5rados___pyx_scope_struct_7_aio_read *)o; - if (p->__pyx_v_length) { - e = (*v)(p->__pyx_v_length, a); if (e) return e; - } - if (p->__pyx_v_oncomplete) { - e = (*v)(p->__pyx_v_oncomplete, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_5rados___pyx_scope_struct_7_aio_read(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_5rados___pyx_scope_struct_7_aio_read *p = (struct __pyx_obj_5rados___pyx_scope_struct_7_aio_read *)o; - tmp = ((PyObject*)p->__pyx_v_length); - p->__pyx_v_length = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_oncomplete); - p->__pyx_v_oncomplete = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyTypeObject __pyx_type_5rados___pyx_scope_struct_7_aio_read = { - PyVarObject_HEAD_INIT(0, 0) - "rados.__pyx_scope_struct_7_aio_read", /*tp_name*/ - sizeof(struct __pyx_obj_5rados___pyx_scope_struct_7_aio_read), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_5rados___pyx_scope_struct_7_aio_read, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_5rados___pyx_scope_struct_7_aio_read, /*tp_traverse*/ - __pyx_tp_clear_5rados___pyx_scope_struct_7_aio_read, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_5rados___pyx_scope_struct_7_aio_read, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - 0, /*tp_finalize*/ - #endif -}; - -static struct __pyx_obj_5rados___pyx_scope_struct_8_set_object_locator *__pyx_freelist_5rados___pyx_scope_struct_8_set_object_locator[8]; -static int __pyx_freecount_5rados___pyx_scope_struct_8_set_object_locator = 0; - -static PyObject *__pyx_tp_new_5rados___pyx_scope_struct_8_set_object_locator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - PyObject *o; - if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_5rados___pyx_scope_struct_8_set_object_locator > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5rados___pyx_scope_struct_8_set_object_locator)))) { - o = (PyObject*)__pyx_freelist_5rados___pyx_scope_struct_8_set_object_locator[--__pyx_freecount_5rados___pyx_scope_struct_8_set_object_locator]; - memset(o, 0, sizeof(struct __pyx_obj_5rados___pyx_scope_struct_8_set_object_locator)); - (void) PyObject_INIT(o, t); - PyObject_GC_Track(o); - } else { - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - } - return o; -} - -static void __pyx_tp_dealloc_5rados___pyx_scope_struct_8_set_object_locator(PyObject *o) { - struct __pyx_obj_5rados___pyx_scope_struct_8_set_object_locator *p = (struct __pyx_obj_5rados___pyx_scope_struct_8_set_object_locator *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_func); - if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_5rados___pyx_scope_struct_8_set_object_locator < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5rados___pyx_scope_struct_8_set_object_locator)))) { - __pyx_freelist_5rados___pyx_scope_struct_8_set_object_locator[__pyx_freecount_5rados___pyx_scope_struct_8_set_object_locator++] = ((struct __pyx_obj_5rados___pyx_scope_struct_8_set_object_locator *)o); - } else { - (*Py_TYPE(o)->tp_free)(o); - } -} - -static int __pyx_tp_traverse_5rados___pyx_scope_struct_8_set_object_locator(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_5rados___pyx_scope_struct_8_set_object_locator *p = (struct __pyx_obj_5rados___pyx_scope_struct_8_set_object_locator *)o; - if (p->__pyx_v_func) { - e = (*v)(p->__pyx_v_func, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_5rados___pyx_scope_struct_8_set_object_locator(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_5rados___pyx_scope_struct_8_set_object_locator *p = (struct __pyx_obj_5rados___pyx_scope_struct_8_set_object_locator *)o; - tmp = ((PyObject*)p->__pyx_v_func); - p->__pyx_v_func = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyTypeObject __pyx_type_5rados___pyx_scope_struct_8_set_object_locator = { - PyVarObject_HEAD_INIT(0, 0) - "rados.__pyx_scope_struct_8_set_object_locator", /*tp_name*/ - sizeof(struct __pyx_obj_5rados___pyx_scope_struct_8_set_object_locator), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_5rados___pyx_scope_struct_8_set_object_locator, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_5rados___pyx_scope_struct_8_set_object_locator, /*tp_traverse*/ - __pyx_tp_clear_5rados___pyx_scope_struct_8_set_object_locator, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_5rados___pyx_scope_struct_8_set_object_locator, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - 0, /*tp_finalize*/ - #endif -}; - -static struct __pyx_obj_5rados___pyx_scope_struct_9_set_object_namespace *__pyx_freelist_5rados___pyx_scope_struct_9_set_object_namespace[8]; -static int __pyx_freecount_5rados___pyx_scope_struct_9_set_object_namespace = 0; - -static PyObject *__pyx_tp_new_5rados___pyx_scope_struct_9_set_object_namespace(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - PyObject *o; - if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_5rados___pyx_scope_struct_9_set_object_namespace > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5rados___pyx_scope_struct_9_set_object_namespace)))) { - o = (PyObject*)__pyx_freelist_5rados___pyx_scope_struct_9_set_object_namespace[--__pyx_freecount_5rados___pyx_scope_struct_9_set_object_namespace]; - memset(o, 0, sizeof(struct __pyx_obj_5rados___pyx_scope_struct_9_set_object_namespace)); - (void) PyObject_INIT(o, t); - PyObject_GC_Track(o); - } else { - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - } - return o; -} - -static void __pyx_tp_dealloc_5rados___pyx_scope_struct_9_set_object_namespace(PyObject *o) { - struct __pyx_obj_5rados___pyx_scope_struct_9_set_object_namespace *p = (struct __pyx_obj_5rados___pyx_scope_struct_9_set_object_namespace *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_func); - if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_5rados___pyx_scope_struct_9_set_object_namespace < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5rados___pyx_scope_struct_9_set_object_namespace)))) { - __pyx_freelist_5rados___pyx_scope_struct_9_set_object_namespace[__pyx_freecount_5rados___pyx_scope_struct_9_set_object_namespace++] = ((struct __pyx_obj_5rados___pyx_scope_struct_9_set_object_namespace *)o); - } else { - (*Py_TYPE(o)->tp_free)(o); - } -} - -static int __pyx_tp_traverse_5rados___pyx_scope_struct_9_set_object_namespace(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_5rados___pyx_scope_struct_9_set_object_namespace *p = (struct __pyx_obj_5rados___pyx_scope_struct_9_set_object_namespace *)o; - if (p->__pyx_v_func) { - e = (*v)(p->__pyx_v_func, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_5rados___pyx_scope_struct_9_set_object_namespace(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_5rados___pyx_scope_struct_9_set_object_namespace *p = (struct __pyx_obj_5rados___pyx_scope_struct_9_set_object_namespace *)o; - tmp = ((PyObject*)p->__pyx_v_func); - p->__pyx_v_func = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyTypeObject __pyx_type_5rados___pyx_scope_struct_9_set_object_namespace = { - PyVarObject_HEAD_INIT(0, 0) - "rados.__pyx_scope_struct_9_set_object_namespace", /*tp_name*/ - sizeof(struct __pyx_obj_5rados___pyx_scope_struct_9_set_object_namespace), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_5rados___pyx_scope_struct_9_set_object_namespace, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_5rados___pyx_scope_struct_9_set_object_namespace, /*tp_traverse*/ - __pyx_tp_clear_5rados___pyx_scope_struct_9_set_object_namespace, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_5rados___pyx_scope_struct_9_set_object_namespace, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - 0, /*tp_finalize*/ - #endif -}; - -static PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; - -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - #if PY_VERSION_HEX < 0x03020000 - { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, - #else - PyModuleDef_HEAD_INIT, - #endif - "rados", - __pyx_k_This_module_is_a_thin_wrapper_a, /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif - -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_n_s_ADMIN_AUID, __pyx_k_ADMIN_AUID, sizeof(__pyx_k_ADMIN_AUID), 0, 0, 1, 1}, - {&__pyx_n_s_ANONYMOUS_AUID, __pyx_k_ANONYMOUS_AUID, sizeof(__pyx_k_ANONYMOUS_AUID), 0, 0, 1, 1}, - {&__pyx_n_s_CEPH_ARGS, __pyx_k_CEPH_ARGS, sizeof(__pyx_k_CEPH_ARGS), 0, 0, 1, 1}, - {&__pyx_n_s_Error, __pyx_k_Error, sizeof(__pyx_k_Error), 0, 0, 1, 1}, - {&__pyx_kp_s_Error_class_derived_from_Except, __pyx_k_Error_class_derived_from_Except, sizeof(__pyx_k_Error_class_derived_from_Except), 0, 0, 1, 0}, - {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1}, - {&__pyx_kp_s_Failed_to_create_snap_s, __pyx_k_Failed_to_create_snap_s, sizeof(__pyx_k_Failed_to_create_snap_s), 0, 0, 1, 0}, - {&__pyx_kp_s_Failed_to_delete_key_r_xattr_r, __pyx_k_Failed_to_delete_key_r_xattr_r, sizeof(__pyx_k_Failed_to_delete_key_r_xattr_r), 0, 0, 1, 0}, - {&__pyx_kp_s_Failed_to_get_rados_xattrs_for_o, __pyx_k_Failed_to_get_rados_xattrs_for_o, sizeof(__pyx_k_Failed_to_get_rados_xattrs_for_o), 0, 0, 1, 0}, - {&__pyx_kp_s_Failed_to_get_xattr_r, __pyx_k_Failed_to_get_xattr_r, sizeof(__pyx_k_Failed_to_get_xattr_r), 0, 0, 1, 0}, - {&__pyx_kp_s_Failed_to_lookup_snap_s, __pyx_k_Failed_to_lookup_snap_s, sizeof(__pyx_k_Failed_to_lookup_snap_s), 0, 0, 1, 0}, - {&__pyx_kp_s_Failed_to_operate_read_op_for_oi, __pyx_k_Failed_to_operate_read_op_for_oi, sizeof(__pyx_k_Failed_to_operate_read_op_for_oi), 0, 0, 1, 0}, - {&__pyx_kp_s_Failed_to_operate_write_op_for_o, __pyx_k_Failed_to_operate_write_op_for_o, sizeof(__pyx_k_Failed_to_operate_write_op_for_o), 0, 0, 1, 0}, - {&__pyx_kp_s_Failed_to_remove_s, __pyx_k_Failed_to_remove_s, sizeof(__pyx_k_Failed_to_remove_s), 0, 0, 1, 0}, - {&__pyx_kp_s_Failed_to_remove_snap_s, __pyx_k_Failed_to_remove_snap_s, sizeof(__pyx_k_Failed_to_remove_snap_s), 0, 0, 1, 0}, - {&__pyx_kp_s_Failed_to_rollback_s, __pyx_k_Failed_to_rollback_s, sizeof(__pyx_k_Failed_to_rollback_s), 0, 0, 1, 0}, - {&__pyx_kp_s_Failed_to_set_xattr_r, __pyx_k_Failed_to_set_xattr_r, sizeof(__pyx_k_Failed_to_set_xattr_r), 0, 0, 1, 0}, - {&__pyx_kp_s_Failed_to_stat_r, __pyx_k_Failed_to_stat_r, sizeof(__pyx_k_Failed_to_stat_r), 0, 0, 1, 0}, - {&__pyx_kp_s_For_watching_cluster_log_messag, __pyx_k_For_watching_cluster_log_messag, sizeof(__pyx_k_For_watching_cluster_log_messag), 0, 0, 1, 0}, - {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1}, - {&__pyx_kp_s_IOError_class_derived_from_Erro, __pyx_k_IOError_class_derived_from_Erro, sizeof(__pyx_k_IOError_class_derived_from_Erro), 0, 0, 1, 0}, - {&__pyx_n_s_IncompleteWriteError, __pyx_k_IncompleteWriteError, sizeof(__pyx_k_IncompleteWriteError), 0, 0, 1, 1}, - {&__pyx_kp_s_IncompleteWriteError_class_deri, __pyx_k_IncompleteWriteError_class_deri, sizeof(__pyx_k_IncompleteWriteError_class_deri), 0, 0, 1, 0}, - {&__pyx_n_s_InterruptedOrTimeoutError, __pyx_k_InterruptedOrTimeoutError, sizeof(__pyx_k_InterruptedOrTimeoutError), 0, 0, 1, 1}, - {&__pyx_kp_s_InterruptedOrTimeoutError_class, __pyx_k_InterruptedOrTimeoutError_class, sizeof(__pyx_k_InterruptedOrTimeoutError_class), 0, 0, 1, 0}, - {&__pyx_n_s_InvalidArgument, __pyx_k_InvalidArgument, sizeof(__pyx_k_InvalidArgument), 0, 0, 1, 1}, - {&__pyx_n_s_IoctxStateError, __pyx_k_IoctxStateError, sizeof(__pyx_k_IoctxStateError), 0, 0, 1, 1}, - {&__pyx_kp_s_IoctxStateError_class_derived_f, __pyx_k_IoctxStateError_class_derived_f, sizeof(__pyx_k_IoctxStateError_class_derived_f), 0, 0, 1, 0}, - {&__pyx_kp_s_Ioctx_append_s_failed_to_append, __pyx_k_Ioctx_append_s_failed_to_append, sizeof(__pyx_k_Ioctx_append_s_failed_to_append), 0, 0, 1, 0}, - {&__pyx_kp_s_Ioctx_append_s_rados_append_retu, __pyx_k_Ioctx_append_s_rados_append_retu, sizeof(__pyx_k_Ioctx_append_s_rados_append_retu), 0, 0, 1, 0}, - {&__pyx_kp_s_Ioctx_get_stats_s_get_stats_fail, __pyx_k_Ioctx_get_stats_s_get_stats_fail, sizeof(__pyx_k_Ioctx_get_stats_s_get_stats_fail), 0, 0, 1, 0}, - {&__pyx_kp_s_Ioctx_rados_lock_exclusive_s_fai, __pyx_k_Ioctx_rados_lock_exclusive_s_fai, sizeof(__pyx_k_Ioctx_rados_lock_exclusive_s_fai), 0, 0, 1, 0}, - {&__pyx_kp_s_Ioctx_read_s_failed_to_read_s, __pyx_k_Ioctx_read_s_failed_to_read_s, sizeof(__pyx_k_Ioctx_read_s_failed_to_read_s), 0, 0, 1, 0}, - {&__pyx_kp_s_Ioctx_trunc_s_failed_to_truncate, __pyx_k_Ioctx_trunc_s_failed_to_truncate, sizeof(__pyx_k_Ioctx_trunc_s_failed_to_truncate), 0, 0, 1, 0}, - {&__pyx_kp_s_Ioctx_write_full_s_failed_to_wri, __pyx_k_Ioctx_write_full_s_failed_to_wri, sizeof(__pyx_k_Ioctx_write_full_s_failed_to_wri), 0, 0, 1, 0}, - {&__pyx_kp_s_Ioctx_write_full_s_rados_write_f, __pyx_k_Ioctx_write_full_s_rados_write_f, sizeof(__pyx_k_Ioctx_write_full_s_rados_write_f), 0, 0, 1, 0}, - {&__pyx_kp_s_Ioctx_write_s_failed_to_write_s, __pyx_k_Ioctx_write_s_failed_to_write_s, sizeof(__pyx_k_Ioctx_write_s_failed_to_write_s), 0, 0, 1, 0}, - {&__pyx_kp_s_Ioctx_write_s_rados_write_return, __pyx_k_Ioctx_write_s_rados_write_return, sizeof(__pyx_k_Ioctx_write_s_rados_write_return), 0, 0, 1, 0}, - {&__pyx_n_s_LIBRADOS_ALL_NSPACES, __pyx_k_LIBRADOS_ALL_NSPACES, sizeof(__pyx_k_LIBRADOS_ALL_NSPACES), 0, 0, 1, 1}, - {&__pyx_n_s_LIBRADOS_OPERATION_BALANCE_READS, __pyx_k_LIBRADOS_OPERATION_BALANCE_READS, sizeof(__pyx_k_LIBRADOS_OPERATION_BALANCE_READS), 0, 0, 1, 1}, - {&__pyx_n_s_LIBRADOS_OPERATION_IGNORE_CACHE, __pyx_k_LIBRADOS_OPERATION_IGNORE_CACHE, sizeof(__pyx_k_LIBRADOS_OPERATION_IGNORE_CACHE), 0, 0, 1, 1}, - {&__pyx_n_s_LIBRADOS_OPERATION_IGNORE_OVERLA, __pyx_k_LIBRADOS_OPERATION_IGNORE_OVERLA, sizeof(__pyx_k_LIBRADOS_OPERATION_IGNORE_OVERLA), 0, 0, 1, 1}, - {&__pyx_n_s_LIBRADOS_OPERATION_LOCALIZE_READ, __pyx_k_LIBRADOS_OPERATION_LOCALIZE_READ, sizeof(__pyx_k_LIBRADOS_OPERATION_LOCALIZE_READ), 0, 0, 1, 1}, - {&__pyx_n_s_LIBRADOS_OPERATION_NOFLAG, __pyx_k_LIBRADOS_OPERATION_NOFLAG, sizeof(__pyx_k_LIBRADOS_OPERATION_NOFLAG), 0, 0, 1, 1}, - {&__pyx_n_s_LIBRADOS_OPERATION_ORDER_READS_W, __pyx_k_LIBRADOS_OPERATION_ORDER_READS_W, sizeof(__pyx_k_LIBRADOS_OPERATION_ORDER_READS_W), 0, 0, 1, 1}, - {&__pyx_n_s_LIBRADOS_OPERATION_SKIPRWLOCKS, __pyx_k_LIBRADOS_OPERATION_SKIPRWLOCKS, sizeof(__pyx_k_LIBRADOS_OPERATION_SKIPRWLOCKS), 0, 0, 1, 1}, - {&__pyx_n_s_LIBRADOS_OP_FLAG_EXCL, __pyx_k_LIBRADOS_OP_FLAG_EXCL, sizeof(__pyx_k_LIBRADOS_OP_FLAG_EXCL), 0, 0, 1, 1}, - {&__pyx_n_s_LIBRADOS_OP_FLAG_FADVISE_DONTNEE, __pyx_k_LIBRADOS_OP_FLAG_FADVISE_DONTNEE, sizeof(__pyx_k_LIBRADOS_OP_FLAG_FADVISE_DONTNEE), 0, 0, 1, 1}, - {&__pyx_n_s_LIBRADOS_OP_FLAG_FADVISE_NOCACHE, __pyx_k_LIBRADOS_OP_FLAG_FADVISE_NOCACHE, sizeof(__pyx_k_LIBRADOS_OP_FLAG_FADVISE_NOCACHE), 0, 0, 1, 1}, - {&__pyx_n_s_LIBRADOS_OP_FLAG_FADVISE_RANDOM, __pyx_k_LIBRADOS_OP_FLAG_FADVISE_RANDOM, sizeof(__pyx_k_LIBRADOS_OP_FLAG_FADVISE_RANDOM), 0, 0, 1, 1}, - {&__pyx_n_s_LIBRADOS_OP_FLAG_FADVISE_SEQUENT, __pyx_k_LIBRADOS_OP_FLAG_FADVISE_SEQUENT, sizeof(__pyx_k_LIBRADOS_OP_FLAG_FADVISE_SEQUENT), 0, 0, 1, 1}, - {&__pyx_n_s_LIBRADOS_OP_FLAG_FADVISE_WILLNEE, __pyx_k_LIBRADOS_OP_FLAG_FADVISE_WILLNEE, sizeof(__pyx_k_LIBRADOS_OP_FLAG_FADVISE_WILLNEE), 0, 0, 1, 1}, - {&__pyx_n_s_LIBRADOS_OP_FLAG_FAILOK, __pyx_k_LIBRADOS_OP_FLAG_FAILOK, sizeof(__pyx_k_LIBRADOS_OP_FLAG_FAILOK), 0, 0, 1, 1}, - {&__pyx_n_s_LIBRADOS_SNAP_HEAD, __pyx_k_LIBRADOS_SNAP_HEAD, sizeof(__pyx_k_LIBRADOS_SNAP_HEAD), 0, 0, 1, 1}, - {&__pyx_n_s_Lock, __pyx_k_Lock, sizeof(__pyx_k_Lock), 0, 0, 1, 1}, - {&__pyx_n_s_LogicError, __pyx_k_LogicError, sizeof(__pyx_k_LogicError), 0, 0, 1, 1}, - {&__pyx_n_s_MONITOR_LEVELS, __pyx_k_MONITOR_LEVELS, sizeof(__pyx_k_MONITOR_LEVELS), 0, 0, 1, 1}, - {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, - {&__pyx_n_s_MonitorLog, __pyx_k_MonitorLog, sizeof(__pyx_k_MonitorLog), 0, 0, 1, 1}, - {&__pyx_n_s_MonitorLog___init, __pyx_k_MonitorLog___init, sizeof(__pyx_k_MonitorLog___init), 0, 0, 1, 1}, - {&__pyx_kp_s_Namespace_not_set_properly_in_co, __pyx_k_Namespace_not_set_properly_in_co, sizeof(__pyx_k_Namespace_not_set_properly_in_co), 0, 0, 1, 0}, - {&__pyx_n_s_NoData, __pyx_k_NoData, sizeof(__pyx_k_NoData), 0, 0, 1, 1}, - {&__pyx_kp_s_NoData_class_derived_from_Error, __pyx_k_NoData_class_derived_from_Error, sizeof(__pyx_k_NoData_class_derived_from_Error), 0, 0, 1, 0}, - {&__pyx_n_s_NoSpace, __pyx_k_NoSpace, sizeof(__pyx_k_NoSpace), 0, 0, 1, 1}, - {&__pyx_kp_s_NoSpace_class_derived_from_Erro, __pyx_k_NoSpace_class_derived_from_Erro, sizeof(__pyx_k_NoSpace_class_derived_from_Erro), 0, 0, 1, 0}, - {&__pyx_n_s_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 0, 1, 1}, - {&__pyx_n_s_Object, __pyx_k_Object, sizeof(__pyx_k_Object), 0, 0, 1, 1}, - {&__pyx_n_s_ObjectBusy, __pyx_k_ObjectBusy, sizeof(__pyx_k_ObjectBusy), 0, 0, 1, 1}, - {&__pyx_kp_s_ObjectBusy_class_derived_from_E, __pyx_k_ObjectBusy_class_derived_from_E, sizeof(__pyx_k_ObjectBusy_class_derived_from_E), 0, 0, 1, 0}, - {&__pyx_n_s_ObjectExists, __pyx_k_ObjectExists, sizeof(__pyx_k_ObjectExists), 0, 0, 1, 1}, - {&__pyx_kp_s_ObjectExists_class_derived_from, __pyx_k_ObjectExists_class_derived_from, sizeof(__pyx_k_ObjectExists_class_derived_from), 0, 0, 1, 0}, - {&__pyx_n_s_ObjectNotFound, __pyx_k_ObjectNotFound, sizeof(__pyx_k_ObjectNotFound), 0, 0, 1, 1}, - {&__pyx_kp_s_ObjectNotFound_class_derived_fr, __pyx_k_ObjectNotFound_class_derived_fr, sizeof(__pyx_k_ObjectNotFound_class_derived_fr), 0, 0, 1, 0}, - {&__pyx_n_s_ObjectStateError, __pyx_k_ObjectStateError, sizeof(__pyx_k_ObjectStateError), 0, 0, 1, 1}, - {&__pyx_kp_s_ObjectStateError_class_derived, __pyx_k_ObjectStateError_class_derived, sizeof(__pyx_k_ObjectStateError_class_derived), 0, 0, 1, 0}, - {&__pyx_n_s_Object___init, __pyx_k_Object___init, sizeof(__pyx_k_Object___init), 0, 0, 1, 1}, - {&__pyx_n_s_Object___str, __pyx_k_Object___str, sizeof(__pyx_k_Object___str), 0, 0, 1, 1}, - {&__pyx_n_s_Object_get_xattr, __pyx_k_Object_get_xattr, sizeof(__pyx_k_Object_get_xattr), 0, 0, 1, 1}, - {&__pyx_n_s_Object_get_xattrs, __pyx_k_Object_get_xattrs, sizeof(__pyx_k_Object_get_xattrs), 0, 0, 1, 1}, - {&__pyx_n_s_Object_read, __pyx_k_Object_read, sizeof(__pyx_k_Object_read), 0, 0, 1, 1}, - {&__pyx_n_s_Object_remove, __pyx_k_Object_remove, sizeof(__pyx_k_Object_remove), 0, 0, 1, 1}, - {&__pyx_n_s_Object_require_object_exists, __pyx_k_Object_require_object_exists, sizeof(__pyx_k_Object_require_object_exists), 0, 0, 1, 1}, - {&__pyx_n_s_Object_rm_xattr, __pyx_k_Object_rm_xattr, sizeof(__pyx_k_Object_rm_xattr), 0, 0, 1, 1}, - {&__pyx_n_s_Object_seek, __pyx_k_Object_seek, sizeof(__pyx_k_Object_seek), 0, 0, 1, 1}, - {&__pyx_n_s_Object_set_xattr, __pyx_k_Object_set_xattr, sizeof(__pyx_k_Object_set_xattr), 0, 0, 1, 1}, - {&__pyx_n_s_Object_stat, __pyx_k_Object_stat, sizeof(__pyx_k_Object_stat), 0, 0, 1, 1}, - {&__pyx_n_s_Object_write, __pyx_k_Object_write, sizeof(__pyx_k_Object_write), 0, 0, 1, 1}, - {&__pyx_n_s_OpCtx, __pyx_k_OpCtx, sizeof(__pyx_k_OpCtx), 0, 0, 1, 1}, - {&__pyx_n_s_OpCtx___enter, __pyx_k_OpCtx___enter, sizeof(__pyx_k_OpCtx___enter), 0, 0, 1, 1}, - {&__pyx_n_s_OpCtx___exit, __pyx_k_OpCtx___exit, sizeof(__pyx_k_OpCtx___exit), 0, 0, 1, 1}, - {&__pyx_n_s_PermissionDeniedError, __pyx_k_PermissionDeniedError, sizeof(__pyx_k_PermissionDeniedError), 0, 0, 1, 1}, - {&__pyx_n_s_PermissionError, __pyx_k_PermissionError, sizeof(__pyx_k_PermissionError), 0, 0, 1, 1}, - {&__pyx_kp_s_PermissionError_class_derived_f, __pyx_k_PermissionError_class_derived_f, sizeof(__pyx_k_PermissionError_class_derived_f), 0, 0, 1, 0}, - {&__pyx_n_s_RadosStateError, __pyx_k_RadosStateError, sizeof(__pyx_k_RadosStateError), 0, 0, 1, 1}, - {&__pyx_kp_s_RadosStateError_class_derived_f, __pyx_k_RadosStateError_class_derived_f, sizeof(__pyx_k_RadosStateError_class_derived_f), 0, 0, 1, 0}, - {&__pyx_kp_s_Rados_can_t_supply_both_rados_id, __pyx_k_Rados_can_t_supply_both_rados_id, sizeof(__pyx_k_Rados_can_t_supply_both_rados_id), 0, 0, 1, 0}, - {&__pyx_kp_s_Rados_get_cluster_stats_s_get_st, __pyx_k_Rados_get_cluster_stats_s_get_st, sizeof(__pyx_k_Rados_get_cluster_stats_s_get_st), 0, 0, 1, 0}, - {&__pyx_kp_s_Rados_keys_and_values_must_have, __pyx_k_Rados_keys_and_values_must_have, sizeof(__pyx_k_Rados_keys_and_values_must_have), 0, 0, 1, 0}, - {&__pyx_kp_s_Rados_object_wrapper_makes_the_o, __pyx_k_Rados_object_wrapper_makes_the_o, sizeof(__pyx_k_Rados_object_wrapper_makes_the_o), 0, 0, 1, 0}, - {&__pyx_n_s_ReadOpCtx, __pyx_k_ReadOpCtx, sizeof(__pyx_k_ReadOpCtx), 0, 0, 1, 1}, - {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1}, - {&__pyx_kp_s_The_object_is_s, __pyx_k_The_object_is_s, sizeof(__pyx_k_The_object_is_s), 0, 0, 1, 0}, - {&__pyx_kp_s_The_pool_is_s, __pyx_k_The_pool_is_s, sizeof(__pyx_k_The_pool_is_s), 0, 0, 1, 0}, - {&__pyx_n_s_TimedOut, __pyx_k_TimedOut, sizeof(__pyx_k_TimedOut), 0, 0, 1, 1}, - {&__pyx_kp_s_TimedOut_class_derived_from_Err, __pyx_k_TimedOut_class_derived_from_Err, sizeof(__pyx_k_TimedOut_class_derived_from_Err), 0, 0, 1, 0}, - {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, - {&__pyx_n_s_Version, __pyx_k_Version, sizeof(__pyx_k_Version), 0, 0, 1, 1}, - {&__pyx_n_s_Version___init, __pyx_k_Version___init, sizeof(__pyx_k_Version___init), 0, 0, 1, 1}, - {&__pyx_n_s_Version___str, __pyx_k_Version___str, sizeof(__pyx_k_Version___str), 0, 0, 1, 1}, - {&__pyx_kp_s_Version_information, __pyx_k_Version_information, sizeof(__pyx_k_Version_information), 0, 0, 1, 0}, - {&__pyx_n_s_WriteOpCtx, __pyx_k_WriteOpCtx, sizeof(__pyx_k_WriteOpCtx), 0, 0, 1, 1}, - {&__pyx_kp_s_You_cannot_perform_that_operatio, __pyx_k_You_cannot_perform_that_operatio, sizeof(__pyx_k_You_cannot_perform_that_operatio), 0, 0, 1, 0}, - {&__pyx_kp_s__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 0, 1, 0}, - {&__pyx_kp_s__28, __pyx_k__28, sizeof(__pyx_k__28), 0, 0, 1, 0}, - {&__pyx_n_s_aio_read_locals_oncomplete, __pyx_k_aio_read_locals_oncomplete, sizeof(__pyx_k_aio_read_locals_oncomplete), 0, 0, 1, 1}, - {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, - {&__pyx_n_s_arg, __pyx_k_arg, sizeof(__pyx_k_arg), 0, 0, 1, 1}, - {&__pyx_n_s_arg_name, __pyx_k_arg_name, sizeof(__pyx_k_arg_name), 0, 0, 1, 1}, - {&__pyx_n_s_arg_type, __pyx_k_arg_type, sizeof(__pyx_k_arg_type), 0, 0, 1, 1}, - {&__pyx_n_s_arg_val, __pyx_k_arg_val, sizeof(__pyx_k_arg_val), 0, 0, 1, 1}, - {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, - {&__pyx_n_s_auid, __pyx_k_auid, sizeof(__pyx_k_auid), 0, 0, 1, 1}, - {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, - {&__pyx_n_s_callback, __pyx_k_callback, sizeof(__pyx_k_callback), 0, 0, 1, 1}, - {&__pyx_kp_s_callback_must_be_a_callable_func, __pyx_k_callback_must_be_a_callable_func, sizeof(__pyx_k_callback_must_be_a_callable_func), 0, 0, 1, 0}, - {&__pyx_n_s_chain, __pyx_k_chain, sizeof(__pyx_k_chain), 0, 0, 1, 1}, - {&__pyx_n_s_check_type, __pyx_k_check_type, sizeof(__pyx_k_check_type), 0, 0, 1, 1}, - {&__pyx_kp_s_class_derived_from_Error, __pyx_k_class_derived_from_Error, sizeof(__pyx_k_class_derived_from_Error), 0, 0, 1, 0}, - {&__pyx_n_s_cleanup, __pyx_k_cleanup, sizeof(__pyx_k_cleanup), 0, 0, 1, 1}, - {&__pyx_n_s_clear_omap, __pyx_k_clear_omap, sizeof(__pyx_k_clear_omap), 0, 0, 1, 1}, - {&__pyx_kp_s_client, __pyx_k_client, sizeof(__pyx_k_client), 0, 0, 1, 0}, - {&__pyx_n_s_client_address, __pyx_k_client_address, sizeof(__pyx_k_client_address), 0, 0, 1, 1}, - {&__pyx_kp_s_client_admin, __pyx_k_client_admin, sizeof(__pyx_k_client_admin), 0, 0, 1, 0}, - {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, - {&__pyx_n_s_closed, __pyx_k_closed, sizeof(__pyx_k_closed), 0, 0, 1, 1}, - {&__pyx_n_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1}, - {&__pyx_n_s_cluster, __pyx_k_cluster, sizeof(__pyx_k_cluster), 0, 0, 1, 1}, - {&__pyx_n_s_clustername, __pyx_k_clustername, sizeof(__pyx_k_clustername), 0, 0, 1, 1}, - {&__pyx_n_s_cmd, __pyx_k_cmd, sizeof(__pyx_k_cmd), 0, 0, 1, 1}, - {&__pyx_n_s_complete, __pyx_k_complete, sizeof(__pyx_k_complete), 0, 0, 1, 1}, - {&__pyx_n_s_completion_v, __pyx_k_completion_v, sizeof(__pyx_k_completion_v), 0, 0, 1, 1}, - {&__pyx_n_s_completion_v_2, __pyx_k_completion_v_2, sizeof(__pyx_k_completion_v_2), 0, 0, 1, 1}, - {&__pyx_n_s_conf, __pyx_k_conf, sizeof(__pyx_k_conf), 0, 0, 1, 1}, - {&__pyx_n_s_conf_defaults, __pyx_k_conf_defaults, sizeof(__pyx_k_conf_defaults), 0, 0, 1, 1}, - {&__pyx_n_s_conf_get, __pyx_k_conf_get, sizeof(__pyx_k_conf_get), 0, 0, 1, 1}, - {&__pyx_n_s_conf_read_file, __pyx_k_conf_read_file, sizeof(__pyx_k_conf_read_file), 0, 0, 1, 1}, - {&__pyx_n_s_conf_set, __pyx_k_conf_set, sizeof(__pyx_k_conf_set), 0, 0, 1, 1}, - {&__pyx_n_s_conffile, __pyx_k_conffile, sizeof(__pyx_k_conffile), 0, 0, 1, 1}, - {&__pyx_n_s_configuring, __pyx_k_configuring, sizeof(__pyx_k_configuring), 0, 0, 1, 1}, - {&__pyx_n_s_connect, __pyx_k_connect, sizeof(__pyx_k_connect), 0, 0, 1, 1}, - {&__pyx_n_s_connected, __pyx_k_connected, sizeof(__pyx_k_connected), 0, 0, 1, 1}, - {&__pyx_n_s_cookie, __pyx_k_cookie, sizeof(__pyx_k_cookie), 0, 0, 1, 1}, - {&__pyx_n_s_create, __pyx_k_create, sizeof(__pyx_k_create), 0, 0, 1, 1}, - {&__pyx_n_s_create_pool, __pyx_k_create_pool, sizeof(__pyx_k_create_pool), 0, 0, 1, 1}, - {&__pyx_n_s_create_snap, __pyx_k_create_snap, sizeof(__pyx_k_create_snap), 0, 0, 1, 1}, - {&__pyx_n_s_crush_rule, __pyx_k_crush_rule, sizeof(__pyx_k_crush_rule), 0, 0, 1, 1}, - {&__pyx_n_s_cstr, __pyx_k_cstr, sizeof(__pyx_k_cstr), 0, 0, 1, 1}, - {&__pyx_n_s_cstr_list, __pyx_k_cstr_list, sizeof(__pyx_k_cstr_list), 0, 0, 1, 1}, - {&__pyx_kp_s_d_d_d, __pyx_k_d_d_d, sizeof(__pyx_k_d_d_d), 0, 0, 1, 0}, - {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, - {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1}, - {&__pyx_kp_s_deal_with_EACCES_related, __pyx_k_deal_with_EACCES_related, sizeof(__pyx_k_deal_with_EACCES_related), 0, 0, 1, 0}, - {&__pyx_n_s_debug, __pyx_k_debug, sizeof(__pyx_k_debug), 0, 0, 1, 1}, - {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, - {&__pyx_n_s_decode_cstr, __pyx_k_decode_cstr, sizeof(__pyx_k_decode_cstr), 0, 0, 1, 1}, - {&__pyx_kp_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 0}, - {&__pyx_n_s_delete_pool, __pyx_k_delete_pool, sizeof(__pyx_k_delete_pool), 0, 0, 1, 1}, - {&__pyx_n_s_desc, __pyx_k_desc, sizeof(__pyx_k_desc), 0, 0, 1, 1}, - {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, - {&__pyx_n_s_duration, __pyx_k_duration, sizeof(__pyx_k_duration), 0, 0, 1, 1}, - {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, - {&__pyx_n_s_encoding, __pyx_k_encoding, sizeof(__pyx_k_encoding), 0, 0, 1, 1}, - {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1}, - {&__pyx_n_s_err, __pyx_k_err, sizeof(__pyx_k_err), 0, 0, 1, 1}, - {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, - {&__pyx_kp_s_error_appending_object_s, __pyx_k_error_appending_object_s, sizeof(__pyx_k_error_appending_object_s), 0, 0, 1, 0}, - {&__pyx_kp_s_error_blacklisting_client_s, __pyx_k_error_blacklisting_client_s, sizeof(__pyx_k_error_blacklisting_client_s), 0, 0, 1, 0}, - {&__pyx_kp_s_error_calling_conf_get, __pyx_k_error_calling_conf_get, sizeof(__pyx_k_error_calling_conf_get), 0, 0, 1, 0}, - {&__pyx_kp_s_error_calling_conf_parse_argv_re, __pyx_k_error_calling_conf_parse_argv_re, sizeof(__pyx_k_error_calling_conf_parse_argv_re), 0, 0, 1, 0}, - {&__pyx_kp_s_error_calling_conf_parse_env, __pyx_k_error_calling_conf_parse_env, sizeof(__pyx_k_error_calling_conf_parse_env), 0, 0, 1, 0}, - {&__pyx_kp_s_error_calling_conf_read_file, __pyx_k_error_calling_conf_read_file, sizeof(__pyx_k_error_calling_conf_read_file), 0, 0, 1, 0}, - {&__pyx_kp_s_error_calling_conf_set, __pyx_k_error_calling_conf_set, sizeof(__pyx_k_error_calling_conf_set), 0, 0, 1, 0}, - {&__pyx_kp_s_error_calling_inconsistent_pg_li, __pyx_k_error_calling_inconsistent_pg_li, sizeof(__pyx_k_error_calling_inconsistent_pg_li), 0, 0, 1, 0}, - {&__pyx_kp_s_error_calling_ping_monitor, __pyx_k_error_calling_ping_monitor, sizeof(__pyx_k_error_calling_ping_monitor), 0, 0, 1, 0}, - {&__pyx_kp_s_error_calling_rados_monitor_log, __pyx_k_error_calling_rados_monitor_log, sizeof(__pyx_k_error_calling_rados_monitor_log), 0, 0, 1, 0}, - {&__pyx_kp_s_error_calling_rados_snap_list_fo, __pyx_k_error_calling_rados_snap_list_fo, sizeof(__pyx_k_error_calling_rados_snap_list_fo), 0, 0, 1, 0}, - {&__pyx_kp_s_error_changing_auid_of_s_to_d, __pyx_k_error_changing_auid_of_s_to_d, sizeof(__pyx_k_error_changing_auid_of_s_to_d), 0, 0, 1, 0}, - {&__pyx_kp_s_error_code_d, __pyx_k_error_code_d, sizeof(__pyx_k_error_code_d), 0, 0, 1, 0}, - {&__pyx_kp_s_error_connecting_to_the_cluster, __pyx_k_error_connecting_to_the_cluster, sizeof(__pyx_k_error_connecting_to_the_cluster), 0, 0, 1, 0}, - {&__pyx_kp_s_error_creating_pool_s, __pyx_k_error_creating_pool_s, sizeof(__pyx_k_error_creating_pool_s), 0, 0, 1, 0}, - {&__pyx_kp_s_error_deleting_pool_s, __pyx_k_error_deleting_pool_s, sizeof(__pyx_k_error_deleting_pool_s), 0, 0, 1, 0}, - {&__pyx_kp_s_error_flushing, __pyx_k_error_flushing, sizeof(__pyx_k_error_flushing), 0, 0, 1, 0}, - {&__pyx_kp_s_error_getting_a_completion, __pyx_k_error_getting_a_completion, sizeof(__pyx_k_error_getting_a_completion), 0, 0, 1, 0}, - {&__pyx_kp_s_error_getting_cluster_fsid, __pyx_k_error_getting_cluster_fsid, sizeof(__pyx_k_error_getting_cluster_fsid), 0, 0, 1, 0}, - {&__pyx_kp_s_error_iterating_over_the_extende, __pyx_k_error_iterating_over_the_extende, sizeof(__pyx_k_error_iterating_over_the_extende), 0, 0, 1, 0}, - {&__pyx_kp_s_error_iterating_over_the_objects, __pyx_k_error_iterating_over_the_objects, sizeof(__pyx_k_error_iterating_over_the_objects), 0, 0, 1, 0}, - {&__pyx_kp_s_error_iterating_over_the_omap, __pyx_k_error_iterating_over_the_omap, sizeof(__pyx_k_error_iterating_over_the_omap), 0, 0, 1, 0}, - {&__pyx_kp_s_error_looking_up_pool_s, __pyx_k_error_looking_up_pool_s, sizeof(__pyx_k_error_looking_up_pool_s), 0, 0, 1, 0}, - {&__pyx_kp_s_error_opening_pool_s, __pyx_k_error_opening_pool_s, sizeof(__pyx_k_error_opening_pool_s), 0, 0, 1, 0}, - {&__pyx_kp_s_error_reading_s, __pyx_k_error_reading_s, sizeof(__pyx_k_error_reading_s), 0, 0, 1, 0}, - {&__pyx_kp_s_error_removing_s, __pyx_k_error_removing_s, sizeof(__pyx_k_error_removing_s), 0, 0, 1, 0}, - {&__pyx_kp_s_error_reverse_looking_up_pool_s, __pyx_k_error_reverse_looking_up_pool_s, sizeof(__pyx_k_error_reverse_looking_up_pool_s), 0, 0, 1, 0}, - {&__pyx_kp_s_error_writing_object_s, __pyx_k_error_writing_object_s, sizeof(__pyx_k_error_writing_object_s), 0, 0, 1, 0}, - {&__pyx_n_s_execute, __pyx_k_execute, sizeof(__pyx_k_execute), 0, 0, 1, 1}, - {&__pyx_n_s_exists, __pyx_k_exists, sizeof(__pyx_k_exists), 0, 0, 1, 1}, - {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, - {&__pyx_n_s_expire_seconds, __pyx_k_expire_seconds, sizeof(__pyx_k_expire_seconds), 0, 0, 1, 1}, - {&__pyx_n_s_extra, __pyx_k_extra, sizeof(__pyx_k_extra), 0, 0, 1, 1}, - {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1}, - {&__pyx_n_s_filter_prefix, __pyx_k_filter_prefix, sizeof(__pyx_k_filter_prefix), 0, 0, 1, 1}, - {&__pyx_n_s_flag, __pyx_k_flag, sizeof(__pyx_k_flag), 0, 0, 1, 1}, - {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, - {&__pyx_n_s_fromtimestamp, __pyx_k_fromtimestamp, sizeof(__pyx_k_fromtimestamp), 0, 0, 1, 1}, - {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1}, - {&__pyx_n_s_functools, __pyx_k_functools, sizeof(__pyx_k_functools), 0, 0, 1, 1}, - {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1}, - {&__pyx_n_s_get_completion, __pyx_k_get_completion, sizeof(__pyx_k_get_completion), 0, 0, 1, 1}, - {&__pyx_n_s_get_inconsistent_pgs, __pyx_k_get_inconsistent_pgs, sizeof(__pyx_k_get_inconsistent_pgs), 0, 0, 1, 1}, - {&__pyx_n_s_get_locator_key, __pyx_k_get_locator_key, sizeof(__pyx_k_get_locator_key), 0, 0, 1, 1}, - {&__pyx_n_s_get_namespace, __pyx_k_get_namespace, sizeof(__pyx_k_get_namespace), 0, 0, 1, 1}, - {&__pyx_n_s_get_omap_keys, __pyx_k_get_omap_keys, sizeof(__pyx_k_get_omap_keys), 0, 0, 1, 1}, - {&__pyx_n_s_get_omap_vals, __pyx_k_get_omap_vals, sizeof(__pyx_k_get_omap_vals), 0, 0, 1, 1}, - {&__pyx_n_s_get_omap_vals_by_keys, __pyx_k_get_omap_vals_by_keys, sizeof(__pyx_k_get_omap_vals_by_keys), 0, 0, 1, 1}, - {&__pyx_n_s_get_pool_base_tier, __pyx_k_get_pool_base_tier, sizeof(__pyx_k_get_pool_base_tier), 0, 0, 1, 1}, - {&__pyx_kp_s_get_pool_base_tier_d, __pyx_k_get_pool_base_tier_d, sizeof(__pyx_k_get_pool_base_tier_d), 0, 0, 1, 0}, - {&__pyx_n_s_get_return_value, __pyx_k_get_return_value, sizeof(__pyx_k_get_return_value), 0, 0, 1, 1}, - {&__pyx_n_s_get_xattr, __pyx_k_get_xattr, sizeof(__pyx_k_get_xattr), 0, 0, 1, 1}, - {&__pyx_n_s_get_xattrs, __pyx_k_get_xattrs, sizeof(__pyx_k_get_xattrs), 0, 0, 1, 1}, - {&__pyx_n_s_hexversion, __pyx_k_hexversion, sizeof(__pyx_k_hexversion), 0, 0, 1, 1}, - {&__pyx_kp_s_home_ani_tryst_ceph_src_pybind, __pyx_k_home_ani_tryst_ceph_src_pybind, sizeof(__pyx_k_home_ani_tryst_ceph_src_pybind), 0, 0, 1, 0}, - {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, - {&__pyx_n_s_inbuf, __pyx_k_inbuf, sizeof(__pyx_k_inbuf), 0, 0, 1, 1}, - {&__pyx_n_s_info, __pyx_k_info, sizeof(__pyx_k_info), 0, 0, 1, 1}, - {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, - {&__pyx_kp_s_invalid_monitor_level, __pyx_k_invalid_monitor_level, sizeof(__pyx_k_invalid_monitor_level), 0, 0, 1, 0}, - {&__pyx_n_s_ioctx, __pyx_k_ioctx, sizeof(__pyx_k_ioctx), 0, 0, 1, 1}, - {&__pyx_n_s_ioctx_name, __pyx_k_ioctx_name, sizeof(__pyx_k_ioctx_name), 0, 0, 1, 1}, - {&__pyx_n_s_is_type_of, __pyx_k_is_type_of, sizeof(__pyx_k_is_type_of), 0, 0, 1, 1}, - {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, - {&__pyx_n_s_itertools, __pyx_k_itertools, sizeof(__pyx_k_itertools), 0, 0, 1, 1}, - {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, - {&__pyx_n_s_kb, __pyx_k_kb, sizeof(__pyx_k_kb), 0, 0, 1, 1}, - {&__pyx_n_s_kb_avail, __pyx_k_kb_avail, sizeof(__pyx_k_kb_avail), 0, 0, 1, 1}, - {&__pyx_n_s_kb_used, __pyx_k_kb_used, sizeof(__pyx_k_kb_used), 0, 0, 1, 1}, - {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, - {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, - {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1}, - {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1}, - {&__pyx_n_s_level, __pyx_k_level, sizeof(__pyx_k_level), 0, 0, 1, 1}, - {&__pyx_n_s_list_str, __pyx_k_list_str, sizeof(__pyx_k_list_str), 0, 0, 1, 1}, - {&__pyx_n_s_loc_key, __pyx_k_loc_key, sizeof(__pyx_k_loc_key), 0, 0, 1, 1}, - {&__pyx_n_s_localtime, __pyx_k_localtime, sizeof(__pyx_k_localtime), 0, 0, 1, 1}, - {&__pyx_n_s_locator_key, __pyx_k_locator_key, sizeof(__pyx_k_locator_key), 0, 0, 1, 1}, - {&__pyx_n_s_lock_exclusive, __pyx_k_lock_exclusive, sizeof(__pyx_k_lock_exclusive), 0, 0, 1, 1}, - {&__pyx_n_s_lock_shared, __pyx_k_lock_shared, sizeof(__pyx_k_lock_shared), 0, 0, 1, 1}, - {&__pyx_n_s_lookup_snap, __pyx_k_lookup_snap, sizeof(__pyx_k_lookup_snap), 0, 0, 1, 1}, - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_n_s_major, __pyx_k_major, sizeof(__pyx_k_major), 0, 0, 1, 1}, - {&__pyx_kp_s_malloc_failed, __pyx_k_malloc_failed, sizeof(__pyx_k_malloc_failed), 0, 0, 1, 0}, - {&__pyx_n_s_max_return, __pyx_k_max_return, sizeof(__pyx_k_max_return), 0, 0, 1, 1}, - {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, - {&__pyx_n_s_method, __pyx_k_method, sizeof(__pyx_k_method), 0, 0, 1, 1}, - {&__pyx_n_s_minor, __pyx_k_minor, sizeof(__pyx_k_minor), 0, 0, 1, 1}, - {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, - {&__pyx_n_s_mon_id, __pyx_k_mon_id, sizeof(__pyx_k_mon_id), 0, 0, 1, 1}, - {&__pyx_n_s_monitor_log, __pyx_k_monitor_log, sizeof(__pyx_k_monitor_log), 0, 0, 1, 1}, - {&__pyx_n_s_msg, __pyx_k_msg, sizeof(__pyx_k_msg), 0, 0, 1, 1}, - {&__pyx_n_s_mtime, __pyx_k_mtime, sizeof(__pyx_k_mtime), 0, 0, 1, 1}, - {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, - {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, - {&__pyx_n_s_named_args, __pyx_k_named_args, sizeof(__pyx_k_named_args), 0, 0, 1, 1}, - {&__pyx_n_s_nspace, __pyx_k_nspace, sizeof(__pyx_k_nspace), 0, 0, 1, 1}, - {&__pyx_n_s_num_bytes, __pyx_k_num_bytes, sizeof(__pyx_k_num_bytes), 0, 0, 1, 1}, - {&__pyx_n_s_num_kb, __pyx_k_num_kb, sizeof(__pyx_k_num_kb), 0, 0, 1, 1}, - {&__pyx_n_s_num_object_clones, __pyx_k_num_object_clones, sizeof(__pyx_k_num_object_clones), 0, 0, 1, 1}, - {&__pyx_n_s_num_object_copies, __pyx_k_num_object_copies, sizeof(__pyx_k_num_object_copies), 0, 0, 1, 1}, - {&__pyx_n_s_num_objects, __pyx_k_num_objects, sizeof(__pyx_k_num_objects), 0, 0, 1, 1}, - {&__pyx_n_s_num_objects_degraded, __pyx_k_num_objects_degraded, sizeof(__pyx_k_num_objects_degraded), 0, 0, 1, 1}, - {&__pyx_n_s_num_objects_missing_on_primary, __pyx_k_num_objects_missing_on_primary, sizeof(__pyx_k_num_objects_missing_on_primary), 0, 0, 1, 1}, - {&__pyx_n_s_num_objects_unfound, __pyx_k_num_objects_unfound, sizeof(__pyx_k_num_objects_unfound), 0, 0, 1, 1}, - {&__pyx_n_s_num_rd, __pyx_k_num_rd, sizeof(__pyx_k_num_rd), 0, 0, 1, 1}, - {&__pyx_n_s_num_rd_kb, __pyx_k_num_rd_kb, sizeof(__pyx_k_num_rd_kb), 0, 0, 1, 1}, - {&__pyx_n_s_num_wr, __pyx_k_num_wr, sizeof(__pyx_k_num_wr), 0, 0, 1, 1}, - {&__pyx_n_s_num_wr_kb, __pyx_k_num_wr_kb, sizeof(__pyx_k_num_wr_kb), 0, 0, 1, 1}, - {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, - {&__pyx_n_s_object_name, __pyx_k_object_name, sizeof(__pyx_k_object_name), 0, 0, 1, 1}, - {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1}, - {&__pyx_n_s_oid, __pyx_k_oid, sizeof(__pyx_k_oid), 0, 0, 1, 1}, - {&__pyx_n_s_old_locator, __pyx_k_old_locator, sizeof(__pyx_k_old_locator), 0, 0, 1, 1}, - {&__pyx_n_s_old_nspace, __pyx_k_old_nspace, sizeof(__pyx_k_old_nspace), 0, 0, 1, 1}, - {&__pyx_n_s_oncomplete, __pyx_k_oncomplete, sizeof(__pyx_k_oncomplete), 0, 0, 1, 1}, - {&__pyx_n_s_oncomplete_2, __pyx_k_oncomplete_2, sizeof(__pyx_k_oncomplete_2), 0, 0, 1, 1}, - {&__pyx_n_s_onsafe, __pyx_k_onsafe, sizeof(__pyx_k_onsafe), 0, 0, 1, 1}, - {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1}, - {&__pyx_n_s_open_ioctx, __pyx_k_open_ioctx, sizeof(__pyx_k_open_ioctx), 0, 0, 1, 1}, - {&__pyx_n_s_operate_read_op, __pyx_k_operate_read_op, sizeof(__pyx_k_operate_read_op), 0, 0, 1, 1}, - {&__pyx_n_s_operate_write_op, __pyx_k_operate_write_op, sizeof(__pyx_k_operate_write_op), 0, 0, 1, 1}, - {&__pyx_n_s_opt, __pyx_k_opt, sizeof(__pyx_k_opt), 0, 0, 1, 1}, - {&__pyx_n_s_option, __pyx_k_option, sizeof(__pyx_k_option), 0, 0, 1, 1}, - {&__pyx_kp_s_or, __pyx_k_or, sizeof(__pyx_k_or), 0, 0, 1, 0}, - {&__pyx_n_s_osdid, __pyx_k_osdid, sizeof(__pyx_k_osdid), 0, 0, 1, 1}, - {&__pyx_n_s_partial, __pyx_k_partial, sizeof(__pyx_k_partial), 0, 0, 1, 1}, - {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, - {&__pyx_n_s_pgid, __pyx_k_pgid, sizeof(__pyx_k_pgid), 0, 0, 1, 1}, - {&__pyx_n_s_pool_exists, __pyx_k_pool_exists, sizeof(__pyx_k_pool_exists), 0, 0, 1, 1}, - {&__pyx_n_s_pool_id, __pyx_k_pool_id, sizeof(__pyx_k_pool_id), 0, 0, 1, 1}, - {&__pyx_n_s_pool_lookup, __pyx_k_pool_lookup, sizeof(__pyx_k_pool_lookup), 0, 0, 1, 1}, - {&__pyx_n_s_pool_name, __pyx_k_pool_name, sizeof(__pyx_k_pool_name), 0, 0, 1, 1}, - {&__pyx_n_s_pool_reverse_lookup, __pyx_k_pool_reverse_lookup, sizeof(__pyx_k_pool_reverse_lookup), 0, 0, 1, 1}, - {&__pyx_n_s_pos_args, __pyx_k_pos_args, sizeof(__pyx_k_pos_args), 0, 0, 1, 1}, - {&__pyx_n_s_position, __pyx_k_position, sizeof(__pyx_k_position), 0, 0, 1, 1}, - {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, - {&__pyx_n_s_python2, __pyx_k_python2, sizeof(__pyx_k_python2), 0, 0, 1, 1}, - {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, - {&__pyx_n_s_rados, __pyx_k_rados, sizeof(__pyx_k_rados), 0, 0, 1, 1}, - {&__pyx_kp_s_rados_Object_ioctx_s_key_s_nspac, __pyx_k_rados_Object_ioctx_s_key_s_nspac, sizeof(__pyx_k_rados_Object_ioctx_s_key_s_nspac), 0, 0, 1, 0}, - {&__pyx_kp_s_rados_Snap_ioctx_s_name_s_snap_i, __pyx_k_rados_Snap_ioctx_s_name_s_snap_i, sizeof(__pyx_k_rados_Snap_ioctx_s_name_s_snap_i), 0, 0, 1, 0}, - {&__pyx_n_s_rados_id, __pyx_k_rados_id, sizeof(__pyx_k_rados_id), 0, 0, 1, 1}, - {&__pyx_kp_s_rados_initialize_failed_with_err, __pyx_k_rados_initialize_failed_with_err, sizeof(__pyx_k_rados_initialize_failed_with_err), 0, 0, 1, 0}, - {&__pyx_kp_s_rados_ioctx_snap_get_stamp_error, __pyx_k_rados_ioctx_snap_get_stamp_error, sizeof(__pyx_k_rados_ioctx_snap_get_stamp_error), 0, 0, 1, 0}, - {&__pyx_kp_s_rados_snap_get_name_error, __pyx_k_rados_snap_get_name_error, sizeof(__pyx_k_rados_snap_get_name_error), 0, 0, 1, 0}, - {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, - {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1}, - {&__pyx_n_s_read_op, __pyx_k_read_op, sizeof(__pyx_k_read_op), 0, 0, 1, 1}, - {&__pyx_kp_s_read_operation_context_manager, __pyx_k_read_operation_context_manager, sizeof(__pyx_k_read_operation_context_manager), 0, 0, 1, 0}, - {&__pyx_kp_s_realloc_failed, __pyx_k_realloc_failed, sizeof(__pyx_k_realloc_failed), 0, 0, 1, 0}, - {&__pyx_n_s_release, __pyx_k_release, sizeof(__pyx_k_release), 0, 0, 1, 1}, - {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1}, - {&__pyx_n_s_remove_object, __pyx_k_remove_object, sizeof(__pyx_k_remove_object), 0, 0, 1, 1}, - {&__pyx_n_s_remove_omap_keys, __pyx_k_remove_omap_keys, sizeof(__pyx_k_remove_omap_keys), 0, 0, 1, 1}, - {&__pyx_n_s_remove_snap, __pyx_k_remove_snap, sizeof(__pyx_k_remove_snap), 0, 0, 1, 1}, - {&__pyx_n_s_removed, __pyx_k_removed, sizeof(__pyx_k_removed), 0, 0, 1, 1}, - {&__pyx_n_s_require_ioctx_open, __pyx_k_require_ioctx_open, sizeof(__pyx_k_require_ioctx_open), 0, 0, 1, 1}, - {&__pyx_n_s_require_object_exists, __pyx_k_require_object_exists, sizeof(__pyx_k_require_object_exists), 0, 0, 1, 1}, - {&__pyx_n_s_require_state, __pyx_k_require_state, sizeof(__pyx_k_require_state), 0, 0, 1, 1}, - {&__pyx_n_s_requires, __pyx_k_requires, sizeof(__pyx_k_requires), 0, 0, 1, 1}, - {&__pyx_n_s_requires_locals_check_type, __pyx_k_requires_locals_check_type, sizeof(__pyx_k_requires_locals_check_type), 0, 0, 1, 1}, - {&__pyx_n_s_requires_locals_check_type_local, __pyx_k_requires_locals_check_type_local, sizeof(__pyx_k_requires_locals_check_type_local), 0, 0, 1, 1}, - {&__pyx_n_s_requires_locals_is_type_of, __pyx_k_requires_locals_is_type_of, sizeof(__pyx_k_requires_locals_is_type_of), 0, 0, 1, 1}, - {&__pyx_n_s_requires_locals_wrapper, __pyx_k_requires_locals_wrapper, sizeof(__pyx_k_requires_locals_wrapper), 0, 0, 1, 1}, - {&__pyx_n_s_requires_locals_wrapper_locals_v, __pyx_k_requires_locals_wrapper_locals_v, sizeof(__pyx_k_requires_locals_wrapper_locals_v), 0, 0, 1, 1}, - {&__pyx_n_s_requires_locals_wrapper_locals_v_2, __pyx_k_requires_locals_wrapper_locals_v_2, sizeof(__pyx_k_requires_locals_wrapper_locals_v_2), 0, 0, 1, 1}, - {&__pyx_n_s_ret, __pyx_k_ret, sizeof(__pyx_k_ret), 0, 0, 1, 1}, - {&__pyx_n_s_retfunc, __pyx_k_retfunc, sizeof(__pyx_k_retfunc), 0, 0, 1, 1}, - {&__pyx_n_s_return_value, __pyx_k_return_value, sizeof(__pyx_k_return_value), 0, 0, 1, 1}, - {&__pyx_n_s_retval, __pyx_k_retval, sizeof(__pyx_k_retval), 0, 0, 1, 1}, - {&__pyx_n_s_rm_xattr, __pyx_k_rm_xattr, sizeof(__pyx_k_rm_xattr), 0, 0, 1, 1}, - {&__pyx_n_s_rstrip, __pyx_k_rstrip, sizeof(__pyx_k_rstrip), 0, 0, 1, 1}, - {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1}, - {&__pyx_kp_s_s_must_be_a_string, __pyx_k_s_must_be_a_string, sizeof(__pyx_k_s_must_be_a_string), 0, 0, 1, 0}, - {&__pyx_kp_s_s_must_be_s, __pyx_k_s_must_be_s, sizeof(__pyx_k_s_must_be_s), 0, 0, 1, 0}, - {&__pyx_n_s_safe, __pyx_k_safe, sizeof(__pyx_k_safe), 0, 0, 1, 1}, - {&__pyx_n_s_sec, __pyx_k_sec, sizeof(__pyx_k_sec), 0, 0, 1, 1}, - {&__pyx_n_s_seek, __pyx_k_seek, sizeof(__pyx_k_seek), 0, 0, 1, 1}, - {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, - {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1}, - {&__pyx_n_s_set_locator_key, __pyx_k_set_locator_key, sizeof(__pyx_k_set_locator_key), 0, 0, 1, 1}, - {&__pyx_n_s_set_namespace, __pyx_k_set_namespace, sizeof(__pyx_k_set_namespace), 0, 0, 1, 1}, - {&__pyx_n_s_set_object_locator, __pyx_k_set_object_locator, sizeof(__pyx_k_set_object_locator), 0, 0, 1, 1}, - {&__pyx_n_s_set_object_locator_locals_retfun, __pyx_k_set_object_locator_locals_retfun, sizeof(__pyx_k_set_object_locator_locals_retfun), 0, 0, 1, 1}, - {&__pyx_n_s_set_object_namespace, __pyx_k_set_object_namespace, sizeof(__pyx_k_set_object_namespace), 0, 0, 1, 1}, - {&__pyx_n_s_set_object_namespace_locals_retf, __pyx_k_set_object_namespace_locals_retf, sizeof(__pyx_k_set_object_namespace_locals_retf), 0, 0, 1, 1}, - {&__pyx_n_s_set_omap, __pyx_k_set_omap, sizeof(__pyx_k_set_omap), 0, 0, 1, 1}, - {&__pyx_n_s_set_read, __pyx_k_set_read, sizeof(__pyx_k_set_read), 0, 0, 1, 1}, - {&__pyx_n_s_set_xattr, __pyx_k_set_xattr, sizeof(__pyx_k_set_xattr), 0, 0, 1, 1}, - {&__pyx_n_s_setup, __pyx_k_setup, sizeof(__pyx_k_setup), 0, 0, 1, 1}, - {&__pyx_n_s_shutdown, __pyx_k_shutdown, sizeof(__pyx_k_shutdown), 0, 0, 1, 1}, - {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, - {&__pyx_n_s_snap_id, __pyx_k_snap_id, sizeof(__pyx_k_snap_id), 0, 0, 1, 1}, - {&__pyx_n_s_snap_name, __pyx_k_snap_name, sizeof(__pyx_k_snap_name), 0, 0, 1, 1}, - {&__pyx_n_s_snap_rollback, __pyx_k_snap_rollback, sizeof(__pyx_k_snap_rollback), 0, 0, 1, 1}, - {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, - {&__pyx_n_s_start_after, __pyx_k_start_after, sizeof(__pyx_k_start_after), 0, 0, 1, 1}, - {&__pyx_n_s_stat, __pyx_k_stat, sizeof(__pyx_k_stat), 0, 0, 1, 1}, - {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, - {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1}, - {&__pyx_n_s_str_type, __pyx_k_str_type, sizeof(__pyx_k_str_type), 0, 0, 1, 1}, - {&__pyx_n_s_string_to_write, __pyx_k_string_to_write, sizeof(__pyx_k_string_to_write), 0, 0, 1, 1}, - {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, - {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1}, - {&__pyx_n_s_tag, __pyx_k_tag, sizeof(__pyx_k_tag), 0, 0, 1, 1}, - {&__pyx_n_s_target, __pyx_k_target, sizeof(__pyx_k_target), 0, 0, 1, 1}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {&__pyx_n_s_threading, __pyx_k_threading, sizeof(__pyx_k_threading), 0, 0, 1, 1}, - {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, - {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1}, - {&__pyx_n_s_timeout, __pyx_k_timeout, sizeof(__pyx_k_timeout), 0, 0, 1, 1}, - {&__pyx_n_s_to_append, __pyx_k_to_append, sizeof(__pyx_k_to_append), 0, 0, 1, 1}, - {&__pyx_n_s_to_write, __pyx_k_to_write, sizeof(__pyx_k_to_write), 0, 0, 1, 1}, - {&__pyx_n_s_traceback, __pyx_k_traceback, sizeof(__pyx_k_traceback), 0, 0, 1, 1}, - {&__pyx_n_s_track_completion, __pyx_k_track_completion, sizeof(__pyx_k_track_completion), 0, 0, 1, 1}, - {&__pyx_n_s_trunc, __pyx_k_trunc, sizeof(__pyx_k_trunc), 0, 0, 1, 1}, - {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, - {&__pyx_n_s_type_2, __pyx_k_type_2, sizeof(__pyx_k_type_2), 0, 0, 1, 1}, - {&__pyx_n_s_type_names, __pyx_k_type_names, sizeof(__pyx_k_type_names), 0, 0, 1, 1}, - {&__pyx_n_s_types, __pyx_k_types, sizeof(__pyx_k_types), 0, 0, 1, 1}, - {&__pyx_n_s_unlock, __pyx_k_unlock, sizeof(__pyx_k_unlock), 0, 0, 1, 1}, - {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0}, - {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1}, - {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1}, - {&__pyx_n_s_validate_func, __pyx_k_validate_func, sizeof(__pyx_k_validate_func), 0, 0, 1, 1}, - {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, - {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, - {&__pyx_n_s_var, __pyx_k_var, sizeof(__pyx_k_var), 0, 0, 1, 1}, - {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1}, - {&__pyx_n_s_warning, __pyx_k_warning, sizeof(__pyx_k_warning), 0, 0, 1, 1}, - {&__pyx_n_s_wrapper, __pyx_k_wrapper, sizeof(__pyx_k_wrapper), 0, 0, 1, 1}, - {&__pyx_n_s_wraps, __pyx_k_wraps, sizeof(__pyx_k_wraps), 0, 0, 1, 1}, - {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1}, - {&__pyx_n_s_write_full, __pyx_k_write_full, sizeof(__pyx_k_write_full), 0, 0, 1, 1}, - {&__pyx_n_s_write_op, __pyx_k_write_op, sizeof(__pyx_k_write_op), 0, 0, 1, 1}, - {&__pyx_kp_s_write_operation_context_manager, __pyx_k_write_operation_context_manager, sizeof(__pyx_k_write_operation_context_manager), 0, 0, 1, 0}, - {&__pyx_n_s_xattr_name, __pyx_k_xattr_name, sizeof(__pyx_k_xattr_name), 0, 0, 1, 1}, - {&__pyx_n_s_xattr_value, __pyx_k_xattr_value, sizeof(__pyx_k_xattr_value), 0, 0, 1, 1}, - {&__pyx_n_s_xrange, __pyx_k_xrange, sizeof(__pyx_k_xrange), 0, 0, 1, 1}, - {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) __PYX_ERR(0, 274, __pyx_L1_error) - __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 508, __pyx_L1_error) - __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 407, __pyx_L1_error) - __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 420, __pyx_L1_error) - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 477, __pyx_L1_error) - #if PY_MAJOR_VERSION >= 3 - __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) __PYX_ERR(0, 485, __pyx_L1_error) - #else - __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) __PYX_ERR(0, 485, __pyx_L1_error) - #endif - __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 1335, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} - -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - - /* "rados.pyx":418 - * # AttributeError: 'method_descriptor' object has no attribute '__module__' - * # @wraps(f) - * def validate_func(*args, **kwargs): # <<<<<<<<<<<<<< - * # ignore the `self` arg - * pos_args = zip(args[1:], types) - */ - __pyx_tuple_ = PyTuple_Pack(9, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_pos_args, __pyx_n_s_named_args, __pyx_n_s_arg_val, __pyx_n_s_arg_name, __pyx_n_s_arg_type, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 418, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple_); - __Pyx_GIVEREF(__pyx_tuple_); - __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(0, 0, 9, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ani_tryst_ceph_src_pybind, __pyx_n_s_validate_func, 418, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 418, __pyx_L1_error) - - /* "rados.pyx":395 - * # kwargs is an un-ordered dict, so use args instead - * def requires(*types): - * def is_type_of(v, t): # <<<<<<<<<<<<<< - * if t is None: - * return v is None - */ - __pyx_tuple__3 = PyTuple_Pack(2, __pyx_n_s_v, __pyx_n_s_t); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 395, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); - __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ani_tryst_ceph_src_pybind, __pyx_n_s_is_type_of, 395, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 395, __pyx_L1_error) - - /* "rados.pyx":401 - * return isinstance(v, t) - * - * def check_type(val, arg_name, arg_type): # <<<<<<<<<<<<<< - * if isinstance(arg_type, tuple): - * if any(is_type_of(val, t) for t in arg_type): - */ - __pyx_tuple__5 = PyTuple_Pack(7, __pyx_n_s_val, __pyx_n_s_arg_name, __pyx_n_s_arg_type, __pyx_n_s_type_names, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 401, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); - __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ani_tryst_ceph_src_pybind, __pyx_n_s_check_type, 401, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 401, __pyx_L1_error) - - /* "rados.pyx":414 - * raise TypeError('%s must be %s' % (arg_name, arg_type.__name__)) - * - * def wrapper(f): # <<<<<<<<<<<<<< - * # FIXME(sileht): this stop with - * # AttributeError: 'method_descriptor' object has no attribute '__module__' - */ - __pyx_tuple__7 = PyTuple_Pack(3, __pyx_n_s_f, __pyx_n_s_validate_func, __pyx_n_s_validate_func); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 414, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); - __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ani_tryst_ceph_src_pybind, __pyx_n_s_wrapper, 414, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 414, __pyx_L1_error) - - /* "rados.pyx":477 - * cdef void *ret = realloc(ptr, size) - * if ret == NULL: - * raise MemoryError("realloc failed") # <<<<<<<<<<<<<< - * return ret - * - */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_realloc_failed); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 477, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); - - /* "rados.pyx":484 - * cdef size_t *ret = malloc(len(list_int) * sizeof(size_t)) - * if ret == NULL: - * raise MemoryError("malloc failed") # <<<<<<<<<<<<<< - * for i in xrange(len(list_int)): - * ret[i] = list_int[i] - */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_malloc_failed); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 484, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); - - /* "rados.pyx":493 - * cdef char **ret = malloc(len(list_bytes) * sizeof(char *)) - * if ret == NULL: - * raise MemoryError("malloc failed") # <<<<<<<<<<<<<< - * for i in xrange(len(list_bytes)): - * ret[i] = list_bytes[i] - */ - __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_malloc_failed); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 493, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__11); - __Pyx_GIVEREF(__pyx_tuple__11); - - /* "rados.pyx":538 - * - * if rados_id and name: - * raise Error("Rados(): can't supply both rados_id and name") # <<<<<<<<<<<<<< - * elif rados_id: - * name = 'client.' + rados_id - */ - __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Rados_can_t_supply_both_rados_id); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 538, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); - - /* "rados.pyx":624 - * :type path: str - * """ - * self.require_state("configuring", "connected") # <<<<<<<<<<<<<< - * path = cstr(path, 'path', opt=True) - * cdef: - */ - __pyx_tuple__14 = PyTuple_Pack(2, __pyx_n_s_configuring, __pyx_n_s_connected); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 624, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); - - /* "rados.pyx":638 - * args contain only those unknown to ceph - * """ - * self.require_state("configuring", "connected") # <<<<<<<<<<<<<< - * if not args: - * return - */ - __pyx_tuple__15 = PyTuple_Pack(2, __pyx_n_s_configuring, __pyx_n_s_connected); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 638, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__15); - __Pyx_GIVEREF(__pyx_tuple__15); - - /* "rados.pyx":672 - * CEPH_ARGS. - * """ - * self.require_state("configuring", "connected") # <<<<<<<<<<<<<< - * if not var: - * return - */ - __pyx_tuple__16 = PyTuple_Pack(2, __pyx_n_s_configuring, __pyx_n_s_connected); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 672, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__16); - __Pyx_GIVEREF(__pyx_tuple__16); - - /* "rados.pyx":695 - * :raises: :class:`TypeError` - * """ - * self.require_state("configuring", "connected") # <<<<<<<<<<<<<< - * option = cstr(option, 'option') - * cdef: - */ - __pyx_tuple__17 = PyTuple_Pack(2, __pyx_n_s_configuring, __pyx_n_s_connected); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 695, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); - - /* "rados.pyx":730 - * :raises: :class:`TypeError`, :class:`ObjectNotFound` - * """ - * self.require_state("configuring", "connected") # <<<<<<<<<<<<<< - * option = cstr(option, 'option') - * val = cstr(val, 'val') - */ - __pyx_tuple__18 = PyTuple_Pack(2, __pyx_n_s_configuring, __pyx_n_s_connected); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 730, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); - __Pyx_GIVEREF(__pyx_tuple__18); - - /* "rados.pyx":755 - * """ - * - * self.require_state("configuring", "connected") # <<<<<<<<<<<<<< - * - * mon_id = cstr(mon_id, 'mon_id') - */ - __pyx_tuple__19 = PyTuple_Pack(2, __pyx_n_s_configuring, __pyx_n_s_connected); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 755, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__19); - __Pyx_GIVEREF(__pyx_tuple__19); - - /* "rados.pyx":778 - * Connect to the cluster. Use shutdown() to release resources. - * """ - * self.require_state("configuring") # <<<<<<<<<<<<<< - * # NOTE(sileht): timeout was supported by old python API, - * # but this is not something available in C API, so ignore - */ - __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_configuring); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 778, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); - - /* "rados.pyx":832 - * :returns: bool - whether the pool exists, false otherwise. - * """ - * self.require_state("connected") # <<<<<<<<<<<<<< - * - * pool_name = cstr(pool_name, 'pool_name') - */ - __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_connected); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__21); - __Pyx_GIVEREF(__pyx_tuple__21); - - /* "rados.pyx":858 - * :returns: int - pool ID, or None if it doesn't exist - * """ - * self.require_state("connected") # <<<<<<<<<<<<<< - * pool_name = cstr(pool_name, 'pool_name') - * cdef: - */ - __pyx_tuple__22 = PyTuple_Pack(1, __pyx_n_s_connected); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 858, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__22); - __Pyx_GIVEREF(__pyx_tuple__22); - - /* "rados.pyx":883 - * :returns: string - pool name, or None if it doesn't exist - * """ - * self.require_state("connected") # <<<<<<<<<<<<<< - * cdef: - * int64_t _pool_id = pool_id - */ - __pyx_tuple__23 = PyTuple_Pack(1, __pyx_n_s_connected); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 883, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__23); - __Pyx_GIVEREF(__pyx_tuple__23); - - /* "rados.pyx":926 - * :raises: :class:`TypeError`, :class:`Error` - * """ - * self.require_state("connected") # <<<<<<<<<<<<<< - * - * pool_name = cstr(pool_name, 'pool_name') - */ - __pyx_tuple__24 = PyTuple_Pack(1, __pyx_n_s_connected); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 926, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__24); - __Pyx_GIVEREF(__pyx_tuple__24); - - /* "rados.pyx":960 - * :returns: base pool, or pool_id if tiering is not configured for the pool - * """ - * self.require_state("connected") # <<<<<<<<<<<<<< - * cdef: - * int64_t base_tier = 0 - */ - __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_connected); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 960, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__25); - __Pyx_GIVEREF(__pyx_tuple__25); - - /* "rados.pyx":984 - * :raises: :class:`TypeError`, :class:`Error` - * """ - * self.require_state("connected") # <<<<<<<<<<<<<< - * - * pool_name = cstr(pool_name, 'pool_name') - */ - __pyx_tuple__26 = PyTuple_Pack(1, __pyx_n_s_connected); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 984, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__26); - __Pyx_GIVEREF(__pyx_tuple__26); - - /* "rados.pyx":1004 - * :returns: list - inconsistent placement groups - * """ - * self.require_state("connected") # <<<<<<<<<<<<<< - * cdef: - * int64_t pool = pool_id - */ - __pyx_tuple__27 = PyTuple_Pack(1, __pyx_n_s_connected); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 1004, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); - - /* "rados.pyx":1022 - * else: - * raise make_ex(ret, "error calling inconsistent_pg_list") - * return [pg for pg in decode_cstr(pgs[:ret]).split('\0') if pg] # <<<<<<<<<<<<<< - * finally: - * free(pgs) - */ - __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s__28); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 1022, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__29); - __Pyx_GIVEREF(__pyx_tuple__29); - - /* "rados.pyx":1032 - * :returns: list - of pool names. - * """ - * self.require_state("connected") # <<<<<<<<<<<<<< - * cdef: - * size_t size = 512 - */ - __pyx_tuple__30 = PyTuple_Pack(1, __pyx_n_s_connected); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 1032, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__30); - __Pyx_GIVEREF(__pyx_tuple__30); - - /* "rados.pyx":1046 - * elif ret >= 0: - * break - * return [name for name in decode_cstr(c_names[:ret]).split('\0') # <<<<<<<<<<<<<< - * if name] - * finally: - */ - __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s__28); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 1046, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__31); - __Pyx_GIVEREF(__pyx_tuple__31); - - /* "rados.pyx":1058 - * :returns: str - cluster fsid - * """ - * self.require_state("connected") # <<<<<<<<<<<<<< - * cdef: - * char *ret_buf - */ - __pyx_tuple__32 = PyTuple_Pack(1, __pyx_n_s_connected); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 1058, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__32); - __Pyx_GIVEREF(__pyx_tuple__32); - - /* "rados.pyx":1095 - * :returns: Ioctx - Rados Ioctx object - * """ - * self.require_state("connected") # <<<<<<<<<<<<<< - * ioctx_name = cstr(ioctx_name, 'ioctx_name') - * cdef: - */ - __pyx_tuple__33 = PyTuple_Pack(1, __pyx_n_s_connected); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 1095, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__33); - __Pyx_GIVEREF(__pyx_tuple__33); - - /* "rados.pyx":1116 - * # timeout argument, but we keep it for backward compat with old python binding - * - * self.require_state("connected") # <<<<<<<<<<<<<< - * cmd = cstr_list(cmd, 'c') - * - */ - __pyx_tuple__34 = PyTuple_Pack(1, __pyx_n_s_connected); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 1116, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__34); - __Pyx_GIVEREF(__pyx_tuple__34); - - /* "rados.pyx":1172 - * # NOTE(sileht): timeout is ignored because C API doesn't provide - * # timeout argument, but we keep it for backward compat with old python binding - * self.require_state("connected") # <<<<<<<<<<<<<< - * - * cmd = cstr_list(cmd, 'cmd') - */ - __pyx_tuple__35 = PyTuple_Pack(1, __pyx_n_s_connected); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 1172, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__35); - __Pyx_GIVEREF(__pyx_tuple__35); - - /* "rados.pyx":1215 - * # NOTE(sileht): timeout is ignored because C API doesn't provide - * # timeout argument, but we keep it for backward compat with old python binding - * self.require_state("connected") # <<<<<<<<<<<<<< - * - * pgid = cstr(pgid, 'pgid') - */ - __pyx_tuple__36 = PyTuple_Pack(1, __pyx_n_s_connected); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 1215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__36); - __Pyx_GIVEREF(__pyx_tuple__36); - - /* "rados.pyx":1253 - * - * def wait_for_latest_osdmap(self): - * self.require_state("connected") # <<<<<<<<<<<<<< - * with nogil: - * ret = rados_wait_for_latest_osdmap(self.cluster) - */ - __pyx_tuple__37 = PyTuple_Pack(1, __pyx_n_s_connected); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 1253, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__37); - __Pyx_GIVEREF(__pyx_tuple__37); - - /* "rados.pyx":1269 - * :raises: :class:`Error` - * """ - * self.require_state("connected") # <<<<<<<<<<<<<< - * client_address = cstr(client_address, 'client_address') - * cdef: - */ - __pyx_tuple__38 = PyTuple_Pack(1, __pyx_n_s_connected); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 1269, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__38); - __Pyx_GIVEREF(__pyx_tuple__38); - - /* "rados.pyx":1284 - * raise LogicError("invalid monitor level " + level) - * if callback is not None and not callable(callback): - * raise LogicError("callback must be a callable function or None") # <<<<<<<<<<<<<< - * - * level = cstr(level, 'level') - */ - __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_a_callable_func); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 1284, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__39); - __Pyx_GIVEREF(__pyx_tuple__39); - - /* "rados.pyx":1504 - * name_len = name_len * 2 - * - * snap = Snap(self.ioctx, decode_cstr(name[:name_len]).rstrip('\0'), snap_id) # <<<<<<<<<<<<<< - * self.cur_snap = self.cur_snap + 1 - * return snap - */ - __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s__28); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 1504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__40); - __Pyx_GIVEREF(__pyx_tuple__40); - - /* "rados.pyx":1654 - * def _complete(self): - * self.oncomplete(self) - * with self.ioctx.lock: # <<<<<<<<<<<<<< - * if self.oncomplete: - * self.ioctx.complete_completions.remove(self) - */ - __pyx_tuple__41 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 1654, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__41); - __Pyx_GIVEREF(__pyx_tuple__41); - - /* "rados.pyx":1660 - * def _safe(self): - * self.onsafe(self) - * with self.ioctx.lock: # <<<<<<<<<<<<<< - * if self.onsafe: - * self.ioctx.safe_completions.remove(self) - */ - __pyx_tuple__42 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 1660, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__42); - __Pyx_GIVEREF(__pyx_tuple__42); - - /* "rados.pyx":1665 - * - * def _cleanup(self): - * with self.ioctx.lock: # <<<<<<<<<<<<<< - * if self.oncomplete: - * self.ioctx.complete_completions.remove(self) - */ - __pyx_tuple__43 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 1665, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__43); - __Pyx_GIVEREF(__pyx_tuple__43); - - /* "rados.pyx":1758 - * def __track_completion(self, completion_obj): - * if completion_obj.oncomplete: - * with self.lock: # <<<<<<<<<<<<<< - * self.complete_completions.append(completion_obj) - * if completion_obj.onsafe: - */ - __pyx_tuple__44 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 1758, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__44); - __Pyx_GIVEREF(__pyx_tuple__44); - - /* "rados.pyx":1761 - * self.complete_completions.append(completion_obj) - * if completion_obj.onsafe: - * with self.lock: # <<<<<<<<<<<<<< - * self.safe_completions.append(completion_obj) - * - */ - __pyx_tuple__45 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 1761, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__45); - __Pyx_GIVEREF(__pyx_tuple__45); - - /* "rados.pyx":1971 - * size_t _length = length - * - * def oncomplete_(completion_v): # <<<<<<<<<<<<<< - * cdef Completion _completion_v = completion_v - * return_value = _completion_v.get_return_value() - */ - __pyx_tuple__46 = PyTuple_Pack(3, __pyx_n_s_completion_v, __pyx_n_s_completion_v_2, __pyx_n_s_return_value); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 1971, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__46); - __Pyx_GIVEREF(__pyx_tuple__46); - __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ani_tryst_ceph_src_pybind, __pyx_n_s_oncomplete_2, 1971, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 1971, __pyx_L1_error) - - /* "rados.pyx":2759 - * - * if len(keys) != len(values): - * raise Error("Rados(): keys and values must have the same number of items") # <<<<<<<<<<<<<< - * - * keys = cstr_list(keys, 'keys') - */ - __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_Rados_keys_and_values_must_have); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 2759, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__48); - __Pyx_GIVEREF(__pyx_tuple__48); - - /* "rados.pyx":3091 - * - * def set_object_locator(func): - * def retfunc(self, *args, **kwargs): # <<<<<<<<<<<<<< - * if self.locator_key is not None: - * old_locator = self.ioctx.get_locator_key() - */ - __pyx_tuple__51 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_old_locator, __pyx_n_s_retval); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 3091, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__51); - __Pyx_GIVEREF(__pyx_tuple__51); - __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ani_tryst_ceph_src_pybind, __pyx_n_s_retfunc, 3091, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 3091, __pyx_L1_error) - - /* "rados.pyx":3106 - * def retfunc(self, *args, **kwargs): - * if self.nspace is None: - * raise LogicError("Namespace not set properly in context") # <<<<<<<<<<<<<< - * old_nspace = self.ioctx.get_namespace() - * self.ioctx.set_namespace(self.nspace) - */ - __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_Namespace_not_set_properly_in_co); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 3106, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__53); - __Pyx_GIVEREF(__pyx_tuple__53); - - /* "rados.pyx":3104 - * - * def set_object_namespace(func): - * def retfunc(self, *args, **kwargs): # <<<<<<<<<<<<<< - * if self.nspace is None: - * raise LogicError("Namespace not set properly in context") - */ - __pyx_tuple__54 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_old_nspace, __pyx_n_s_retval); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 3104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__54); - __Pyx_GIVEREF(__pyx_tuple__54); - __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ani_tryst_ceph_src_pybind, __pyx_n_s_retfunc, 3104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 3104, __pyx_L1_error) - - /* "rados.pyx":388 - * # helper to specify an optional argument, where in addition to `cls`, `None` - * # is also acceptable - * def opt(cls): # <<<<<<<<<<<<<< - * return (cls, None) - * - */ - __pyx_tuple__56 = PyTuple_Pack(1, __pyx_n_s_cls); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 388, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__56); - __Pyx_GIVEREF(__pyx_tuple__56); - __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ani_tryst_ceph_src_pybind, __pyx_n_s_opt, 388, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 388, __pyx_L1_error) - - /* "rados.pyx":394 - * # validate argument types of an instance method - * # kwargs is an un-ordered dict, so use args instead - * def requires(*types): # <<<<<<<<<<<<<< - * def is_type_of(v, t): - * if t is None: - */ - __pyx_tuple__58 = PyTuple_Pack(7, __pyx_n_s_types, __pyx_n_s_is_type_of, __pyx_n_s_is_type_of, __pyx_n_s_check_type, __pyx_n_s_check_type, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 394, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__58); - __Pyx_GIVEREF(__pyx_tuple__58); - __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(0, 0, 7, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ani_tryst_ceph_src_pybind, __pyx_n_s_requires, 394, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 394, __pyx_L1_error) - - /* "rados.pyx":430 - * - * - * def cstr(val, name, encoding="utf-8", opt=False): # <<<<<<<<<<<<<< - * """ - * Create a byte string from a Python string - */ - __pyx_tuple__60 = PyTuple_Pack(4, __pyx_n_s_val, __pyx_n_s_name_2, __pyx_n_s_encoding, __pyx_n_s_opt); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 430, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__60); - __Pyx_GIVEREF(__pyx_tuple__60); - __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ani_tryst_ceph_src_pybind, __pyx_n_s_cstr, 430, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 430, __pyx_L1_error) - - /* "rados.pyx":451 - * - * - * def cstr_list(list_str, name, encoding="utf-8"): # <<<<<<<<<<<<<< - * return [cstr(s, name) for s in list_str] - * - */ - __pyx_tuple__62 = PyTuple_Pack(4, __pyx_n_s_list_str, __pyx_n_s_name_2, __pyx_n_s_encoding, __pyx_n_s_s); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 451, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__62); - __Pyx_GIVEREF(__pyx_tuple__62); - __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ani_tryst_ceph_src_pybind, __pyx_n_s_cstr_list, 451, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 451, __pyx_L1_error) - - /* "rados.pyx":455 - * - * - * def decode_cstr(val, encoding="utf-8"): # <<<<<<<<<<<<<< - * """ - * Decode a byte string into a Python string. - */ - __pyx_tuple__64 = PyTuple_Pack(2, __pyx_n_s_val, __pyx_n_s_encoding); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 455, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__64); - __Pyx_GIVEREF(__pyx_tuple__64); - __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ani_tryst_ceph_src_pybind, __pyx_n_s_decode_cstr, 455, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 455, __pyx_L1_error) - - /* "rados.pyx":510 - * class Version(object): - * """ Version information """ - * def __init__(self, major, minor, extra): # <<<<<<<<<<<<<< - * self.major = major - * self.minor = minor - */ - __pyx_tuple__66 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_major, __pyx_n_s_minor, __pyx_n_s_extra); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 510, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__66); - __Pyx_GIVEREF(__pyx_tuple__66); - __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ani_tryst_ceph_src_pybind, __pyx_n_s_init, 510, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 510, __pyx_L1_error) - - /* "rados.pyx":515 - * self.extra = extra - * - * def __str__(self): # <<<<<<<<<<<<<< - * return "%d.%d.%d" % (self.major, self.minor, self.extra) - * - */ - __pyx_tuple__68 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 515, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__68); - __Pyx_GIVEREF(__pyx_tuple__68); - __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ani_tryst_ceph_src_pybind, __pyx_n_s_str, 515, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 515, __pyx_L1_error) - - /* "rados.pyx":1673 - * - * class OpCtx(object): - * def __enter__(self): # <<<<<<<<<<<<<< - * return self.create() - * - */ - __pyx_tuple__70 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 1673, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__70); - __Pyx_GIVEREF(__pyx_tuple__70); - __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ani_tryst_ceph_src_pybind, __pyx_n_s_enter, 1673, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 1673, __pyx_L1_error) - - /* "rados.pyx":1676 - * return self.create() - * - * def __exit__(self, type, msg, traceback): # <<<<<<<<<<<<<< - * self.release() - * - */ - __pyx_tuple__72 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_type_2, __pyx_n_s_msg, __pyx_n_s_traceback); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 1676, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__72); - __Pyx_GIVEREF(__pyx_tuple__72); - __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ani_tryst_ceph_src_pybind, __pyx_n_s_exit, 1676, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 1676, __pyx_L1_error) - - /* "rados.pyx":3090 - * - * - * def set_object_locator(func): # <<<<<<<<<<<<<< - * def retfunc(self, *args, **kwargs): - * if self.locator_key is not None: - */ - __pyx_tuple__74 = PyTuple_Pack(3, __pyx_n_s_func, __pyx_n_s_retfunc, __pyx_n_s_retfunc); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 3090, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__74); - __Pyx_GIVEREF(__pyx_tuple__74); - __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ani_tryst_ceph_src_pybind, __pyx_n_s_set_object_locator, 3090, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(0, 3090, __pyx_L1_error) - - /* "rados.pyx":3103 - * - * - * def set_object_namespace(func): # <<<<<<<<<<<<<< - * def retfunc(self, *args, **kwargs): - * if self.nspace is None: - */ - __pyx_tuple__76 = PyTuple_Pack(3, __pyx_n_s_func, __pyx_n_s_retfunc, __pyx_n_s_retfunc); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 3103, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__76); - __Pyx_GIVEREF(__pyx_tuple__76); - __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ani_tryst_ceph_src_pybind, __pyx_n_s_set_object_namespace, 3103, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 3103, __pyx_L1_error) - - /* "rados.pyx":3117 - * class Object(object): - * """Rados object wrapper, makes the object look like a file""" - * def __init__(self, ioctx, key, locator_key=None, nspace=None): # <<<<<<<<<<<<<< - * self.key = key - * self.ioctx = ioctx - */ - __pyx_tuple__78 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_ioctx, __pyx_n_s_key, __pyx_n_s_locator_key, __pyx_n_s_nspace); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 3117, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__78); - __Pyx_GIVEREF(__pyx_tuple__78); - __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ani_tryst_ceph_src_pybind, __pyx_n_s_init, 3117, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(0, 3117, __pyx_L1_error) - __pyx_tuple__80 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 3117, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__80); - __Pyx_GIVEREF(__pyx_tuple__80); - - /* "rados.pyx":3125 - * self.nspace = "" if nspace is None else nspace - * - * def __str__(self): # <<<<<<<<<<<<<< - * return "rados.Object(ioctx=%s,key=%s,nspace=%s,locator=%s)" % \ - * (str(self.ioctx), self.key, "--default--" - */ - __pyx_tuple__81 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 3125, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__81); - __Pyx_GIVEREF(__pyx_tuple__81); - __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ani_tryst_ceph_src_pybind, __pyx_n_s_str, 3125, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(0, 3125, __pyx_L1_error) - - /* "rados.pyx":3130 - * if self.nspace is "" else self.nspace, self.locator_key) - * - * def require_object_exists(self): # <<<<<<<<<<<<<< - * if self.state != "exists": - * raise ObjectStateError("The object is %s" % self.state) - */ - __pyx_tuple__83 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 3130, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__83); - __Pyx_GIVEREF(__pyx_tuple__83); - __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ani_tryst_ceph_src_pybind, __pyx_n_s_require_object_exists, 3130, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(0, 3130, __pyx_L1_error) - - /* "rados.pyx":3136 - * @set_object_locator - * @set_object_namespace - * def read(self, length=1024 * 1024): # <<<<<<<<<<<<<< - * self.require_object_exists() - * ret = self.ioctx.read(self.key, length, self.offset) - */ - __pyx_tuple__85 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_length, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 3136, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__85); - __Pyx_GIVEREF(__pyx_tuple__85); - __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ani_tryst_ceph_src_pybind, __pyx_n_s_read, 3136, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(0, 3136, __pyx_L1_error) - __pyx_tuple__87 = PyTuple_Pack(1, ((PyObject *)__pyx_int_1048576)); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 3136, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__87); - __Pyx_GIVEREF(__pyx_tuple__87); - - /* "rados.pyx":3144 - * @set_object_locator - * @set_object_namespace - * def write(self, string_to_write): # <<<<<<<<<<<<<< - * self.require_object_exists() - * ret = self.ioctx.write(self.key, string_to_write, self.offset) - */ - __pyx_tuple__88 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_string_to_write, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 3144, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__88); - __Pyx_GIVEREF(__pyx_tuple__88); - __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__88, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ani_tryst_ceph_src_pybind, __pyx_n_s_write, 3144, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) __PYX_ERR(0, 3144, __pyx_L1_error) - - /* "rados.pyx":3153 - * @set_object_locator - * @set_object_namespace - * def remove(self): # <<<<<<<<<<<<<< - * self.require_object_exists() - * self.ioctx.remove_object(self.key) - */ - __pyx_tuple__90 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 3153, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__90); - __Pyx_GIVEREF(__pyx_tuple__90); - __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ani_tryst_ceph_src_pybind, __pyx_n_s_remove, 3153, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) __PYX_ERR(0, 3153, __pyx_L1_error) - - /* "rados.pyx":3160 - * @set_object_locator - * @set_object_namespace - * def stat(self): # <<<<<<<<<<<<<< - * self.require_object_exists() - * return self.ioctx.stat(self.key) - */ - __pyx_tuple__92 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 3160, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__92); - __Pyx_GIVEREF(__pyx_tuple__92); - __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__92, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ani_tryst_ceph_src_pybind, __pyx_n_s_stat, 3160, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) __PYX_ERR(0, 3160, __pyx_L1_error) - - /* "rados.pyx":3164 - * return self.ioctx.stat(self.key) - * - * def seek(self, position): # <<<<<<<<<<<<<< - * self.require_object_exists() - * self.offset = position - */ - __pyx_tuple__94 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_position); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(0, 3164, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__94); - __Pyx_GIVEREF(__pyx_tuple__94); - __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__94, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ani_tryst_ceph_src_pybind, __pyx_n_s_seek, 3164, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) __PYX_ERR(0, 3164, __pyx_L1_error) - - /* "rados.pyx":3170 - * @set_object_locator - * @set_object_namespace - * def get_xattr(self, xattr_name): # <<<<<<<<<<<<<< - * self.require_object_exists() - * return self.ioctx.get_xattr(self.key, xattr_name) - */ - __pyx_tuple__96 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_xattr_name); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(0, 3170, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__96); - __Pyx_GIVEREF(__pyx_tuple__96); - __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ani_tryst_ceph_src_pybind, __pyx_n_s_get_xattr, 3170, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) __PYX_ERR(0, 3170, __pyx_L1_error) - - /* "rados.pyx":3176 - * @set_object_locator - * @set_object_namespace - * def get_xattrs(self): # <<<<<<<<<<<<<< - * self.require_object_exists() - * return self.ioctx.get_xattrs(self.key) - */ - __pyx_tuple__98 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(0, 3176, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__98); - __Pyx_GIVEREF(__pyx_tuple__98); - __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ani_tryst_ceph_src_pybind, __pyx_n_s_get_xattrs, 3176, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(0, 3176, __pyx_L1_error) - - /* "rados.pyx":3182 - * @set_object_locator - * @set_object_namespace - * def set_xattr(self, xattr_name, xattr_value): # <<<<<<<<<<<<<< - * self.require_object_exists() - * return self.ioctx.set_xattr(self.key, xattr_name, xattr_value) - */ - __pyx_tuple__100 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_xattr_name, __pyx_n_s_xattr_value); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(0, 3182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__100); - __Pyx_GIVEREF(__pyx_tuple__100); - __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__100, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ani_tryst_ceph_src_pybind, __pyx_n_s_set_xattr, 3182, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) __PYX_ERR(0, 3182, __pyx_L1_error) - - /* "rados.pyx":3188 - * @set_object_locator - * @set_object_namespace - * def rm_xattr(self, xattr_name): # <<<<<<<<<<<<<< - * self.require_object_exists() - * return self.ioctx.rm_xattr(self.key, xattr_name) - */ - __pyx_tuple__102 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_xattr_name); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(0, 3188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__102); - __Pyx_GIVEREF(__pyx_tuple__102); - __pyx_codeobj__103 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__102, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ani_tryst_ceph_src_pybind, __pyx_n_s_rm_xattr, 3188, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__103)) __PYX_ERR(0, 3188, __pyx_L1_error) - - /* "rados.pyx":3221 - * callback's return value is ignored - * """ - * def __init__(self, cluster, level, callback, arg): # <<<<<<<<<<<<<< - * self.level = level - * self.callback = callback - */ - __pyx_tuple__104 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_cluster, __pyx_n_s_level, __pyx_n_s_callback, __pyx_n_s_arg); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(0, 3221, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__104); - __Pyx_GIVEREF(__pyx_tuple__104); - __pyx_codeobj__105 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__104, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ani_tryst_ceph_src_pybind, __pyx_n_s_init, 3221, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__105)) __PYX_ERR(0, 3221, __pyx_L1_error) - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} - -static int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_8192 = PyInt_FromLong(8192); if (unlikely(!__pyx_int_8192)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_1048576 = PyInt_FromLong(1048576L); if (unlikely(!__pyx_int_1048576)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_50331648 = PyInt_FromLong(50331648L); if (unlikely(!__pyx_int_50331648)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_4294967296 = PyInt_FromString((char *)"4294967296", 0, 0); if (unlikely(!__pyx_int_4294967296)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_18446744073709551615 = PyInt_FromString((char *)"18446744073709551615", 0, 0); if (unlikely(!__pyx_int_18446744073709551615)) __PYX_ERR(0, 1, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} - -#if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC initrados(void); /*proto*/ -PyMODINIT_FUNC initrados(void) -#else -PyMODINIT_FUNC PyInit_rados(void); /*proto*/ -PyMODINIT_FUNC PyInit_rados(void) -#endif -{ - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - PyObject *__pyx_t_11 = NULL; - PyObject *__pyx_t_12 = NULL; - Py_ssize_t __pyx_t_13; - PyObject *__pyx_t_14 = NULL; - __Pyx_RefNannyDeclarations - #if CYTHON_REFNANNY - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); - if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); - } - #endif - __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_rados(void)", 0); - if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) - #ifdef __Pyx_CyFunction_USED - if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Coroutine_USED - if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - #ifdef WITH_THREAD /* Python build with threading support? */ - PyEval_InitThreads(); - #endif - #endif - /*--- Module creation code ---*/ - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("rados", __pyx_methods, __pyx_k_This_module_is_a_thin_wrapper_a, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_d); - __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - #if CYTHON_COMPILING_IN_PYPY - Py_INCREF(__pyx_b); - #endif - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - if (__pyx_module_is_main_rados) { - if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - } - #if PY_MAJOR_VERSION >= 3 - { - PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) - if (!PyDict_GetItemString(modules, "rados")) { - if (unlikely(PyDict_SetItemString(modules, "rados", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) - } - } - #endif - /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Global init code ---*/ - __pyx_v_5rados_errno_to_exception = Py_None; Py_INCREF(Py_None); - /*--- Variable export code ---*/ - /*--- Function export code ---*/ - /*--- Type init code ---*/ - if (PyType_Ready(&__pyx_type_5rados_Rados) < 0) __PYX_ERR(0, 519, __pyx_L1_error) - __pyx_type_5rados_Rados.tp_print = 0; - if (PyObject_SetAttrString(__pyx_m, "Rados", (PyObject *)&__pyx_type_5rados_Rados) < 0) __PYX_ERR(0, 519, __pyx_L1_error) - __pyx_ptype_5rados_Rados = &__pyx_type_5rados_Rados; - if (PyType_Ready(&__pyx_type_5rados_Ioctx) < 0) __PYX_ERR(0, 1732, __pyx_L1_error) - __pyx_type_5rados_Ioctx.tp_print = 0; - if (PyObject_SetAttrString(__pyx_m, "Ioctx", (PyObject *)&__pyx_type_5rados_Ioctx) < 0) __PYX_ERR(0, 1732, __pyx_L1_error) - __pyx_ptype_5rados_Ioctx = &__pyx_type_5rados_Ioctx; - if (PyType_Ready(&__pyx_type_5rados_OmapIterator) < 0) __PYX_ERR(0, 1307, __pyx_L1_error) - __pyx_type_5rados_OmapIterator.tp_print = 0; - #if CYTHON_COMPILING_IN_CPYTHON - { - PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_5rados_OmapIterator, "__next__"); if (unlikely(!wrapper)) __PYX_ERR(0, 1307, __pyx_L1_error) - if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { - __pyx_wrapperbase_5rados_12OmapIterator_4__next__ = *((PyWrapperDescrObject *)wrapper)->d_base; - __pyx_wrapperbase_5rados_12OmapIterator_4__next__.doc = __pyx_doc_5rados_12OmapIterator_4__next__; - ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5rados_12OmapIterator_4__next__; - } - } - #endif - if (PyObject_SetAttrString(__pyx_m, "OmapIterator", (PyObject *)&__pyx_type_5rados_OmapIterator) < 0) __PYX_ERR(0, 1307, __pyx_L1_error) - __pyx_ptype_5rados_OmapIterator = &__pyx_type_5rados_OmapIterator; - if (PyType_Ready(&__pyx_type_5rados_ObjectIterator) < 0) __PYX_ERR(0, 1347, __pyx_L1_error) - __pyx_type_5rados_ObjectIterator.tp_print = 0; - #if CYTHON_COMPILING_IN_CPYTHON - { - PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_5rados_ObjectIterator, "__next__"); if (unlikely(!wrapper)) __PYX_ERR(0, 1347, __pyx_L1_error) - if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { - __pyx_wrapperbase_5rados_14ObjectIterator_4__next__ = *((PyWrapperDescrObject *)wrapper)->d_base; - __pyx_wrapperbase_5rados_14ObjectIterator_4__next__.doc = __pyx_doc_5rados_14ObjectIterator_4__next__; - ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5rados_14ObjectIterator_4__next__; - } - } - #endif - if (PyObject_SetAttrString(__pyx_m, "ObjectIterator", (PyObject *)&__pyx_type_5rados_ObjectIterator) < 0) __PYX_ERR(0, 1347, __pyx_L1_error) - __pyx_ptype_5rados_ObjectIterator = &__pyx_type_5rados_ObjectIterator; - if (PyType_Ready(&__pyx_type_5rados_XattrIterator) < 0) __PYX_ERR(0, 1394, __pyx_L1_error) - __pyx_type_5rados_XattrIterator.tp_print = 0; - #if CYTHON_COMPILING_IN_CPYTHON - { - PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_5rados_XattrIterator, "__next__"); if (unlikely(!wrapper)) __PYX_ERR(0, 1394, __pyx_L1_error) - if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { - __pyx_wrapperbase_5rados_13XattrIterator_4__next__ = *((PyWrapperDescrObject *)wrapper)->d_base; - __pyx_wrapperbase_5rados_13XattrIterator_4__next__.doc = __pyx_doc_5rados_13XattrIterator_4__next__; - ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5rados_13XattrIterator_4__next__; - } - } - #endif - if (PyObject_SetAttrString(__pyx_m, "XattrIterator", (PyObject *)&__pyx_type_5rados_XattrIterator) < 0) __PYX_ERR(0, 1394, __pyx_L1_error) - __pyx_ptype_5rados_XattrIterator = &__pyx_type_5rados_XattrIterator; - if (PyType_Ready(&__pyx_type_5rados_SnapIterator) < 0) __PYX_ERR(0, 1444, __pyx_L1_error) - __pyx_type_5rados_SnapIterator.tp_print = 0; - #if CYTHON_COMPILING_IN_CPYTHON - { - PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_5rados_SnapIterator, "__next__"); if (unlikely(!wrapper)) __PYX_ERR(0, 1444, __pyx_L1_error) - if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { - __pyx_wrapperbase_5rados_12SnapIterator_4__next__ = *((PyWrapperDescrObject *)wrapper)->d_base; - __pyx_wrapperbase_5rados_12SnapIterator_4__next__.doc = __pyx_doc_5rados_12SnapIterator_4__next__; - ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5rados_12SnapIterator_4__next__; - } - } - #endif - if (PyObject_SetAttrString(__pyx_m, "SnapIterator", (PyObject *)&__pyx_type_5rados_SnapIterator) < 0) __PYX_ERR(0, 1444, __pyx_L1_error) - __pyx_ptype_5rados_SnapIterator = &__pyx_type_5rados_SnapIterator; - if (PyType_Ready(&__pyx_type_5rados_Snap) < 0) __PYX_ERR(0, 1511, __pyx_L1_error) - __pyx_type_5rados_Snap.tp_print = 0; - if (PyObject_SetAttrString(__pyx_m, "Snap", (PyObject *)&__pyx_type_5rados_Snap) < 0) __PYX_ERR(0, 1511, __pyx_L1_error) - __pyx_ptype_5rados_Snap = &__pyx_type_5rados_Snap; - if (PyType_Ready(&__pyx_type_5rados_Completion) < 0) __PYX_ERR(0, 1545, __pyx_L1_error) - __pyx_type_5rados_Completion.tp_print = 0; - if (PyObject_SetAttrString(__pyx_m, "Completion", (PyObject *)&__pyx_type_5rados_Completion) < 0) __PYX_ERR(0, 1545, __pyx_L1_error) - __pyx_ptype_5rados_Completion = &__pyx_type_5rados_Completion; - if (PyType_Ready(&__pyx_type_5rados_WriteOp) < 0) __PYX_ERR(0, 1680, __pyx_L1_error) - __pyx_type_5rados_WriteOp.tp_print = 0; - if (PyObject_SetAttrString(__pyx_m, "WriteOp", (PyObject *)&__pyx_type_5rados_WriteOp) < 0) __PYX_ERR(0, 1680, __pyx_L1_error) - __pyx_ptype_5rados_WriteOp = &__pyx_type_5rados_WriteOp; - if (PyType_Ready(&__pyx_type_5rados_ReadOp) < 0) __PYX_ERR(0, 1697, __pyx_L1_error) - __pyx_type_5rados_ReadOp.tp_print = 0; - if (PyObject_SetAttrString(__pyx_m, "ReadOp", (PyObject *)&__pyx_type_5rados_ReadOp) < 0) __PYX_ERR(0, 1697, __pyx_L1_error) - __pyx_ptype_5rados_ReadOp = &__pyx_type_5rados_ReadOp; - if (PyType_Ready(&__pyx_type_5rados___pyx_scope_struct__requires) < 0) __PYX_ERR(0, 394, __pyx_L1_error) - __pyx_type_5rados___pyx_scope_struct__requires.tp_print = 0; - __pyx_ptype_5rados___pyx_scope_struct__requires = &__pyx_type_5rados___pyx_scope_struct__requires; - if (PyType_Ready(&__pyx_type_5rados___pyx_scope_struct_1_check_type) < 0) __PYX_ERR(0, 401, __pyx_L1_error) - __pyx_type_5rados___pyx_scope_struct_1_check_type.tp_print = 0; - __pyx_ptype_5rados___pyx_scope_struct_1_check_type = &__pyx_type_5rados___pyx_scope_struct_1_check_type; - if (PyType_Ready(&__pyx_type_5rados___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 403, __pyx_L1_error) - __pyx_type_5rados___pyx_scope_struct_2_genexpr.tp_print = 0; - __pyx_ptype_5rados___pyx_scope_struct_2_genexpr = &__pyx_type_5rados___pyx_scope_struct_2_genexpr; - if (PyType_Ready(&__pyx_type_5rados___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 405, __pyx_L1_error) - __pyx_type_5rados___pyx_scope_struct_3_genexpr.tp_print = 0; - __pyx_ptype_5rados___pyx_scope_struct_3_genexpr = &__pyx_type_5rados___pyx_scope_struct_3_genexpr; - if (PyType_Ready(&__pyx_type_5rados___pyx_scope_struct_4_wrapper) < 0) __PYX_ERR(0, 414, __pyx_L1_error) - __pyx_type_5rados___pyx_scope_struct_4_wrapper.tp_print = 0; - __pyx_ptype_5rados___pyx_scope_struct_4_wrapper = &__pyx_type_5rados___pyx_scope_struct_4_wrapper; - if (PyType_Ready(&__pyx_type_5rados___pyx_scope_struct_5_validate_func) < 0) __PYX_ERR(0, 418, __pyx_L1_error) - __pyx_type_5rados___pyx_scope_struct_5_validate_func.tp_print = 0; - __pyx_ptype_5rados___pyx_scope_struct_5_validate_func = &__pyx_type_5rados___pyx_scope_struct_5_validate_func; - if (PyType_Ready(&__pyx_type_5rados___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 421, __pyx_L1_error) - __pyx_type_5rados___pyx_scope_struct_6_genexpr.tp_print = 0; - __pyx_ptype_5rados___pyx_scope_struct_6_genexpr = &__pyx_type_5rados___pyx_scope_struct_6_genexpr; - if (PyType_Ready(&__pyx_type_5rados___pyx_scope_struct_7_aio_read) < 0) __PYX_ERR(0, 1939, __pyx_L1_error) - __pyx_type_5rados___pyx_scope_struct_7_aio_read.tp_print = 0; - __pyx_ptype_5rados___pyx_scope_struct_7_aio_read = &__pyx_type_5rados___pyx_scope_struct_7_aio_read; - if (PyType_Ready(&__pyx_type_5rados___pyx_scope_struct_8_set_object_locator) < 0) __PYX_ERR(0, 3090, __pyx_L1_error) - __pyx_type_5rados___pyx_scope_struct_8_set_object_locator.tp_print = 0; - __pyx_ptype_5rados___pyx_scope_struct_8_set_object_locator = &__pyx_type_5rados___pyx_scope_struct_8_set_object_locator; - if (PyType_Ready(&__pyx_type_5rados___pyx_scope_struct_9_set_object_namespace) < 0) __PYX_ERR(0, 3103, __pyx_L1_error) - __pyx_type_5rados___pyx_scope_struct_9_set_object_namespace.tp_print = 0; - __pyx_ptype_5rados___pyx_scope_struct_9_set_object_namespace = &__pyx_type_5rados___pyx_scope_struct_9_set_object_namespace; - /*--- Type import code ---*/ - __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", - #if CYTHON_COMPILING_IN_PYPY - sizeof(PyTypeObject), - #else - sizeof(PyHeapTypeObject), - #endif - 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(2, 9, __pyx_L1_error) - __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) __PYX_ERR(3, 8, __pyx_L1_error) - __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) __PYX_ERR(4, 15, __pyx_L1_error) - /*--- Variable import code ---*/ - /*--- Function import code ---*/ - /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - - /* "rados.pyx":21 - * from libc.stdlib cimport malloc, realloc, free - * - * import sys # <<<<<<<<<<<<<< - * import threading - * import time - */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 21, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":22 - * - * import sys - * import threading # <<<<<<<<<<<<<< - * import time - * - */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_threading, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_threading, __pyx_t_1) < 0) __PYX_ERR(0, 22, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":23 - * import sys - * import threading - * import time # <<<<<<<<<<<<<< - * - * from datetime import datetime - */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_time, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_1) < 0) __PYX_ERR(0, 23, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":25 - * import time - * - * from datetime import datetime # <<<<<<<<<<<<<< - * from functools import partial, wraps - * from itertools import chain - */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_n_s_datetime); - __Pyx_GIVEREF(__pyx_n_s_datetime); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_datetime); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime, __pyx_t_1) < 0) __PYX_ERR(0, 25, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":26 - * - * from datetime import datetime - * from functools import partial, wraps # <<<<<<<<<<<<<< - * from itertools import chain - * - */ - __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_partial); - __Pyx_GIVEREF(__pyx_n_s_partial); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_partial); - __Pyx_INCREF(__pyx_n_s_wraps); - __Pyx_GIVEREF(__pyx_n_s_wraps); - PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_wraps); - __pyx_t_1 = __Pyx_Import(__pyx_n_s_functools, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_partial); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_partial, __pyx_t_2) < 0) __PYX_ERR(0, 26, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_wraps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_wraps, __pyx_t_2) < 0) __PYX_ERR(0, 26, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":27 - * from datetime import datetime - * from functools import partial, wraps - * from itertools import chain # <<<<<<<<<<<<<< - * - * # Are we running Python 2.x - */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_n_s_chain); - __Pyx_GIVEREF(__pyx_n_s_chain); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_chain); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_itertools, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_chain); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_chain, __pyx_t_1) < 0) __PYX_ERR(0, 27, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":30 - * - * # Are we running Python 2.x - * _python2 = sys.hexversion < 0x03000000 # <<<<<<<<<<<<<< - * - * if _python2: - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_hexversion); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_50331648, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_python2, __pyx_t_2) < 0) __PYX_ERR(0, 30, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":32 - * _python2 = sys.hexversion < 0x03000000 - * - * if _python2: # <<<<<<<<<<<<<< - * str_type = basestring - * else: - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_python2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 32, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_3) { - - /* "rados.pyx":33 - * - * if _python2: - * str_type = basestring # <<<<<<<<<<<<<< - * else: - * str_type = str - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_str_type, ((PyObject *)(&PyBaseString_Type))) < 0) __PYX_ERR(0, 33, __pyx_L1_error) - - /* "rados.pyx":32 - * _python2 = sys.hexversion < 0x03000000 - * - * if _python2: # <<<<<<<<<<<<<< - * str_type = basestring - * else: - */ - goto __pyx_L2; - } - - /* "rados.pyx":35 - * str_type = basestring - * else: - * str_type = str # <<<<<<<<<<<<<< - * - * - */ - /*else*/ { - if (PyDict_SetItem(__pyx_d, __pyx_n_s_str_type, ((PyObject *)(&PyString_Type))) < 0) __PYX_ERR(0, 35, __pyx_L1_error) - } - __pyx_L2:; - - /* "rados.pyx":251 - * - * - * LIBRADOS_OP_FLAG_EXCL = _LIBRADOS_OP_FLAG_EXCL # <<<<<<<<<<<<<< - * LIBRADOS_OP_FLAG_FAILOK = _LIBRADOS_OP_FLAG_FAILOK - * LIBRADOS_OP_FLAG_FADVISE_RANDOM = _LIBRADOS_OP_FLAG_FADVISE_RANDOM - */ - __pyx_t_2 = __Pyx_PyInt_From_int(LIBRADOS_OP_FLAG_EXCL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBRADOS_OP_FLAG_EXCL, __pyx_t_2) < 0) __PYX_ERR(0, 251, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":252 - * - * LIBRADOS_OP_FLAG_EXCL = _LIBRADOS_OP_FLAG_EXCL - * LIBRADOS_OP_FLAG_FAILOK = _LIBRADOS_OP_FLAG_FAILOK # <<<<<<<<<<<<<< - * LIBRADOS_OP_FLAG_FADVISE_RANDOM = _LIBRADOS_OP_FLAG_FADVISE_RANDOM - * LIBRADOS_OP_FLAG_FADVISE_SEQUENTIAL = _LIBRADOS_OP_FLAG_FADVISE_SEQUENTIAL - */ - __pyx_t_2 = __Pyx_PyInt_From_int(LIBRADOS_OP_FLAG_FAILOK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBRADOS_OP_FLAG_FAILOK, __pyx_t_2) < 0) __PYX_ERR(0, 252, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":253 - * LIBRADOS_OP_FLAG_EXCL = _LIBRADOS_OP_FLAG_EXCL - * LIBRADOS_OP_FLAG_FAILOK = _LIBRADOS_OP_FLAG_FAILOK - * LIBRADOS_OP_FLAG_FADVISE_RANDOM = _LIBRADOS_OP_FLAG_FADVISE_RANDOM # <<<<<<<<<<<<<< - * LIBRADOS_OP_FLAG_FADVISE_SEQUENTIAL = _LIBRADOS_OP_FLAG_FADVISE_SEQUENTIAL - * LIBRADOS_OP_FLAG_FADVISE_WILLNEED = _LIBRADOS_OP_FLAG_FADVISE_WILLNEED - */ - __pyx_t_2 = __Pyx_PyInt_From_int(LIBRADOS_OP_FLAG_FADVISE_RANDOM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBRADOS_OP_FLAG_FADVISE_RANDOM, __pyx_t_2) < 0) __PYX_ERR(0, 253, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":254 - * LIBRADOS_OP_FLAG_FAILOK = _LIBRADOS_OP_FLAG_FAILOK - * LIBRADOS_OP_FLAG_FADVISE_RANDOM = _LIBRADOS_OP_FLAG_FADVISE_RANDOM - * LIBRADOS_OP_FLAG_FADVISE_SEQUENTIAL = _LIBRADOS_OP_FLAG_FADVISE_SEQUENTIAL # <<<<<<<<<<<<<< - * LIBRADOS_OP_FLAG_FADVISE_WILLNEED = _LIBRADOS_OP_FLAG_FADVISE_WILLNEED - * LIBRADOS_OP_FLAG_FADVISE_DONTNEED = _LIBRADOS_OP_FLAG_FADVISE_DONTNEED - */ - __pyx_t_2 = __Pyx_PyInt_From_int(LIBRADOS_OP_FLAG_FADVISE_SEQUENTIAL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 254, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBRADOS_OP_FLAG_FADVISE_SEQUENT, __pyx_t_2) < 0) __PYX_ERR(0, 254, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":255 - * LIBRADOS_OP_FLAG_FADVISE_RANDOM = _LIBRADOS_OP_FLAG_FADVISE_RANDOM - * LIBRADOS_OP_FLAG_FADVISE_SEQUENTIAL = _LIBRADOS_OP_FLAG_FADVISE_SEQUENTIAL - * LIBRADOS_OP_FLAG_FADVISE_WILLNEED = _LIBRADOS_OP_FLAG_FADVISE_WILLNEED # <<<<<<<<<<<<<< - * LIBRADOS_OP_FLAG_FADVISE_DONTNEED = _LIBRADOS_OP_FLAG_FADVISE_DONTNEED - * LIBRADOS_OP_FLAG_FADVISE_NOCACHE = _LIBRADOS_OP_FLAG_FADVISE_NOCACHE - */ - __pyx_t_2 = __Pyx_PyInt_From_int(LIBRADOS_OP_FLAG_FADVISE_WILLNEED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBRADOS_OP_FLAG_FADVISE_WILLNEE, __pyx_t_2) < 0) __PYX_ERR(0, 255, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":256 - * LIBRADOS_OP_FLAG_FADVISE_SEQUENTIAL = _LIBRADOS_OP_FLAG_FADVISE_SEQUENTIAL - * LIBRADOS_OP_FLAG_FADVISE_WILLNEED = _LIBRADOS_OP_FLAG_FADVISE_WILLNEED - * LIBRADOS_OP_FLAG_FADVISE_DONTNEED = _LIBRADOS_OP_FLAG_FADVISE_DONTNEED # <<<<<<<<<<<<<< - * LIBRADOS_OP_FLAG_FADVISE_NOCACHE = _LIBRADOS_OP_FLAG_FADVISE_NOCACHE - * - */ - __pyx_t_2 = __Pyx_PyInt_From_int(LIBRADOS_OP_FLAG_FADVISE_DONTNEED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBRADOS_OP_FLAG_FADVISE_DONTNEE, __pyx_t_2) < 0) __PYX_ERR(0, 256, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":257 - * LIBRADOS_OP_FLAG_FADVISE_WILLNEED = _LIBRADOS_OP_FLAG_FADVISE_WILLNEED - * LIBRADOS_OP_FLAG_FADVISE_DONTNEED = _LIBRADOS_OP_FLAG_FADVISE_DONTNEED - * LIBRADOS_OP_FLAG_FADVISE_NOCACHE = _LIBRADOS_OP_FLAG_FADVISE_NOCACHE # <<<<<<<<<<<<<< - * - * LIBRADOS_SNAP_HEAD = _LIBRADOS_SNAP_HEAD - */ - __pyx_t_2 = __Pyx_PyInt_From_int(LIBRADOS_OP_FLAG_FADVISE_NOCACHE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBRADOS_OP_FLAG_FADVISE_NOCACHE, __pyx_t_2) < 0) __PYX_ERR(0, 257, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":259 - * LIBRADOS_OP_FLAG_FADVISE_NOCACHE = _LIBRADOS_OP_FLAG_FADVISE_NOCACHE - * - * LIBRADOS_SNAP_HEAD = _LIBRADOS_SNAP_HEAD # <<<<<<<<<<<<<< - * - * LIBRADOS_OPERATION_NOFLAG = _LIBRADOS_OPERATION_NOFLAG - */ - __pyx_t_2 = __Pyx_PyInt_From_uint64_t(LIBRADOS_SNAP_HEAD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBRADOS_SNAP_HEAD, __pyx_t_2) < 0) __PYX_ERR(0, 259, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":261 - * LIBRADOS_SNAP_HEAD = _LIBRADOS_SNAP_HEAD - * - * LIBRADOS_OPERATION_NOFLAG = _LIBRADOS_OPERATION_NOFLAG # <<<<<<<<<<<<<< - * LIBRADOS_OPERATION_BALANCE_READS = _LIBRADOS_OPERATION_BALANCE_READS - * LIBRADOS_OPERATION_LOCALIZE_READS = _LIBRADOS_OPERATION_LOCALIZE_READS - */ - __pyx_t_2 = __Pyx_PyInt_From_int(LIBRADOS_OPERATION_NOFLAG); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 261, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBRADOS_OPERATION_NOFLAG, __pyx_t_2) < 0) __PYX_ERR(0, 261, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":262 - * - * LIBRADOS_OPERATION_NOFLAG = _LIBRADOS_OPERATION_NOFLAG - * LIBRADOS_OPERATION_BALANCE_READS = _LIBRADOS_OPERATION_BALANCE_READS # <<<<<<<<<<<<<< - * LIBRADOS_OPERATION_LOCALIZE_READS = _LIBRADOS_OPERATION_LOCALIZE_READS - * LIBRADOS_OPERATION_ORDER_READS_WRITES = _LIBRADOS_OPERATION_ORDER_READS_WRITES - */ - __pyx_t_2 = __Pyx_PyInt_From_int(LIBRADOS_OPERATION_BALANCE_READS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBRADOS_OPERATION_BALANCE_READS, __pyx_t_2) < 0) __PYX_ERR(0, 262, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":263 - * LIBRADOS_OPERATION_NOFLAG = _LIBRADOS_OPERATION_NOFLAG - * LIBRADOS_OPERATION_BALANCE_READS = _LIBRADOS_OPERATION_BALANCE_READS - * LIBRADOS_OPERATION_LOCALIZE_READS = _LIBRADOS_OPERATION_LOCALIZE_READS # <<<<<<<<<<<<<< - * LIBRADOS_OPERATION_ORDER_READS_WRITES = _LIBRADOS_OPERATION_ORDER_READS_WRITES - * LIBRADOS_OPERATION_IGNORE_CACHE = _LIBRADOS_OPERATION_IGNORE_CACHE - */ - __pyx_t_2 = __Pyx_PyInt_From_int(LIBRADOS_OPERATION_LOCALIZE_READS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBRADOS_OPERATION_LOCALIZE_READ, __pyx_t_2) < 0) __PYX_ERR(0, 263, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":264 - * LIBRADOS_OPERATION_BALANCE_READS = _LIBRADOS_OPERATION_BALANCE_READS - * LIBRADOS_OPERATION_LOCALIZE_READS = _LIBRADOS_OPERATION_LOCALIZE_READS - * LIBRADOS_OPERATION_ORDER_READS_WRITES = _LIBRADOS_OPERATION_ORDER_READS_WRITES # <<<<<<<<<<<<<< - * LIBRADOS_OPERATION_IGNORE_CACHE = _LIBRADOS_OPERATION_IGNORE_CACHE - * LIBRADOS_OPERATION_SKIPRWLOCKS = _LIBRADOS_OPERATION_SKIPRWLOCKS - */ - __pyx_t_2 = __Pyx_PyInt_From_int(LIBRADOS_OPERATION_ORDER_READS_WRITES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBRADOS_OPERATION_ORDER_READS_W, __pyx_t_2) < 0) __PYX_ERR(0, 264, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":265 - * LIBRADOS_OPERATION_LOCALIZE_READS = _LIBRADOS_OPERATION_LOCALIZE_READS - * LIBRADOS_OPERATION_ORDER_READS_WRITES = _LIBRADOS_OPERATION_ORDER_READS_WRITES - * LIBRADOS_OPERATION_IGNORE_CACHE = _LIBRADOS_OPERATION_IGNORE_CACHE # <<<<<<<<<<<<<< - * LIBRADOS_OPERATION_SKIPRWLOCKS = _LIBRADOS_OPERATION_SKIPRWLOCKS - * LIBRADOS_OPERATION_IGNORE_OVERLAY = _LIBRADOS_OPERATION_IGNORE_OVERLAY - */ - __pyx_t_2 = __Pyx_PyInt_From_int(LIBRADOS_OPERATION_IGNORE_CACHE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBRADOS_OPERATION_IGNORE_CACHE, __pyx_t_2) < 0) __PYX_ERR(0, 265, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":266 - * LIBRADOS_OPERATION_ORDER_READS_WRITES = _LIBRADOS_OPERATION_ORDER_READS_WRITES - * LIBRADOS_OPERATION_IGNORE_CACHE = _LIBRADOS_OPERATION_IGNORE_CACHE - * LIBRADOS_OPERATION_SKIPRWLOCKS = _LIBRADOS_OPERATION_SKIPRWLOCKS # <<<<<<<<<<<<<< - * LIBRADOS_OPERATION_IGNORE_OVERLAY = _LIBRADOS_OPERATION_IGNORE_OVERLAY - * - */ - __pyx_t_2 = __Pyx_PyInt_From_int(LIBRADOS_OPERATION_SKIPRWLOCKS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBRADOS_OPERATION_SKIPRWLOCKS, __pyx_t_2) < 0) __PYX_ERR(0, 266, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":267 - * LIBRADOS_OPERATION_IGNORE_CACHE = _LIBRADOS_OPERATION_IGNORE_CACHE - * LIBRADOS_OPERATION_SKIPRWLOCKS = _LIBRADOS_OPERATION_SKIPRWLOCKS - * LIBRADOS_OPERATION_IGNORE_OVERLAY = _LIBRADOS_OPERATION_IGNORE_OVERLAY # <<<<<<<<<<<<<< - * - * LIBRADOS_ALL_NSPACES = _LIBRADOS_ALL_NSPACES.decode('utf-8') - */ - __pyx_t_2 = __Pyx_PyInt_From_int(LIBRADOS_OPERATION_IGNORE_OVERLAY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 267, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBRADOS_OPERATION_IGNORE_OVERLA, __pyx_t_2) < 0) __PYX_ERR(0, 267, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":269 - * LIBRADOS_OPERATION_IGNORE_OVERLAY = _LIBRADOS_OPERATION_IGNORE_OVERLAY - * - * LIBRADOS_ALL_NSPACES = _LIBRADOS_ALL_NSPACES.decode('utf-8') # <<<<<<<<<<<<<< - * - * ANONYMOUS_AUID = 0xffffffffffffffff - */ - __pyx_t_2 = __Pyx_decode_c_string(LIBRADOS_ALL_NSPACES, 0, strlen(LIBRADOS_ALL_NSPACES), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBRADOS_ALL_NSPACES, __pyx_t_2) < 0) __PYX_ERR(0, 269, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":271 - * LIBRADOS_ALL_NSPACES = _LIBRADOS_ALL_NSPACES.decode('utf-8') - * - * ANONYMOUS_AUID = 0xffffffffffffffff # <<<<<<<<<<<<<< - * ADMIN_AUID = 0 - * - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ANONYMOUS_AUID, __pyx_int_18446744073709551615) < 0) __PYX_ERR(0, 271, __pyx_L1_error) - - /* "rados.pyx":272 - * - * ANONYMOUS_AUID = 0xffffffffffffffff - * ADMIN_AUID = 0 # <<<<<<<<<<<<<< - * - * class Error(Exception): - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADMIN_AUID, __pyx_int_0) < 0) __PYX_ERR(0, 272, __pyx_L1_error) - - /* "rados.pyx":274 - * ADMIN_AUID = 0 - * - * class Error(Exception): # <<<<<<<<<<<<<< - * """ `Error` class, derived from `Exception` """ - * - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 274, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_builtin_Exception); - __Pyx_GIVEREF(__pyx_builtin_Exception); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_Exception); - __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Error, __pyx_n_s_Error, (PyObject *) NULL, __pyx_n_s_rados, __pyx_kp_s_Error_class_derived_from_Except); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Error, __pyx_t_2, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 274, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Error, __pyx_t_5) < 0) __PYX_ERR(0, 274, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":278 - * - * - * class InvalidArgument(Error): # <<<<<<<<<<<<<< - * pass - * - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_InvalidArgument, __pyx_n_s_InvalidArgument, (PyObject *) NULL, __pyx_n_s_rados, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_InvalidArgument, __pyx_t_1, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_InvalidArgument, __pyx_t_5) < 0) __PYX_ERR(0, 278, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":282 - * - * - * class InterruptedOrTimeoutError(Error): # <<<<<<<<<<<<<< - * """ `InterruptedOrTimeoutError` class, derived from `Error` """ - * pass - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_InterruptedOrTimeoutError, __pyx_n_s_InterruptedOrTimeoutError, (PyObject *) NULL, __pyx_n_s_rados, __pyx_kp_s_InterruptedOrTimeoutError_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_InterruptedOrTimeoutError, __pyx_t_2, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_InterruptedOrTimeoutError, __pyx_t_5) < 0) __PYX_ERR(0, 282, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":287 - * - * - * class PermissionError(Error): # <<<<<<<<<<<<<< - * """ `PermissionError` class, derived from `Error` """ - * pass - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_PermissionError, __pyx_n_s_PermissionError, (PyObject *) NULL, __pyx_n_s_rados, __pyx_kp_s_PermissionError_class_derived_f); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_PermissionError, __pyx_t_1, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PermissionError, __pyx_t_5) < 0) __PYX_ERR(0, 287, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":291 - * pass - * - * class PermissionDeniedError(Error): # <<<<<<<<<<<<<< - * """ deal with EACCES related. """ - * pass - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_PermissionDeniedError, __pyx_n_s_PermissionDeniedError, (PyObject *) NULL, __pyx_n_s_rados, __pyx_kp_s_deal_with_EACCES_related); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 291, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_PermissionDeniedError, __pyx_t_2, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 291, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_PermissionDeniedError, __pyx_t_5) < 0) __PYX_ERR(0, 291, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":295 - * pass - * - * class ObjectNotFound(Error): # <<<<<<<<<<<<<< - * """ `ObjectNotFound` class, derived from `Error` """ - * pass - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_ObjectNotFound, __pyx_n_s_ObjectNotFound, (PyObject *) NULL, __pyx_n_s_rados, __pyx_kp_s_ObjectNotFound_class_derived_fr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 295, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_ObjectNotFound, __pyx_t_1, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 295, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ObjectNotFound, __pyx_t_5) < 0) __PYX_ERR(0, 295, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":300 - * - * - * class NoData(Error): # <<<<<<<<<<<<<< - * """ `NoData` class, derived from `Error` """ - * pass - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_NoData, __pyx_n_s_NoData, (PyObject *) NULL, __pyx_n_s_rados, __pyx_kp_s_NoData_class_derived_from_Error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 300, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_NoData, __pyx_t_2, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_NoData, __pyx_t_5) < 0) __PYX_ERR(0, 300, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":305 - * - * - * class ObjectExists(Error): # <<<<<<<<<<<<<< - * """ `ObjectExists` class, derived from `Error` """ - * pass - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 305, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 305, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_ObjectExists, __pyx_n_s_ObjectExists, (PyObject *) NULL, __pyx_n_s_rados, __pyx_kp_s_ObjectExists_class_derived_from); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 305, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_ObjectExists, __pyx_t_1, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 305, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ObjectExists, __pyx_t_5) < 0) __PYX_ERR(0, 305, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":310 - * - * - * class ObjectBusy(Error): # <<<<<<<<<<<<<< - * """ `ObjectBusy` class, derived from `Error` """ - * pass - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_ObjectBusy, __pyx_n_s_ObjectBusy, (PyObject *) NULL, __pyx_n_s_rados, __pyx_kp_s_ObjectBusy_class_derived_from_E); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 310, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ObjectBusy, __pyx_t_2, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 310, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ObjectBusy, __pyx_t_5) < 0) __PYX_ERR(0, 310, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":315 - * - * - * class IOError(Error): # <<<<<<<<<<<<<< - * """ `IOError` class, derived from `Error` """ - * pass - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 315, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 315, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 315, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_IOError, __pyx_n_s_IOError, (PyObject *) NULL, __pyx_n_s_rados, __pyx_kp_s_IOError_class_derived_from_Erro); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 315, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_IOError, __pyx_t_1, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 315, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_IOError, __pyx_t_5) < 0) __PYX_ERR(0, 315, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":320 - * - * - * class NoSpace(Error): # <<<<<<<<<<<<<< - * """ `NoSpace` class, derived from `Error` """ - * pass - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 320, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_NoSpace, __pyx_n_s_NoSpace, (PyObject *) NULL, __pyx_n_s_rados, __pyx_kp_s_NoSpace_class_derived_from_Erro); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_NoSpace, __pyx_t_2, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 320, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_NoSpace, __pyx_t_5) < 0) __PYX_ERR(0, 320, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":325 - * - * - * class IncompleteWriteError(Error): # <<<<<<<<<<<<<< - * """ `IncompleteWriteError` class, derived from `Error` """ - * pass - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_IncompleteWriteError, __pyx_n_s_IncompleteWriteError, (PyObject *) NULL, __pyx_n_s_rados, __pyx_kp_s_IncompleteWriteError_class_deri); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_IncompleteWriteError, __pyx_t_1, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_IncompleteWriteError, __pyx_t_5) < 0) __PYX_ERR(0, 325, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":330 - * - * - * class RadosStateError(Error): # <<<<<<<<<<<<<< - * """ `RadosStateError` class, derived from `Error` """ - * pass - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_RadosStateError, __pyx_n_s_RadosStateError, (PyObject *) NULL, __pyx_n_s_rados, __pyx_kp_s_RadosStateError_class_derived_f); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_RadosStateError, __pyx_t_2, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_RadosStateError, __pyx_t_5) < 0) __PYX_ERR(0, 330, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":335 - * - * - * class IoctxStateError(Error): # <<<<<<<<<<<<<< - * """ `IoctxStateError` class, derived from `Error` """ - * pass - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 335, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 335, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 335, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_IoctxStateError, __pyx_n_s_IoctxStateError, (PyObject *) NULL, __pyx_n_s_rados, __pyx_kp_s_IoctxStateError_class_derived_f); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 335, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_IoctxStateError, __pyx_t_1, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 335, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_IoctxStateError, __pyx_t_5) < 0) __PYX_ERR(0, 335, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":339 - * pass - * - * class ObjectStateError(Error): # <<<<<<<<<<<<<< - * """ `ObjectStateError` class, derived from `Error` """ - * pass - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 339, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_ObjectStateError, __pyx_n_s_ObjectStateError, (PyObject *) NULL, __pyx_n_s_rados, __pyx_kp_s_ObjectStateError_class_derived); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 339, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ObjectStateError, __pyx_t_2, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 339, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ObjectStateError, __pyx_t_5) < 0) __PYX_ERR(0, 339, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":344 - * - * - * class LogicError(Error): # <<<<<<<<<<<<<< - * """ `` class, derived from `Error` """ - * pass - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_LogicError, __pyx_n_s_LogicError, (PyObject *) NULL, __pyx_n_s_rados, __pyx_kp_s_class_derived_from_Error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_LogicError, __pyx_t_1, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 344, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_LogicError, __pyx_t_5) < 0) __PYX_ERR(0, 344, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":349 - * - * - * class TimedOut(Error): # <<<<<<<<<<<<<< - * """ `TimedOut` class, derived from `Error` """ - * pass - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 349, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_TimedOut, __pyx_n_s_TimedOut, (PyObject *) NULL, __pyx_n_s_rados, __pyx_kp_s_TimedOut_class_derived_from_Err); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 349, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_TimedOut, __pyx_t_2, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 349, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_TimedOut, __pyx_t_5) < 0) __PYX_ERR(0, 349, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":356 - * - * cdef errno_to_exception = { - * errno.EPERM : PermissionError, # <<<<<<<<<<<<<< - * errno.ENOENT : ObjectNotFound, - * errno.EIO : IOError, - */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyInt_From_int(EPERM); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_PermissionError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 356, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_4) < 0) __PYX_ERR(0, 356, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "rados.pyx":357 - * cdef errno_to_exception = { - * errno.EPERM : PermissionError, - * errno.ENOENT : ObjectNotFound, # <<<<<<<<<<<<<< - * errno.EIO : IOError, - * errno.ENOSPC : NoSpace, - */ - __pyx_t_4 = __Pyx_PyInt_From_int(ENOENT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 357, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ObjectNotFound); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_2, __pyx_t_4, __pyx_t_1) < 0) __PYX_ERR(0, 356, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":358 - * errno.EPERM : PermissionError, - * errno.ENOENT : ObjectNotFound, - * errno.EIO : IOError, # <<<<<<<<<<<<<< - * errno.ENOSPC : NoSpace, - * errno.EEXIST : ObjectExists, - */ - __pyx_t_1 = __Pyx_PyInt_From_int(EIO); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_IOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 358, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_4) < 0) __PYX_ERR(0, 356, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "rados.pyx":359 - * errno.ENOENT : ObjectNotFound, - * errno.EIO : IOError, - * errno.ENOSPC : NoSpace, # <<<<<<<<<<<<<< - * errno.EEXIST : ObjectExists, - * errno.EBUSY : ObjectBusy, - */ - __pyx_t_4 = __Pyx_PyInt_From_int(ENOSPC); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 359, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_NoSpace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_2, __pyx_t_4, __pyx_t_1) < 0) __PYX_ERR(0, 356, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":360 - * errno.EIO : IOError, - * errno.ENOSPC : NoSpace, - * errno.EEXIST : ObjectExists, # <<<<<<<<<<<<<< - * errno.EBUSY : ObjectBusy, - * errno.ENODATA : NoData, - */ - __pyx_t_1 = __Pyx_PyInt_From_int(EEXIST); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_ObjectExists); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 360, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_4) < 0) __PYX_ERR(0, 356, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "rados.pyx":361 - * errno.ENOSPC : NoSpace, - * errno.EEXIST : ObjectExists, - * errno.EBUSY : ObjectBusy, # <<<<<<<<<<<<<< - * errno.ENODATA : NoData, - * errno.EINTR : InterruptedOrTimeoutError, - */ - __pyx_t_4 = __Pyx_PyInt_From_int(EBUSY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ObjectBusy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_2, __pyx_t_4, __pyx_t_1) < 0) __PYX_ERR(0, 356, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":362 - * errno.EEXIST : ObjectExists, - * errno.EBUSY : ObjectBusy, - * errno.ENODATA : NoData, # <<<<<<<<<<<<<< - * errno.EINTR : InterruptedOrTimeoutError, - * errno.ETIMEDOUT : TimedOut, - */ - __pyx_t_1 = __Pyx_PyInt_From_int(ENODATA); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NoData); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 362, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_4) < 0) __PYX_ERR(0, 356, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "rados.pyx":363 - * errno.EBUSY : ObjectBusy, - * errno.ENODATA : NoData, - * errno.EINTR : InterruptedOrTimeoutError, # <<<<<<<<<<<<<< - * errno.ETIMEDOUT : TimedOut, - * errno.EACCES : PermissionDeniedError - */ - __pyx_t_4 = __Pyx_PyInt_From_int(EINTR); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 363, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_InterruptedOrTimeoutError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_2, __pyx_t_4, __pyx_t_1) < 0) __PYX_ERR(0, 356, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":364 - * errno.ENODATA : NoData, - * errno.EINTR : InterruptedOrTimeoutError, - * errno.ETIMEDOUT : TimedOut, # <<<<<<<<<<<<<< - * errno.EACCES : PermissionDeniedError - * } - */ - __pyx_t_1 = __Pyx_PyInt_From_int(ETIMEDOUT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_TimedOut); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 364, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_4) < 0) __PYX_ERR(0, 356, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "rados.pyx":365 - * errno.EINTR : InterruptedOrTimeoutError, - * errno.ETIMEDOUT : TimedOut, - * errno.EACCES : PermissionDeniedError # <<<<<<<<<<<<<< - * } - * - */ - __pyx_t_4 = __Pyx_PyInt_From_int(EACCES); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 365, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - - /* "rados.pyx":366 - * errno.ETIMEDOUT : TimedOut, - * errno.EACCES : PermissionDeniedError - * } # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_PermissionDeniedError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_2, __pyx_t_4, __pyx_t_1) < 0) __PYX_ERR(0, 356, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XGOTREF(__pyx_v_5rados_errno_to_exception); - __Pyx_DECREF_SET(__pyx_v_5rados_errno_to_exception, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - - /* "rados.pyx":388 - * # helper to specify an optional argument, where in addition to `cls`, `None` - * # is also acceptable - * def opt(cls): # <<<<<<<<<<<<<< - * return (cls, None) - * - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5rados_1opt, NULL, __pyx_n_s_rados); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_opt, __pyx_t_2) < 0) __PYX_ERR(0, 388, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":394 - * # validate argument types of an instance method - * # kwargs is an un-ordered dict, so use args instead - * def requires(*types): # <<<<<<<<<<<<<< - * def is_type_of(v, t): - * if t is None: - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5rados_3requires, NULL, __pyx_n_s_rados); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_requires, __pyx_t_2) < 0) __PYX_ERR(0, 394, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":430 - * - * - * def cstr(val, name, encoding="utf-8", opt=False): # <<<<<<<<<<<<<< - * """ - * Create a byte string from a Python string - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5rados_5cstr, NULL, __pyx_n_s_rados); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 430, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_cstr, __pyx_t_2) < 0) __PYX_ERR(0, 430, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":451 - * - * - * def cstr_list(list_str, name, encoding="utf-8"): # <<<<<<<<<<<<<< - * return [cstr(s, name) for s in list_str] - * - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5rados_7cstr_list, NULL, __pyx_n_s_rados); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_cstr_list, __pyx_t_2) < 0) __PYX_ERR(0, 451, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":455 - * - * - * def decode_cstr(val, encoding="utf-8"): # <<<<<<<<<<<<<< - * """ - * Decode a byte string into a Python string. - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5rados_9decode_cstr, NULL, __pyx_n_s_rados); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_decode_cstr, __pyx_t_2) < 0) __PYX_ERR(0, 455, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":508 - * - * - * class Version(object): # <<<<<<<<<<<<<< - * """ Version information """ - * def __init__(self, major, minor, extra): - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 508, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_builtin_object); - __Pyx_GIVEREF(__pyx_builtin_object); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_object); - __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Version, __pyx_n_s_Version, (PyObject *) NULL, __pyx_n_s_rados, __pyx_kp_s_Version_information); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 508, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - - /* "rados.pyx":510 - * class Version(object): - * """ Version information """ - * def __init__(self, major, minor, extra): # <<<<<<<<<<<<<< - * self.major = major - * self.minor = minor - */ - __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5rados_7Version_1__init__, 0, __pyx_n_s_Version___init, NULL, __pyx_n_s_rados, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 510, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_init, __pyx_t_5) < 0) __PYX_ERR(0, 510, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "rados.pyx":515 - * self.extra = extra - * - * def __str__(self): # <<<<<<<<<<<<<< - * return "%d.%d.%d" % (self.major, self.minor, self.extra) - * - */ - __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5rados_7Version_3__str__, 0, __pyx_n_s_Version___str, NULL, __pyx_n_s_rados, __pyx_d, ((PyObject *)__pyx_codeobj__69)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 515, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_str, __pyx_t_5) < 0) __PYX_ERR(0, 515, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "rados.pyx":508 - * - * - * class Version(object): # <<<<<<<<<<<<<< - * """ Version information """ - * def __init__(self, major, minor, extra): - */ - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Version, __pyx_t_2, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 508, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Version, __pyx_t_5) < 0) __PYX_ERR(0, 508, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":527 - * self.__setup(*args, **kwargs) - * - * @requires(('rados_id', opt(str_type)), ('name', opt(str_type)), ('clustername', opt(str_type)), # <<<<<<<<<<<<<< - * ('conffile', opt(str_type))) - * def __setup(self, rados_id=None, name=None, clustername=None, - */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_opt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - } - } - if (!__pyx_t_8) { - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GOTREF(__pyx_t_5); - } else { - __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_n_s_rados_id); - __Pyx_GIVEREF(__pyx_n_s_rados_id); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_rados_id); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_opt); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - } - } - if (!__pyx_t_8) { - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GOTREF(__pyx_t_5); - } else { - __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_INCREF(__pyx_n_s_name_2); - __Pyx_GIVEREF(__pyx_n_s_name_2); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_n_s_name_2); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_opt); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); - } - } - if (!__pyx_t_8) { - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GOTREF(__pyx_t_5); - } else { - __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8); __pyx_t_8 = NULL; - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_INCREF(__pyx_n_s_clustername); - __Pyx_GIVEREF(__pyx_n_s_clustername); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_n_s_clustername); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_5); - __pyx_t_5 = 0; - - /* "rados.pyx":528 - * - * @requires(('rados_id', opt(str_type)), ('name', opt(str_type)), ('clustername', opt(str_type)), - * ('conffile', opt(str_type))) # <<<<<<<<<<<<<< - * def __setup(self, rados_id=None, name=None, clustername=None, - * conf_defaults=None, conffile=None, conf=None, flags=0): - */ - __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_opt); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 528, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 528, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_11, function); - } - } - if (!__pyx_t_8) { - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 528, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GOTREF(__pyx_t_5); - } else { - __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 528, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_8); __pyx_t_8 = NULL; - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 528, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - } - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 528, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_INCREF(__pyx_n_s_conffile); - __Pyx_GIVEREF(__pyx_n_s_conffile); - PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_n_s_conffile); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_5 = NULL; - __pyx_t_13 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_13 = 1; - } - } - __pyx_t_12 = PyTuple_New(4+__pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_5); __pyx_t_5 = NULL; - } - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_13, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_13, __pyx_t_9); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_13, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_12, 3+__pyx_t_13, __pyx_t_11); - __pyx_t_6 = 0; - __pyx_t_9 = 0; - __pyx_t_10 = 0; - __pyx_t_11 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "rados.pyx":529 - * @requires(('rados_id', opt(str_type)), ('name', opt(str_type)), ('clustername', opt(str_type)), - * ('conffile', opt(str_type))) - * def __setup(self, rados_id=None, name=None, clustername=None, # <<<<<<<<<<<<<< - * conf_defaults=None, conffile=None, conf=None, flags=0): - * self.monitor_callback = None - */ - __pyx_t_4 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Rados, __pyx_n_s_setup); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_12 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_12)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_12) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12); __pyx_t_12 = NULL; - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Rados->tp_dict, __pyx_n_s_setup, __pyx_t_2) < 0) __PYX_ERR(0, 529, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Rados); - - /* "rados.pyx":616 - * return Version(major, minor, extra) - * - * @requires(('path', opt(str_type))) # <<<<<<<<<<<<<< - * def conf_read_file(self, path=None): - * """ - */ - __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 616, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_opt); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 616, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 616, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_12))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_12); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_12, function); - } - } - if (!__pyx_t_9) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 616, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_GOTREF(__pyx_t_4); - } else { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 616, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); __pyx_t_9 = NULL; - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 616, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 616, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_INCREF(__pyx_n_s_path); - __Pyx_GIVEREF(__pyx_n_s_path); - PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_n_s_path); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_11, function); - } - } - if (!__pyx_t_4) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 616, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_12); - __pyx_t_12 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - - /* "rados.pyx":617 - * - * @requires(('path', opt(str_type))) - * def conf_read_file(self, path=None): # <<<<<<<<<<<<<< - * """ - * Configure the cluster handle using a Ceph config file. - */ - __pyx_t_11 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Rados, __pyx_n_s_conf_read_file); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 617, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_6 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_6) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 616, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 616, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_6); __pyx_t_6 = NULL; - __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_11); - __pyx_t_11 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 616, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Rados->tp_dict, __pyx_n_s_conf_read_file, __pyx_t_2) < 0) __PYX_ERR(0, 617, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Rados); - - /* "rados.pyx":684 - * raise make_ex(ret, "error calling conf_parse_env") - * - * @requires(('option', str_type)) # <<<<<<<<<<<<<< - * def conf_get(self, option): - * """ - */ - __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_n_s_option); - __Pyx_GIVEREF(__pyx_n_s_option); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_option); - __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_11); - __pyx_t_11 = 0; - __pyx_t_11 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_12))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_12, function); - } - } - if (!__pyx_t_11) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_11); __pyx_t_11 = NULL; - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - - /* "rados.pyx":685 - * - * @requires(('option', str_type)) - * def conf_get(self, option): # <<<<<<<<<<<<<< - * """ - * Get the value of a configuration option - */ - __pyx_t_12 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Rados, __pyx_n_s_conf_get); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 685, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_4 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 684, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_12); - __pyx_t_12 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Rados->tp_dict, __pyx_n_s_conf_get, __pyx_t_2) < 0) __PYX_ERR(0, 685, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Rados); - - /* "rados.pyx":718 - * free(ret_buf) - * - * @requires(('option', str_type), ('val', str_type)) # <<<<<<<<<<<<<< - * def conf_set(self, option, val): - * """ - */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 718, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 718, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 718, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_n_s_option); - __Pyx_GIVEREF(__pyx_n_s_option); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_option); - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_12); - __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 718, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 718, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_INCREF(__pyx_n_s_val); - __Pyx_GIVEREF(__pyx_n_s_val); - PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_n_s_val); - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_12); - __pyx_t_12 = 0; - __pyx_t_12 = NULL; - __pyx_t_13 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_12)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_13 = 1; - } - } - __pyx_t_10 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 718, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (__pyx_t_12) { - __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12); __pyx_t_12 = NULL; - } - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_13, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_13, __pyx_t_11); - __pyx_t_4 = 0; - __pyx_t_11 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 718, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - - /* "rados.pyx":719 - * - * @requires(('option', str_type), ('val', str_type)) - * def conf_set(self, option, val): # <<<<<<<<<<<<<< - * """ - * Set the value of a configuration option - */ - __pyx_t_6 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Rados, __pyx_n_s_conf_set); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 719, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_10 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_10) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 718, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 718, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL; - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 718, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Rados->tp_dict, __pyx_n_s_conf_set, __pyx_t_2) < 0) __PYX_ERR(0, 719, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Rados); - - /* "rados.pyx":821 - * 'num_objects': stats.num_objects} - * - * @requires(('pool_name', str_type)) # <<<<<<<<<<<<<< - * def pool_exists(self, pool_name): - * """ - */ - __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_INCREF(__pyx_n_s_pool_name); - __Pyx_GIVEREF(__pyx_n_s_pool_name); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_n_s_pool_name); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_11, function); - } - } - if (!__pyx_t_6) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 821, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL; - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - - /* "rados.pyx":822 - * - * @requires(('pool_name', str_type)) - * def pool_exists(self, pool_name): # <<<<<<<<<<<<<< - * """ - * Checks if a given pool exists. - */ - __pyx_t_11 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Rados, __pyx_n_s_pool_exists); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 822, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_4 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 821, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4); __pyx_t_4 = NULL; - __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_11); - __pyx_t_11 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Rados->tp_dict, __pyx_n_s_pool_exists, __pyx_t_2) < 0) __PYX_ERR(0, 822, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Rados); - - /* "rados.pyx":847 - * raise make_ex(ret, "error looking up pool '%s'" % pool_name) - * - * @requires(('pool_name', str_type)) # <<<<<<<<<<<<<< - * def pool_lookup(self, pool_name): - * """ - */ - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 847, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 847, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 847, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_n_s_pool_name); - __Pyx_GIVEREF(__pyx_n_s_pool_name); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_pool_name); - __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_11); - __pyx_t_11 = 0; - __pyx_t_11 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); - } - } - if (!__pyx_t_11) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 847, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 847, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_11); __pyx_t_11 = NULL; - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 847, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - - /* "rados.pyx":848 - * - * @requires(('pool_name', str_type)) - * def pool_lookup(self, pool_name): # <<<<<<<<<<<<<< - * """ - * Returns a pool's ID based on its name. - */ - __pyx_t_10 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Rados, __pyx_n_s_pool_lookup); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 848, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_6 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_6) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 847, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 847, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL; - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 847, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Rados->tp_dict, __pyx_n_s_pool_lookup, __pyx_t_2) < 0) __PYX_ERR(0, 848, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Rados); - - /* "rados.pyx":872 - * raise make_ex(ret, "error looking up pool '%s'" % pool_name) - * - * @requires(('pool_id', int)) # <<<<<<<<<<<<<< - * def pool_reverse_lookup(self, pool_id): - * """ - */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 872, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 872, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_INCREF(__pyx_n_s_pool_id); - __Pyx_GIVEREF(__pyx_n_s_pool_id); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_n_s_pool_id); - __Pyx_INCREF(((PyObject *)(&PyInt_Type))); - __Pyx_GIVEREF(((PyObject *)(&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)(&PyInt_Type))); - __pyx_t_6 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - } - } - if (!__pyx_t_6) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 872, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 872, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); __pyx_t_6 = NULL; - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 872, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "rados.pyx":873 - * - * @requires(('pool_id', int)) - * def pool_reverse_lookup(self, pool_id): # <<<<<<<<<<<<<< - * """ - * Returns a pool's name based on its ID. - */ - __pyx_t_4 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Rados, __pyx_n_s_pool_reverse_lookup); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 873, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_11) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 872, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 872, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); __pyx_t_11 = NULL; - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 872, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Rados->tp_dict, __pyx_n_s_pool_reverse_lookup, __pyx_t_2) < 0) __PYX_ERR(0, 873, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Rados); - - /* "rados.pyx":908 - * free(name) - * - * @requires(('pool_name', str_type), ('auid', opt(int)), ('crush_rule', opt(int))) # <<<<<<<<<<<<<< - * def create_pool(self, pool_name, auid=None, crush_rule=None): - * """ - */ - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 908, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 908, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 908, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_INCREF(__pyx_n_s_pool_name); - __Pyx_GIVEREF(__pyx_n_s_pool_name); - PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_n_s_pool_name); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_opt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 908, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_12 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_12)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - } - } - if (!__pyx_t_12) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)(&PyInt_Type))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 908, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - } else { - __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 908, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_12); __pyx_t_12 = NULL; - __Pyx_INCREF(((PyObject *)(&PyInt_Type))); - __Pyx_GIVEREF(((PyObject *)(&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_t_9, 0+1, ((PyObject *)(&PyInt_Type))); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 908, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 908, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_n_s_auid); - __Pyx_GIVEREF(__pyx_n_s_auid); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_auid); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_opt); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 908, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_12 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_12)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - } - } - if (!__pyx_t_12) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_9, ((PyObject *)(&PyInt_Type))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 908, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 908, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_12); __pyx_t_12 = NULL; - __Pyx_INCREF(((PyObject *)(&PyInt_Type))); - __Pyx_GIVEREF(((PyObject *)(&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)(&PyInt_Type))); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 908, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 908, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_INCREF(__pyx_n_s_crush_rule); - __Pyx_GIVEREF(__pyx_n_s_crush_rule); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_n_s_crush_rule); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = NULL; - __pyx_t_13 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); - __pyx_t_13 = 1; - } - } - __pyx_t_5 = PyTuple_New(3+__pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 908, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_4) { - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; - } - __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_13, __pyx_t_11); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_13, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_13, __pyx_t_9); - __pyx_t_11 = 0; - __pyx_t_6 = 0; - __pyx_t_9 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - - /* "rados.pyx":909 - * - * @requires(('pool_name', str_type), ('auid', opt(int)), ('crush_rule', opt(int))) - * def create_pool(self, pool_name, auid=None, crush_rule=None): # <<<<<<<<<<<<<< - * """ - * Create a pool: - */ - __pyx_t_10 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Rados, __pyx_n_s_create_pool); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 909, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 908, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 908, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __pyx_t_5 = NULL; - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 908, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Rados->tp_dict, __pyx_n_s_create_pool, __pyx_t_2) < 0) __PYX_ERR(0, 909, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Rados); - - /* "rados.pyx":953 - * raise make_ex(ret, "error creating pool '%s'" % pool_name) - * - * @requires(('pool_id', int)) # <<<<<<<<<<<<<< - * def get_pool_base_tier(self, pool_id): - * """ - */ - __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 953, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 953, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_INCREF(__pyx_n_s_pool_id); - __Pyx_GIVEREF(__pyx_n_s_pool_id); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_n_s_pool_id); - __Pyx_INCREF(((PyObject *)(&PyInt_Type))); - __Pyx_GIVEREF(((PyObject *)(&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)(&PyInt_Type))); - __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - } - } - if (!__pyx_t_5) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 953, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 953, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 953, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "rados.pyx":954 - * - * @requires(('pool_id', int)) - * def get_pool_base_tier(self, pool_id): # <<<<<<<<<<<<<< - * """ - * Get base pool - */ - __pyx_t_9 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Rados, __pyx_n_s_get_pool_base_tier); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 954, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_6 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_6) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 953, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 953, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6); __pyx_t_6 = NULL; - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 953, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Rados->tp_dict, __pyx_n_s_get_pool_base_tier, __pyx_t_2) < 0) __PYX_ERR(0, 954, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Rados); - - /* "rados.pyx":971 - * return int(base_tier) - * - * @requires(('pool_name', str_type)) # <<<<<<<<<<<<<< - * def delete_pool(self, pool_name): - * """ - */ - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 971, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 971, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 971, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_n_s_pool_name); - __Pyx_GIVEREF(__pyx_n_s_pool_name); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_pool_name); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_9 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); - } - } - if (!__pyx_t_9) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 971, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 971, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = NULL; - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 971, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - - /* "rados.pyx":972 - * - * @requires(('pool_name', str_type)) - * def delete_pool(self, pool_name): # <<<<<<<<<<<<<< - * """ - * Delete a pool and all data inside it. - */ - __pyx_t_10 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Rados, __pyx_n_s_delete_pool); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 972, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 971, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 971, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 971, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Rados->tp_dict, __pyx_n_s_delete_pool, __pyx_t_2) < 0) __PYX_ERR(0, 972, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Rados); - - /* "rados.pyx":995 - * raise make_ex(ret, "error deleting pool '%s'" % pool_name) - * - * @requires(('pool_id', int)) # <<<<<<<<<<<<<< - * def get_inconsistent_pgs(self, pool_id): - * """ - */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_INCREF(__pyx_n_s_pool_id); - __Pyx_GIVEREF(__pyx_n_s_pool_id); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_n_s_pool_id); - __Pyx_INCREF(((PyObject *)(&PyInt_Type))); - __Pyx_GIVEREF(((PyObject *)(&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)(&PyInt_Type))); - __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - } - } - if (!__pyx_t_5) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 995, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __pyx_t_5 = NULL; - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - - /* "rados.pyx":996 - * - * @requires(('pool_id', int)) - * def get_inconsistent_pgs(self, pool_id): # <<<<<<<<<<<<<< - * """ - * List inconsistent placement groups in the given pool - */ - __pyx_t_6 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Rados, __pyx_n_s_get_inconsistent_pgs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 996, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_9) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 995, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL; - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 995, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Rados->tp_dict, __pyx_n_s_get_inconsistent_pgs, __pyx_t_2) < 0) __PYX_ERR(0, 996, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Rados); - - /* "rados.pyx":1081 - * ref.Py_XDECREF(ret_s) - * - * @requires(('ioctx_name', str_type)) # <<<<<<<<<<<<<< - * def open_ioctx(self, ioctx_name): - * """ - */ - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1081, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1081, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1081, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_INCREF(__pyx_n_s_ioctx_name); - __Pyx_GIVEREF(__pyx_n_s_ioctx_name); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_n_s_ioctx_name); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); - } - } - if (!__pyx_t_6) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1081, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1081, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL; - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1081, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - - /* "rados.pyx":1082 - * - * @requires(('ioctx_name', str_type)) - * def open_ioctx(self, ioctx_name): # <<<<<<<<<<<<<< - * """ - * Create an io context - */ - __pyx_t_10 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Rados, __pyx_n_s_open_ioctx); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1082, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1081, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1081, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __pyx_t_5 = NULL; - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1081, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Rados->tp_dict, __pyx_n_s_open_ioctx, __pyx_t_2) < 0) __PYX_ERR(0, 1082, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Rados); - - /* "rados.pyx":1672 - * - * - * class OpCtx(object): # <<<<<<<<<<<<<< - * def __enter__(self): - * return self.create() - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1672, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_builtin_object); - __Pyx_GIVEREF(__pyx_builtin_object); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_object); - __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1672, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_OpCtx, __pyx_n_s_OpCtx, (PyObject *) NULL, __pyx_n_s_rados, (PyObject *) NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1672, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - - /* "rados.pyx":1673 - * - * class OpCtx(object): - * def __enter__(self): # <<<<<<<<<<<<<< - * return self.create() - * - */ - __pyx_t_10 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5rados_5OpCtx_1__enter__, 0, __pyx_n_s_OpCtx___enter, NULL, __pyx_n_s_rados, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1673, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_enter, __pyx_t_10) < 0) __PYX_ERR(0, 1673, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - - /* "rados.pyx":1676 - * return self.create() - * - * def __exit__(self, type, msg, traceback): # <<<<<<<<<<<<<< - * self.release() - * - */ - __pyx_t_10 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5rados_5OpCtx_3__exit__, 0, __pyx_n_s_OpCtx___exit, NULL, __pyx_n_s_rados, __pyx_d, ((PyObject *)__pyx_codeobj__73)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1676, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_exit, __pyx_t_10) < 0) __PYX_ERR(0, 1676, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - - /* "rados.pyx":1672 - * - * - * class OpCtx(object): # <<<<<<<<<<<<<< - * def __enter__(self): - * return self.create() - */ - __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_OpCtx, __pyx_t_2, __pyx_t_9, NULL, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1672, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_OpCtx, __pyx_t_10) < 0) __PYX_ERR(0, 1672, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":1693 - * - * - * class WriteOpCtx(WriteOp, OpCtx): # <<<<<<<<<<<<<< - * """write operation context manager""" - * - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_OpCtx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1693, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1693, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_ptype_5rados_WriteOp)); - __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5rados_WriteOp)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_5rados_WriteOp)); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1693, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_WriteOpCtx, __pyx_n_s_WriteOpCtx, (PyObject *) NULL, __pyx_n_s_rados, __pyx_kp_s_write_operation_context_manager); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1693, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_WriteOpCtx, __pyx_t_1, __pyx_t_9, NULL, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1693, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_WriteOpCtx, __pyx_t_10) < 0) __PYX_ERR(0, 1693, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rados.pyx":1710 - * - * - * class ReadOpCtx(ReadOp, OpCtx): # <<<<<<<<<<<<<< - * """read operation context manager""" - * - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_OpCtx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1710, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1710, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_ptype_5rados_ReadOp)); - __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5rados_ReadOp)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_5rados_ReadOp)); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1710, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_ReadOpCtx, __pyx_n_s_ReadOpCtx, (PyObject *) NULL, __pyx_n_s_rados, __pyx_kp_s_read_operation_context_manager); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1710, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ReadOpCtx, __pyx_t_2, __pyx_t_9, NULL, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1710, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ReadOpCtx, __pyx_t_10) < 0) __PYX_ERR(0, 1710, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":2051 - * % (self.name, auid)) - * - * @requires(('loc_key', str_type)) # <<<<<<<<<<<<<< - * def set_locator_key(self, loc_key): - * """ - */ - __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2051, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2051, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2051, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(__pyx_n_s_loc_key); - __Pyx_GIVEREF(__pyx_n_s_loc_key); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_loc_key); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_10 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - } - } - if (!__pyx_t_10) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2051, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2051, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_10); __pyx_t_10 = NULL; - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2051, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "rados.pyx":2052 - * - * @requires(('loc_key', str_type)) - * def set_locator_key(self, loc_key): # <<<<<<<<<<<<<< - * """ - * Set the key for mapping objects to pgs within an io context. - */ - __pyx_t_9 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Ioctx, __pyx_n_s_set_locator_key); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2052, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_6 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_6) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2051, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2051, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL; - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2051, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Ioctx->tp_dict, __pyx_n_s_set_locator_key, __pyx_t_2) < 0) __PYX_ERR(0, 2052, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Ioctx); - - /* "rados.pyx":2082 - * return self.locator_key - * - * @requires(('snap_id', long)) # <<<<<<<<<<<<<< - * def set_read(self, snap_id): - * """ - */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2082, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2082, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_INCREF(__pyx_n_s_snap_id); - __Pyx_GIVEREF(__pyx_n_s_snap_id); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_n_s_snap_id); - __Pyx_INCREF(((PyObject *)(&PyLong_Type))); - __Pyx_GIVEREF(((PyObject *)(&PyLong_Type))); - PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)(&PyLong_Type))); - __pyx_t_6 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - } - } - if (!__pyx_t_6) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2082, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2082, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6); __pyx_t_6 = NULL; - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2082, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "rados.pyx":2083 - * - * @requires(('snap_id', long)) - * def set_read(self, snap_id): # <<<<<<<<<<<<<< - * """ - * Set the snapshot for reading objects. - */ - __pyx_t_5 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Ioctx, __pyx_n_s_set_read); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2083, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_10) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2082, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2082, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10); __pyx_t_10 = NULL; - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2082, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Ioctx->tp_dict, __pyx_n_s_set_read, __pyx_t_2) < 0) __PYX_ERR(0, 2083, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Ioctx); - - /* "rados.pyx":2099 - * rados_ioctx_snap_set_read(self.io, _snap_id) - * - * @requires(('nspace', str_type)) # <<<<<<<<<<<<<< - * def set_namespace(self, nspace): - * """ - */ - __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2099, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2099, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2099, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_INCREF(__pyx_n_s_nspace); - __Pyx_GIVEREF(__pyx_n_s_nspace); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_n_s_nspace); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - } - } - if (!__pyx_t_5) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2099, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2099, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2099, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "rados.pyx":2100 - * - * @requires(('nspace', str_type)) - * def set_namespace(self, nspace): # <<<<<<<<<<<<<< - * """ - * Set the namespace for objects within an io context. - */ - __pyx_t_9 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Ioctx, __pyx_n_s_set_namespace); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2100, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_6 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_6) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2099, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2099, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6); __pyx_t_6 = NULL; - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2099, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Ioctx->tp_dict, __pyx_n_s_set_namespace, __pyx_t_2) < 0) __PYX_ERR(0, 2100, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Ioctx); - - /* "rados.pyx":2147 - * - * - * @requires(('key', str_type), ('data', bytes)) # <<<<<<<<<<<<<< - * def write(self, key, data, offset=0): - * """ - */ - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2147, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2147, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2147, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_n_s_key); - __Pyx_GIVEREF(__pyx_n_s_key); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_key); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2147, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_INCREF(__pyx_n_s_data); - __Pyx_GIVEREF(__pyx_n_s_data); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_n_s_data); - __Pyx_INCREF(((PyObject *)(&PyBytes_Type))); - __Pyx_GIVEREF(((PyObject *)(&PyBytes_Type))); - PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)(&PyBytes_Type))); - __pyx_t_5 = NULL; - __pyx_t_13 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); - __pyx_t_13 = 1; - } - } - __pyx_t_11 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2147, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5); __pyx_t_5 = NULL; - } - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_13, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_13, __pyx_t_9); - __pyx_t_6 = 0; - __pyx_t_9 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2147, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - - /* "rados.pyx":2148 - * - * @requires(('key', str_type), ('data', bytes)) - * def write(self, key, data, offset=0): # <<<<<<<<<<<<<< - * """ - * Write data to an object synchronously - */ - __pyx_t_10 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Ioctx, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2148, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_11) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2147, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2147, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_11); __pyx_t_11 = NULL; - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2147, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Ioctx->tp_dict, __pyx_n_s_write, __pyx_t_2) < 0) __PYX_ERR(0, 2148, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Ioctx); - - /* "rados.pyx":2183 - * returned %d, but should return zero on success." % (self.name, ret)) - * - * @requires(('key', str_type), ('data', bytes)) # <<<<<<<<<<<<<< - * def write_full(self, key, data): - * """ - */ - __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2183, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2183, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2183, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_INCREF(__pyx_n_s_key); - __Pyx_GIVEREF(__pyx_n_s_key); - PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_n_s_key); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2183, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_INCREF(__pyx_n_s_data); - __Pyx_GIVEREF(__pyx_n_s_data); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_n_s_data); - __Pyx_INCREF(((PyObject *)(&PyBytes_Type))); - __Pyx_GIVEREF(((PyObject *)(&PyBytes_Type))); - PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)(&PyBytes_Type))); - __pyx_t_6 = NULL; - __pyx_t_13 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - __pyx_t_13 = 1; - } - } - __pyx_t_5 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2183, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_6) { - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL; - } - __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_13, __pyx_t_11); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_13, __pyx_t_10); - __pyx_t_11 = 0; - __pyx_t_10 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2183, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "rados.pyx":2184 - * - * @requires(('key', str_type), ('data', bytes)) - * def write_full(self, key, data): # <<<<<<<<<<<<<< - * """ - * Write an entire object synchronously. - */ - __pyx_t_9 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Ioctx, __pyx_n_s_write_full); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2184, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2183, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2183, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); __pyx_t_5 = NULL; - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2183, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Ioctx->tp_dict, __pyx_n_s_write_full, __pyx_t_2) < 0) __PYX_ERR(0, 2184, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Ioctx); - - /* "rados.pyx":2218 - * returned %d, but should return zero on success." % (self.name, ret)) - * - * @requires(('key', str_type), ('data', bytes)) # <<<<<<<<<<<<<< - * def append(self, key, data): - * """ - */ - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(__pyx_n_s_key); - __Pyx_GIVEREF(__pyx_n_s_key); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_key); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_INCREF(__pyx_n_s_data); - __Pyx_GIVEREF(__pyx_n_s_data); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_n_s_data); - __Pyx_INCREF(((PyObject *)(&PyBytes_Type))); - __Pyx_GIVEREF(((PyObject *)(&PyBytes_Type))); - PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)(&PyBytes_Type))); - __pyx_t_11 = NULL; - __pyx_t_13 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); - __pyx_t_13 = 1; - } - } - __pyx_t_6 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (__pyx_t_11) { - __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_11); __pyx_t_11 = NULL; - } - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_13, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_13, __pyx_t_9); - __pyx_t_5 = 0; - __pyx_t_9 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - - /* "rados.pyx":2219 - * - * @requires(('key', str_type), ('data', bytes)) - * def append(self, key, data): # <<<<<<<<<<<<<< - * """ - * Append data to an object synchronously - */ - __pyx_t_10 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Ioctx, __pyx_n_s_append); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2219, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_6 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_6) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2218, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL; - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Ioctx->tp_dict, __pyx_n_s_append, __pyx_t_2) < 0) __PYX_ERR(0, 2219, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Ioctx); - - /* "rados.pyx":2250 - * returned %d, but should return zero on success." % (self.name, ret)) - * - * @requires(('key', str_type)) # <<<<<<<<<<<<<< - * def read(self, key, length=8192, offset=0): - * """ - */ - __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2250, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2250, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2250, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_n_s_key); - __Pyx_GIVEREF(__pyx_n_s_key); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_key); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_10 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - } - } - if (!__pyx_t_10) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2250, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2250, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_10); __pyx_t_10 = NULL; - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2250, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "rados.pyx":2251 - * - * @requires(('key', str_type)) - * def read(self, key, length=8192, offset=0): # <<<<<<<<<<<<<< - * """ - * Read data from an object synchronously - */ - __pyx_t_9 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Ioctx, __pyx_n_s_read); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2251, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2250, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2250, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2250, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Ioctx->tp_dict, __pyx_n_s_read, __pyx_t_2) < 0) __PYX_ERR(0, 2251, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Ioctx); - - /* "rados.pyx":2294 - * ref.Py_XDECREF(ret_s) - * - * @requires(('key', str_type), ('cls', str_type), ('method', str_type), ('data', bytes)) # <<<<<<<<<<<<<< - * def execute(self, key, cls, method, data, length=8192): - * """ - */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2294, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2294, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2294, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(__pyx_n_s_key); - __Pyx_GIVEREF(__pyx_n_s_key); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_key); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2294, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2294, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_INCREF(__pyx_n_s_cls); - __Pyx_GIVEREF(__pyx_n_s_cls); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_n_s_cls); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2294, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2294, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_INCREF(__pyx_n_s_method); - __Pyx_GIVEREF(__pyx_n_s_method); - PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_n_s_method); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2294, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_INCREF(__pyx_n_s_data); - __Pyx_GIVEREF(__pyx_n_s_data); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_n_s_data); - __Pyx_INCREF(((PyObject *)(&PyBytes_Type))); - __Pyx_GIVEREF(((PyObject *)(&PyBytes_Type))); - PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)(&PyBytes_Type))); - __pyx_t_4 = NULL; - __pyx_t_13 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_13 = 1; - } - } - __pyx_t_12 = PyTuple_New(4+__pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2294, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - if (__pyx_t_4) { - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_4); __pyx_t_4 = NULL; - } - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_13, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_13, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_13, __pyx_t_11); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_12, 3+__pyx_t_13, __pyx_t_9); - __pyx_t_5 = 0; - __pyx_t_10 = 0; - __pyx_t_11 = 0; - __pyx_t_9 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2294, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - - /* "rados.pyx":2295 - * - * @requires(('key', str_type), ('cls', str_type), ('method', str_type), ('data', bytes)) - * def execute(self, key, cls, method, data, length=8192): # <<<<<<<<<<<<<< - * """ - * Execute an OSD class method on an object. - */ - __pyx_t_6 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Ioctx, __pyx_n_s_execute); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2295, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_12 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_12)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_12) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2294, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2294, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_12); __pyx_t_12 = NULL; - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2294, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Ioctx->tp_dict, __pyx_n_s_execute, __pyx_t_2) < 0) __PYX_ERR(0, 2295, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Ioctx); - - /* "rados.pyx":2400 - * "num_wr_kb": stats.num_wr_kb} - * - * @requires(('key', str_type)) # <<<<<<<<<<<<<< - * def remove_object(self, key): - * """ - */ - __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2400, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2400, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2400, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_INCREF(__pyx_n_s_key); - __Pyx_GIVEREF(__pyx_n_s_key); - PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_n_s_key); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - } - } - if (!__pyx_t_6) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2400, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2400, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); __pyx_t_6 = NULL; - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_12); - __pyx_t_12 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2400, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "rados.pyx":2401 - * - * @requires(('key', str_type)) - * def remove_object(self, key): # <<<<<<<<<<<<<< - * """ - * Delete an object - */ - __pyx_t_9 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Ioctx, __pyx_n_s_remove_object); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2401, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_11 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_11) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2400, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2400, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL; - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2400, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Ioctx->tp_dict, __pyx_n_s_remove_object, __pyx_t_2) < 0) __PYX_ERR(0, 2401, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Ioctx); - - /* "rados.pyx":2425 - * return True - * - * @requires(('key', str_type)) # <<<<<<<<<<<<<< - * def trunc(self, key, size): - * """ - */ - __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2425, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2425, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2425, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_INCREF(__pyx_n_s_key); - __Pyx_GIVEREF(__pyx_n_s_key); - PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_n_s_key); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_9 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_12))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_12); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_12, function); - } - } - if (!__pyx_t_9) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2425, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2425, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); __pyx_t_9 = NULL; - __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_11); - __pyx_t_11 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2425, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - - /* "rados.pyx":2426 - * - * @requires(('key', str_type)) - * def trunc(self, key, size): # <<<<<<<<<<<<<< - * """ - * Resize an object - */ - __pyx_t_12 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Ioctx, __pyx_n_s_trunc); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2426, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_6 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_6) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2425, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2425, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); __pyx_t_6 = NULL; - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_12); - __pyx_t_12 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2425, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Ioctx->tp_dict, __pyx_n_s_trunc, __pyx_t_2) < 0) __PYX_ERR(0, 2426, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Ioctx); - - /* "rados.pyx":2455 - * return ret - * - * @requires(('key', str_type)) # <<<<<<<<<<<<<< - * def stat(self, key): - * """ - */ - __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2455, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2455, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2455, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_n_s_key); - __Pyx_GIVEREF(__pyx_n_s_key); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_key); - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_12); - __pyx_t_12 = 0; - __pyx_t_12 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_12)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_11, function); - } - } - if (!__pyx_t_12) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2455, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2455, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_12); __pyx_t_12 = NULL; - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2455, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - - /* "rados.pyx":2456 - * - * @requires(('key', str_type)) - * def stat(self, key): # <<<<<<<<<<<<<< - * """ - * Get object stats (size/mtime) - */ - __pyx_t_11 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Ioctx, __pyx_n_s_stat); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2456, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_9 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_9) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2455, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2455, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); __pyx_t_9 = NULL; - __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_11); - __pyx_t_11 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2455, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Ioctx->tp_dict, __pyx_n_s_stat, __pyx_t_2) < 0) __PYX_ERR(0, 2456, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Ioctx); - - /* "rados.pyx":2481 - * return psize, time.localtime(pmtime) - * - * @requires(('key', str_type), ('xattr_name', str_type)) # <<<<<<<<<<<<<< - * def get_xattr(self, key, xattr_name): - * """ - */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2481, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2481, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2481, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_INCREF(__pyx_n_s_key); - __Pyx_GIVEREF(__pyx_n_s_key); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_n_s_key); - __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_11); - __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2481, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2481, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_INCREF(__pyx_n_s_xattr_name); - __Pyx_GIVEREF(__pyx_n_s_xattr_name); - PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_n_s_xattr_name); - __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_11); - __pyx_t_11 = 0; - __pyx_t_11 = NULL; - __pyx_t_13 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_13 = 1; - } - } - __pyx_t_10 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2481, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (__pyx_t_11) { - __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); __pyx_t_11 = NULL; - } - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_13, __pyx_t_9); - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_13, __pyx_t_12); - __pyx_t_9 = 0; - __pyx_t_12 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2481, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - - /* "rados.pyx":2482 - * - * @requires(('key', str_type), ('xattr_name', str_type)) - * def get_xattr(self, key, xattr_name): # <<<<<<<<<<<<<< - * """ - * Get the value of an extended attribute on an object. - */ - __pyx_t_6 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Ioctx, __pyx_n_s_get_xattr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2482, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_10 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_10) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2481, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2481, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL; - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2481, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Ioctx->tp_dict, __pyx_n_s_get_xattr, __pyx_t_2) < 0) __PYX_ERR(0, 2482, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Ioctx); - - /* "rados.pyx":2520 - * free(ret_buf) - * - * @requires(('oid', str_type)) # <<<<<<<<<<<<<< - * def get_xattrs(self, oid): - * """ - */ - __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2520, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2520, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2520, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_INCREF(__pyx_n_s_oid); - __Pyx_GIVEREF(__pyx_n_s_oid); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_n_s_oid); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_12))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_12); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_12, function); - } - } - if (!__pyx_t_6) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2520, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2520, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL; - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2520, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - - /* "rados.pyx":2521 - * - * @requires(('oid', str_type)) - * def get_xattrs(self, oid): # <<<<<<<<<<<<<< - * """ - * Start iterating over xattrs on an object. - */ - __pyx_t_12 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Ioctx, __pyx_n_s_get_xattrs); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2521, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_9 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_9) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2520, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2520, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL; - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_12); - __pyx_t_12 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2520, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Ioctx->tp_dict, __pyx_n_s_get_xattrs, __pyx_t_2) < 0) __PYX_ERR(0, 2521, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Ioctx); - - /* "rados.pyx":2535 - * return XattrIterator(self, oid) - * - * @requires(('key', str_type), ('xattr_name', str_type), ('xattr_value', bytes)) # <<<<<<<<<<<<<< - * def set_xattr(self, key, xattr_name, xattr_value): - * """ - */ - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2535, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2535, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2535, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_INCREF(__pyx_n_s_key); - __Pyx_GIVEREF(__pyx_n_s_key); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_n_s_key); - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_12); - __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2535, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2535, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_n_s_xattr_name); - __Pyx_GIVEREF(__pyx_n_s_xattr_name); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_xattr_name); - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_12); - __pyx_t_12 = 0; - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2535, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_INCREF(__pyx_n_s_xattr_value); - __Pyx_GIVEREF(__pyx_n_s_xattr_value); - PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_n_s_xattr_value); - __Pyx_INCREF(((PyObject *)(&PyBytes_Type))); - __Pyx_GIVEREF(((PyObject *)(&PyBytes_Type))); - PyTuple_SET_ITEM(__pyx_t_12, 1, ((PyObject *)(&PyBytes_Type))); - __pyx_t_11 = NULL; - __pyx_t_13 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); - __pyx_t_13 = 1; - } - } - __pyx_t_5 = PyTuple_New(3+__pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2535, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_11) { - __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_11); __pyx_t_11 = NULL; - } - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_13, __pyx_t_9); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_13, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_13, __pyx_t_12); - __pyx_t_9 = 0; - __pyx_t_6 = 0; - __pyx_t_12 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2535, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - - /* "rados.pyx":2536 - * - * @requires(('key', str_type), ('xattr_name', str_type), ('xattr_value', bytes)) - * def set_xattr(self, key, xattr_name, xattr_value): # <<<<<<<<<<<<<< - * """ - * Set an extended attribute on an object. - */ - __pyx_t_10 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Ioctx, __pyx_n_s_set_xattr); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2536, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2535, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2535, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_5); __pyx_t_5 = NULL; - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2535, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Ioctx->tp_dict, __pyx_n_s_set_xattr, __pyx_t_2) < 0) __PYX_ERR(0, 2536, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Ioctx); - - /* "rados.pyx":2568 - * return True - * - * @requires(('key', str_type), ('xattr_name', str_type)) # <<<<<<<<<<<<<< - * def rm_xattr(self, key, xattr_name): - * """ - */ - __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2568, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2568, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2568, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(__pyx_n_s_key); - __Pyx_GIVEREF(__pyx_n_s_key); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_key); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2568, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2568, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_n_s_xattr_name); - __Pyx_GIVEREF(__pyx_n_s_xattr_name); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_xattr_name); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_10 = NULL; - __pyx_t_13 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_12))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_12, function); - __pyx_t_13 = 1; - } - } - __pyx_t_9 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2568, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - if (__pyx_t_10) { - __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10); __pyx_t_10 = NULL; - } - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_13, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_13, __pyx_t_6); - __pyx_t_5 = 0; - __pyx_t_6 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2568, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - - /* "rados.pyx":2569 - * - * @requires(('key', str_type), ('xattr_name', str_type)) - * def rm_xattr(self, key, xattr_name): # <<<<<<<<<<<<<< - * """ - * Removes an extended attribute on from an object. - */ - __pyx_t_12 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Ioctx, __pyx_n_s_rm_xattr); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2569, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_9 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_9) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2568, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2568, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); __pyx_t_9 = NULL; - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_12); - __pyx_t_12 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2568, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Ioctx->tp_dict, __pyx_n_s_rm_xattr, __pyx_t_2) < 0) __PYX_ERR(0, 2569, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Ioctx); - - /* "rados.pyx":2615 - * return SnapIterator(self) - * - * @requires(('snap_name', str_type)) # <<<<<<<<<<<<<< - * def create_snap(self, snap_name): - * """ - */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_INCREF(__pyx_n_s_snap_name); - __Pyx_GIVEREF(__pyx_n_s_snap_name); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_n_s_snap_name); - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_12); - __pyx_t_12 = 0; - __pyx_t_12 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_12)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - } - } - if (!__pyx_t_12) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2615, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_12); __pyx_t_12 = NULL; - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - - /* "rados.pyx":2616 - * - * @requires(('snap_name', str_type)) - * def create_snap(self, snap_name): # <<<<<<<<<<<<<< - * """ - * Create a pool-wide snapshot - */ - __pyx_t_6 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Ioctx, __pyx_n_s_create_snap); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2616, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2615, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __pyx_t_5 = NULL; - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Ioctx->tp_dict, __pyx_n_s_create_snap, __pyx_t_2) < 0) __PYX_ERR(0, 2616, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Ioctx); - - /* "rados.pyx":2635 - * raise make_ex(ret, "Failed to create snap %s" % snap_name) - * - * @requires(('snap_name', str_type)) # <<<<<<<<<<<<<< - * def remove_snap(self, snap_name): - * """ - */ - __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(__pyx_n_s_snap_name); - __Pyx_GIVEREF(__pyx_n_s_snap_name); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_snap_name); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - } - } - if (!__pyx_t_6) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2635, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_6); __pyx_t_6 = NULL; - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "rados.pyx":2636 - * - * @requires(('snap_name', str_type)) - * def remove_snap(self, snap_name): # <<<<<<<<<<<<<< - * """ - * Removes a pool-wide snapshot - */ - __pyx_t_9 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Ioctx, __pyx_n_s_remove_snap); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2636, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_12 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_12)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_12) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2635, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_12); __pyx_t_12 = NULL; - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Ioctx->tp_dict, __pyx_n_s_remove_snap, __pyx_t_2) < 0) __PYX_ERR(0, 2636, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Ioctx); - - /* "rados.pyx":2655 - * raise make_ex(ret, "Failed to remove snap %s" % snap_name) - * - * @requires(('snap_name', str_type)) # <<<<<<<<<<<<<< - * def lookup_snap(self, snap_name): - * """ - */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2655, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2655, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2655, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_INCREF(__pyx_n_s_snap_name); - __Pyx_GIVEREF(__pyx_n_s_snap_name); - PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_n_s_snap_name); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_9 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - } - } - if (!__pyx_t_9) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2655, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2655, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); __pyx_t_9 = NULL; - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_12); - __pyx_t_12 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2655, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "rados.pyx":2656 - * - * @requires(('snap_name', str_type)) - * def lookup_snap(self, snap_name): # <<<<<<<<<<<<<< - * """ - * Get the id of a pool snapshot - */ - __pyx_t_5 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Ioctx, __pyx_n_s_lookup_snap); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2656, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_6) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2655, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2655, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_6); __pyx_t_6 = NULL; - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2655, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Ioctx->tp_dict, __pyx_n_s_lookup_snap, __pyx_t_2) < 0) __PYX_ERR(0, 2656, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Ioctx); - - /* "rados.pyx":2679 - * return Snap(self, snap_name, int(snap_id)) - * - * @requires(('oid', str_type), ('snap_name', str_type)) # <<<<<<<<<<<<<< - * def snap_rollback(self, oid, snap_name): - * """ - */ - __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2679, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2679, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2679, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_n_s_oid); - __Pyx_GIVEREF(__pyx_n_s_oid); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_oid); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2679, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2679, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_INCREF(__pyx_n_s_snap_name); - __Pyx_GIVEREF(__pyx_n_s_snap_name); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_n_s_snap_name); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_5 = NULL; - __pyx_t_13 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_12))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_12); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_12, function); - __pyx_t_13 = 1; - } - } - __pyx_t_10 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2679, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); __pyx_t_5 = NULL; - } - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_13, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_13, __pyx_t_9); - __pyx_t_6 = 0; - __pyx_t_9 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2679, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - - /* "rados.pyx":2680 - * - * @requires(('oid', str_type), ('snap_name', str_type)) - * def snap_rollback(self, oid, snap_name): # <<<<<<<<<<<<<< - * """ - * Rollback an object to a snapshot - */ - __pyx_t_12 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Ioctx, __pyx_n_s_snap_rollback); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2680, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_10 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_10) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2679, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2679, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10); __pyx_t_10 = NULL; - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_12); - __pyx_t_12 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2679, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Ioctx->tp_dict, __pyx_n_s_snap_rollback, __pyx_t_2) < 0) __PYX_ERR(0, 2680, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Ioctx); - - /* "rados.pyx":2746 - * read_op.release() - * - * @requires(('write_op', WriteOp), ('keys', tuple), ('values', tuple)) # <<<<<<<<<<<<<< - * def set_omap(self, write_op, keys, values): - * """ - */ - __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2746, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2746, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_INCREF(__pyx_n_s_write_op); - __Pyx_GIVEREF(__pyx_n_s_write_op); - PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_n_s_write_op); - __Pyx_INCREF(((PyObject *)__pyx_ptype_5rados_WriteOp)); - __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5rados_WriteOp)); - PyTuple_SET_ITEM(__pyx_t_12, 1, ((PyObject *)__pyx_ptype_5rados_WriteOp)); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2746, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_INCREF(__pyx_n_s_keys); - __Pyx_GIVEREF(__pyx_n_s_keys); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_n_s_keys); - __Pyx_INCREF(((PyObject *)(&PyTuple_Type))); - __Pyx_GIVEREF(((PyObject *)(&PyTuple_Type))); - PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)(&PyTuple_Type))); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2746, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_n_s_values); - __Pyx_GIVEREF(__pyx_n_s_values); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_values); - __Pyx_INCREF(((PyObject *)(&PyTuple_Type))); - __Pyx_GIVEREF(((PyObject *)(&PyTuple_Type))); - PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)(&PyTuple_Type))); - __pyx_t_5 = NULL; - __pyx_t_13 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - __pyx_t_13 = 1; - } - } - __pyx_t_11 = PyTuple_New(3+__pyx_t_13); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2746, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5); __pyx_t_5 = NULL; - } - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_13, __pyx_t_12); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_13, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_13, __pyx_t_6); - __pyx_t_12 = 0; - __pyx_t_10 = 0; - __pyx_t_6 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2746, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "rados.pyx":2747 - * - * @requires(('write_op', WriteOp), ('keys', tuple), ('values', tuple)) - * def set_omap(self, write_op, keys, values): # <<<<<<<<<<<<<< - * """ - * set keys values to write_op - */ - __pyx_t_9 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Ioctx, __pyx_n_s_set_omap); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2747, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_11 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_11) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2746, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2746, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_11); __pyx_t_11 = NULL; - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2746, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Ioctx->tp_dict, __pyx_n_s_set_omap, __pyx_t_2) < 0) __PYX_ERR(0, 2747, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Ioctx); - - /* "rados.pyx":2781 - * - * @requires(('write_op', WriteOp), ('oid', str_type), ('mtime', opt(int)), ('flags', opt(int))) - * def operate_write_op(self, write_op, oid, mtime=0, flags=LIBRADOS_OPERATION_NOFLAG): # <<<<<<<<<<<<<< - * """ - * excute the real write operation - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_LIBRADOS_OPERATION_NOFLAG); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2781, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_k__49 = __pyx_t_2; - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - - /* "rados.pyx":2780 - * free(_lens) - * - * @requires(('write_op', WriteOp), ('oid', str_type), ('mtime', opt(int)), ('flags', opt(int))) # <<<<<<<<<<<<<< - * def operate_write_op(self, write_op, oid, mtime=0, flags=LIBRADOS_OPERATION_NOFLAG): - * """ - */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_INCREF(__pyx_n_s_write_op); - __Pyx_GIVEREF(__pyx_n_s_write_op); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_n_s_write_op); - __Pyx_INCREF(((PyObject *)__pyx_ptype_5rados_WriteOp)); - __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5rados_WriteOp)); - PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_ptype_5rados_WriteOp)); - __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_INCREF(__pyx_n_s_oid); - __Pyx_GIVEREF(__pyx_n_s_oid); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_n_s_oid); - __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11); - __pyx_t_11 = 0; - __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_opt); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_12))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_12); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_12, function); - } - } - if (!__pyx_t_5) { - __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_12, ((PyObject *)(&PyInt_Type))); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - } else { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL; - __Pyx_INCREF(((PyObject *)(&PyInt_Type))); - __Pyx_GIVEREF(((PyObject *)(&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)(&PyInt_Type))); - __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_4, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_INCREF(__pyx_n_s_mtime); - __Pyx_GIVEREF(__pyx_n_s_mtime); - PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_n_s_mtime); - __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_11); - __pyx_t_11 = 0; - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_opt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - } - } - if (!__pyx_t_5) { - __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyInt_Type))); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - } else { - __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; - __Pyx_INCREF(((PyObject *)(&PyInt_Type))); - __Pyx_GIVEREF(((PyObject *)(&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_t_7, 0+1, ((PyObject *)(&PyInt_Type))); - __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_n_s_flags); - __Pyx_GIVEREF(__pyx_n_s_flags); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_flags); - __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_11); - __pyx_t_11 = 0; - __pyx_t_11 = NULL; - __pyx_t_13 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_13 = 1; - } - } - __pyx_t_7 = PyTuple_New(4+__pyx_t_13); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (__pyx_t_11) { - __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_11); __pyx_t_11 = NULL; - } - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_13, __pyx_t_9); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_13, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_13, __pyx_t_12); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_13, __pyx_t_4); - __pyx_t_9 = 0; - __pyx_t_10 = 0; - __pyx_t_12 = 0; - __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - - /* "rados.pyx":2781 - * - * @requires(('write_op', WriteOp), ('oid', str_type), ('mtime', opt(int)), ('flags', opt(int))) - * def operate_write_op(self, write_op, oid, mtime=0, flags=LIBRADOS_OPERATION_NOFLAG): # <<<<<<<<<<<<<< - * """ - * excute the real write operation - */ - __pyx_t_6 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Ioctx, __pyx_n_s_operate_write_op); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2781, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_7) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2780, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL; - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Ioctx->tp_dict, __pyx_n_s_operate_write_op, __pyx_t_2) < 0) __PYX_ERR(0, 2781, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Ioctx); - - /* "rados.pyx":2807 - * - * @requires(('read_op', ReadOp), ('oid', str_type), ('flag', opt(int))) - * def operate_read_op(self, read_op, oid, flag=LIBRADOS_OPERATION_NOFLAG): # <<<<<<<<<<<<<< - * """ - * excute the real read operation - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_LIBRADOS_OPERATION_NOFLAG); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2807, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_k__50 = __pyx_t_2; - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - - /* "rados.pyx":2806 - * raise make_ex(ret, "Failed to operate write op for oid %s" % oid) - * - * @requires(('read_op', ReadOp), ('oid', str_type), ('flag', opt(int))) # <<<<<<<<<<<<<< - * def operate_read_op(self, read_op, oid, flag=LIBRADOS_OPERATION_NOFLAG): - * """ - */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2806, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2806, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_n_s_read_op); - __Pyx_GIVEREF(__pyx_n_s_read_op); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_read_op); - __Pyx_INCREF(((PyObject *)__pyx_ptype_5rados_ReadOp)); - __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5rados_ReadOp)); - PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_ptype_5rados_ReadOp)); - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2806, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2806, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_INCREF(__pyx_n_s_oid); - __Pyx_GIVEREF(__pyx_n_s_oid); - PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_n_s_oid); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_opt); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2806, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); - } - } - if (!__pyx_t_9) { - __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_10, ((PyObject *)(&PyInt_Type))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2806, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - } else { - __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2806, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL; - __Pyx_INCREF(((PyObject *)(&PyInt_Type))); - __Pyx_GIVEREF(((PyObject *)(&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_t_11, 0+1, ((PyObject *)(&PyInt_Type))); - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2806, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2806, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_INCREF(__pyx_n_s_flag); - __Pyx_GIVEREF(__pyx_n_s_flag); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_n_s_flag); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_7 = NULL; - __pyx_t_13 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_13 = 1; - } - } - __pyx_t_11 = PyTuple_New(3+__pyx_t_13); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2806, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (__pyx_t_7) { - __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); __pyx_t_7 = NULL; - } - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_13, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_13, __pyx_t_12); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_13, __pyx_t_10); - __pyx_t_6 = 0; - __pyx_t_12 = 0; - __pyx_t_10 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2806, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "rados.pyx":2807 - * - * @requires(('read_op', ReadOp), ('oid', str_type), ('flag', opt(int))) - * def operate_read_op(self, read_op, oid, flag=LIBRADOS_OPERATION_NOFLAG): # <<<<<<<<<<<<<< - * """ - * excute the real read operation - */ - __pyx_t_4 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Ioctx, __pyx_n_s_operate_read_op); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2807, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_11) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2806, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2806, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); __pyx_t_11 = NULL; - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2806, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Ioctx->tp_dict, __pyx_n_s_operate_read_op, __pyx_t_2) < 0) __PYX_ERR(0, 2807, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Ioctx); - - /* "rados.pyx":2828 - * raise make_ex(ret, "Failed to operate read op for oid %s" % oid) - * - * @requires(('read_op', ReadOp), ('start_after', str_type), ('filter_prefix', str_type), ('max_return', int)) # <<<<<<<<<<<<<< - * def get_omap_vals(self, read_op, start_after, filter_prefix, max_return): - * """ - */ - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2828, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2828, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_n_s_read_op); - __Pyx_GIVEREF(__pyx_n_s_read_op); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_read_op); - __Pyx_INCREF(((PyObject *)__pyx_ptype_5rados_ReadOp)); - __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5rados_ReadOp)); - PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_ptype_5rados_ReadOp)); - __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2828, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2828, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_INCREF(__pyx_n_s_start_after); - __Pyx_GIVEREF(__pyx_n_s_start_after); - PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_n_s_start_after); - __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_11); - __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2828, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2828, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_n_s_filter_prefix); - __Pyx_GIVEREF(__pyx_n_s_filter_prefix); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_filter_prefix); - __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_11); - __pyx_t_11 = 0; - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2828, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_INCREF(__pyx_n_s_max_return); - __Pyx_GIVEREF(__pyx_n_s_max_return); - PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_n_s_max_return); - __Pyx_INCREF(((PyObject *)(&PyInt_Type))); - __Pyx_GIVEREF(((PyObject *)(&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_t_11, 1, ((PyObject *)(&PyInt_Type))); - __pyx_t_7 = NULL; - __pyx_t_13 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); - __pyx_t_13 = 1; - } - } - __pyx_t_9 = PyTuple_New(4+__pyx_t_13); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2828, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - if (__pyx_t_7) { - __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; - } - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_13, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_13, __pyx_t_12); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_13, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_13, __pyx_t_11); - __pyx_t_4 = 0; - __pyx_t_12 = 0; - __pyx_t_6 = 0; - __pyx_t_11 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2828, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - - /* "rados.pyx":2829 - * - * @requires(('read_op', ReadOp), ('start_after', str_type), ('filter_prefix', str_type), ('max_return', int)) - * def get_omap_vals(self, read_op, start_after, filter_prefix, max_return): # <<<<<<<<<<<<<< - * """ - * get the omap values - */ - __pyx_t_10 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Ioctx, __pyx_n_s_get_omap_vals); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2829, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_9) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2828, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL; - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2828, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Ioctx->tp_dict, __pyx_n_s_get_omap_vals, __pyx_t_2) < 0) __PYX_ERR(0, 2829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Ioctx); - - /* "rados.pyx":2860 - * return it, int(prval) - * - * @requires(('read_op', ReadOp), ('start_after', str_type), ('max_return', int)) # <<<<<<<<<<<<<< - * def get_omap_keys(self, read_op, start_after, max_return): - * """ - */ - __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2860, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2860, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_INCREF(__pyx_n_s_read_op); - __Pyx_GIVEREF(__pyx_n_s_read_op); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_n_s_read_op); - __Pyx_INCREF(((PyObject *)__pyx_ptype_5rados_ReadOp)); - __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5rados_ReadOp)); - PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)__pyx_ptype_5rados_ReadOp)); - __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2860, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2860, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_n_s_start_after); - __Pyx_GIVEREF(__pyx_n_s_start_after); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_start_after); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2860, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_INCREF(__pyx_n_s_max_return); - __Pyx_GIVEREF(__pyx_n_s_max_return); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_n_s_max_return); - __Pyx_INCREF(((PyObject *)(&PyInt_Type))); - __Pyx_GIVEREF(((PyObject *)(&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)(&PyInt_Type))); - __pyx_t_12 = NULL; - __pyx_t_13 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_12)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_11, function); - __pyx_t_13 = 1; - } - } - __pyx_t_4 = PyTuple_New(3+__pyx_t_13); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2860, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (__pyx_t_12) { - __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_12); __pyx_t_12 = NULL; - } - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_13, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_13, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_13, __pyx_t_9); - __pyx_t_10 = 0; - __pyx_t_6 = 0; - __pyx_t_9 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2860, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - - /* "rados.pyx":2861 - * - * @requires(('read_op', ReadOp), ('start_after', str_type), ('max_return', int)) - * def get_omap_keys(self, read_op, start_after, max_return): # <<<<<<<<<<<<<< - * """ - * get the omap keys - */ - __pyx_t_11 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Ioctx, __pyx_n_s_get_omap_keys); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2861, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_4 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2860, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2860, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL; - __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_11); - __pyx_t_11 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2860, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Ioctx->tp_dict, __pyx_n_s_get_omap_keys, __pyx_t_2) < 0) __PYX_ERR(0, 2861, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Ioctx); - - /* "rados.pyx":2887 - * return it, int(prval) - * - * @requires(('read_op', ReadOp), ('keys', tuple)) # <<<<<<<<<<<<<< - * def get_omap_vals_by_keys(self, read_op, keys): - * """ - */ - __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2887, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2887, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_INCREF(__pyx_n_s_read_op); - __Pyx_GIVEREF(__pyx_n_s_read_op); - PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_n_s_read_op); - __Pyx_INCREF(((PyObject *)__pyx_ptype_5rados_ReadOp)); - __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5rados_ReadOp)); - PyTuple_SET_ITEM(__pyx_t_11, 1, ((PyObject *)__pyx_ptype_5rados_ReadOp)); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2887, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_n_s_keys); - __Pyx_GIVEREF(__pyx_n_s_keys); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_keys); - __Pyx_INCREF(((PyObject *)(&PyTuple_Type))); - __Pyx_GIVEREF(((PyObject *)(&PyTuple_Type))); - PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)(&PyTuple_Type))); - __pyx_t_6 = NULL; - __pyx_t_13 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - __pyx_t_13 = 1; - } - } - __pyx_t_10 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2887, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (__pyx_t_6) { - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6); __pyx_t_6 = NULL; - } - __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_13, __pyx_t_11); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_13, __pyx_t_4); - __pyx_t_11 = 0; - __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2887, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "rados.pyx":2888 - * - * @requires(('read_op', ReadOp), ('keys', tuple)) - * def get_omap_vals_by_keys(self, read_op, keys): # <<<<<<<<<<<<<< - * """ - * get the omap values by keys - */ - __pyx_t_9 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Ioctx, __pyx_n_s_get_omap_vals_by_keys); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2888, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_10) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2887, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2887, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_10); __pyx_t_10 = NULL; - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2887, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Ioctx->tp_dict, __pyx_n_s_get_omap_vals_by_keys, __pyx_t_2) < 0) __PYX_ERR(0, 2888, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Ioctx); - - /* "rados.pyx":2916 - * free(_keys) - * - * @requires(('write_op', WriteOp), ('keys', tuple)) # <<<<<<<<<<<<<< - * def remove_omap_keys(self, write_op, keys): - * """ - */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2916, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2916, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_INCREF(__pyx_n_s_write_op); - __Pyx_GIVEREF(__pyx_n_s_write_op); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_n_s_write_op); - __Pyx_INCREF(((PyObject *)__pyx_ptype_5rados_WriteOp)); - __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5rados_WriteOp)); - PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_ptype_5rados_WriteOp)); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2916, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_INCREF(__pyx_n_s_keys); - __Pyx_GIVEREF(__pyx_n_s_keys); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_n_s_keys); - __Pyx_INCREF(((PyObject *)(&PyTuple_Type))); - __Pyx_GIVEREF(((PyObject *)(&PyTuple_Type))); - PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)(&PyTuple_Type))); - __pyx_t_11 = NULL; - __pyx_t_13 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_13 = 1; - } - } - __pyx_t_6 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2916, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (__pyx_t_11) { - __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_11); __pyx_t_11 = NULL; - } - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_13, __pyx_t_9); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_13, __pyx_t_10); - __pyx_t_9 = 0; - __pyx_t_10 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2916, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "rados.pyx":2917 - * - * @requires(('write_op', WriteOp), ('keys', tuple)) - * def remove_omap_keys(self, write_op, keys): # <<<<<<<<<<<<<< - * """ - * remove omap keys specifiled - */ - __pyx_t_4 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Ioctx, __pyx_n_s_remove_omap_keys); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2917, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_6) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2916, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2916, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6); __pyx_t_6 = NULL; - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2916, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Ioctx->tp_dict, __pyx_n_s_remove_omap_keys, __pyx_t_2) < 0) __PYX_ERR(0, 2917, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Ioctx); - - /* "rados.pyx":2938 - * free(_keys) - * - * @requires(('write_op', WriteOp)) # <<<<<<<<<<<<<< - * def clear_omap(self, write_op): - * """ - */ - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2938, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2938, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_n_s_write_op); - __Pyx_GIVEREF(__pyx_n_s_write_op); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_write_op); - __Pyx_INCREF(((PyObject *)__pyx_ptype_5rados_WriteOp)); - __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5rados_WriteOp)); - PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_ptype_5rados_WriteOp)); - __pyx_t_6 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); - } - } - if (!__pyx_t_6) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2938, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2938, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL; - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2938, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - - /* "rados.pyx":2939 - * - * @requires(('write_op', WriteOp)) - * def clear_omap(self, write_op): # <<<<<<<<<<<<<< - * """ - * Remove all key/value pairs from an object - */ - __pyx_t_10 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Ioctx, __pyx_n_s_clear_omap); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2939, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_9) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2938, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2938, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_9); __pyx_t_9 = NULL; - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2938, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Ioctx->tp_dict, __pyx_n_s_clear_omap, __pyx_t_2) < 0) __PYX_ERR(0, 2939, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Ioctx); - - /* "rados.pyx":2952 - * rados_write_op_omap_clear(_write_op.write_op) - * - * @requires(('key', str_type), ('name', str_type), ('cookie', str_type), ('desc', str_type), # <<<<<<<<<<<<<< - * ('duration', opt(int)), ('flags', int)) - * def lock_exclusive(self, key, name, cookie, desc="", duration=None, flags=0): - */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2952, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2952, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2952, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_INCREF(__pyx_n_s_key); - __Pyx_GIVEREF(__pyx_n_s_key); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_n_s_key); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2952, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2952, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_n_s_name_2); - __Pyx_GIVEREF(__pyx_n_s_name_2); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_name_2); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2952, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2952, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_INCREF(__pyx_n_s_cookie); - __Pyx_GIVEREF(__pyx_n_s_cookie); - PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_n_s_cookie); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2952, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2952, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_INCREF(__pyx_n_s_desc); - __Pyx_GIVEREF(__pyx_n_s_desc); - PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_n_s_desc); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_10); - __pyx_t_10 = 0; - - /* "rados.pyx":2953 - * - * @requires(('key', str_type), ('name', str_type), ('cookie', str_type), ('desc', str_type), - * ('duration', opt(int)), ('flags', int)) # <<<<<<<<<<<<<< - * def lock_exclusive(self, key, name, cookie, desc="", duration=None, flags=0): - * - */ - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_opt); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2953, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - } - } - if (!__pyx_t_5) { - __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)(&PyInt_Type))); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2953, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - } else { - __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2953, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; - __Pyx_INCREF(((PyObject *)(&PyInt_Type))); - __Pyx_GIVEREF(((PyObject *)(&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_t_8, 0+1, ((PyObject *)(&PyInt_Type))); - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2953, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2953, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_INCREF(__pyx_n_s_duration); - __Pyx_GIVEREF(__pyx_n_s_duration); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_duration); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2953, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_INCREF(__pyx_n_s_flags); - __Pyx_GIVEREF(__pyx_n_s_flags); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_n_s_flags); - __Pyx_INCREF(((PyObject *)(&PyInt_Type))); - __Pyx_GIVEREF(((PyObject *)(&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)(&PyInt_Type))); - __pyx_t_8 = NULL; - __pyx_t_13 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_13 = 1; - } - } - __pyx_t_5 = PyTuple_New(6+__pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2952, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_8) { - __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8); __pyx_t_8 = NULL; - } - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_13, __pyx_t_9); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_13, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_13, __pyx_t_11); - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_13, __pyx_t_12); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_5, 4+__pyx_t_13, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_5, 5+__pyx_t_13, __pyx_t_10); - __pyx_t_9 = 0; - __pyx_t_6 = 0; - __pyx_t_11 = 0; - __pyx_t_12 = 0; - __pyx_t_7 = 0; - __pyx_t_10 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2952, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "rados.pyx":2954 - * @requires(('key', str_type), ('name', str_type), ('cookie', str_type), ('desc', str_type), - * ('duration', opt(int)), ('flags', int)) - * def lock_exclusive(self, key, name, cookie, desc="", duration=None, flags=0): # <<<<<<<<<<<<<< - * - * """ - */ - __pyx_t_4 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Ioctx, __pyx_n_s_lock_exclusive); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2954, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2952, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2952, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); __pyx_t_5 = NULL; - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2952, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Ioctx->tp_dict, __pyx_n_s_lock_exclusive, __pyx_t_2) < 0) __PYX_ERR(0, 2954, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Ioctx); - - /* "rados.pyx":3003 - * raise make_ex(ret, "Ioctx.rados_lock_exclusive(%s): failed to set lock %s on %s" % (self.name, name, key)) - * - * @requires(('key', str_type), ('name', str_type), ('cookie', str_type), ('tag', str_type), # <<<<<<<<<<<<<< - * ('desc', str_type), ('duration', opt(int)), ('flags', int)) - * def lock_shared(self, key, name, cookie, tag, desc="", duration=None, flags=0): - */ - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3003, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3003, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3003, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(__pyx_n_s_key); - __Pyx_GIVEREF(__pyx_n_s_key); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_key); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3003, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3003, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_INCREF(__pyx_n_s_name_2); - __Pyx_GIVEREF(__pyx_n_s_name_2); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_name_2); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3003, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3003, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_INCREF(__pyx_n_s_cookie); - __Pyx_GIVEREF(__pyx_n_s_cookie); - PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_n_s_cookie); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3003, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3003, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_INCREF(__pyx_n_s_tag); - __Pyx_GIVEREF(__pyx_n_s_tag); - PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_n_s_tag); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4); - __pyx_t_4 = 0; - - /* "rados.pyx":3004 - * - * @requires(('key', str_type), ('name', str_type), ('cookie', str_type), ('tag', str_type), - * ('desc', str_type), ('duration', opt(int)), ('flags', int)) # <<<<<<<<<<<<<< - * def lock_shared(self, key, name, cookie, tag, desc="", duration=None, flags=0): - * - */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3004, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3004, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_n_s_desc); - __Pyx_GIVEREF(__pyx_n_s_desc); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_desc); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_opt); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3004, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - } - } - if (!__pyx_t_8) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_9, ((PyObject *)(&PyInt_Type))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3004, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - } else { - __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3004, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_8); __pyx_t_8 = NULL; - __Pyx_INCREF(((PyObject *)(&PyInt_Type))); - __Pyx_GIVEREF(((PyObject *)(&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_t_14, 0+1, ((PyObject *)(&PyInt_Type))); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_14, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3004, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3004, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_INCREF(__pyx_n_s_duration); - __Pyx_GIVEREF(__pyx_n_s_duration); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_n_s_duration); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3004, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_n_s_flags); - __Pyx_GIVEREF(__pyx_n_s_flags); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_flags); - __Pyx_INCREF(((PyObject *)(&PyInt_Type))); - __Pyx_GIVEREF(((PyObject *)(&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)(&PyInt_Type))); - __pyx_t_14 = NULL; - __pyx_t_13 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_14); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); - __pyx_t_13 = 1; - } - } - __pyx_t_8 = PyTuple_New(7+__pyx_t_13); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3003, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (__pyx_t_14) { - __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_14); __pyx_t_14 = NULL; - } - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_13, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_13, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_13, __pyx_t_12); - __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_13, __pyx_t_11); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_8, 4+__pyx_t_13, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_8, 5+__pyx_t_13, __pyx_t_9); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_8, 6+__pyx_t_13, __pyx_t_4); - __pyx_t_5 = 0; - __pyx_t_7 = 0; - __pyx_t_12 = 0; - __pyx_t_11 = 0; - __pyx_t_6 = 0; - __pyx_t_9 = 0; - __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3003, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - - /* "rados.pyx":3005 - * @requires(('key', str_type), ('name', str_type), ('cookie', str_type), ('tag', str_type), - * ('desc', str_type), ('duration', opt(int)), ('flags', int)) - * def lock_shared(self, key, name, cookie, tag, desc="", duration=None, flags=0): # <<<<<<<<<<<<<< - * - * """ - */ - __pyx_t_10 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Ioctx, __pyx_n_s_lock_shared); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3005, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_8 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_8) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3003, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3003, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); __pyx_t_8 = NULL; - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3003, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Ioctx->tp_dict, __pyx_n_s_lock_shared, __pyx_t_2) < 0) __PYX_ERR(0, 3005, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Ioctx); - - /* "rados.pyx":3057 - * raise make_ex(ret, "Ioctx.rados_lock_exclusive(%s): failed to set lock %s on %s" % (self.name, name, key)) - * - * @requires(('key', str_type), ('name', str_type), ('cookie', str_type)) # <<<<<<<<<<<<<< - * def unlock(self, key, name, cookie): - * - */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_requires); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3057, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3057, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3057, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_INCREF(__pyx_n_s_key); - __Pyx_GIVEREF(__pyx_n_s_key); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_n_s_key); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3057, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3057, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_INCREF(__pyx_n_s_name_2); - __Pyx_GIVEREF(__pyx_n_s_name_2); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_n_s_name_2); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_str_type); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3057, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3057, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_n_s_cookie); - __Pyx_GIVEREF(__pyx_n_s_cookie); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_cookie); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_10 = NULL; - __pyx_t_13 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_13 = 1; - } - } - __pyx_t_11 = PyTuple_New(3+__pyx_t_13); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3057, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (__pyx_t_10) { - __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL; - } - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_13, __pyx_t_8); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_13, __pyx_t_9); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_13, __pyx_t_6); - __pyx_t_8 = 0; - __pyx_t_9 = 0; - __pyx_t_6 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3057, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "rados.pyx":3058 - * - * @requires(('key', str_type), ('name', str_type), ('cookie', str_type)) - * def unlock(self, key, name, cookie): # <<<<<<<<<<<<<< - * - * """ - */ - __pyx_t_4 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5rados_Ioctx, __pyx_n_s_unlock); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3058, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - if (!__pyx_t_11) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3057, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GOTREF(__pyx_t_2); - } else { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3057, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_11); __pyx_t_11 = NULL; - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3057, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_5rados_Ioctx->tp_dict, __pyx_n_s_unlock, __pyx_t_2) < 0) __PYX_ERR(0, 3058, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - PyType_Modified(__pyx_ptype_5rados_Ioctx); - - /* "rados.pyx":3090 - * - * - * def set_object_locator(func): # <<<<<<<<<<<<<< - * def retfunc(self, *args, **kwargs): - * if self.locator_key is not None: - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5rados_11set_object_locator, NULL, __pyx_n_s_rados); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3090, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_object_locator, __pyx_t_2) < 0) __PYX_ERR(0, 3090, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":3103 - * - * - * def set_object_namespace(func): # <<<<<<<<<<<<<< - * def retfunc(self, *args, **kwargs): - * if self.nspace is None: - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5rados_13set_object_namespace, NULL, __pyx_n_s_rados); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3103, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_object_namespace, __pyx_t_2) < 0) __PYX_ERR(0, 3103, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":3115 - * - * - * class Object(object): # <<<<<<<<<<<<<< - * """Rados object wrapper, makes the object look like a file""" - * def __init__(self, ioctx, key, locator_key=None, nspace=None): - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3115, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_builtin_object); - __Pyx_GIVEREF(__pyx_builtin_object); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_object); - __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3115, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Object, __pyx_n_s_Object, (PyObject *) NULL, __pyx_n_s_rados, __pyx_kp_s_Rados_object_wrapper_makes_the_o); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3115, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - - /* "rados.pyx":3117 - * class Object(object): - * """Rados object wrapper, makes the object look like a file""" - * def __init__(self, ioctx, key, locator_key=None, nspace=None): # <<<<<<<<<<<<<< - * self.key = key - * self.ioctx = ioctx - */ - __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5rados_6Object_1__init__, 0, __pyx_n_s_Object___init, NULL, __pyx_n_s_rados, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3117, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__80); - if (PyObject_SetItem(__pyx_t_6, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 3117, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "rados.pyx":3125 - * self.nspace = "" if nspace is None else nspace - * - * def __str__(self): # <<<<<<<<<<<<<< - * return "rados.Object(ioctx=%s,key=%s,nspace=%s,locator=%s)" % \ - * (str(self.ioctx), self.key, "--default--" - */ - __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5rados_6Object_3__str__, 0, __pyx_n_s_Object___str, NULL, __pyx_n_s_rados, __pyx_d, ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3125, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyObject_SetItem(__pyx_t_6, __pyx_n_s_str, __pyx_t_4) < 0) __PYX_ERR(0, 3125, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "rados.pyx":3130 - * if self.nspace is "" else self.nspace, self.locator_key) - * - * def require_object_exists(self): # <<<<<<<<<<<<<< - * if self.state != "exists": - * raise ObjectStateError("The object is %s" % self.state) - */ - __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5rados_6Object_5require_object_exists, 0, __pyx_n_s_Object_require_object_exists, NULL, __pyx_n_s_rados, __pyx_d, ((PyObject *)__pyx_codeobj__84)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3130, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyObject_SetItem(__pyx_t_6, __pyx_n_s_require_object_exists, __pyx_t_4) < 0) __PYX_ERR(0, 3130, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "rados.pyx":3134 - * raise ObjectStateError("The object is %s" % self.state) - * - * @set_object_locator # <<<<<<<<<<<<<< - * @set_object_namespace - * def read(self, length=1024 * 1024): - */ - __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_set_object_locator); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3134, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - - /* "rados.pyx":3135 - * - * @set_object_locator - * @set_object_namespace # <<<<<<<<<<<<<< - * def read(self, length=1024 * 1024): - * self.require_object_exists() - */ - __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_set_object_namespace); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3135, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - - /* "rados.pyx":3136 - * @set_object_locator - * @set_object_namespace - * def read(self, length=1024 * 1024): # <<<<<<<<<<<<<< - * self.require_object_exists() - * ret = self.ioctx.read(self.key, length, self.offset) - */ - __pyx_t_10 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5rados_6Object_7read, 0, __pyx_n_s_Object_read, NULL, __pyx_n_s_rados, __pyx_d, ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3136, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_tuple__87); - __pyx_t_12 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_12)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - } - } - if (!__pyx_t_12) { - __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3135, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_GOTREF(__pyx_t_9); - } else { - __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3135, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_12); __pyx_t_12 = NULL; - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3135, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_11, function); - } - } - if (!__pyx_t_8) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3134, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_GOTREF(__pyx_t_4); - } else { - __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3134, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); __pyx_t_8 = NULL; - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3134, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PyObject_SetItem(__pyx_t_6, __pyx_n_s_read, __pyx_t_4) < 0) __PYX_ERR(0, 3136, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "rados.pyx":3142 - * return ret - * - * @set_object_locator # <<<<<<<<<<<<<< - * @set_object_namespace - * def write(self, string_to_write): - */ - __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_set_object_locator); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3142, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - - /* "rados.pyx":3143 - * - * @set_object_locator - * @set_object_namespace # <<<<<<<<<<<<<< - * def write(self, string_to_write): - * self.require_object_exists() - */ - __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_set_object_namespace); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3143, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - - /* "rados.pyx":3144 - * @set_object_locator - * @set_object_namespace - * def write(self, string_to_write): # <<<<<<<<<<<<<< - * self.require_object_exists() - * ret = self.ioctx.write(self.key, string_to_write, self.offset) - */ - __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5rados_6Object_9write, 0, __pyx_n_s_Object_write, NULL, __pyx_n_s_rados, __pyx_d, ((PyObject *)__pyx_codeobj__89)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3144, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - } - } - if (!__pyx_t_10) { - __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3143, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_GOTREF(__pyx_t_7); - } else { - __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3143, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL; - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_8); - __pyx_t_8 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3143, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_11, function); - } - } - if (!__pyx_t_9) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3142, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GOTREF(__pyx_t_4); - } else { - __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3142, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __pyx_t_9 = NULL; - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3142, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - } - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PyObject_SetItem(__pyx_t_6, __pyx_n_s_write, __pyx_t_4) < 0) __PYX_ERR(0, 3144, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "rados.pyx":3151 - * return ret - * - * @set_object_locator # <<<<<<<<<<<<<< - * @set_object_namespace - * def remove(self): - */ - __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_set_object_locator); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - - /* "rados.pyx":3152 - * - * @set_object_locator - * @set_object_namespace # <<<<<<<<<<<<<< - * def remove(self): - * self.require_object_exists() - */ - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_set_object_namespace); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3152, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - - /* "rados.pyx":3153 - * @set_object_locator - * @set_object_namespace - * def remove(self): # <<<<<<<<<<<<<< - * self.require_object_exists() - * self.ioctx.remove_object(self.key) - */ - __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5rados_6Object_11remove, 0, __pyx_n_s_Object_remove, NULL, __pyx_n_s_rados, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3153, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - } - } - if (!__pyx_t_8) { - __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3152, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_GOTREF(__pyx_t_12); - } else { - __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3152, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3152, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - } - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_11, function); - } - } - if (!__pyx_t_7) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3151, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_GOTREF(__pyx_t_4); - } else { - __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7); __pyx_t_7 = NULL; - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_12); - __pyx_t_12 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - } - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PyObject_SetItem(__pyx_t_6, __pyx_n_s_remove, __pyx_t_4) < 0) __PYX_ERR(0, 3153, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "rados.pyx":3158 - * self.state = "removed" - * - * @set_object_locator # <<<<<<<<<<<<<< - * @set_object_namespace - * def stat(self): - */ - __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_set_object_locator); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3158, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - - /* "rados.pyx":3159 - * - * @set_object_locator - * @set_object_namespace # <<<<<<<<<<<<<< - * def stat(self): - * self.require_object_exists() - */ - __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_set_object_namespace); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - - /* "rados.pyx":3160 - * @set_object_locator - * @set_object_namespace - * def stat(self): # <<<<<<<<<<<<<< - * self.require_object_exists() - * return self.ioctx.stat(self.key) - */ - __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5rados_6Object_13stat, 0, __pyx_n_s_Object_stat, NULL, __pyx_n_s_rados, __pyx_d, ((PyObject *)__pyx_codeobj__93)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3160, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_12))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_12); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_12, function); - } - } - if (!__pyx_t_9) { - __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3159, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GOTREF(__pyx_t_10); - } else { - __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); __pyx_t_9 = NULL; - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_8, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_12)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_11, function); - } - } - if (!__pyx_t_12) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3158, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_GOTREF(__pyx_t_4); - } else { - __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3158, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_12); __pyx_t_12 = NULL; - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3158, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PyObject_SetItem(__pyx_t_6, __pyx_n_s_stat, __pyx_t_4) < 0) __PYX_ERR(0, 3160, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "rados.pyx":3164 - * return self.ioctx.stat(self.key) - * - * def seek(self, position): # <<<<<<<<<<<<<< - * self.require_object_exists() - * self.offset = position - */ - __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5rados_6Object_15seek, 0, __pyx_n_s_Object_seek, NULL, __pyx_n_s_rados, __pyx_d, ((PyObject *)__pyx_codeobj__95)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3164, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyObject_SetItem(__pyx_t_6, __pyx_n_s_seek, __pyx_t_4) < 0) __PYX_ERR(0, 3164, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "rados.pyx":3168 - * self.offset = position - * - * @set_object_locator # <<<<<<<<<<<<<< - * @set_object_namespace - * def get_xattr(self, xattr_name): - */ - __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_set_object_locator); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3168, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - - /* "rados.pyx":3169 - * - * @set_object_locator - * @set_object_namespace # <<<<<<<<<<<<<< - * def get_xattr(self, xattr_name): - * self.require_object_exists() - */ - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_set_object_namespace); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - - /* "rados.pyx":3170 - * @set_object_locator - * @set_object_namespace - * def get_xattr(self, xattr_name): # <<<<<<<<<<<<<< - * self.require_object_exists() - * return self.ioctx.get_xattr(self.key, xattr_name) - */ - __pyx_t_12 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5rados_6Object_17get_xattr, 0, __pyx_n_s_Object_get_xattr, NULL, __pyx_n_s_rados, __pyx_d, ((PyObject *)__pyx_codeobj__97)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3170, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_7 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); - } - } - if (!__pyx_t_7) { - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_12); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3169, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_GOTREF(__pyx_t_8); - } else { - __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_12); - __pyx_t_12 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_11, function); - } - } - if (!__pyx_t_10) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3168, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_GOTREF(__pyx_t_4); - } else { - __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3168, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10); __pyx_t_10 = NULL; - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_8); - __pyx_t_8 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3168, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PyObject_SetItem(__pyx_t_6, __pyx_n_s_get_xattr, __pyx_t_4) < 0) __PYX_ERR(0, 3170, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "rados.pyx":3174 - * return self.ioctx.get_xattr(self.key, xattr_name) - * - * @set_object_locator # <<<<<<<<<<<<<< - * @set_object_namespace - * def get_xattrs(self): - */ - __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_set_object_locator); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - - /* "rados.pyx":3175 - * - * @set_object_locator - * @set_object_namespace # <<<<<<<<<<<<<< - * def get_xattrs(self): - * self.require_object_exists() - */ - __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_set_object_namespace); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - - /* "rados.pyx":3176 - * @set_object_locator - * @set_object_namespace - * def get_xattrs(self): # <<<<<<<<<<<<<< - * self.require_object_exists() - * return self.ioctx.get_xattrs(self.key) - */ - __pyx_t_10 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5rados_6Object_19get_xattrs, 0, __pyx_n_s_Object_get_xattrs, NULL, __pyx_n_s_rados, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3176, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_12 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_12)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - } - } - if (!__pyx_t_12) { - __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3175, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_GOTREF(__pyx_t_9); - } else { - __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_12); __pyx_t_12 = NULL; - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_11, function); - } - } - if (!__pyx_t_8) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3174, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_GOTREF(__pyx_t_4); - } else { - __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); __pyx_t_8 = NULL; - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PyObject_SetItem(__pyx_t_6, __pyx_n_s_get_xattrs, __pyx_t_4) < 0) __PYX_ERR(0, 3176, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "rados.pyx":3180 - * return self.ioctx.get_xattrs(self.key) - * - * @set_object_locator # <<<<<<<<<<<<<< - * @set_object_namespace - * def set_xattr(self, xattr_name, xattr_value): - */ - __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_set_object_locator); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3180, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - - /* "rados.pyx":3181 - * - * @set_object_locator - * @set_object_namespace # <<<<<<<<<<<<<< - * def set_xattr(self, xattr_name, xattr_value): - * self.require_object_exists() - */ - __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_set_object_namespace); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - - /* "rados.pyx":3182 - * @set_object_locator - * @set_object_namespace - * def set_xattr(self, xattr_name, xattr_value): # <<<<<<<<<<<<<< - * self.require_object_exists() - * return self.ioctx.set_xattr(self.key, xattr_name, xattr_value) - */ - __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5rados_6Object_21set_xattr, 0, __pyx_n_s_Object_set_xattr, NULL, __pyx_n_s_rados, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - } - } - if (!__pyx_t_10) { - __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3181, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_GOTREF(__pyx_t_7); - } else { - __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL; - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_8); - __pyx_t_8 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_11, function); - } - } - if (!__pyx_t_9) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3180, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GOTREF(__pyx_t_4); - } else { - __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3180, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __pyx_t_9 = NULL; - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3180, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - } - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PyObject_SetItem(__pyx_t_6, __pyx_n_s_set_xattr, __pyx_t_4) < 0) __PYX_ERR(0, 3182, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "rados.pyx":3186 - * return self.ioctx.set_xattr(self.key, xattr_name, xattr_value) - * - * @set_object_locator # <<<<<<<<<<<<<< - * @set_object_namespace - * def rm_xattr(self, xattr_name): - */ - __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_set_object_locator); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3186, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - - /* "rados.pyx":3187 - * - * @set_object_locator - * @set_object_namespace # <<<<<<<<<<<<<< - * def rm_xattr(self, xattr_name): - * self.require_object_exists() - */ - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_set_object_namespace); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3187, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - - /* "rados.pyx":3188 - * @set_object_locator - * @set_object_namespace - * def rm_xattr(self, xattr_name): # <<<<<<<<<<<<<< - * self.require_object_exists() - * return self.ioctx.rm_xattr(self.key, xattr_name) - */ - __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5rados_6Object_23rm_xattr, 0, __pyx_n_s_Object_rm_xattr, NULL, __pyx_n_s_rados, __pyx_d, ((PyObject *)__pyx_codeobj__103)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - } - } - if (!__pyx_t_8) { - __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3187, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_GOTREF(__pyx_t_12); - } else { - __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3187, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3187, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - } - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_11, function); - } - } - if (!__pyx_t_7) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3186, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_GOTREF(__pyx_t_4); - } else { - __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3186, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7); __pyx_t_7 = NULL; - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_12); - __pyx_t_12 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3186, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - } - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PyObject_SetItem(__pyx_t_6, __pyx_n_s_rm_xattr, __pyx_t_4) < 0) __PYX_ERR(0, 3188, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "rados.pyx":3115 - * - * - * class Object(object): # <<<<<<<<<<<<<< - * """Rados object wrapper, makes the object look like a file""" - * def __init__(self, ioctx, key, locator_key=None, nspace=None): - */ - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Object, __pyx_t_2, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3115, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Object, __pyx_t_4) < 0) __PYX_ERR(0, 3115, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":3192 - * return self.ioctx.rm_xattr(self.key, xattr_name) - * - * MONITOR_LEVELS = [ # <<<<<<<<<<<<<< - * "debug", - * "info", - */ - __pyx_t_2 = PyList_New(7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3192, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_debug); - __Pyx_GIVEREF(__pyx_n_s_debug); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_debug); - __Pyx_INCREF(__pyx_n_s_info); - __Pyx_GIVEREF(__pyx_n_s_info); - PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_info); - __Pyx_INCREF(__pyx_n_s_warn); - __Pyx_GIVEREF(__pyx_n_s_warn); - PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_warn); - __Pyx_INCREF(__pyx_n_s_warning); - __Pyx_GIVEREF(__pyx_n_s_warning); - PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_warning); - __Pyx_INCREF(__pyx_n_s_err); - __Pyx_GIVEREF(__pyx_n_s_err); - PyList_SET_ITEM(__pyx_t_2, 4, __pyx_n_s_err); - __Pyx_INCREF(__pyx_n_s_error); - __Pyx_GIVEREF(__pyx_n_s_error); - PyList_SET_ITEM(__pyx_t_2, 5, __pyx_n_s_error); - __Pyx_INCREF(__pyx_n_s_sec); - __Pyx_GIVEREF(__pyx_n_s_sec); - PyList_SET_ITEM(__pyx_t_2, 6, __pyx_n_s_sec); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MONITOR_LEVELS, __pyx_t_2) < 0) __PYX_ERR(0, 3192, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":3201 - * - * - * class MonitorLog(object): # <<<<<<<<<<<<<< - * # NOTE(sileht): Keep this class for backward compat - * # method moved to Rados.monitor_log() - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_builtin_object); - __Pyx_GIVEREF(__pyx_builtin_object); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_object); - __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_MonitorLog, __pyx_n_s_MonitorLog, (PyObject *) NULL, __pyx_n_s_rados, __pyx_kp_s_For_watching_cluster_log_messag); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - - /* "rados.pyx":3221 - * callback's return value is ignored - * """ - * def __init__(self, cluster, level, callback, arg): # <<<<<<<<<<<<<< - * self.level = level - * self.callback = callback - */ - __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5rados_10MonitorLog_1__init__, 0, __pyx_n_s_MonitorLog___init, NULL, __pyx_n_s_rados, __pyx_d, ((PyObject *)__pyx_codeobj__105)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3221, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyObject_SetItem(__pyx_t_6, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 3221, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "rados.pyx":3201 - * - * - * class MonitorLog(object): # <<<<<<<<<<<<<< - * # NOTE(sileht): Keep this class for backward compat - * # method moved to Rados.monitor_log() - */ - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_MonitorLog, __pyx_t_2, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MonitorLog, __pyx_t_4) < 0) __PYX_ERR(0, 3201, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rados.pyx":1 - * # cython: embedsignature=True # <<<<<<<<<<<<<< - * """ - * This module is a thin wrapper around librados. - */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /*--- Wrapped vars code ---*/ - - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_10); - __Pyx_XDECREF(__pyx_t_11); - __Pyx_XDECREF(__pyx_t_12); - __Pyx_XDECREF(__pyx_t_14); - if (__pyx_m) { - if (__pyx_d) { - __Pyx_AddTraceback("init rados", __pyx_clineno, __pyx_lineno, __pyx_filename); - } - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init rados"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #endif -} - -/* --- Runtime support code --- */ -/* Refnanny */ -#if CYTHON_REFNANNY -static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule((char *)modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); -end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; -} -#endif - -/* GetBuiltinName */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); - if (unlikely(!result)) { - PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 - "name '%U' is not defined", name); -#else - "name '%.200s' is not defined", PyString_AS_STRING(name)); -#endif - } - return result; -} - -/* PyObjectCall */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { - PyObject *result; - ternaryfunc call = func->ob_type->tp_call; - if (unlikely(!call)) - return PyObject_Call(func, arg, kw); - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - result = (*call)(func, arg, kw); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); - } - return result; -} -#endif - -/* PyObjectCallMethO */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { - PyObject *self, *result; - PyCFunction cfunc; - cfunc = PyCFunction_GET_FUNCTION(func); - self = PyCFunction_GET_SELF(func); - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - result = cfunc(self, arg); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); - } - return result; -} -#endif - -/* PyObjectCallOneArg */ -#if CYTHON_COMPILING_IN_CPYTHON -static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { - PyObject *result; - PyObject *args = PyTuple_New(1); - if (unlikely(!args)) return NULL; - Py_INCREF(arg); - PyTuple_SET_ITEM(args, 0, arg); - result = __Pyx_PyObject_Call(func, args, NULL); - Py_DECREF(args); - return result; -} -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else - if (likely(PyCFunction_Check(func))) { -#endif - if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { - return __Pyx_PyObject_CallMethO(func, arg); - } - } - return __Pyx__PyObject_CallOneArg(func, arg); -} -#else -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { - PyObject *result; - PyObject *args = PyTuple_Pack(1, arg); - if (unlikely(!args)) return NULL; - result = __Pyx_PyObject_Call(func, args, NULL); - Py_DECREF(args); - return result; -} -#endif - -/* GetModuleGlobalName */ - static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { - PyObject *result; -#if CYTHON_COMPILING_IN_CPYTHON - result = PyDict_GetItem(__pyx_d, name); - if (likely(result)) { - Py_INCREF(result); - } else { -#else - result = PyObject_GetItem(__pyx_d, name); - if (!result) { - PyErr_Clear(); -#endif - result = __Pyx_GetBuiltinName(name); - } - return result; -} - -/* KeywordStringCheck */ - static CYTHON_INLINE int __Pyx_CheckKeywordStrings( - PyObject *kwdict, - const char* function_name, - int kw_allowed) -{ - PyObject* key = 0; - Py_ssize_t pos = 0; -#if CYTHON_COMPILING_IN_PYPY - if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) - goto invalid_keyword; - return 1; -#else - while (PyDict_Next(kwdict, &pos, &key, 0)) { - #if PY_MAJOR_VERSION < 3 - if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) - #endif - if (unlikely(!PyUnicode_Check(key))) - goto invalid_keyword_type; - } - if ((!kw_allowed) && unlikely(key)) - goto invalid_keyword; - return 1; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%.200s() keywords must be strings", function_name); - return 0; -#endif -invalid_keyword: - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%.200s() got an unexpected keyword argument '%.200s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif - return 0; -} - -/* RaiseArgTupleInvalid */ - static void __Pyx_RaiseArgtupleInvalid( - const char* func_name, - int exact, - Py_ssize_t num_min, - Py_ssize_t num_max, - Py_ssize_t num_found) -{ - Py_ssize_t num_expected; - const char *more_or_less; - if (num_found < num_min) { - num_expected = num_min; - more_or_less = "at least"; - } else { - num_expected = num_max; - more_or_less = "at most"; - } - if (exact) { - more_or_less = "exactly"; - } - PyErr_Format(PyExc_TypeError, - "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", - func_name, more_or_less, num_expected, - (num_expected == 1) ? "" : "s", num_found); -} - -/* RaiseDoubleKeywords */ - static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AsString(kw_name)); - #endif -} - -/* ParseKeywords */ - static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - while (PyDict_Next(kwds, &pos, &key, &value)) { - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; - continue; - } - name = first_kw_arg; - #if PY_MAJOR_VERSION < 3 - if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { - while (*name) { - if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) - && _PyString_Eq(**name, key)) { - values[name-argnames] = value; - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - if ((**argname == key) || ( - (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) - && _PyString_Eq(**argname, key))) { - goto arg_passed_twice; - } - argname++; - } - } - } else - #endif - if (likely(PyUnicode_Check(key))) { - while (*name) { - int cmp = (**name == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : - #endif - PyUnicode_Compare(**name, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) { - values[name-argnames] = value; - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - int cmp = (**argname == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : - #endif - PyUnicode_Compare(**argname, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) goto arg_passed_twice; - argname++; - } - } - } else - goto invalid_keyword_type; - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, key); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%.200s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%.200s() got an unexpected keyword argument '%.200s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - return -1; -} - -/* None */ - static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { - PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); -} - -/* StringJoin */ - #if !CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { - return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL); -} -#endif - -/* PyErrFetchRestore */ - #if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -} -#endif - -/* RaiseException */ - #if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, - CYTHON_UNUSED PyObject *cause) { - __Pyx_PyThreadState_declare - Py_XINCREF(type); - if (!value || value == Py_None) - value = NULL; - else - Py_INCREF(value); - if (!tb || tb == Py_None) - tb = NULL; - else { - Py_INCREF(tb); - if (!PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - } - if (PyType_Check(type)) { -#if CYTHON_COMPILING_IN_PYPY - if (!value) { - Py_INCREF(Py_None); - value = Py_None; - } -#endif - PyErr_NormalizeException(&type, &value, &tb); - } else { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - value = type; - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - } - __Pyx_PyThreadState_assign - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} -#else -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - PyObject* owned_instance = NULL; - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; - } - if (value == Py_None) - value = 0; - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (PyExceptionClass_Check(type)) { - PyObject *instance_class = NULL; - if (value && PyExceptionInstance_Check(value)) { - instance_class = (PyObject*) Py_TYPE(value); - if (instance_class != type) { - int is_subclass = PyObject_IsSubclass(instance_class, type); - if (!is_subclass) { - instance_class = NULL; - } else if (unlikely(is_subclass == -1)) { - goto bad; - } else { - type = instance_class; - } - } - } - if (!instance_class) { - PyObject *args; - if (!value) - args = PyTuple_New(0); - else if (PyTuple_Check(value)) { - Py_INCREF(value); - args = value; - } else - args = PyTuple_Pack(1, value); - if (!args) - goto bad; - owned_instance = PyObject_Call(type, args, NULL); - Py_DECREF(args); - if (!owned_instance) - goto bad; - value = owned_instance; - if (!PyExceptionInstance_Check(value)) { - PyErr_Format(PyExc_TypeError, - "calling %R should have returned an instance of " - "BaseException, not %R", - type, Py_TYPE(value)); - goto bad; - } - } - } else { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } -#if PY_VERSION_HEX >= 0x03030000 - if (cause) { -#else - if (cause && cause != Py_None) { -#endif - PyObject *fixed_cause; - if (cause == Py_None) { - fixed_cause = NULL; - } else if (PyExceptionClass_Check(cause)) { - fixed_cause = PyObject_CallObject(cause, NULL); - if (fixed_cause == NULL) - goto bad; - } else if (PyExceptionInstance_Check(cause)) { - fixed_cause = cause; - Py_INCREF(fixed_cause); - } else { - PyErr_SetString(PyExc_TypeError, - "exception causes must derive from " - "BaseException"); - goto bad; - } - PyException_SetCause(value, fixed_cause); - } - PyErr_SetObject(type, value); - if (tb) { -#if CYTHON_COMPILING_IN_PYPY - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - Py_INCREF(tb); - PyErr_Restore(tmp_type, tmp_value, tb); - Py_XDECREF(tmp_tb); -#else - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } -#endif - } -bad: - Py_XDECREF(owned_instance); - return; -} -#endif - -/* RaiseTooManyValuesToUnpack */ - static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { - PyErr_Format(PyExc_ValueError, - "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); -} - -/* RaiseNeedMoreValuesToUnpack */ - static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { - PyErr_Format(PyExc_ValueError, - "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", - index, (index == 1) ? "" : "s"); -} - -/* IterFinish */ - static CYTHON_INLINE int __Pyx_IterFinish(void) { -#if CYTHON_COMPILING_IN_CPYTHON - PyThreadState *tstate = PyThreadState_GET(); - PyObject* exc_type = tstate->curexc_type; - if (unlikely(exc_type)) { - if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { - PyObject *exc_value, *exc_tb; - exc_value = tstate->curexc_value; - exc_tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; - Py_DECREF(exc_type); - Py_XDECREF(exc_value); - Py_XDECREF(exc_tb); - return 0; - } else { - return -1; - } - } - return 0; -#else - if (unlikely(PyErr_Occurred())) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { - PyErr_Clear(); - return 0; - } else { - return -1; - } - } - return 0; -#endif -} - -/* UnpackItemEndCheck */ - static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { - if (unlikely(retval)) { - Py_DECREF(retval); - __Pyx_RaiseTooManyValuesError(expected); - return -1; - } else { - return __Pyx_IterFinish(); - } - return 0; -} - -/* SliceTupleAndList */ - #if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE void __Pyx_crop_slice(Py_ssize_t* _start, Py_ssize_t* _stop, Py_ssize_t* _length) { - Py_ssize_t start = *_start, stop = *_stop, length = *_length; - if (start < 0) { - start += length; - if (start < 0) - start = 0; - } - if (stop < 0) - stop += length; - else if (stop > length) - stop = length; - *_length = stop - start; - *_start = start; - *_stop = stop; -} -static CYTHON_INLINE void __Pyx_copy_object_array(PyObject** CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { - PyObject *v; - Py_ssize_t i; - for (i = 0; i < length; i++) { - v = dest[i] = src[i]; - Py_INCREF(v); - } -} -static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice( - PyObject* src, Py_ssize_t start, Py_ssize_t stop) { - PyObject* dest; - Py_ssize_t length = PyList_GET_SIZE(src); - __Pyx_crop_slice(&start, &stop, &length); - if (unlikely(length <= 0)) - return PyList_New(0); - dest = PyList_New(length); - if (unlikely(!dest)) - return NULL; - __Pyx_copy_object_array( - ((PyListObject*)src)->ob_item + start, - ((PyListObject*)dest)->ob_item, - length); - return dest; -} -static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice( - PyObject* src, Py_ssize_t start, Py_ssize_t stop) { - PyObject* dest; - Py_ssize_t length = PyTuple_GET_SIZE(src); - __Pyx_crop_slice(&start, &stop, &length); - if (unlikely(length <= 0)) - return PyTuple_New(0); - dest = PyTuple_New(length); - if (unlikely(!dest)) - return NULL; - __Pyx_copy_object_array( - ((PyTupleObject*)src)->ob_item + start, - ((PyTupleObject*)dest)->ob_item, - length); - return dest; -} -#endif - -/* FetchCommonType */ - static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { - PyObject* fake_module; - PyTypeObject* cached_type = NULL; - fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); - if (!fake_module) return NULL; - Py_INCREF(fake_module); - cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); - if (cached_type) { - if (!PyType_Check((PyObject*)cached_type)) { - PyErr_Format(PyExc_TypeError, - "Shared Cython type %.200s is not a type object", - type->tp_name); - goto bad; - } - if (cached_type->tp_basicsize != type->tp_basicsize) { - PyErr_Format(PyExc_TypeError, - "Shared Cython type %.200s has the wrong size, try recompiling", - type->tp_name); - goto bad; - } - } else { - if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; - PyErr_Clear(); - if (PyType_Ready(type) < 0) goto bad; - if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) - goto bad; - Py_INCREF(type); - cached_type = type; - } -done: - Py_DECREF(fake_module); - return cached_type; -bad: - Py_XDECREF(cached_type); - cached_type = NULL; - goto done; -} - -/* CythonFunction */ - static PyObject * -__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) -{ - if (unlikely(op->func_doc == NULL)) { - if (op->func.m_ml->ml_doc) { -#if PY_MAJOR_VERSION >= 3 - op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); -#else - op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); -#endif - if (unlikely(op->func_doc == NULL)) - return NULL; - } else { - Py_INCREF(Py_None); - return Py_None; - } - } - Py_INCREF(op->func_doc); - return op->func_doc; -} -static int -__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) -{ - PyObject *tmp = op->func_doc; - if (value == NULL) { - value = Py_None; - } - Py_INCREF(value); - op->func_doc = value; - Py_XDECREF(tmp); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) -{ - if (unlikely(op->func_name == NULL)) { -#if PY_MAJOR_VERSION >= 3 - op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); -#else - op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); -#endif - if (unlikely(op->func_name == NULL)) - return NULL; - } - Py_INCREF(op->func_name); - return op->func_name; -} -static int -__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) -{ - PyObject *tmp; -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) { -#else - if (unlikely(value == NULL || !PyString_Check(value))) { -#endif - PyErr_SetString(PyExc_TypeError, - "__name__ must be set to a string object"); - return -1; - } - tmp = op->func_name; - Py_INCREF(value); - op->func_name = value; - Py_XDECREF(tmp); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) -{ - Py_INCREF(op->func_qualname); - return op->func_qualname; -} -static int -__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) -{ - PyObject *tmp; -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) { -#else - if (unlikely(value == NULL || !PyString_Check(value))) { -#endif - PyErr_SetString(PyExc_TypeError, - "__qualname__ must be set to a string object"); - return -1; - } - tmp = op->func_qualname; - Py_INCREF(value); - op->func_qualname = value; - Py_XDECREF(tmp); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) -{ - PyObject *self; - self = m->func_closure; - if (self == NULL) - self = Py_None; - Py_INCREF(self); - return self; -} -static PyObject * -__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) -{ - if (unlikely(op->func_dict == NULL)) { - op->func_dict = PyDict_New(); - if (unlikely(op->func_dict == NULL)) - return NULL; - } - Py_INCREF(op->func_dict); - return op->func_dict; -} -static int -__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) -{ - PyObject *tmp; - if (unlikely(value == NULL)) { - PyErr_SetString(PyExc_TypeError, - "function's dictionary may not be deleted"); - return -1; - } - if (unlikely(!PyDict_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "setting function's dictionary to a non-dict"); - return -1; - } - tmp = op->func_dict; - Py_INCREF(value); - op->func_dict = value; - Py_XDECREF(tmp); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) -{ - Py_INCREF(op->func_globals); - return op->func_globals; -} -static PyObject * -__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) -{ - Py_INCREF(Py_None); - return Py_None; -} -static PyObject * -__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) -{ - PyObject* result = (op->func_code) ? op->func_code : Py_None; - Py_INCREF(result); - return result; -} -static int -__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { - int result = 0; - PyObject *res = op->defaults_getter((PyObject *) op); - if (unlikely(!res)) - return -1; - #if CYTHON_COMPILING_IN_CPYTHON - op->defaults_tuple = PyTuple_GET_ITEM(res, 0); - Py_INCREF(op->defaults_tuple); - op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); - Py_INCREF(op->defaults_kwdict); - #else - op->defaults_tuple = PySequence_ITEM(res, 0); - if (unlikely(!op->defaults_tuple)) result = -1; - else { - op->defaults_kwdict = PySequence_ITEM(res, 1); - if (unlikely(!op->defaults_kwdict)) result = -1; - } - #endif - Py_DECREF(res); - return result; -} -static int -__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { - PyObject* tmp; - if (!value) { - value = Py_None; - } else if (value != Py_None && !PyTuple_Check(value)) { - PyErr_SetString(PyExc_TypeError, - "__defaults__ must be set to a tuple object"); - return -1; - } - Py_INCREF(value); - tmp = op->defaults_tuple; - op->defaults_tuple = value; - Py_XDECREF(tmp); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { - PyObject* result = op->defaults_tuple; - if (unlikely(!result)) { - if (op->defaults_getter) { - if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; - result = op->defaults_tuple; - } else { - result = Py_None; - } - } - Py_INCREF(result); - return result; -} -static int -__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { - PyObject* tmp; - if (!value) { - value = Py_None; - } else if (value != Py_None && !PyDict_Check(value)) { - PyErr_SetString(PyExc_TypeError, - "__kwdefaults__ must be set to a dict object"); - return -1; - } - Py_INCREF(value); - tmp = op->defaults_kwdict; - op->defaults_kwdict = value; - Py_XDECREF(tmp); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { - PyObject* result = op->defaults_kwdict; - if (unlikely(!result)) { - if (op->defaults_getter) { - if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; - result = op->defaults_kwdict; - } else { - result = Py_None; - } - } - Py_INCREF(result); - return result; -} -static int -__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { - PyObject* tmp; - if (!value || value == Py_None) { - value = NULL; - } else if (!PyDict_Check(value)) { - PyErr_SetString(PyExc_TypeError, - "__annotations__ must be set to a dict object"); - return -1; - } - Py_XINCREF(value); - tmp = op->func_annotations; - op->func_annotations = value; - Py_XDECREF(tmp); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { - PyObject* result = op->func_annotations; - if (unlikely(!result)) { - result = PyDict_New(); - if (unlikely(!result)) return NULL; - op->func_annotations = result; - } - Py_INCREF(result); - return result; -} -static PyGetSetDef __pyx_CyFunction_getsets[] = { - {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, - {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, - {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, - {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, - {0, 0, 0, 0, 0} -}; -static PyMemberDef __pyx_CyFunction_members[] = { - {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, - {0, 0, 0, 0, 0} -}; -static PyObject * -__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) -{ -#if PY_MAJOR_VERSION >= 3 - return PyUnicode_FromString(m->func.m_ml->ml_name); -#else - return PyString_FromString(m->func.m_ml->ml_name); -#endif -} -static PyMethodDef __pyx_CyFunction_methods[] = { - {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, - {0, 0, 0, 0} -}; -#if PY_VERSION_HEX < 0x030500A0 -#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) -#else -#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) -#endif -static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, - PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { - __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); - if (op == NULL) - return NULL; - op->flags = flags; - __Pyx_CyFunction_weakreflist(op) = NULL; - op->func.m_ml = ml; - op->func.m_self = (PyObject *) op; - Py_XINCREF(closure); - op->func_closure = closure; - Py_XINCREF(module); - op->func.m_module = module; - op->func_dict = NULL; - op->func_name = NULL; - Py_INCREF(qualname); - op->func_qualname = qualname; - op->func_doc = NULL; - op->func_classobj = NULL; - op->func_globals = globals; - Py_INCREF(op->func_globals); - Py_XINCREF(code); - op->func_code = code; - op->defaults_pyobjects = 0; - op->defaults = NULL; - op->defaults_tuple = NULL; - op->defaults_kwdict = NULL; - op->defaults_getter = NULL; - op->func_annotations = NULL; - PyObject_GC_Track(op); - return (PyObject *) op; -} -static int -__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) -{ - Py_CLEAR(m->func_closure); - Py_CLEAR(m->func.m_module); - Py_CLEAR(m->func_dict); - Py_CLEAR(m->func_name); - Py_CLEAR(m->func_qualname); - Py_CLEAR(m->func_doc); - Py_CLEAR(m->func_globals); - Py_CLEAR(m->func_code); - Py_CLEAR(m->func_classobj); - Py_CLEAR(m->defaults_tuple); - Py_CLEAR(m->defaults_kwdict); - Py_CLEAR(m->func_annotations); - if (m->defaults) { - PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); - int i; - for (i = 0; i < m->defaults_pyobjects; i++) - Py_XDECREF(pydefaults[i]); - PyObject_Free(m->defaults); - m->defaults = NULL; - } - return 0; -} -static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) -{ - PyObject_GC_UnTrack(m); - if (__Pyx_CyFunction_weakreflist(m) != NULL) - PyObject_ClearWeakRefs((PyObject *) m); - __Pyx_CyFunction_clear(m); - PyObject_GC_Del(m); -} -static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) -{ - Py_VISIT(m->func_closure); - Py_VISIT(m->func.m_module); - Py_VISIT(m->func_dict); - Py_VISIT(m->func_name); - Py_VISIT(m->func_qualname); - Py_VISIT(m->func_doc); - Py_VISIT(m->func_globals); - Py_VISIT(m->func_code); - Py_VISIT(m->func_classobj); - Py_VISIT(m->defaults_tuple); - Py_VISIT(m->defaults_kwdict); - if (m->defaults) { - PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); - int i; - for (i = 0; i < m->defaults_pyobjects; i++) - Py_VISIT(pydefaults[i]); - } - return 0; -} -static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) -{ - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { - Py_INCREF(func); - return func; - } - if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { - if (type == NULL) - type = (PyObject *)(Py_TYPE(obj)); - return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); - } - if (obj == Py_None) - obj = NULL; - return __Pyx_PyMethod_New(func, obj, type); -} -static PyObject* -__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) -{ -#if PY_MAJOR_VERSION >= 3 - return PyUnicode_FromFormat("", - op->func_qualname, (void *)op); -#else - return PyString_FromFormat("", - PyString_AsString(op->func_qualname), (void *)op); -#endif -} -#if CYTHON_COMPILING_IN_PYPY -static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { - PyCFunctionObject* f = (PyCFunctionObject*)func; - PyCFunction meth = f->m_ml->ml_meth; - PyObject *self = f->m_self; - Py_ssize_t size; - switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { - case METH_VARARGS: - if (likely(kw == NULL || PyDict_Size(kw) == 0)) - return (*meth)(self, arg); - break; - case METH_VARARGS | METH_KEYWORDS: - return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); - case METH_NOARGS: - if (likely(kw == NULL || PyDict_Size(kw) == 0)) { - size = PyTuple_GET_SIZE(arg); - if (likely(size == 0)) - return (*meth)(self, NULL); - PyErr_Format(PyExc_TypeError, - "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - f->m_ml->ml_name, size); - return NULL; - } - break; - case METH_O: - if (likely(kw == NULL || PyDict_Size(kw) == 0)) { - size = PyTuple_GET_SIZE(arg); - if (likely(size == 1)) { - PyObject *result, *arg0 = PySequence_ITEM(arg, 0); - if (unlikely(!arg0)) return NULL; - result = (*meth)(self, arg0); - Py_DECREF(arg0); - return result; - } - PyErr_Format(PyExc_TypeError, - "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - f->m_ml->ml_name, size); - return NULL; - } - break; - default: - PyErr_SetString(PyExc_SystemError, "Bad call flags in " - "__Pyx_CyFunction_Call. METH_OLDARGS is no " - "longer supported!"); - return NULL; - } - PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", - f->m_ml->ml_name); - return NULL; -} -#else -static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { - return PyCFunction_Call(func, arg, kw); -} -#endif -static PyTypeObject __pyx_CyFunctionType_type = { - PyVarObject_HEAD_INIT(0, 0) - "cython_function_or_method", - sizeof(__pyx_CyFunctionObject), - 0, - (destructor) __Pyx_CyFunction_dealloc, - 0, - 0, - 0, -#if PY_MAJOR_VERSION < 3 - 0, -#else - 0, -#endif - (reprfunc) __Pyx_CyFunction_repr, - 0, - 0, - 0, - 0, - __Pyx_CyFunction_Call, - 0, - 0, - 0, - 0, - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, - 0, - (traverseproc) __Pyx_CyFunction_traverse, - (inquiry) __Pyx_CyFunction_clear, - 0, -#if PY_VERSION_HEX < 0x030500A0 - offsetof(__pyx_CyFunctionObject, func_weakreflist), -#else - offsetof(PyCFunctionObject, m_weakreflist), -#endif - 0, - 0, - __pyx_CyFunction_methods, - __pyx_CyFunction_members, - __pyx_CyFunction_getsets, - 0, - 0, - __Pyx_CyFunction_descr_get, - 0, - offsetof(__pyx_CyFunctionObject, func_dict), - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, -#if PY_VERSION_HEX >= 0x030400a1 - 0, -#endif -}; -static int __pyx_CyFunction_init(void) { -#if !CYTHON_COMPILING_IN_PYPY - __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; -#endif - __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); - if (__pyx_CyFunctionType == NULL) { - return -1; - } - return 0; -} -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults = PyObject_Malloc(size); - if (!m->defaults) - return PyErr_NoMemory(); - memset(m->defaults, 0, size); - m->defaults_pyobjects = pyobjects; - return m->defaults; -} -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults_tuple = tuple; - Py_INCREF(tuple); -} -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults_kwdict = dict; - Py_INCREF(dict); -} -static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->func_annotations = dict; - Py_INCREF(dict); -} - -/* GetItemInt */ - static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { - PyObject *r; - if (!j) return NULL; - r = PyObject_GetItem(o, j); - Py_DECREF(j); - return r; -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_COMPILING_IN_CPYTHON - if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_COMPILING_IN_CPYTHON - if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_COMPILING_IN_CPYTHON - if (is_list || PyList_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); - if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { - PyObject *r = PyList_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } - else if (PyTuple_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } else { - PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; - if (likely(m && m->sq_item)) { - if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { - Py_ssize_t l = m->sq_length(o); - if (likely(l >= 0)) { - i += l; - } else { - if (!PyErr_ExceptionMatches(PyExc_OverflowError)) - return NULL; - PyErr_Clear(); - } - } - return m->sq_item(o, i); - } - } -#else - if (is_list || PySequence_Check(o)) { - return PySequence_GetItem(o, i); - } -#endif - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -} - -/* WriteUnraisableException */ - static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, - CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, - int full_traceback, CYTHON_UNUSED int nogil) { - PyObject *old_exc, *old_val, *old_tb; - PyObject *ctx; - __Pyx_PyThreadState_declare -#ifdef WITH_THREAD - PyGILState_STATE state; - if (nogil) - state = PyGILState_Ensure(); -#ifdef _MSC_VER - else state = (PyGILState_STATE)-1; -#endif -#endif - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); - if (full_traceback) { - Py_XINCREF(old_exc); - Py_XINCREF(old_val); - Py_XINCREF(old_tb); - __Pyx_ErrRestore(old_exc, old_val, old_tb); - PyErr_PrintEx(1); - } - #if PY_MAJOR_VERSION < 3 - ctx = PyString_FromString(name); - #else - ctx = PyUnicode_FromString(name); - #endif - __Pyx_ErrRestore(old_exc, old_val, old_tb); - if (!ctx) { - PyErr_WriteUnraisable(Py_None); - } else { - PyErr_WriteUnraisable(ctx); - Py_DECREF(ctx); - } -#ifdef WITH_THREAD - if (nogil) - PyGILState_Release(state); -#endif -} - -/* PyObjectCallNoArg */ - #if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else - if (likely(PyCFunction_Check(func))) { -#endif - if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { - return __Pyx_PyObject_CallMethO(func, NULL); - } - } - return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); -} -#endif - -/* BytesEquals */ - static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY - return PyObject_RichCompareBool(s1, s2, equals); -#else - if (s1 == s2) { - return (equals == Py_EQ); - } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { - const char *ps1, *ps2; - Py_ssize_t length = PyBytes_GET_SIZE(s1); - if (length != PyBytes_GET_SIZE(s2)) - return (equals == Py_NE); - ps1 = PyBytes_AS_STRING(s1); - ps2 = PyBytes_AS_STRING(s2); - if (ps1[0] != ps2[0]) { - return (equals == Py_NE); - } else if (length == 1) { - return (equals == Py_EQ); - } else { - int result = memcmp(ps1, ps2, (size_t)length); - return (equals == Py_EQ) ? (result == 0) : (result != 0); - } - } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { - return (equals == Py_NE); - } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { - return (equals == Py_NE); - } else { - int result; - PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - if (!py_result) - return -1; - result = __Pyx_PyObject_IsTrue(py_result); - Py_DECREF(py_result); - return result; - } -#endif -} - -/* UnicodeEquals */ - static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY - return PyObject_RichCompareBool(s1, s2, equals); -#else -#if PY_MAJOR_VERSION < 3 - PyObject* owned_ref = NULL; -#endif - int s1_is_unicode, s2_is_unicode; - if (s1 == s2) { - goto return_eq; - } - s1_is_unicode = PyUnicode_CheckExact(s1); - s2_is_unicode = PyUnicode_CheckExact(s2); -#if PY_MAJOR_VERSION < 3 - if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { - owned_ref = PyUnicode_FromObject(s2); - if (unlikely(!owned_ref)) - return -1; - s2 = owned_ref; - s2_is_unicode = 1; - } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { - owned_ref = PyUnicode_FromObject(s1); - if (unlikely(!owned_ref)) - return -1; - s1 = owned_ref; - s1_is_unicode = 1; - } else if (((!s2_is_unicode) & (!s1_is_unicode))) { - return __Pyx_PyBytes_Equals(s1, s2, equals); - } -#endif - if (s1_is_unicode & s2_is_unicode) { - Py_ssize_t length; - int kind; - void *data1, *data2; - if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) - return -1; - length = __Pyx_PyUnicode_GET_LENGTH(s1); - if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { - goto return_ne; - } - kind = __Pyx_PyUnicode_KIND(s1); - if (kind != __Pyx_PyUnicode_KIND(s2)) { - goto return_ne; - } - data1 = __Pyx_PyUnicode_DATA(s1); - data2 = __Pyx_PyUnicode_DATA(s2); - if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { - goto return_ne; - } else if (length == 1) { - goto return_eq; - } else { - int result = memcmp(data1, data2, (size_t)(length * kind)); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_EQ) ? (result == 0) : (result != 0); - } - } else if ((s1 == Py_None) & s2_is_unicode) { - goto return_ne; - } else if ((s2 == Py_None) & s1_is_unicode) { - goto return_ne; - } else { - int result; - PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - if (!py_result) - return -1; - result = __Pyx_PyObject_IsTrue(py_result); - Py_DECREF(py_result); - return result; - } -return_eq: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_EQ); -return_ne: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_NE); -#endif -} - -/* GetException */ - #if CYTHON_COMPILING_IN_CPYTHON -static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { -#else -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { -#endif - PyObject *local_type, *local_value, *local_tb; -#if CYTHON_COMPILING_IN_CPYTHON - PyObject *tmp_type, *tmp_value, *tmp_tb; - local_type = tstate->curexc_type; - local_value = tstate->curexc_value; - local_tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -#else - PyErr_Fetch(&local_type, &local_value, &local_tb); -#endif - PyErr_NormalizeException(&local_type, &local_value, &local_tb); -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(tstate->curexc_type)) -#else - if (unlikely(PyErr_Occurred())) -#endif - goto bad; - #if PY_MAJOR_VERSION >= 3 - if (local_tb) { - if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) - goto bad; - } - #endif - Py_XINCREF(local_tb); - Py_XINCREF(local_type); - Py_XINCREF(local_value); - *type = local_type; - *value = local_value; - *tb = local_tb; -#if CYTHON_COMPILING_IN_CPYTHON - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = local_type; - tstate->exc_value = local_value; - tstate->exc_traceback = local_tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#else - PyErr_SetExcInfo(local_type, local_value, local_tb); -#endif - return 0; -bad: - *type = 0; - *value = 0; - *tb = 0; - Py_XDECREF(local_type); - Py_XDECREF(local_value); - Py_XDECREF(local_tb); - return -1; -} - -/* SwapException */ - #if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = *type; - tstate->exc_value = *value; - tstate->exc_traceback = *tb; - *type = tmp_type; - *value = tmp_value; - *tb = tmp_tb; -} -#else -static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); - PyErr_SetExcInfo(*type, *value, *tb); - *type = tmp_type; - *value = tmp_value; - *tb = tmp_tb; -} -#endif - -/* SaveResetException */ - #if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - *type = tstate->exc_type; - *value = tstate->exc_value; - *tb = tstate->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); -} -static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = type; - tstate->exc_value = value; - tstate->exc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} -#endif - -/* ArgTypeTest */ - static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { - PyErr_Format(PyExc_TypeError, - "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", - name, type->tp_name, Py_TYPE(obj)->tp_name); -} -static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact) -{ - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); - return 0; - } - if (none_allowed && obj == Py_None) return 1; - else if (exact) { - if (likely(Py_TYPE(obj) == type)) return 1; - #if PY_MAJOR_VERSION == 2 - else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; - #endif - } - else { - if (likely(PyObject_TypeCheck(obj, type))) return 1; - } - __Pyx_RaiseArgumentTypeInvalid(name, obj, type); - return 0; -} - -/* ExtTypeTest */ - static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); - return 0; - } - if (likely(PyObject_TypeCheck(obj, type))) - return 1; - PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", - Py_TYPE(obj)->tp_name, type->tp_name); - return 0; -} - -/* PyObjectCallMethod1 */ - static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { - PyObject *method, *result = NULL; - method = __Pyx_PyObject_GetAttrStr(obj, method_name); - if (unlikely(!method)) goto bad; -#if CYTHON_COMPILING_IN_CPYTHON - if (likely(PyMethod_Check(method))) { - PyObject *self = PyMethod_GET_SELF(method); - if (likely(self)) { - PyObject *args; - PyObject *function = PyMethod_GET_FUNCTION(method); - args = PyTuple_New(2); - if (unlikely(!args)) goto bad; - Py_INCREF(self); - PyTuple_SET_ITEM(args, 0, self); - Py_INCREF(arg); - PyTuple_SET_ITEM(args, 1, arg); - Py_INCREF(function); - Py_DECREF(method); method = NULL; - result = __Pyx_PyObject_Call(function, args, NULL); - Py_DECREF(args); - Py_DECREF(function); - return result; - } - } -#endif - result = __Pyx_PyObject_CallOneArg(method, arg); -bad: - Py_XDECREF(method); - return result; -} - -/* append */ - static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { - if (likely(PyList_CheckExact(L))) { - if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; - } else { - PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); - if (unlikely(!retval)) - return -1; - Py_DECREF(retval); - } - return 0; -} - -/* PyIntBinop */ - #if CYTHON_COMPILING_IN_CPYTHON -static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { - if (op1 == op2) { - Py_RETURN_TRUE; - } - #if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(op1))) { - const long b = intval; - long a = PyInt_AS_LONG(op1); - if (a == b) { - Py_RETURN_TRUE; - } else { - Py_RETURN_FALSE; - } - } - #endif - #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3 - if (likely(PyLong_CheckExact(op1))) { - const long b = intval; - long a; - const digit* digits = ((PyLongObject*)op1)->ob_digit; - const Py_ssize_t size = Py_SIZE(op1); - if (likely(__Pyx_sst_abs(size) <= 1)) { - a = likely(size) ? digits[0] : 0; - if (size == -1) a = -a; - } else { - switch (size) { - case -2: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - } - case 2: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - } - case -3: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - } - case 3: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - } - case -4: - if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - } - case 4: - if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - } - #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15 - default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ); - #else - default: Py_RETURN_FALSE; - #endif - } - } - if (a == b) { - Py_RETURN_TRUE; - } else { - Py_RETURN_FALSE; - } - } - #endif - if (PyFloat_CheckExact(op1)) { - const long b = intval; - double a = PyFloat_AS_DOUBLE(op1); - if ((double)a == (double)b) { - Py_RETURN_TRUE; - } else { - Py_RETURN_FALSE; - } - } - return PyObject_RichCompare(op1, op2, Py_EQ); -} -#endif - -/* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (!py_import) - goto bad; - #endif - if (from_list) - list = from_list; - else { - empty_list = PyList_New(0); - if (!empty_list) - goto bad; - list = empty_list; - } - global_dict = PyModule_GetDict(__pyx_m); - if (!global_dict) - goto bad; - empty_dict = PyDict_New(); - if (!empty_dict) - goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.')) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(1); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, 1); - #endif - if (!module) { - if (!PyErr_ExceptionMatches(PyExc_ImportError)) - goto bad; - PyErr_Clear(); - } - } - level = 0; - } - #endif - if (!module) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(level); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, level); - #endif - } - } -bad: - #if PY_VERSION_HEX < 0x03030000 - Py_XDECREF(py_import); - #endif - Py_XDECREF(empty_list); - Py_XDECREF(empty_dict); - return module; -} - -/* ImportFrom */ - static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { - PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); - if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { - PyErr_Format(PyExc_ImportError, - #if PY_MAJOR_VERSION < 3 - "cannot import name %.230s", PyString_AS_STRING(name)); - #else - "cannot import name %S", name); - #endif - } - return value; -} - -/* decode_c_string */ - static CYTHON_INLINE PyObject* __Pyx_decode_c_string( - const char* cstring, Py_ssize_t start, Py_ssize_t stop, - const char* encoding, const char* errors, - PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { - Py_ssize_t length; - if (unlikely((start < 0) | (stop < 0))) { - size_t slen = strlen(cstring); - if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) { - PyErr_SetString(PyExc_OverflowError, - "c-string too long to convert to Python"); - return NULL; - } - length = (Py_ssize_t) slen; - if (start < 0) { - start += length; - if (start < 0) - start = 0; - } - if (stop < 0) - stop += length; - } - length = stop - start; - if (unlikely(length <= 0)) - return PyUnicode_FromUnicode(NULL, 0); - cstring += start; - if (decode_func) { - return decode_func(cstring, length, errors); - } else { - return PyUnicode_Decode(cstring, length, encoding, errors); - } -} - -/* CalculateMetaclass */ - static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { - Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); - for (i=0; i < nbases; i++) { - PyTypeObject *tmptype; - PyObject *tmp = PyTuple_GET_ITEM(bases, i); - tmptype = Py_TYPE(tmp); -#if PY_MAJOR_VERSION < 3 - if (tmptype == &PyClass_Type) - continue; -#endif - if (!metaclass) { - metaclass = tmptype; - continue; - } - if (PyType_IsSubtype(metaclass, tmptype)) - continue; - if (PyType_IsSubtype(tmptype, metaclass)) { - metaclass = tmptype; - continue; - } - PyErr_SetString(PyExc_TypeError, - "metaclass conflict: " - "the metaclass of a derived class " - "must be a (non-strict) subclass " - "of the metaclasses of all its bases"); - return NULL; - } - if (!metaclass) { -#if PY_MAJOR_VERSION < 3 - metaclass = &PyClass_Type; -#else - metaclass = &PyType_Type; -#endif - } - Py_INCREF((PyObject*) metaclass); - return (PyObject*) metaclass; -} - -/* Py3ClassCreate */ - static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, - PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { - PyObject *ns; - if (metaclass) { - PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); - if (prep) { - PyObject *pargs = PyTuple_Pack(2, name, bases); - if (unlikely(!pargs)) { - Py_DECREF(prep); - return NULL; - } - ns = PyObject_Call(prep, pargs, mkw); - Py_DECREF(prep); - Py_DECREF(pargs); - } else { - if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) - return NULL; - PyErr_Clear(); - ns = PyDict_New(); - } - } else { - ns = PyDict_New(); - } - if (unlikely(!ns)) - return NULL; - if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; - if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; - if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; - return ns; -bad: - Py_DECREF(ns); - return NULL; -} -static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, - PyObject *dict, PyObject *mkw, - int calculate_metaclass, int allow_py2_metaclass) { - PyObject *result, *margs; - PyObject *owned_metaclass = NULL; - if (allow_py2_metaclass) { - owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); - if (owned_metaclass) { - metaclass = owned_metaclass; - } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { - PyErr_Clear(); - } else { - return NULL; - } - } - if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { - metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); - Py_XDECREF(owned_metaclass); - if (unlikely(!metaclass)) - return NULL; - owned_metaclass = metaclass; - } - margs = PyTuple_Pack(3, name, bases, dict); - if (unlikely(!margs)) { - result = NULL; - } else { - result = PyObject_Call(metaclass, margs, mkw); - Py_DECREF(margs); - } - Py_XDECREF(owned_metaclass); - return result; -} - -/* GetNameInClass */ - static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name) { - PyObject *result; - result = __Pyx_PyObject_GetAttrStr(nmspace, name); - if (!result) - result = __Pyx_GetModuleGlobalName(name); - return result; -} - -/* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { - int start = 0, mid = 0, end = count - 1; - if (end >= 0 && code_line > entries[end].code_line) { - return count; - } - while (start < end) { - mid = start + (end - start) / 2; - if (code_line < entries[mid].code_line) { - end = mid; - } else if (code_line > entries[mid].code_line) { - start = mid + 1; - } else { - return mid; - } - } - if (code_line <= entries[mid].code_line) { - return mid; - } else { - return mid + 1; - } -} -static PyCodeObject *__pyx_find_code_object(int code_line) { - PyCodeObject* code_object; - int pos; - if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { - return NULL; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { - return NULL; - } - code_object = __pyx_code_cache.entries[pos].code_object; - Py_INCREF(code_object); - return code_object; -} -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { - int pos, i; - __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; - if (unlikely(!code_line)) { - return; - } - if (unlikely(!entries)) { - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); - if (likely(entries)) { - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = 64; - __pyx_code_cache.count = 1; - entries[0].code_line = code_line; - entries[0].code_object = code_object; - Py_INCREF(code_object); - } - return; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { - PyCodeObject* tmp = entries[pos].code_object; - entries[pos].code_object = code_object; - Py_DECREF(tmp); - return; - } - if (__pyx_code_cache.count == __pyx_code_cache.max_count) { - int new_max = __pyx_code_cache.max_count + 64; - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); - if (unlikely(!entries)) { - return; - } - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = new_max; - } - for (i=__pyx_code_cache.count; i>pos; i--) { - entries[i] = entries[i-1]; - } - entries[pos].code_line = code_line; - entries[pos].code_object = code_object; - __pyx_code_cache.count++; - Py_INCREF(code_object); -} - -/* AddTraceback */ - #include "compile.h" -#include "frameobject.h" -#include "traceback.h" -static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( - const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - #if PY_MAJOR_VERSION < 3 - py_srcfile = PyString_FromString(filename); - #else - py_srcfile = PyUnicode_FromString(filename); - #endif - if (!py_srcfile) goto bad; - if (c_line) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - #else - py_funcname = PyUnicode_FromString(funcname); - #endif - } - if (!py_funcname) goto bad; - py_code = __Pyx_PyCode_New( - 0, - 0, - 0, - 0, - 0, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - py_line, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - Py_DECREF(py_srcfile); - Py_DECREF(py_funcname); - return py_code; -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); - return NULL; -} -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); - if (!py_code) { - py_code = __Pyx_CreateCodeObjectForTraceback( - funcname, c_line, py_line, filename); - if (!py_code) goto bad; - __pyx_insert_code_object(c_line ? c_line : py_line, py_code); - } - py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - py_frame->f_lineno = py_line; - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { - const int neg_one = (int) -1, const_zero = (int) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(int) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(int) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(int) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(int), - little, !is_unsigned); - } -} - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value) { - const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(uint64_t) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(uint64_t) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(uint64_t) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(uint64_t) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(uint64_t), - little, !is_unsigned); - } -} - -/* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) -#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) -#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ - {\ - func_type value = func_value;\ - if (sizeof(target_type) < sizeof(func_type)) {\ - if (unlikely(value != (func_type) (target_type) value)) {\ - func_type zero = 0;\ - if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ - return (target_type) -1;\ - if (is_unsigned && unlikely(value < zero))\ - goto raise_neg_overflow;\ - else\ - goto raise_overflow;\ - }\ - }\ - return (target_type) value;\ - } - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { - const long neg_one = (long) -1, const_zero = (long) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(long) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(long) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(long), - little, !is_unsigned); - } -} - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) { - const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(int64_t) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(int64_t) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(int64_t) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(int64_t), - little, !is_unsigned); - } -} - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_time_t(time_t value) { - const time_t neg_one = (time_t) -1, const_zero = (time_t) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(time_t) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(time_t) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(time_t) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(time_t) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(time_t) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(time_t), - little, !is_unsigned); - } -} - -/* CIntFromPy */ - static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *x) { - const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(uint64_t) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(uint64_t, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (uint64_t) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (uint64_t) 0; - case 1: __PYX_VERIFY_RETURN_INT(uint64_t, digit, digits[0]) - case 2: - if (8 * sizeof(uint64_t) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(uint64_t) >= 2 * PyLong_SHIFT) { - return (uint64_t) (((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(uint64_t) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(uint64_t) >= 3 * PyLong_SHIFT) { - return (uint64_t) (((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(uint64_t) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(uint64_t) >= 4 * PyLong_SHIFT) { - return (uint64_t) (((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (uint64_t) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(uint64_t) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(uint64_t, unsigned long, PyLong_AsUnsignedLong(x)) - } else if (sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(uint64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (uint64_t) 0; - case -1: __PYX_VERIFY_RETURN_INT(uint64_t, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(uint64_t, digit, +digits[0]) - case -2: - if (8 * sizeof(uint64_t) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT) { - return (uint64_t) (((uint64_t)-1)*(((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(uint64_t) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT) { - return (uint64_t) ((((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT) { - return (uint64_t) (((uint64_t)-1)*(((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(uint64_t) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT) { - return (uint64_t) ((((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(uint64_t) - 1 > 4 * PyLong_SHIFT) { - return (uint64_t) (((uint64_t)-1)*(((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(uint64_t) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(uint64_t) - 1 > 4 * PyLong_SHIFT) { - return (uint64_t) ((((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]))); - } - } - break; - } -#endif - if (sizeof(uint64_t) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(uint64_t, long, PyLong_AsLong(x)) - } else if (sizeof(uint64_t) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(uint64_t, PY_LONG_LONG, PyLong_AsLongLong(x)) - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - uint64_t val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (uint64_t) -1; - } - } else { - uint64_t val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (uint64_t) -1; - val = __Pyx_PyInt_As_uint64_t(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to uint64_t"); - return (uint64_t) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to uint64_t"); - return (uint64_t) -1; -} - -/* CIntFromPy */ - static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { - const size_t neg_one = (size_t) -1, const_zero = (size_t) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(size_t) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (size_t) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (size_t) 0; - case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0]) - case 2: - if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) { - return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) { - return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) { - return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (size_t) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(size_t) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x)) - } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (size_t) 0; - case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, +digits[0]) - case -2: - if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { - return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { - return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { - return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { - return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) { - return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) { - return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); - } - } - break; - } -#endif - if (sizeof(size_t) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x)) - } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x)) - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - size_t val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (size_t) -1; - } - } else { - size_t val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (size_t) -1; - val = __Pyx_PyInt_As_size_t(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to size_t"); - return (size_t) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to size_t"); - return (size_t) -1; -} - -/* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { - const int neg_one = (int) -1, const_zero = (int) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(int) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (int) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (int) 0; - case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) - case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { - return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { - return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { - return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(int) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) - } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (int) 0; - case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) - case -2: - if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { - return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - } -#endif - if (sizeof(int) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) - } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - int val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (int) -1; - } - } else { - int val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to int"); - return (int) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to int"); - return (int) -1; -} - -/* CIntFromPy */ - static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *x) { - const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(int64_t) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(int64_t, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (int64_t) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (int64_t) 0; - case 1: __PYX_VERIFY_RETURN_INT(int64_t, digit, digits[0]) - case 2: - if (8 * sizeof(int64_t) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int64_t) >= 2 * PyLong_SHIFT) { - return (int64_t) (((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(int64_t) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int64_t) >= 3 * PyLong_SHIFT) { - return (int64_t) (((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(int64_t) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int64_t) >= 4 * PyLong_SHIFT) { - return (int64_t) (((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int64_t) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(int64_t) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned long, PyLong_AsUnsignedLong(x)) - } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (int64_t) 0; - case -1: __PYX_VERIFY_RETURN_INT(int64_t, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(int64_t, digit, +digits[0]) - case -2: - if (8 * sizeof(int64_t) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) { - return (int64_t) (((int64_t)-1)*(((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(int64_t) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) { - return (int64_t) ((((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) { - return (int64_t) (((int64_t)-1)*(((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(int64_t) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) { - return (int64_t) ((((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT) { - return (int64_t) (((int64_t)-1)*(((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(int64_t) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT) { - return (int64_t) ((((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); - } - } - break; - } -#endif - if (sizeof(int64_t) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(int64_t, long, PyLong_AsLong(x)) - } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int64_t, PY_LONG_LONG, PyLong_AsLongLong(x)) - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - int64_t val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (int64_t) -1; - } - } else { - int64_t val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (int64_t) -1; - val = __Pyx_PyInt_As_int64_t(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to int64_t"); - return (int64_t) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to int64_t"); - return (int64_t) -1; -} - -/* CIntFromPy */ - static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *x) { - const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(uint8_t) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(uint8_t, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (uint8_t) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (uint8_t) 0; - case 1: __PYX_VERIFY_RETURN_INT(uint8_t, digit, digits[0]) - case 2: - if (8 * sizeof(uint8_t) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(uint8_t) >= 2 * PyLong_SHIFT) { - return (uint8_t) (((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(uint8_t) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(uint8_t) >= 3 * PyLong_SHIFT) { - return (uint8_t) (((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(uint8_t) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(uint8_t) >= 4 * PyLong_SHIFT) { - return (uint8_t) (((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (uint8_t) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(uint8_t) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned long, PyLong_AsUnsignedLong(x)) - } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (uint8_t) 0; - case -1: __PYX_VERIFY_RETURN_INT(uint8_t, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(uint8_t, digit, +digits[0]) - case -2: - if (8 * sizeof(uint8_t) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) { - return (uint8_t) (((uint8_t)-1)*(((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(uint8_t) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) { - return (uint8_t) ((((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) { - return (uint8_t) (((uint8_t)-1)*(((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(uint8_t) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) { - return (uint8_t) ((((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT) { - return (uint8_t) (((uint8_t)-1)*(((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(uint8_t) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT) { - return (uint8_t) ((((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); - } - } - break; - } -#endif - if (sizeof(uint8_t) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(uint8_t, long, PyLong_AsLong(x)) - } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(uint8_t, PY_LONG_LONG, PyLong_AsLongLong(x)) - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - uint8_t val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (uint8_t) -1; - } - } else { - uint8_t val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (uint8_t) -1; - val = __Pyx_PyInt_As_uint8_t(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to uint8_t"); - return (uint8_t) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to uint8_t"); - return (uint8_t) -1; -} - -/* CIntFromPy */ - static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) { - const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(uint32_t) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (uint32_t) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (uint32_t) 0; - case 1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, digits[0]) - case 2: - if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT) { - return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT) { - return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT) { - return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (uint32_t) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(uint32_t) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x)) - } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (uint32_t) 0; - case -1: __PYX_VERIFY_RETURN_INT(uint32_t, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, +digits[0]) - case -2: - if (8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { - return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { - return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { - return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { - return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) { - return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) { - return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); - } - } - break; - } -#endif - if (sizeof(uint32_t) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x)) - } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - uint32_t val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (uint32_t) -1; - } - } else { - uint32_t val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (uint32_t) -1; - val = __Pyx_PyInt_As_uint32_t(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to uint32_t"); - return (uint32_t) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to uint32_t"); - return (uint32_t) -1; -} - -/* CIntFromPy */ - static CYTHON_INLINE time_t __Pyx_PyInt_As_time_t(PyObject *x) { - const time_t neg_one = (time_t) -1, const_zero = (time_t) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(time_t) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(time_t, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (time_t) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (time_t) 0; - case 1: __PYX_VERIFY_RETURN_INT(time_t, digit, digits[0]) - case 2: - if (8 * sizeof(time_t) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(time_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(time_t) >= 2 * PyLong_SHIFT) { - return (time_t) (((((time_t)digits[1]) << PyLong_SHIFT) | (time_t)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(time_t) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(time_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(time_t) >= 3 * PyLong_SHIFT) { - return (time_t) (((((((time_t)digits[2]) << PyLong_SHIFT) | (time_t)digits[1]) << PyLong_SHIFT) | (time_t)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(time_t) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(time_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(time_t) >= 4 * PyLong_SHIFT) { - return (time_t) (((((((((time_t)digits[3]) << PyLong_SHIFT) | (time_t)digits[2]) << PyLong_SHIFT) | (time_t)digits[1]) << PyLong_SHIFT) | (time_t)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (time_t) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(time_t) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(time_t, unsigned long, PyLong_AsUnsignedLong(x)) - } else if (sizeof(time_t) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(time_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (time_t) 0; - case -1: __PYX_VERIFY_RETURN_INT(time_t, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(time_t, digit, +digits[0]) - case -2: - if (8 * sizeof(time_t) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(time_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(time_t) - 1 > 2 * PyLong_SHIFT) { - return (time_t) (((time_t)-1)*(((((time_t)digits[1]) << PyLong_SHIFT) | (time_t)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(time_t) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(time_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(time_t) - 1 > 2 * PyLong_SHIFT) { - return (time_t) ((((((time_t)digits[1]) << PyLong_SHIFT) | (time_t)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(time_t) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(time_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(time_t) - 1 > 3 * PyLong_SHIFT) { - return (time_t) (((time_t)-1)*(((((((time_t)digits[2]) << PyLong_SHIFT) | (time_t)digits[1]) << PyLong_SHIFT) | (time_t)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(time_t) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(time_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(time_t) - 1 > 3 * PyLong_SHIFT) { - return (time_t) ((((((((time_t)digits[2]) << PyLong_SHIFT) | (time_t)digits[1]) << PyLong_SHIFT) | (time_t)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(time_t) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(time_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(time_t) - 1 > 4 * PyLong_SHIFT) { - return (time_t) (((time_t)-1)*(((((((((time_t)digits[3]) << PyLong_SHIFT) | (time_t)digits[2]) << PyLong_SHIFT) | (time_t)digits[1]) << PyLong_SHIFT) | (time_t)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(time_t) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(time_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(time_t) - 1 > 4 * PyLong_SHIFT) { - return (time_t) ((((((((((time_t)digits[3]) << PyLong_SHIFT) | (time_t)digits[2]) << PyLong_SHIFT) | (time_t)digits[1]) << PyLong_SHIFT) | (time_t)digits[0]))); - } - } - break; - } -#endif - if (sizeof(time_t) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(time_t, long, PyLong_AsLong(x)) - } else if (sizeof(time_t) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(time_t, PY_LONG_LONG, PyLong_AsLongLong(x)) - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - time_t val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (time_t) -1; - } - } else { - time_t val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (time_t) -1; - val = __Pyx_PyInt_As_time_t(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to time_t"); - return (time_t) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to time_t"); - return (time_t) -1; -} - -/* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { - const long neg_one = (long) -1, const_zero = (long) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(long) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (long) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (long) 0; - case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) - case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { - return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(long) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { - return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(long) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { - return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (long) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(long) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (long) 0; - case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) - case -2: - if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(long) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(long) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - } -#endif - if (sizeof(long) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - long val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (long) -1; - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to long"); - return (long) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long) -1; -} - -/* CoroutineBase */ - #include -#include -static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value); -static PyObject *__Pyx_Coroutine_Close(PyObject *self); -static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); -#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) -#if 1 || PY_VERSION_HEX < 0x030300B0 -static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) { - PyObject *et, *ev, *tb; - PyObject *value = NULL; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&et, &ev, &tb); - if (!et) { - Py_XDECREF(tb); - Py_XDECREF(ev); - Py_INCREF(Py_None); - *pvalue = Py_None; - return 0; - } - if (likely(et == PyExc_StopIteration)) { -#if PY_VERSION_HEX >= 0x030300A0 - if (ev && Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) { - value = ((PyStopIterationObject *)ev)->value; - Py_INCREF(value); - Py_DECREF(ev); - Py_XDECREF(tb); - Py_DECREF(et); - *pvalue = value; - return 0; - } -#endif - if (!ev || !PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) { - if (!ev) { - Py_INCREF(Py_None); - ev = Py_None; - } else if (PyTuple_Check(ev)) { - if (PyTuple_GET_SIZE(ev) >= 1) { - PyObject *value; -#if CYTHON_COMPILING_IN_CPYTHON - value = PySequence_ITEM(ev, 0); -#else - value = PyTuple_GET_ITEM(ev, 0); - Py_INCREF(value); -#endif - Py_DECREF(ev); - ev = value; - } else { - Py_INCREF(Py_None); - Py_DECREF(ev); - ev = Py_None; - } - } - Py_XDECREF(tb); - Py_DECREF(et); - *pvalue = ev; - return 0; - } - } else if (!PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) { - __Pyx_ErrRestore(et, ev, tb); - return -1; - } - PyErr_NormalizeException(&et, &ev, &tb); - if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) { - __Pyx_ErrRestore(et, ev, tb); - return -1; - } - Py_XDECREF(tb); - Py_DECREF(et); -#if PY_VERSION_HEX >= 0x030300A0 - value = ((PyStopIterationObject *)ev)->value; - Py_INCREF(value); - Py_DECREF(ev); -#else - { - PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args); - Py_DECREF(ev); - if (likely(args)) { - value = PySequence_GetItem(args, 0); - Py_DECREF(args); - } - if (unlikely(!value)) { - __Pyx_ErrRestore(NULL, NULL, NULL); - Py_INCREF(Py_None); - value = Py_None; - } - } -#endif - *pvalue = value; - return 0; -} -#endif -static CYTHON_INLINE -void __Pyx_Coroutine_ExceptionClear(__pyx_CoroutineObject *self) { - PyObject *exc_type = self->exc_type; - PyObject *exc_value = self->exc_value; - PyObject *exc_traceback = self->exc_traceback; - self->exc_type = NULL; - self->exc_value = NULL; - self->exc_traceback = NULL; - Py_XDECREF(exc_type); - Py_XDECREF(exc_value); - Py_XDECREF(exc_traceback); -} -static CYTHON_INLINE -int __Pyx_Coroutine_CheckRunning(__pyx_CoroutineObject *gen) { - if (unlikely(gen->is_running)) { - PyErr_SetString(PyExc_ValueError, - "generator already executing"); - return 1; - } - return 0; -} -static CYTHON_INLINE -PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value) { - PyObject *retval; - __Pyx_PyThreadState_declare - assert(!self->is_running); - if (unlikely(self->resume_label == 0)) { - if (unlikely(value && value != Py_None)) { - PyErr_SetString(PyExc_TypeError, - "can't send non-None value to a " - "just-started generator"); - return NULL; - } - } - if (unlikely(self->resume_label == -1)) { - PyErr_SetNone(PyExc_StopIteration); - return NULL; - } - __Pyx_PyThreadState_assign - if (value) { -#if CYTHON_COMPILING_IN_PYPY -#else - if (self->exc_traceback) { - PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback; - PyFrameObject *f = tb->tb_frame; - Py_XINCREF(__pyx_tstate->frame); - assert(f->f_back == NULL); - f->f_back = __pyx_tstate->frame; - } -#endif - __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value, - &self->exc_traceback); - } else { - __Pyx_Coroutine_ExceptionClear(self); - } - self->is_running = 1; - retval = self->body((PyObject *) self, value); - self->is_running = 0; - if (retval) { - __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value, - &self->exc_traceback); -#if CYTHON_COMPILING_IN_PYPY -#else - if (self->exc_traceback) { - PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback; - PyFrameObject *f = tb->tb_frame; - Py_CLEAR(f->f_back); - } -#endif - } else { - __Pyx_Coroutine_ExceptionClear(self); - } - return retval; -} -static CYTHON_INLINE -PyObject *__Pyx_Coroutine_MethodReturn(PyObject *retval) { - if (unlikely(!retval && !PyErr_Occurred())) { - PyErr_SetNone(PyExc_StopIteration); - } - return retval; -} -static CYTHON_INLINE -PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) { - PyObject *ret; - PyObject *val = NULL; - __Pyx_Coroutine_Undelegate(gen); - __Pyx_PyGen_FetchStopIterationValue(&val); - ret = __Pyx_Coroutine_SendEx(gen, val); - Py_XDECREF(val); - return ret; -} -static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { - PyObject *retval; - __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; - PyObject *yf = gen->yieldfrom; - if (unlikely(__Pyx_Coroutine_CheckRunning(gen))) - return NULL; - if (yf) { - PyObject *ret; - gen->is_running = 1; - #ifdef __Pyx_Generator_USED - if (__Pyx_Generator_CheckExact(yf)) { - ret = __Pyx_Coroutine_Send(yf, value); - } else - #endif - #ifdef __Pyx_Coroutine_USED - if (__Pyx_Coroutine_CheckExact(yf)) { - ret = __Pyx_Coroutine_Send(yf, value); - } else - #endif - { - if (value == Py_None) - ret = Py_TYPE(yf)->tp_iternext(yf); - else - ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value); - } - gen->is_running = 0; - if (likely(ret)) { - return ret; - } - retval = __Pyx_Coroutine_FinishDelegation(gen); - } else { - retval = __Pyx_Coroutine_SendEx(gen, value); - } - return __Pyx_Coroutine_MethodReturn(retval); -} -static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { - PyObject *retval = NULL; - int err = 0; - #ifdef __Pyx_Generator_USED - if (__Pyx_Generator_CheckExact(yf)) { - retval = __Pyx_Coroutine_Close(yf); - if (!retval) - return -1; - } else - #endif - #ifdef __Pyx_Coroutine_USED - if (__Pyx_Coroutine_CheckExact(yf)) { - retval = __Pyx_Coroutine_Close(yf); - if (!retval) - return -1; - } else - #endif - { - PyObject *meth; - gen->is_running = 1; - meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close); - if (unlikely(!meth)) { - if (!PyErr_ExceptionMatches(PyExc_AttributeError)) { - PyErr_WriteUnraisable(yf); - } - PyErr_Clear(); - } else { - retval = PyObject_CallFunction(meth, NULL); - Py_DECREF(meth); - if (!retval) - err = -1; - } - gen->is_running = 0; - } - Py_XDECREF(retval); - return err; -} -static PyObject *__Pyx_Generator_Next(PyObject *self) { - __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; - PyObject *yf = gen->yieldfrom; - if (unlikely(__Pyx_Coroutine_CheckRunning(gen))) - return NULL; - if (yf) { - PyObject *ret; - gen->is_running = 1; - ret = Py_TYPE(yf)->tp_iternext(yf); - gen->is_running = 0; - if (likely(ret)) { - return ret; - } - return __Pyx_Coroutine_FinishDelegation(gen); - } - return __Pyx_Coroutine_SendEx(gen, Py_None); -} -static PyObject *__Pyx_Coroutine_Close(PyObject *self) { - __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; - PyObject *retval, *raised_exception; - PyObject *yf = gen->yieldfrom; - int err = 0; - if (unlikely(__Pyx_Coroutine_CheckRunning(gen))) - return NULL; - if (yf) { - Py_INCREF(yf); - err = __Pyx_Coroutine_CloseIter(gen, yf); - __Pyx_Coroutine_Undelegate(gen); - Py_DECREF(yf); - } - if (err == 0) - PyErr_SetNone(PyExc_GeneratorExit); - retval = __Pyx_Coroutine_SendEx(gen, NULL); - if (retval) { - Py_DECREF(retval); - PyErr_SetString(PyExc_RuntimeError, - "generator ignored GeneratorExit"); - return NULL; - } - raised_exception = PyErr_Occurred(); - if (!raised_exception - || raised_exception == PyExc_StopIteration - || raised_exception == PyExc_GeneratorExit - || PyErr_GivenExceptionMatches(raised_exception, PyExc_GeneratorExit) - || PyErr_GivenExceptionMatches(raised_exception, PyExc_StopIteration)) - { - if (raised_exception) PyErr_Clear(); - Py_INCREF(Py_None); - return Py_None; - } - return NULL; -} -static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) { - __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; - PyObject *typ; - PyObject *tb = NULL; - PyObject *val = NULL; - PyObject *yf = gen->yieldfrom; - if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb)) - return NULL; - if (unlikely(__Pyx_Coroutine_CheckRunning(gen))) - return NULL; - if (yf) { - PyObject *ret; - Py_INCREF(yf); - if (PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit)) { - int err = __Pyx_Coroutine_CloseIter(gen, yf); - Py_DECREF(yf); - __Pyx_Coroutine_Undelegate(gen); - if (err < 0) - return __Pyx_Coroutine_MethodReturn(__Pyx_Coroutine_SendEx(gen, NULL)); - goto throw_here; - } - gen->is_running = 1; - #ifdef __Pyx_Generator_USED - if (__Pyx_Generator_CheckExact(yf)) { - ret = __Pyx_Coroutine_Throw(yf, args); - } else - #endif - #ifdef __Pyx_Coroutine_USED - if (__Pyx_Coroutine_CheckExact(yf)) { - ret = __Pyx_Coroutine_Throw(yf, args); - } else - #endif - { - PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw); - if (unlikely(!meth)) { - Py_DECREF(yf); - if (!PyErr_ExceptionMatches(PyExc_AttributeError)) { - gen->is_running = 0; - return NULL; - } - PyErr_Clear(); - __Pyx_Coroutine_Undelegate(gen); - gen->is_running = 0; - goto throw_here; - } - ret = PyObject_CallObject(meth, args); - Py_DECREF(meth); - } - gen->is_running = 0; - Py_DECREF(yf); - if (!ret) { - ret = __Pyx_Coroutine_FinishDelegation(gen); - } - return __Pyx_Coroutine_MethodReturn(ret); - } -throw_here: - __Pyx_Raise(typ, val, tb, NULL); - return __Pyx_Coroutine_MethodReturn(__Pyx_Coroutine_SendEx(gen, NULL)); -} -static int __Pyx_Coroutine_traverse(PyObject *self, visitproc visit, void *arg) { - __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; - Py_VISIT(gen->closure); - Py_VISIT(gen->classobj); - Py_VISIT(gen->yieldfrom); - Py_VISIT(gen->exc_type); - Py_VISIT(gen->exc_value); - Py_VISIT(gen->exc_traceback); - return 0; -} -static int __Pyx_Coroutine_clear(PyObject *self) { - __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; - Py_CLEAR(gen->closure); - Py_CLEAR(gen->classobj); - Py_CLEAR(gen->yieldfrom); - Py_CLEAR(gen->exc_type); - Py_CLEAR(gen->exc_value); - Py_CLEAR(gen->exc_traceback); - Py_CLEAR(gen->gi_name); - Py_CLEAR(gen->gi_qualname); - return 0; -} -static void __Pyx_Coroutine_dealloc(PyObject *self) { - __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; - PyObject_GC_UnTrack(gen); - if (gen->gi_weakreflist != NULL) - PyObject_ClearWeakRefs(self); - if (gen->resume_label > 0) { - PyObject_GC_Track(self); -#if PY_VERSION_HEX >= 0x030400a1 - if (PyObject_CallFinalizerFromDealloc(self)) -#else - Py_TYPE(gen)->tp_del(self); - if (self->ob_refcnt > 0) -#endif - { - return; - } - PyObject_GC_UnTrack(self); - } - __Pyx_Coroutine_clear(self); - PyObject_GC_Del(gen); -} -static void __Pyx_Coroutine_del(PyObject *self) { - PyObject *res; - PyObject *error_type, *error_value, *error_traceback; - __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; - __Pyx_PyThreadState_declare - if (gen->resume_label <= 0) - return ; -#if PY_VERSION_HEX < 0x030400a1 - assert(self->ob_refcnt == 0); - self->ob_refcnt = 1; -#endif - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&error_type, &error_value, &error_traceback); - res = __Pyx_Coroutine_Close(self); - if (res == NULL) - PyErr_WriteUnraisable(self); - else - Py_DECREF(res); - __Pyx_ErrRestore(error_type, error_value, error_traceback); -#if PY_VERSION_HEX < 0x030400a1 - assert(self->ob_refcnt > 0); - if (--self->ob_refcnt == 0) { - return; - } - { - Py_ssize_t refcnt = self->ob_refcnt; - _Py_NewReference(self); - self->ob_refcnt = refcnt; - } -#if CYTHON_COMPILING_IN_CPYTHON - assert(PyType_IS_GC(self->ob_type) && - _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED); - _Py_DEC_REFTOTAL; -#endif -#ifdef COUNT_ALLOCS - --Py_TYPE(self)->tp_frees; - --Py_TYPE(self)->tp_allocs; -#endif -#endif -} -static PyObject * -__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self) -{ - Py_INCREF(self->gi_name); - return self->gi_name; -} -static int -__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value) -{ - PyObject *tmp; -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) { -#else - if (unlikely(value == NULL || !PyString_Check(value))) { -#endif - PyErr_SetString(PyExc_TypeError, - "__name__ must be set to a string object"); - return -1; - } - tmp = self->gi_name; - Py_INCREF(value); - self->gi_name = value; - Py_XDECREF(tmp); - return 0; -} -static PyObject * -__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self) -{ - Py_INCREF(self->gi_qualname); - return self->gi_qualname; -} -static int -__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value) -{ - PyObject *tmp; -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) { -#else - if (unlikely(value == NULL || !PyString_Check(value))) { -#endif - PyErr_SetString(PyExc_TypeError, - "__qualname__ must be set to a string object"); - return -1; - } - tmp = self->gi_qualname; - Py_INCREF(value); - self->gi_qualname = value; - Py_XDECREF(tmp); - return 0; -} -static __pyx_CoroutineObject *__Pyx__Coroutine_New(PyTypeObject* type, __pyx_coroutine_body_t body, - PyObject *closure, PyObject *name, PyObject *qualname) { - __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type); - if (gen == NULL) - return NULL; - gen->body = body; - gen->closure = closure; - Py_XINCREF(closure); - gen->is_running = 0; - gen->resume_label = 0; - gen->classobj = NULL; - gen->yieldfrom = NULL; - gen->exc_type = NULL; - gen->exc_value = NULL; - gen->exc_traceback = NULL; - gen->gi_weakreflist = NULL; - Py_XINCREF(qualname); - gen->gi_qualname = qualname; - Py_XINCREF(name); - gen->gi_name = name; - PyObject_GC_Track(gen); - return gen; -} - -/* PatchModuleWithCoroutine */ - static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { -#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - int result; - PyObject *globals, *result_obj; - globals = PyDict_New(); if (unlikely(!globals)) goto ignore; - result = PyDict_SetItemString(globals, "_cython_coroutine_type", - #ifdef __Pyx_Coroutine_USED - (PyObject*)__pyx_CoroutineType); - #else - Py_None); - #endif - if (unlikely(result < 0)) goto ignore; - result = PyDict_SetItemString(globals, "_cython_generator_type", - #ifdef __Pyx_Generator_USED - (PyObject*)__pyx_GeneratorType); - #else - Py_None); - #endif - if (unlikely(result < 0)) goto ignore; - if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore; - if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore; - result_obj = PyRun_String(py_code, Py_file_input, globals, globals); - if (unlikely(!result_obj)) goto ignore; - Py_DECREF(result_obj); - Py_DECREF(globals); - return module; -ignore: - Py_XDECREF(globals); - PyErr_WriteUnraisable(module); - if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) { - Py_DECREF(module); - module = NULL; - } -#else - py_code++; -#endif - return module; -} - -/* PatchGeneratorABC */ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) -static PyObject* __Pyx_patch_abc_module(PyObject *module); -static PyObject* __Pyx_patch_abc_module(PyObject *module) { - module = __Pyx_Coroutine_patch_module( - module, "" -"if _cython_generator_type is not None:\n" -" try: Generator = _module.Generator\n" -" except AttributeError: pass\n" -" else: Generator.register(_cython_generator_type)\n" -"if _cython_coroutine_type is not None:\n" -" try: Coroutine = _module.Coroutine\n" -" except AttributeError: pass\n" -" else: Coroutine.register(_cython_coroutine_type)\n" - ); - return module; -} -#endif -static int __Pyx_patch_abc(void) { -#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - static int abc_patched = 0; - if (!abc_patched) { - PyObject *module; - module = PyImport_ImportModule((PY_VERSION_HEX >= 0x03030000) ? "collections.abc" : "collections"); - if (!module) { - PyErr_WriteUnraisable(NULL); - if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, - ((PY_VERSION_HEX >= 0x03030000) ? - "Cython module failed to register with collections.abc module" : - "Cython module failed to register with collections module"), 1) < 0)) { - return -1; - } - } else { - module = __Pyx_patch_abc_module(module); - abc_patched = 1; - if (unlikely(!module)) - return -1; - Py_DECREF(module); - } - module = PyImport_ImportModule("backports_abc"); - if (module) { - module = __Pyx_patch_abc_module(module); - Py_XDECREF(module); - } - if (!module) { - PyErr_Clear(); - } - } -#else - if (0) __Pyx_Coroutine_patch_module(NULL, NULL); -#endif - return 0; -} - -/* Generator */ - static PyMethodDef __pyx_Generator_methods[] = { - {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, - (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, - {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, - (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, - {"close", (PyCFunction) __Pyx_Coroutine_Close, METH_NOARGS, - (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, - {0, 0, 0, 0} -}; -static PyMemberDef __pyx_Generator_memberlist[] = { - {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL}, - {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, - (char*) PyDoc_STR("object being iterated by 'yield from', or None")}, - {0, 0, 0, 0, 0} -}; -static PyGetSetDef __pyx_Generator_getsets[] = { - {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, - (char*) PyDoc_STR("name of the generator"), 0}, - {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, - (char*) PyDoc_STR("qualified name of the generator"), 0}, - {0, 0, 0, 0, 0} -}; -static PyTypeObject __pyx_GeneratorType_type = { - PyVarObject_HEAD_INIT(0, 0) - "generator", - sizeof(__pyx_CoroutineObject), - 0, - (destructor) __Pyx_Coroutine_dealloc, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, - 0, - (traverseproc) __Pyx_Coroutine_traverse, - 0, - 0, - offsetof(__pyx_CoroutineObject, gi_weakreflist), - 0, - (iternextfunc) __Pyx_Generator_Next, - __pyx_Generator_methods, - __pyx_Generator_memberlist, - __pyx_Generator_getsets, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, -#if PY_VERSION_HEX >= 0x030400a1 - 0, -#else - __Pyx_Coroutine_del, -#endif - 0, -#if PY_VERSION_HEX >= 0x030400a1 - __Pyx_Coroutine_del, -#endif -}; -static int __pyx_Generator_init(void) { - __pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr; - __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter; - __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); - if (unlikely(!__pyx_GeneratorType)) { - return -1; - } - return 0; -} - -/* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { - char ctversion[4], rtversion[4]; - PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); - PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); - if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { - char message[200]; - PyOS_snprintf(message, sizeof(message), - "compiletime version %s of module '%.100s' " - "does not match runtime version %s", - ctversion, __Pyx_MODULE_NAME, rtversion); - return PyErr_WarnEx(NULL, message, 1); - } - return 0; -} - -/* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule -#define __PYX_HAVE_RT_ImportModule -static PyObject *__Pyx_ImportModule(const char *name) { - PyObject *py_name = 0; - PyObject *py_module = 0; - py_name = __Pyx_PyIdentifier_FromString(name); - if (!py_name) - goto bad; - py_module = PyImport_Import(py_name); - Py_DECREF(py_name); - return py_module; -bad: - Py_XDECREF(py_name); - return 0; -} -#endif - -/* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType -#define __PYX_HAVE_RT_ImportType -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, - size_t size, int strict) -{ - PyObject *py_module = 0; - PyObject *result = 0; - PyObject *py_name = 0; - char warning[200]; - Py_ssize_t basicsize; -#ifdef Py_LIMITED_API - PyObject *py_basicsize; -#endif - py_module = __Pyx_ImportModule(module_name); - if (!py_module) - goto bad; - py_name = __Pyx_PyIdentifier_FromString(class_name); - if (!py_name) - goto bad; - result = PyObject_GetAttr(py_module, py_name); - Py_DECREF(py_name); - py_name = 0; - Py_DECREF(py_module); - py_module = 0; - if (!result) - goto bad; - if (!PyType_Check(result)) { - PyErr_Format(PyExc_TypeError, - "%.200s.%.200s is not a type object", - module_name, class_name); - goto bad; - } -#ifndef Py_LIMITED_API - basicsize = ((PyTypeObject *)result)->tp_basicsize; -#else - py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); - if (!py_basicsize) - goto bad; - basicsize = PyLong_AsSsize_t(py_basicsize); - Py_DECREF(py_basicsize); - py_basicsize = 0; - if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) - goto bad; -#endif - if (!strict && (size_t)basicsize > size) { - PyOS_snprintf(warning, sizeof(warning), - "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd", - module_name, class_name, basicsize, size); - if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; - } - else if ((size_t)basicsize != size) { - PyErr_Format(PyExc_ValueError, - "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd", - module_name, class_name, basicsize, size); - goto bad; - } - return (PyTypeObject *)result; -bad: - Py_XDECREF(py_module); - Py_XDECREF(result); - return NULL; -} -#endif - -/* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION < 3 - if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - #else - if (t->is_unicode | t->is_str) { - if (t->intern) { - *t->p = PyUnicode_InternFromString(t->s); - } else if (t->encoding) { - *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); - } else { - *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } - } else { - *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - #endif - if (!*t->p) - return -1; - ++t; - } - return 0; -} - -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { - return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); -} -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { - Py_ssize_t ignore; - return __Pyx_PyObject_AsStringAndSize(o, &ignore); -} -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { -#if PY_VERSION_HEX < 0x03030000 - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } - } - } -#endif - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -#else - if (__Pyx_PyUnicode_READY(o) == -1) return NULL; -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - if (PyUnicode_IS_ASCII(o)) { - *length = PyUnicode_GET_LENGTH(o); - return PyUnicode_AsUTF8(o); - } else { - PyUnicode_AsASCIIString(o); - return NULL; - } -#else - return PyUnicode_AsUTF8AndSize(o, length); -#endif -#endif - } else -#endif -#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) - if (PyByteArray_Check(o)) { - *length = PyByteArray_GET_SIZE(o); - return PyByteArray_AS_STRING(o); - } else -#endif - { - char* result; - int r = PyBytes_AsStringAndSize(o, &result, length); - if (unlikely(r < 0)) { - return NULL; - } else { - return result; - } - } -} -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - int is_true = x == Py_True; - if (is_true | (x == Py_False) | (x == Py_None)) return is_true; - else return PyObject_IsTrue(x); -} -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { - PyNumberMethods *m; - const char *name = NULL; - PyObject *res = NULL; -#if PY_MAJOR_VERSION < 3 - if (PyInt_Check(x) || PyLong_Check(x)) -#else - if (PyLong_Check(x)) -#endif - return __Pyx_NewRef(x); - m = Py_TYPE(x)->tp_as_number; -#if PY_MAJOR_VERSION < 3 - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = PyNumber_Long(x); - } -#else - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Long(x); - } -#endif - if (res) { -#if PY_MAJOR_VERSION < 3 - if (!PyInt_Check(res) && !PyLong_Check(res)) { -#else - if (!PyLong_Check(res)) { -#endif - PyErr_Format(PyExc_TypeError, - "__%.4s__ returned non-%.4s (type %.200s)", - name, name, Py_TYPE(res)->tp_name); - Py_DECREF(res); - return NULL; - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject *x; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(b))) { - if (sizeof(Py_ssize_t) >= sizeof(long)) - return PyInt_AS_LONG(b); - else - return PyInt_AsSsize_t(x); - } -#endif - if (likely(PyLong_CheckExact(b))) { - #if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)b)->ob_digit; - const Py_ssize_t size = Py_SIZE(b); - if (likely(__Pyx_sst_abs(size) <= 1)) { - ival = likely(size) ? digits[0] : 0; - if (size == -1) ival = -ival; - return ival; - } else { - switch (size) { - case 2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case 3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case 4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - } - } - #endif - return PyLong_AsSsize_t(b); - } - x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { - return PyInt_FromSize_t(ival); -} - - -#endif /* Py_PYTHON_H */ diff --git a/src/pybind/rados/setup.py b/src/pybind/rados/setup.py index 4bdfcbd89beed7..90d0763307c5e9 100755 --- a/src/pybind/rados/setup.py +++ b/src/pybind/rados/setup.py @@ -91,10 +91,14 @@ def check_sanity(): if set(['MAKEFLAGS', 'MFLAGS', 'MAKELEVEL']).issubset(set(os.environ.keys())): # The setup.py has been invoked by a top-level Ceph make. # Set the appropriate CFLAGS and LDFLAGS - CEPH_ROOT = subprocess.check_output(['git', 'rev-parse', '--show-toplevel']).strip().decode('utf-8') + CEPH_SRC_DIR = os.path.join( + os.path.dirname(os.path.abspath(__file__)), + '..', + '..' + ) - compiler.add_include_dir(os.path.join(CEPH_ROOT, 'src', 'include')) - compiler.add_library_dir(os.path.join(CEPH_ROOT, 'src', '.libs')) + compiler.add_include_dir(os.path.join(CEPH_SRC_DIR, 'include')) + compiler.add_library_dir(os.environ['CEPH_LIB_DIR']) try: compiler.link_executable( @@ -119,22 +123,21 @@ def check_sanity(): if not check_sanity(): sys.exit(1) -if '--without-cython' in sys.argv: +try: + from Cython.Build import cythonize +except ImportError: + print("WARNING: Cython is not installed.") + if not os.path.isfile('rados.c'): - print('Error: Cannot find Cythonized file rados.c', file=sys.stderr) - print('Retry without using --without-cython', file=sys.stderr) + print('ERROR: Cannot find Cythonized file rados.c', file=sys.stderr) sys.exit(1) + else: + def cythonize(x, **kwargs): + return x - def cythonize(x, **kwargs): - return x - - - sys.argv.remove('--without-cython') - source = "rados.c" + source = "rados.c" else: - from Cython.Build import cythonize - source = "rados.pyx" # Disable cythonification if we're not really building anything @@ -177,10 +180,7 @@ def cythonize(x, **kwargs): 'License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)', 'Operating System :: POSIX :: Linux', 'Programming Language :: Cython', - 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.2', - 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5' ],