From bc9b6bc6f67f7635b58fd2c1b365ec880edf2651 Mon Sep 17 00:00:00 2001 From: Derek Chiang Date: Tue, 29 Apr 2014 22:09:20 -0400 Subject: [PATCH 1/4] Fix a bug in packing --- admin/admin.cc | 4 +- bindings/python/_hyperdex_admin.c | 1 + bindings/python/_hyperdex_client.c | 51107 +++++++++++++++++++++++++++ coordinator/transitions.cc | 4 +- hyper.diff | 1203 + hyperdex.diff | 4089 +++ test/migration-test | Bin 0 -> 31772 bytes test/migration-test.cc | 6 +- 8 files changed, 56408 insertions(+), 6 deletions(-) create mode 100644 bindings/python/_hyperdex_admin.c create mode 100644 bindings/python/_hyperdex_client.c create mode 100644 hyper.diff create mode 100644 hyperdex.diff create mode 100755 test/migration-test diff --git a/admin/admin.cc b/admin/admin.cc index 7eb404476..c072701d6 100644 --- a/admin/admin.cc +++ b/admin/admin.cc @@ -212,10 +212,10 @@ admin :: migrate_data(const char* space_from, const char* space_to, size_t total_sz = sizeof(uint32_t) * 2 + space_from_sz + space_to_sz; std::vector buf(total_sz); char* pos = &buf[0]; - pos = e::pack64be(space_from_sz, pos); + pos = e::pack32be(space_from_sz, pos); memcpy(pos, space_from, space_from_sz); pos += space_from_sz; - pos = e::pack64be(space_to_sz, pos); + pos = e::pack32be(space_to_sz, pos); memcpy(pos, space_to, space_to_sz); int64_t cid = m_coord.rpc("migrate", &buf[0], total_sz, diff --git a/bindings/python/_hyperdex_admin.c b/bindings/python/_hyperdex_admin.c new file mode 100644 index 000000000..06f2230dd --- /dev/null +++ b/bindings/python/_hyperdex_admin.c @@ -0,0 +1 @@ +#error Do not use this file, it is the result of a failed Cython compilation. diff --git a/bindings/python/_hyperdex_client.c b/bindings/python/_hyperdex_client.c new file mode 100644 index 000000000..75c0b8523 --- /dev/null +++ b/bindings/python/_hyperdex_client.c @@ -0,0 +1,51107 @@ +/* Generated by Cython 0.19 on Sat Dec 14 23:29:21 2013 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#endif +#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 < 0x02040000 + #error Cython requires Python 2.4+. +#else +#include /* For offsetof */ +#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 PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_AsInt(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#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, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#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) +#endif +#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 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_READ(k, d, i) PyUnicode_READ(k, d, i) +#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_READ(k, d, i) ((k=k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#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_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#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_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (Py_TYPE(obj) == &PyBaseString_Type) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#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 +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x03020000 + 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) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#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 +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif + + +#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 + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE___hyperdex_client +#define __PYX_HAVE_API___hyperdex_client +#include "string.h" +#include "stdio.h" +#include "pythread.h" +#include "datetime.h" +#include "stdint.h" +#include "stdlib.h" +#include "sys/socket.h" +#include "hyperdex.h" +#include "hyperdex/client.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 +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#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 +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(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_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((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 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_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); +#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 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params() { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + const char* default_encoding_c = PyBytes_AS_STRING(default_encoding); + 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 == NULL) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (ascii_chars_b == NULL || strncmp(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 '%s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + } + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return 0; +bad: + Py_XDECREF(sys); + 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() { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + default_encoding_c = PyBytes_AS_STRING(default_encoding); + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(sys); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +#ifdef __GNUC__ + /* Test for GCC > 2.95 */ + #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #else /* __GNUC__ > 2 ... */ + #define likely(x) (x) + #define unlikely(x) (x) + #endif /* __GNUC__ > 2 ... */ +#else /* __GNUC__ */ + #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 int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "_hyperdex_client.pyx", + "datetime.pxd", + "type.pxd", + "bool.pxd", + "complex.pxd", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_16_hyperdex_client_Predicate; +struct __pyx_obj_16_hyperdex_client_LengthLessEqual; +struct __pyx_obj_16_hyperdex_client_LessEqual; +struct __pyx_obj_16_hyperdex_client_Deferred; +struct __pyx_obj_16_hyperdex_client_DeferredGroupDel; +struct __pyx_obj_16_hyperdex_client_LengthGreaterEqual; +struct __pyx_obj_16_hyperdex_client_DeferredCount; +struct __pyx_obj_16_hyperdex_client_DeferredCondMapOp; +struct __pyx_obj_16_hyperdex_client_DeferredGet; +struct __pyx_obj_16_hyperdex_client_SearchBase; +struct __pyx_obj_16_hyperdex_client_DeferredCondDelete; +struct __pyx_obj_16_hyperdex_client_GreaterEqual; +struct __pyx_obj_16_hyperdex_client_Range; +struct __pyx_obj_16_hyperdex_client_Client; +struct __pyx_obj_16_hyperdex_client_DeferredMapOp; +struct __pyx_obj_16_hyperdex_client_Contains; +struct __pyx_obj_16_hyperdex_client_Search; +struct __pyx_obj_16_hyperdex_client_LengthEquals; +struct __pyx_obj_16_hyperdex_client_SortedSearch; +struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs; +struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs; +struct __pyx_obj_16_hyperdex_client_DeferredDelete; +struct __pyx_obj_16_hyperdex_client_Regex; +struct __pyx_obj_16_hyperdex_client_DeferredSearchDescribe; + +/* "_hyperdex_client.pyx":214 + * void hyperdex_client_destroy_attrs(hyperdex_client_attribute* attrs, size_t attrs_sz) + * + * ctypedef int64_t (*hyperdex_client_simple_op)(hyperdex_client*, char*, char*, size_t, hyperdex_client_attribute*, size_t, hyperdex_client_returncode*) # <<<<<<<<<<<<<< + * ctypedef int64_t (*hyperdex_client_map_op)(hyperdex_client*, char*, char*, size_t, hyperdex_client_map_attribute*, size_t, hyperdex_client_returncode*) + * ctypedef int64_t (*hyperdex_client_cond_op)(hyperdex_client*, char*, char*, size_t, hyperdex_client_attribute_check* condattrs, size_t condattrs_sz, hyperdex_client_attribute*, size_t, hyperdex_client_returncode*) + */ +typedef int64_t (*__pyx_t_16_hyperdex_client_hyperdex_client_simple_op)(struct hyperdex_client *, char *, char *, size_t, struct hyperdex_client_attribute *, size_t, enum hyperdex_client_returncode *); + +/* "_hyperdex_client.pyx":215 + * + * ctypedef int64_t (*hyperdex_client_simple_op)(hyperdex_client*, char*, char*, size_t, hyperdex_client_attribute*, size_t, hyperdex_client_returncode*) + * ctypedef int64_t (*hyperdex_client_map_op)(hyperdex_client*, char*, char*, size_t, hyperdex_client_map_attribute*, size_t, hyperdex_client_returncode*) # <<<<<<<<<<<<<< + * ctypedef int64_t (*hyperdex_client_cond_op)(hyperdex_client*, char*, char*, size_t, hyperdex_client_attribute_check* condattrs, size_t condattrs_sz, hyperdex_client_attribute*, size_t, hyperdex_client_returncode*) + * ctypedef int64_t (*hyperdex_client_cond_map_op)(hyperdex_client*, char*, char*, size_t, hyperdex_client_attribute_check* condattrs, size_t condattrs_sz, hyperdex_client_map_attribute*, size_t, hyperdex_client_returncode*) + */ +typedef int64_t (*__pyx_t_16_hyperdex_client_hyperdex_client_map_op)(struct hyperdex_client *, char *, char *, size_t, struct hyperdex_client_map_attribute *, size_t, enum hyperdex_client_returncode *); + +/* "_hyperdex_client.pyx":216 + * ctypedef int64_t (*hyperdex_client_simple_op)(hyperdex_client*, char*, char*, size_t, hyperdex_client_attribute*, size_t, hyperdex_client_returncode*) + * ctypedef int64_t (*hyperdex_client_map_op)(hyperdex_client*, char*, char*, size_t, hyperdex_client_map_attribute*, size_t, hyperdex_client_returncode*) + * ctypedef int64_t (*hyperdex_client_cond_op)(hyperdex_client*, char*, char*, size_t, hyperdex_client_attribute_check* condattrs, size_t condattrs_sz, hyperdex_client_attribute*, size_t, hyperdex_client_returncode*) # <<<<<<<<<<<<<< + * ctypedef int64_t (*hyperdex_client_cond_map_op)(hyperdex_client*, char*, char*, size_t, hyperdex_client_attribute_check* condattrs, size_t condattrs_sz, hyperdex_client_map_attribute*, size_t, hyperdex_client_returncode*) + * + */ +typedef int64_t (*__pyx_t_16_hyperdex_client_hyperdex_client_cond_op)(struct hyperdex_client *, char *, char *, size_t, struct hyperdex_client_attribute_check *, size_t, struct hyperdex_client_attribute *, size_t, enum hyperdex_client_returncode *); + +/* "_hyperdex_client.pyx":217 + * ctypedef int64_t (*hyperdex_client_map_op)(hyperdex_client*, char*, char*, size_t, hyperdex_client_map_attribute*, size_t, hyperdex_client_returncode*) + * ctypedef int64_t (*hyperdex_client_cond_op)(hyperdex_client*, char*, char*, size_t, hyperdex_client_attribute_check* condattrs, size_t condattrs_sz, hyperdex_client_attribute*, size_t, hyperdex_client_returncode*) + * ctypedef int64_t (*hyperdex_client_cond_map_op)(hyperdex_client*, char*, char*, size_t, hyperdex_client_attribute_check* condattrs, size_t condattrs_sz, hyperdex_client_map_attribute*, size_t, hyperdex_client_returncode*) # <<<<<<<<<<<<<< + * + * import collections + */ +typedef int64_t (*__pyx_t_16_hyperdex_client_hyperdex_client_cond_map_op)(struct hyperdex_client *, char *, char *, size_t, struct hyperdex_client_attribute_check *, size_t, struct hyperdex_client_map_attribute *, size_t, enum hyperdex_client_returncode *); + +/* "_hyperdex_client.pyx":1293 + * + * + * cdef class Predicate: # <<<<<<<<<<<<<< + * + * cdef list _raw_check + */ +struct __pyx_obj_16_hyperdex_client_Predicate { + PyObject_HEAD + PyObject *_raw_check; +}; + + +/* "_hyperdex_client.pyx":1353 + * + * + * cdef class LengthLessEqual(Predicate): # <<<<<<<<<<<<<< + * + * def __init__(self, upper): + */ +struct __pyx_obj_16_hyperdex_client_LengthLessEqual { + struct __pyx_obj_16_hyperdex_client_Predicate __pyx_base; +}; + + +/* "_hyperdex_client.pyx":1321 + * + * + * cdef class LessEqual(Predicate): # <<<<<<<<<<<<<< + * + * def __init__(self, upper): + */ +struct __pyx_obj_16_hyperdex_client_LessEqual { + struct __pyx_obj_16_hyperdex_client_Predicate __pyx_base; +}; + + +/* "_hyperdex_client.pyx":816 + * + * + * cdef class Deferred: # <<<<<<<<<<<<<< + * + * cdef Client _client + */ +struct __pyx_obj_16_hyperdex_client_Deferred { + PyObject_HEAD + struct __pyx_obj_16_hyperdex_client_Client *_client; + int64_t _reqid; + enum hyperdex_client_returncode _status; + int _finished; +}; + + +/* "_hyperdex_client.pyx":1115 + * + * + * cdef class DeferredGroupDel(Deferred): # <<<<<<<<<<<<<< + * + * def __cinit__(self, Client client, bytes space, dict predicate): + */ +struct __pyx_obj_16_hyperdex_client_DeferredGroupDel { + struct __pyx_obj_16_hyperdex_client_Deferred __pyx_base; +}; + + +/* "_hyperdex_client.pyx":1361 + * + * + * cdef class LengthGreaterEqual(Predicate): # <<<<<<<<<<<<<< + * + * def __init__(self, lower): + */ +struct __pyx_obj_16_hyperdex_client_LengthGreaterEqual { + struct __pyx_obj_16_hyperdex_client_Predicate __pyx_base; +}; + + +/* "_hyperdex_client.pyx":1172 + * + * + * cdef class DeferredCount(Deferred): # <<<<<<<<<<<<<< + * + * cdef uint64_t _result + */ +struct __pyx_obj_16_hyperdex_client_DeferredCount { + struct __pyx_obj_16_hyperdex_client_Deferred __pyx_base; + uint64_t _result; + int _unsafe; +}; + + +/* "_hyperdex_client.pyx":1037 + * raise HyperClientException(self._status) + * + * cdef class DeferredCondMapOp(Deferred): # <<<<<<<<<<<<<< + * + * def __cinit__(self, Client client): + */ +struct __pyx_obj_16_hyperdex_client_DeferredCondMapOp { + struct __pyx_obj_16_hyperdex_client_Deferred __pyx_base; + struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondMapOp *__pyx_vtab; +}; + + +/* "_hyperdex_client.pyx":839 + * + * + * cdef class DeferredGet(Deferred): # <<<<<<<<<<<<<< + * + * cdef hyperdex_client_attribute* _attrs + */ +struct __pyx_obj_16_hyperdex_client_DeferredGet { + struct __pyx_obj_16_hyperdex_client_Deferred __pyx_base; + struct hyperdex_client_attribute *_attrs; + size_t _attrs_sz; + PyObject *_space; +}; + + +/* "_hyperdex_client.pyx":1203 + * + * + * cdef class SearchBase: # <<<<<<<<<<<<<< + * + * cdef Client _client + */ +struct __pyx_obj_16_hyperdex_client_SearchBase { + PyObject_HEAD + struct __pyx_obj_16_hyperdex_client_Client *_client; + int64_t _reqid; + enum hyperdex_client_returncode _status; + int _finished; + struct hyperdex_client_attribute *_attrs; + size_t _attrs_sz; + PyObject *_backlogged; +}; + + +/* "_hyperdex_client.pyx":974 + * + * + * cdef class DeferredCondDelete(Deferred): # <<<<<<<<<<<<<< + * + * def __cinit__(self, Client client, bytes space, key, dict cond): + */ +struct __pyx_obj_16_hyperdex_client_DeferredCondDelete { + struct __pyx_obj_16_hyperdex_client_Deferred __pyx_base; +}; + + +/* "_hyperdex_client.pyx":1329 + * + * + * cdef class GreaterEqual(Predicate): # <<<<<<<<<<<<<< + * + * def __init__(self, lower): + */ +struct __pyx_obj_16_hyperdex_client_GreaterEqual { + struct __pyx_obj_16_hyperdex_client_Predicate __pyx_base; +}; + + +/* "_hyperdex_client.pyx":1304 + * + * + * cdef class Range(Predicate): # <<<<<<<<<<<<<< + * + * def __init__(self, lower, upper): + */ +struct __pyx_obj_16_hyperdex_client_Range { + struct __pyx_obj_16_hyperdex_client_Predicate __pyx_base; +}; + + +/* "_hyperdex_client.pyx":1369 + * + * + * cdef class Client: # <<<<<<<<<<<<<< + * cdef hyperdex_client* _client + * cdef dict _ops + */ +struct __pyx_obj_16_hyperdex_client_Client { + PyObject_HEAD + struct hyperdex_client *_client; + PyObject *_ops; +}; + + +/* "_hyperdex_client.pyx":1007 + * + * + * cdef class DeferredMapOp(Deferred): # <<<<<<<<<<<<<< + * + * def __cinit__(self, Client client): + */ +struct __pyx_obj_16_hyperdex_client_DeferredMapOp { + struct __pyx_obj_16_hyperdex_client_Deferred __pyx_base; + struct __pyx_vtabstruct_16_hyperdex_client_DeferredMapOp *__pyx_vtab; +}; + + +/* "_hyperdex_client.pyx":1313 + * + * + * cdef class Contains(Predicate): # <<<<<<<<<<<<<< + * + * def __init__(self, elem): + */ +struct __pyx_obj_16_hyperdex_client_Contains { + struct __pyx_obj_16_hyperdex_client_Predicate __pyx_base; +}; + + +/* "_hyperdex_client.pyx":1247 + * + * + * cdef class Search(SearchBase): # <<<<<<<<<<<<<< + * + * def __cinit__(self, Client client, bytes space, dict predicate): + */ +struct __pyx_obj_16_hyperdex_client_Search { + struct __pyx_obj_16_hyperdex_client_SearchBase __pyx_base; +}; + + +/* "_hyperdex_client.pyx":1345 + * + * + * cdef class LengthEquals(Predicate): # <<<<<<<<<<<<<< + * + * def __init__(self, length): + */ +struct __pyx_obj_16_hyperdex_client_LengthEquals { + struct __pyx_obj_16_hyperdex_client_Predicate __pyx_base; +}; + + +/* "_hyperdex_client.pyx":1265 + * + * + * cdef class SortedSearch(SearchBase): # <<<<<<<<<<<<<< + * + * def __cinit__(self, Client client, bytes space, dict predicate, + */ +struct __pyx_obj_16_hyperdex_client_SortedSearch { + struct __pyx_obj_16_hyperdex_client_SearchBase __pyx_base; +}; + + +/* "_hyperdex_client.pyx":874 + * + * + * cdef class DeferredFromAttrs(Deferred): # <<<<<<<<<<<<<< + * + * cdef bint _cmped + */ +struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs { + struct __pyx_obj_16_hyperdex_client_Deferred __pyx_base; + struct __pyx_vtabstruct_16_hyperdex_client_DeferredFromAttrs *__pyx_vtab; + int _cmped; +}; + + +/* "_hyperdex_client.pyx":911 + * + * + * cdef class DeferredCondFromAttrs(Deferred): # <<<<<<<<<<<<<< + * + * def __cinit__(self, Client client): + */ +struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs { + struct __pyx_obj_16_hyperdex_client_Deferred __pyx_base; + struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondFromAttrs *__pyx_vtab; +}; + + +/* "_hyperdex_client.pyx":952 + * + * + * cdef class DeferredDelete(Deferred): # <<<<<<<<<<<<<< + * + * def __cinit__(self, Client client, bytes space, key): + */ +struct __pyx_obj_16_hyperdex_client_DeferredDelete { + struct __pyx_obj_16_hyperdex_client_Deferred __pyx_base; +}; + + +/* "_hyperdex_client.pyx":1337 + * + * + * cdef class Regex(Predicate): # <<<<<<<<<<<<<< + * + * def __init__(self, regex): + */ +struct __pyx_obj_16_hyperdex_client_Regex { + struct __pyx_obj_16_hyperdex_client_Predicate __pyx_base; +}; + + +/* "_hyperdex_client.pyx":1141 + * + * + * cdef class DeferredSearchDescribe(Deferred): # <<<<<<<<<<<<<< + * + * cdef char* _text + */ +struct __pyx_obj_16_hyperdex_client_DeferredSearchDescribe { + struct __pyx_obj_16_hyperdex_client_Deferred __pyx_base; + char *_text; +}; + + + +/* "_hyperdex_client.pyx":911 + * + * + * cdef class DeferredCondFromAttrs(Deferred): # <<<<<<<<<<<<<< + * + * def __cinit__(self, Client client): + */ + +struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondFromAttrs { + PyObject *(*call)(struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *, __pyx_t_16_hyperdex_client_hyperdex_client_cond_op, PyObject *, PyObject *, PyObject *, PyObject *); +}; +static struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondFromAttrs *__pyx_vtabptr_16_hyperdex_client_DeferredCondFromAttrs; + + +/* "_hyperdex_client.pyx":1007 + * + * + * cdef class DeferredMapOp(Deferred): # <<<<<<<<<<<<<< + * + * def __cinit__(self, Client client): + */ + +struct __pyx_vtabstruct_16_hyperdex_client_DeferredMapOp { + PyObject *(*call)(struct __pyx_obj_16_hyperdex_client_DeferredMapOp *, __pyx_t_16_hyperdex_client_hyperdex_client_map_op, PyObject *, PyObject *, PyObject *); +}; +static struct __pyx_vtabstruct_16_hyperdex_client_DeferredMapOp *__pyx_vtabptr_16_hyperdex_client_DeferredMapOp; + + +/* "_hyperdex_client.pyx":874 + * + * + * cdef class DeferredFromAttrs(Deferred): # <<<<<<<<<<<<<< + * + * cdef bint _cmped + */ + +struct __pyx_vtabstruct_16_hyperdex_client_DeferredFromAttrs { + PyObject *(*setcmp)(struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *); + PyObject *(*call)(struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *, __pyx_t_16_hyperdex_client_hyperdex_client_simple_op, PyObject *, PyObject *, PyObject *); +}; +static struct __pyx_vtabstruct_16_hyperdex_client_DeferredFromAttrs *__pyx_vtabptr_16_hyperdex_client_DeferredFromAttrs; + + +/* "_hyperdex_client.pyx":1037 + * raise HyperClientException(self._status) + * + * cdef class DeferredCondMapOp(Deferred): # <<<<<<<<<<<<<< + * + * def __cinit__(self, Client client): + */ + +struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondMapOp { + PyObject *(*call)(struct __pyx_obj_16_hyperdex_client_DeferredCondMapOp *, __pyx_t_16_hyperdex_client_hyperdex_client_cond_map_op, PyObject *, PyObject *, PyObject *, PyObject *); +}; +static struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondMapOp *__pyx_vtabptr_16_hyperdex_client_DeferredCondMapOp; +#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); /*proto*/ + #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 /* CYTHON_REFNANNY */ +#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) + +#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 + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*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); /*proto*/ + +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ + +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*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 + +static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value); /*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 + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ + +#if PY_VERSION_HEX < 0x02050000 +#ifndef PyAnySet_CheckExact +#define PyAnySet_CheckExact(ob) \ + ((ob)->ob_type == &PySet_Type || \ + (ob)->ob_type == &PyFrozenSet_Type) +#define PySet_New(iterable) \ + PyObject_CallFunctionObjArgs((PyObject *)&PySet_Type, (iterable), NULL) +#define Pyx_PyFrozenSet_New(iterable) \ + PyObject_CallFunctionObjArgs((PyObject *)&PyFrozenSet_Type, (iterable), NULL) +#define PySet_Size(anyset) \ + PyObject_Size((anyset)) +#define PySet_Contains(anyset, key) \ + PySequence_Contains((anyset), (key)) +#define PySet_Pop(set) \ + PyObject_CallMethod(set, (char *)"pop", NULL) +static CYTHON_INLINE int PySet_Clear(PyObject *set) { + PyObject *ret = PyObject_CallMethod(set, (char *)"clear", NULL); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +static CYTHON_INLINE int PySet_Discard(PyObject *set, PyObject *key) { + PyObject *ret = PyObject_CallMethod(set, (char *)"discard", (char *)"O", key); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +static CYTHON_INLINE int PySet_Add(PyObject *set, PyObject *key) { + PyObject *ret = PyObject_CallMethod(set, (char *)"add", (char *)"O", key); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +#endif /* PyAnySet_CheckExact (<= Py2.4) */ +#endif /* < Py2.5 */ + +#if PY_MAJOR_VERSION >= 3 +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 + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/ + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( + PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, + PyObject** py_start, PyObject** py_stop, PyObject** py_slice, + int has_cstart, int has_cstop, int wraparound); + +#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 + +#define __Pyx_GetItemInt(o, i, size, to_py_func, is_list, wraparound, boundscheck) \ + (((size) <= sizeof(Py_ssize_t)) ? \ + __Pyx_GetItemInt_Fast(o, i, is_list, wraparound, boundscheck) : \ + __Pyx_GetItemInt_Generic(o, to_py_func(i))) +#define __Pyx_GetItemInt_List(o, i, size, to_py_func, is_list, wraparound, boundscheck) \ + (((size) <= sizeof(Py_ssize_t)) ? \ + __Pyx_GetItemInt_List_Fast(o, i, wraparound, boundscheck) : \ + __Pyx_GetItemInt_Generic(o, to_py_func(i))) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func, is_list, wraparound, boundscheck) \ + (((size) <= sizeof(Py_ssize_t)) ? \ + __Pyx_GetItemInt_Tuple_Fast(o, i, wraparound, boundscheck) : \ + __Pyx_GetItemInt_Generic(o, to_py_func(i))) +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); + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +static PyObject* __Pyx_PyObject_CallMethodTuple(PyObject* obj, PyObject* method_name, PyObject* args) { + PyObject *method, *result = NULL; + if (unlikely(!args)) return NULL; + method = __Pyx_PyObject_GetAttrStr(obj, method_name); + if (unlikely(!method)) goto bad; + result = PyObject_Call(method, args, NULL); + Py_DECREF(method); +bad: + Py_DECREF(args); + return result; +} +#define __Pyx_PyObject_CallMethod3(obj, name, arg1, arg2, arg3) \ + __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(3, arg1, arg2, arg3)) +#define __Pyx_PyObject_CallMethod2(obj, name, arg1, arg2) \ + __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(2, arg1, arg2)) +#define __Pyx_PyObject_CallMethod1(obj, name, arg1) \ + __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(1, arg1)) +#define __Pyx_PyObject_CallMethod0(obj, name) \ + __Pyx_PyObject_CallMethodTuple(obj, name, (Py_INCREF(__pyx_empty_tuple), __pyx_empty_tuple)) + +static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /*proto*/ + +static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2, + int is_tuple, int has_known_size, int decref_tuple); + +static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, + Py_ssize_t* p_orig_length, int* p_is_dict); +static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, + PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); + +static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact); /*proto*/ + +#define __Pyx_DelItemInt(o, i, size, to_py_func, is_list, wraparound, boundscheck) \ + (((size) <= sizeof(Py_ssize_t)) ? \ + __Pyx_DelItemInt_Fast(o, i, is_list, wraparound) : \ + __Pyx_DelItem_Generic(o, to_py_func(i))) +static CYTHON_INLINE int __Pyx_DelItem_Generic(PyObject *o, PyObject *j); +static CYTHON_INLINE int __Pyx_DelItemInt_Fast(PyObject *o, Py_ssize_t i, + CYTHON_UNUSED int is_list, int wraparound); + +#define __Pyx_SetItemInt(o, i, v, size, to_py_func, is_list, wraparound, boundscheck) \ + (((size) <= sizeof(Py_ssize_t)) ? \ + __Pyx_SetItemInt_Fast(o, i, v, is_list, wraparound, boundscheck) : \ + __Pyx_SetItemInt_Generic(o, to_py_func(i), v)) +static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v); +static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, + int is_list, int wraparound, int boundscheck); + +#if PY_MAJOR_VERSION >= 3 +static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d); /*proto*/ +#else +#define __Pyx_PyDict_Items(d) PyDict_Items(d) +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyObject_Pop(PyObject* L); /*proto*/ + +#include + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyDict_Contains(PyObject* item, PyObject* dict, int eq) { + int result = PyDict_Contains(dict, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +#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; + int flags; + PyObject *func_dict; + PyObject *func_weakreflist; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; /* No-args super() class cell */ + void *defaults; + int defaults_pyobjects; + PyObject *defaults_tuple; /* Const defaults tuple */ + PyObject *defaults_kwdict; /* Const kwonly defaults dict */ + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; /* function annotations dict */ +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, code) \ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, PyObject *module, + 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); + +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases); /*proto*/ + +static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, + PyObject *qualname, PyObject *modname); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_int64_t(int64_t); + +static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_uint64_t(uint64_t); + +static CYTHON_INLINE uint16_t __Pyx_PyInt_from_py_uint16_t(PyObject *); + +static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); + +static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); + +static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *); + +static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *); + +static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *); + +static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *); + +static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *); + +static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); + +static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); + +static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *); + +static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); + +static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); + +static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *); + +static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *); + +static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *); + +static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *); + +static int __Pyx_check_binary_version(void); + +static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*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 + +static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ + +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /*proto*/ + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __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); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'cpython.version' */ + +/* 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 'libc.string' */ + +/* Module declarations from 'libc.stdio' */ + +/* Module declarations from 'cpython.object' */ + +/* Module declarations from 'cpython.sequence' */ + +/* Module declarations from 'cpython.mapping' */ + +/* Module declarations from 'cpython.iterator' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.type' */ +static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; + +/* 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 'datetime' */ + +/* Module declarations from 'cpython.datetime' */ +static PyTypeObject *__pyx_ptype_7cpython_8datetime_date = 0; +static PyTypeObject *__pyx_ptype_7cpython_8datetime_time = 0; +static PyTypeObject *__pyx_ptype_7cpython_8datetime_datetime = 0; +static PyTypeObject *__pyx_ptype_7cpython_8datetime_timedelta = 0; +static PyTypeObject *__pyx_ptype_7cpython_8datetime_tzinfo = 0; + +/* Module declarations from 'cpython' */ + +/* Module declarations from '_hyperdex_client' */ +static PyTypeObject *__pyx_ptype_16_hyperdex_client_Deferred = 0; +static PyTypeObject *__pyx_ptype_16_hyperdex_client_DeferredGet = 0; +static PyTypeObject *__pyx_ptype_16_hyperdex_client_DeferredFromAttrs = 0; +static PyTypeObject *__pyx_ptype_16_hyperdex_client_DeferredCondFromAttrs = 0; +static PyTypeObject *__pyx_ptype_16_hyperdex_client_DeferredDelete = 0; +static PyTypeObject *__pyx_ptype_16_hyperdex_client_DeferredCondDelete = 0; +static PyTypeObject *__pyx_ptype_16_hyperdex_client_DeferredMapOp = 0; +static PyTypeObject *__pyx_ptype_16_hyperdex_client_DeferredCondMapOp = 0; +static PyTypeObject *__pyx_ptype_16_hyperdex_client_DeferredGroupDel = 0; +static PyTypeObject *__pyx_ptype_16_hyperdex_client_DeferredSearchDescribe = 0; +static PyTypeObject *__pyx_ptype_16_hyperdex_client_DeferredCount = 0; +static PyTypeObject *__pyx_ptype_16_hyperdex_client_SearchBase = 0; +static PyTypeObject *__pyx_ptype_16_hyperdex_client_Search = 0; +static PyTypeObject *__pyx_ptype_16_hyperdex_client_SortedSearch = 0; +static PyTypeObject *__pyx_ptype_16_hyperdex_client_Predicate = 0; +static PyTypeObject *__pyx_ptype_16_hyperdex_client_Range = 0; +static PyTypeObject *__pyx_ptype_16_hyperdex_client_Contains = 0; +static PyTypeObject *__pyx_ptype_16_hyperdex_client_LessEqual = 0; +static PyTypeObject *__pyx_ptype_16_hyperdex_client_GreaterEqual = 0; +static PyTypeObject *__pyx_ptype_16_hyperdex_client_Regex = 0; +static PyTypeObject *__pyx_ptype_16_hyperdex_client_LengthEquals = 0; +static PyTypeObject *__pyx_ptype_16_hyperdex_client_LengthLessEqual = 0; +static PyTypeObject *__pyx_ptype_16_hyperdex_client_LengthGreaterEqual = 0; +static PyTypeObject *__pyx_ptype_16_hyperdex_client_Client = 0; +static PyObject *__pyx_f_16_hyperdex_client__obj_to_backing(PyObject *); /*proto*/ +static PyObject *__pyx_f_16_hyperdex_client__dict_to_attrs(PyObject *, struct hyperdex_client_attribute **); /*proto*/ +static PyObject *__pyx_f_16_hyperdex_client__dict_to_map_attrs(PyObject *, struct hyperdex_client_map_attribute **, size_t *); /*proto*/ +static PyObject *__pyx_f_16_hyperdex_client__attrs_to_dict(struct hyperdex_client_attribute *, size_t); /*proto*/ +static PyObject *__pyx_f_16_hyperdex_client__check_reqid(int64_t, enum hyperdex_client_returncode); /*proto*/ +static PyObject *__pyx_f_16_hyperdex_client__check_reqid_key_attrs(int64_t, enum hyperdex_client_returncode, struct hyperdex_client_attribute *, size_t); /*proto*/ +static PyObject *__pyx_f_16_hyperdex_client__check_reqid_key_conds(int64_t, enum hyperdex_client_returncode, struct hyperdex_client_attribute_check *, size_t); /*proto*/ +static PyObject *__pyx_f_16_hyperdex_client__check_reqid_key_attrs2(int64_t, enum hyperdex_client_returncode, struct hyperdex_client_attribute_check *, size_t, struct hyperdex_client_attribute *, size_t); /*proto*/ +static PyObject *__pyx_f_16_hyperdex_client__check_reqid_key_cond_map_attrs(int64_t, enum hyperdex_client_returncode, struct hyperdex_client_attribute_check *, size_t, struct hyperdex_client_map_attribute *, size_t); /*proto*/ +static PyObject *__pyx_f_16_hyperdex_client__check_reqid_key_map_attrs(int64_t, enum hyperdex_client_returncode, struct hyperdex_client_map_attribute *, size_t); /*proto*/ +static PyObject *__pyx_f_16_hyperdex_client__check_reqid_search(int64_t, enum hyperdex_client_returncode, struct hyperdex_client_attribute_check *, size_t); /*proto*/ +static PyObject *__pyx_f_16_hyperdex_client__predicate_to_c(PyObject *, struct hyperdex_client_attribute_check **, size_t *); /*proto*/ +#define __Pyx_MODULE_NAME "_hyperdex_client" +int __pyx_module_is_main__hyperdex_client = 0; + +/* Implementation of '_hyperdex_client' */ +static PyObject *__pyx_builtin_Exception; +static PyObject *__pyx_builtin_ord; +static PyObject *__pyx_builtin_all; +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_sorted; +static PyObject *__pyx_builtin_MemoryError; +static PyObject *__pyx_builtin_enumerate; +static PyObject *__pyx_builtin_sum; +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_StopIteration; +static PyObject *__pyx_builtin_AttributeError; +static PyObject *__pyx_pf_16_hyperdex_client_20HyperClientException___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_status, PyObject *__pyx_v_attr); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_20HyperClientException_2status(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_20HyperClientException_4symbol(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_20HyperClientException_6__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_20HyperClientException_8__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_20HyperClientException_10__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_20HyperClientException_12__ne__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client___sort_key(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */ +static int __pyx_pf_16_hyperdex_client_8Deferred___cinit__(struct __pyx_obj_16_hyperdex_client_Deferred *__pyx_v_self, struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client, CYTHON_UNUSED PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_8Deferred_2_callback(struct __pyx_obj_16_hyperdex_client_Deferred *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_8Deferred_4wait(struct __pyx_obj_16_hyperdex_client_Deferred *__pyx_v_self); /* proto */ +static int __pyx_pf_16_hyperdex_client_11DeferredGet___cinit__(struct __pyx_obj_16_hyperdex_client_DeferredGet *__pyx_v_self, struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client, PyObject *__pyx_v_space, PyObject *__pyx_v_key); /* proto */ +static void __pyx_pf_16_hyperdex_client_11DeferredGet_2__dealloc__(struct __pyx_obj_16_hyperdex_client_DeferredGet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_11DeferredGet_4wait(struct __pyx_obj_16_hyperdex_client_DeferredGet *__pyx_v_self); /* proto */ +static int __pyx_pf_16_hyperdex_client_17DeferredFromAttrs___cinit__(struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_17DeferredFromAttrs_2wait(struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *__pyx_v_self); /* proto */ +static int __pyx_pf_16_hyperdex_client_21DeferredCondFromAttrs___cinit__(CYTHON_UNUSED struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_21DeferredCondFromAttrs_2wait(struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *__pyx_v_self); /* proto */ +static int __pyx_pf_16_hyperdex_client_14DeferredDelete___cinit__(struct __pyx_obj_16_hyperdex_client_DeferredDelete *__pyx_v_self, struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client, PyObject *__pyx_v_space, PyObject *__pyx_v_key); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_14DeferredDelete_2wait(struct __pyx_obj_16_hyperdex_client_DeferredDelete *__pyx_v_self); /* proto */ +static int __pyx_pf_16_hyperdex_client_18DeferredCondDelete___cinit__(struct __pyx_obj_16_hyperdex_client_DeferredCondDelete *__pyx_v_self, struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_18DeferredCondDelete_2wait(struct __pyx_obj_16_hyperdex_client_DeferredCondDelete *__pyx_v_self); /* proto */ +static int __pyx_pf_16_hyperdex_client_13DeferredMapOp___cinit__(CYTHON_UNUSED struct __pyx_obj_16_hyperdex_client_DeferredMapOp *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_13DeferredMapOp_2wait(struct __pyx_obj_16_hyperdex_client_DeferredMapOp *__pyx_v_self); /* proto */ +static int __pyx_pf_16_hyperdex_client_17DeferredCondMapOp___cinit__(CYTHON_UNUSED struct __pyx_obj_16_hyperdex_client_DeferredCondMapOp *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_17DeferredCondMapOp_2wait(struct __pyx_obj_16_hyperdex_client_DeferredCondMapOp *__pyx_v_self); /* proto */ +static int __pyx_pf_16_hyperdex_client_16DeferredGroupDel___cinit__(struct __pyx_obj_16_hyperdex_client_DeferredGroupDel *__pyx_v_self, struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client, PyObject *__pyx_v_space, PyObject *__pyx_v_predicate); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_16DeferredGroupDel_2wait(struct __pyx_obj_16_hyperdex_client_DeferredGroupDel *__pyx_v_self); /* proto */ +static int __pyx_pf_16_hyperdex_client_22DeferredSearchDescribe___cinit__(struct __pyx_obj_16_hyperdex_client_DeferredSearchDescribe *__pyx_v_self, struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client, PyObject *__pyx_v_space, PyObject *__pyx_v_predicate, CYTHON_UNUSED PyBoolObject *__pyx_v_unsafe); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_22DeferredSearchDescribe_2wait(struct __pyx_obj_16_hyperdex_client_DeferredSearchDescribe *__pyx_v_self); /* proto */ +static int __pyx_pf_16_hyperdex_client_13DeferredCount___cinit__(struct __pyx_obj_16_hyperdex_client_DeferredCount *__pyx_v_self, struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client, PyObject *__pyx_v_space, PyObject *__pyx_v_predicate, PyBoolObject *__pyx_v_unsafe); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_13DeferredCount_2wait(struct __pyx_obj_16_hyperdex_client_DeferredCount *__pyx_v_self); /* proto */ +static int __pyx_pf_16_hyperdex_client_10SearchBase___cinit__(struct __pyx_obj_16_hyperdex_client_SearchBase *__pyx_v_self, struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client, CYTHON_UNUSED PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_10SearchBase_2__iter__(struct __pyx_obj_16_hyperdex_client_SearchBase *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_10SearchBase_4__next__(struct __pyx_obj_16_hyperdex_client_SearchBase *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_10SearchBase_6_callback(struct __pyx_obj_16_hyperdex_client_SearchBase *__pyx_v_self); /* proto */ +static int __pyx_pf_16_hyperdex_client_6Search___cinit__(struct __pyx_obj_16_hyperdex_client_Search *__pyx_v_self, struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client, PyObject *__pyx_v_space, PyObject *__pyx_v_predicate); /* proto */ +static int __pyx_pf_16_hyperdex_client_12SortedSearch___cinit__(struct __pyx_obj_16_hyperdex_client_SortedSearch *__pyx_v_self, struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client, PyObject *__pyx_v_space, PyObject *__pyx_v_predicate, PyObject *__pyx_v_sort_by, long __pyx_v_limit, PyObject *__pyx_v_compare); /* proto */ +static int __pyx_pf_16_hyperdex_client_9Predicate___init__(struct __pyx_obj_16_hyperdex_client_Predicate *__pyx_v_self, PyObject *__pyx_v_raw); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_9Predicate_2_raw(struct __pyx_obj_16_hyperdex_client_Predicate *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ +static int __pyx_pf_16_hyperdex_client_5Range___init__(struct __pyx_obj_16_hyperdex_client_Range *__pyx_v_self, PyObject *__pyx_v_lower, PyObject *__pyx_v_upper); /* proto */ +static int __pyx_pf_16_hyperdex_client_8Contains___init__(struct __pyx_obj_16_hyperdex_client_Contains *__pyx_v_self, PyObject *__pyx_v_elem); /* proto */ +static int __pyx_pf_16_hyperdex_client_9LessEqual___init__(struct __pyx_obj_16_hyperdex_client_LessEqual *__pyx_v_self, PyObject *__pyx_v_upper); /* proto */ +static int __pyx_pf_16_hyperdex_client_12GreaterEqual___init__(struct __pyx_obj_16_hyperdex_client_GreaterEqual *__pyx_v_self, PyObject *__pyx_v_lower); /* proto */ +static int __pyx_pf_16_hyperdex_client_5Regex___init__(struct __pyx_obj_16_hyperdex_client_Regex *__pyx_v_self, PyObject *__pyx_v_regex); /* proto */ +static int __pyx_pf_16_hyperdex_client_12LengthEquals___init__(struct __pyx_obj_16_hyperdex_client_LengthEquals *__pyx_v_self, PyObject *__pyx_v_length); /* proto */ +static int __pyx_pf_16_hyperdex_client_15LengthLessEqual___init__(struct __pyx_obj_16_hyperdex_client_LengthLessEqual *__pyx_v_self, PyObject *__pyx_v_upper); /* proto */ +static int __pyx_pf_16_hyperdex_client_18LengthGreaterEqual___init__(struct __pyx_obj_16_hyperdex_client_LengthGreaterEqual *__pyx_v_self, PyObject *__pyx_v_lower); /* proto */ +static int __pyx_pf_16_hyperdex_client_6Client___cinit__(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_address, PyObject *__pyx_v_port); /* proto */ +static void __pyx_pf_16_hyperdex_client_6Client_2__dealloc__(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_4get(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_6put(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_8cond_put(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_condition, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_10put_if_not_exist(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_12delete(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_14cond_delete(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_16atomic_add(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_18cond_atomic_add(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_20atomic_sub(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_22cond_atomic_sub(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_24atomic_mul(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_26cond_atomic_mul(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_28atomic_div(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_30cond_atomic_div(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_32atomic_mod(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_34cond_atomic_mod(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_36atomic_and(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_38cond_atomic_and(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_40atomic_or(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_42cond_atomic_or(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_44atomic_xor(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_46cond_atomic_xor(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_48string_prepend(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_50cond_string_prepend(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_52string_append(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_54cond_string_append(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_56list_lpush(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_58cond_list_lpush(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_60list_rpush(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_62cond_list_rpush(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_64set_add(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_66cond_set_add(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_68set_remove(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_70cond_set_remove(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_72set_intersect(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_74cond_set_intersect(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_76set_union(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_78cond_set_union(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_80map_add(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_82cond_map_add(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_84map_remove(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_86cond_map_remove(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_88map_atomic_add(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_90cond_map_atomic_add(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_92map_atomic_sub(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_94cond_map_atomic_sub(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_96map_atomic_mul(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_98cond_map_atomic_mul(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_100map_atomic_div(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_102cond_map_atomic_div(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_104map_atomic_mod(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_106cond_map_atomic_mod(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_108map_atomic_and(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_110cond_map_atomic_and(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_112map_atomic_or(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_114cond_map_atomic_or(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_116map_atomic_xor(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_118cond_map_atomic_xor(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_120map_string_prepend(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_122cond_map_string_prepend(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_124map_string_append(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_126cond_map_string_append(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_128search_describe(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_predicate, PyBoolObject *__pyx_v_unsafe); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_130group_del(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_predicate); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_132count(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_predicate, PyBoolObject *__pyx_v_unsafe); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_134search(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_predicate); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_136sorted_search(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_predicate, PyObject *__pyx_v_sort_by, long __pyx_v_limit, PyObject *__pyx_v_compare); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_138async_get(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_140async_put(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_142async_put_if_not_exist(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_144async_cond_put(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_146async_delete(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_148async_cond_delete(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_150async_atomic_add(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_152async_cond_atomic_add(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_154async_atomic_sub(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_156async_cond_atomic_sub(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_158async_atomic_mul(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_160async_cond_atomic_mul(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_162async_atomic_div(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_164async_cond_atomic_div(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_166async_atomic_mod(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_168async_cond_atomic_mod(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_170async_atomic_and(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_172async_cond_atomic_and(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_174async_atomic_or(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_176async_cond_atomic_or(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_178async_atomic_xor(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_180async_cond_atomic_xor(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_182async_string_prepend(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_184async_cond_string_prepend(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_186async_string_append(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_188async_cond_string_append(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_190async_list_lpush(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_192async_cond_list_lpush(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_194async_list_rpush(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_196async_cond_list_rpush(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_198async_set_add(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_200async_cond_set_add(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_202async_set_remove(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_204async_cond_set_remove(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_206async_set_intersect(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_208async_cond_set_intersect(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_210async_set_union(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_212async_cond_set_union(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_214async_map_add(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_216async_cond_map_add(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_218async_map_remove(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_220async_cond_map_remove(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_222async_map_atomic_add(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_224async_cond_map_atomic_add(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_226async_map_atomic_sub(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_228async_cond_map_atomic_sub(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_230async_map_atomic_mul(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_232async_cond_map_atomic_mul(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_234async_map_atomic_div(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_236async_cond_map_atomic_div(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_238async_map_atomic_mod(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_240async_cond_map_atomic_mod(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_242async_map_atomic_and(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_244async_cond_map_atomic_and(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_246async_map_atomic_or(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_248async_cond_map_atomic_or(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_250async_map_atomic_xor(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_252async_cond_map_atomic_xor(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_254async_map_string_prepend(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_256async_cond_map_string_prepend(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_258async_map_string_append(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_260async_cond_map_string_append(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_262async_search_describe(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_predicate, PyBoolObject *__pyx_v_unsafe); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_264async_group_del(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_predicate); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_266async_count(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_predicate, PyBoolObject *__pyx_v_unsafe); /* proto */ +static PyObject *__pyx_pf_16_hyperdex_client_6Client_268loop(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self); /* proto */ +static PyObject *__pyx_tp_new_16_hyperdex_client_Deferred(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_16_hyperdex_client_DeferredGet(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_16_hyperdex_client_DeferredFromAttrs(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_16_hyperdex_client_DeferredCondFromAttrs(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_16_hyperdex_client_DeferredDelete(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_16_hyperdex_client_DeferredCondDelete(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_16_hyperdex_client_DeferredMapOp(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_16_hyperdex_client_DeferredCondMapOp(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_16_hyperdex_client_DeferredGroupDel(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_16_hyperdex_client_DeferredSearchDescribe(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_16_hyperdex_client_DeferredCount(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_16_hyperdex_client_SearchBase(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_16_hyperdex_client_Search(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_16_hyperdex_client_SortedSearch(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_16_hyperdex_client_Predicate(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_16_hyperdex_client_Range(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_16_hyperdex_client_Contains(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_16_hyperdex_client_LessEqual(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_16_hyperdex_client_GreaterEqual(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_16_hyperdex_client_Regex(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_16_hyperdex_client_LengthEquals(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_16_hyperdex_client_LengthLessEqual(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_16_hyperdex_client_LengthGreaterEqual(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_16_hyperdex_client_Client(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static char __pyx_k_1[] = "Not Found"; +static char __pyx_k_2[] = "Search Done"; +static char __pyx_k_3[] = "Conditional Operation Did Not Match Object"; +static char __pyx_k_4[] = "Cluster is in a Read-Only State"; +static char __pyx_k_5[] = "Unknown Space"; +static char __pyx_k_6[] = "Coordinator Failure"; +static char __pyx_k_7[] = "Server Error"; +static char __pyx_k_8[] = "Polling Failed"; +static char __pyx_k_9[] = "Integer-overflow or divide-by-zero"; +static char __pyx_k_10[] = "Unknown attribute \"%s\""; +static char __pyx_k_11[] = "Duplicate attribute \"%s\""; +static char __pyx_k_12[] = "None pending"; +static char __pyx_k_13[] = "Do not specify the key in a search predicate and do not redundantly specify the key for an insert"; +static char __pyx_k_14[] = "Attribute \"%s\" has the wrong type"; +static char __pyx_k_15[] = "Memory allocation failed"; +static char __pyx_k_16[] = "Interrupted by a signal"; +static char __pyx_k_17[] = "The cluster changed identities"; +static char __pyx_k_18[] = "Internal Error (file a bug)"; +static char __pyx_k_19[] = "Internal Exception (file a bug)"; +static char __pyx_k_20[] = "Internal Corruption (file a bug)"; +static char __pyx_k_21[] = "Unknown Error (file a bug)"; +static char __pyx_k_22[] = "HYPERDEX_CLIENT_SUCCESS"; +static char __pyx_k_23[] = "HYPERDEX_CLIENT_NOTFOUND"; +static char __pyx_k_24[] = "HYPERDEX_CLIENT_SEARCHDONE"; +static char __pyx_k_25[] = "HYPERDEX_CLIENT_CMPFAIL"; +static char __pyx_k_26[] = "HYPERDEX_CLIENT_READONLY"; +static char __pyx_k_27[] = "HYPERDEX_CLIENT_UNKNOWNSPACE"; +static char __pyx_k_28[] = "HYPERDEX_CLIENT_COORDFAIL"; +static char __pyx_k_29[] = "HYPERDEX_CLIENT_SERVERERROR"; +static char __pyx_k_30[] = "HYPERDEX_CLIENT_POLLFAILED"; +static char __pyx_k_31[] = "HYPERDEX_CLIENT_OVERFLOW"; +static char __pyx_k_32[] = "HYPERDEX_CLIENT_RECONFIGURE"; +static char __pyx_k_33[] = "HYPERDEX_CLIENT_TIMEOUT"; +static char __pyx_k_34[] = "HYPERDEX_CLIENT_UNKNOWNATTR"; +static char __pyx_k_35[] = "HYPERDEX_CLIENT_DUPEATTR"; +static char __pyx_k_36[] = "HYPERDEX_CLIENT_NONEPENDING"; +static char __pyx_k_37[] = "HYPERDEX_CLIENT_DONTUSEKEY"; +static char __pyx_k_38[] = "HYPERDEX_CLIENT_WRONGTYPE"; +static char __pyx_k_39[] = "HYPERDEX_CLIENT_NOMEM"; +static char __pyx_k_40[] = "HYPERDEX_CLIENT_INTERRUPTED"; +static char __pyx_k_41[] = "HYPERDEX_CLIENT_CLUSTER_JUMP"; +static char __pyx_k_42[] = "HYPERDEX_CLIENT_INTERNAL"; +static char __pyx_k_43[] = "HYPERDEX_CLIENT_EXCEPTION"; +static char __pyx_k_44[] = "HYPERDEX_CLIENT_GARBAGE"; +static char __pyx_k_45[] = "HyperClient(%s, %s)"; +static char __pyx_k_46[] = ""; +static char __pyx_k_47[] = " 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__attr); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __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_self = values[0]; + __pyx_v_status = values[1]; + __pyx_v_attr = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.HyperClientException.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_16_hyperdex_client_20HyperClientException___init__(__pyx_self, __pyx_v_self, __pyx_v_status, __pyx_v_attr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_16_hyperdex_client_20HyperClientException___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_status, PyObject *__pyx_v_attr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "_hyperdex_client.pyx":225 + * + * def __init__(self, status, attr=None): + * self._status = status # <<<<<<<<<<<<<< + * self._s = {HYPERDEX_CLIENT_SUCCESS: 'Success' + * ,HYPERDEX_CLIENT_NOTFOUND: 'Not Found' + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s___status, __pyx_v_status) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "_hyperdex_client.pyx":226 + * def __init__(self, status, attr=None): + * self._status = status + * self._s = {HYPERDEX_CLIENT_SUCCESS: 'Success' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_NOTFOUND: 'Not Found' + * ,HYPERDEX_CLIENT_SEARCHDONE: 'Search Done' + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __pyx_t_2 = PyInt_FromLong(HYPERDEX_CLIENT_SUCCESS); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_n_s__Success)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":227 + * self._status = status + * self._s = {HYPERDEX_CLIENT_SUCCESS: 'Success' + * ,HYPERDEX_CLIENT_NOTFOUND: 'Not Found' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_SEARCHDONE: 'Search Done' + * ,HYPERDEX_CLIENT_CMPFAIL: 'Conditional Operation Did Not Match Object' + */ + __pyx_t_2 = PyInt_FromLong(HYPERDEX_CLIENT_NOTFOUND); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_kp_s_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":228 + * self._s = {HYPERDEX_CLIENT_SUCCESS: 'Success' + * ,HYPERDEX_CLIENT_NOTFOUND: 'Not Found' + * ,HYPERDEX_CLIENT_SEARCHDONE: 'Search Done' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_CMPFAIL: 'Conditional Operation Did Not Match Object' + * ,HYPERDEX_CLIENT_READONLY: 'Cluster is in a Read-Only State' + */ + __pyx_t_2 = PyInt_FromLong(HYPERDEX_CLIENT_SEARCHDONE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_kp_s_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":229 + * ,HYPERDEX_CLIENT_NOTFOUND: 'Not Found' + * ,HYPERDEX_CLIENT_SEARCHDONE: 'Search Done' + * ,HYPERDEX_CLIENT_CMPFAIL: 'Conditional Operation Did Not Match Object' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_READONLY: 'Cluster is in a Read-Only State' + * ,HYPERDEX_CLIENT_UNKNOWNSPACE: 'Unknown Space' + */ + __pyx_t_2 = PyInt_FromLong(HYPERDEX_CLIENT_CMPFAIL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_kp_s_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":230 + * ,HYPERDEX_CLIENT_SEARCHDONE: 'Search Done' + * ,HYPERDEX_CLIENT_CMPFAIL: 'Conditional Operation Did Not Match Object' + * ,HYPERDEX_CLIENT_READONLY: 'Cluster is in a Read-Only State' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_UNKNOWNSPACE: 'Unknown Space' + * ,HYPERDEX_CLIENT_COORDFAIL: 'Coordinator Failure' + */ + __pyx_t_2 = PyInt_FromLong(HYPERDEX_CLIENT_READONLY); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_kp_s_4)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":231 + * ,HYPERDEX_CLIENT_CMPFAIL: 'Conditional Operation Did Not Match Object' + * ,HYPERDEX_CLIENT_READONLY: 'Cluster is in a Read-Only State' + * ,HYPERDEX_CLIENT_UNKNOWNSPACE: 'Unknown Space' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_COORDFAIL: 'Coordinator Failure' + * ,HYPERDEX_CLIENT_SERVERERROR: 'Server Error' + */ + __pyx_t_2 = PyInt_FromLong(HYPERDEX_CLIENT_UNKNOWNSPACE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_kp_s_5)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":232 + * ,HYPERDEX_CLIENT_READONLY: 'Cluster is in a Read-Only State' + * ,HYPERDEX_CLIENT_UNKNOWNSPACE: 'Unknown Space' + * ,HYPERDEX_CLIENT_COORDFAIL: 'Coordinator Failure' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_SERVERERROR: 'Server Error' + * ,HYPERDEX_CLIENT_POLLFAILED: 'Polling Failed' + */ + __pyx_t_2 = PyInt_FromLong(HYPERDEX_CLIENT_COORDFAIL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_kp_s_6)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":233 + * ,HYPERDEX_CLIENT_UNKNOWNSPACE: 'Unknown Space' + * ,HYPERDEX_CLIENT_COORDFAIL: 'Coordinator Failure' + * ,HYPERDEX_CLIENT_SERVERERROR: 'Server Error' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_POLLFAILED: 'Polling Failed' + * ,HYPERDEX_CLIENT_OVERFLOW: 'Integer-overflow or divide-by-zero' + */ + __pyx_t_2 = PyInt_FromLong(HYPERDEX_CLIENT_SERVERERROR); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_kp_s_7)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":234 + * ,HYPERDEX_CLIENT_COORDFAIL: 'Coordinator Failure' + * ,HYPERDEX_CLIENT_SERVERERROR: 'Server Error' + * ,HYPERDEX_CLIENT_POLLFAILED: 'Polling Failed' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_OVERFLOW: 'Integer-overflow or divide-by-zero' + * ,HYPERDEX_CLIENT_RECONFIGURE: 'Reconfiguration' + */ + __pyx_t_2 = PyInt_FromLong(HYPERDEX_CLIENT_POLLFAILED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_kp_s_8)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":235 + * ,HYPERDEX_CLIENT_SERVERERROR: 'Server Error' + * ,HYPERDEX_CLIENT_POLLFAILED: 'Polling Failed' + * ,HYPERDEX_CLIENT_OVERFLOW: 'Integer-overflow or divide-by-zero' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_RECONFIGURE: 'Reconfiguration' + * ,HYPERDEX_CLIENT_TIMEOUT: 'Timeout' + */ + __pyx_t_2 = PyInt_FromLong(HYPERDEX_CLIENT_OVERFLOW); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_kp_s_9)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":236 + * ,HYPERDEX_CLIENT_POLLFAILED: 'Polling Failed' + * ,HYPERDEX_CLIENT_OVERFLOW: 'Integer-overflow or divide-by-zero' + * ,HYPERDEX_CLIENT_RECONFIGURE: 'Reconfiguration' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_TIMEOUT: 'Timeout' + * ,HYPERDEX_CLIENT_UNKNOWNATTR: 'Unknown attribute "%s"' % attr + */ + __pyx_t_2 = PyInt_FromLong(HYPERDEX_CLIENT_RECONFIGURE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_n_s__Reconfiguration)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":237 + * ,HYPERDEX_CLIENT_OVERFLOW: 'Integer-overflow or divide-by-zero' + * ,HYPERDEX_CLIENT_RECONFIGURE: 'Reconfiguration' + * ,HYPERDEX_CLIENT_TIMEOUT: 'Timeout' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_UNKNOWNATTR: 'Unknown attribute "%s"' % attr + * ,HYPERDEX_CLIENT_DUPEATTR: 'Duplicate attribute "%s"' % attr + */ + __pyx_t_2 = PyInt_FromLong(HYPERDEX_CLIENT_TIMEOUT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_n_s__Timeout)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":238 + * ,HYPERDEX_CLIENT_RECONFIGURE: 'Reconfiguration' + * ,HYPERDEX_CLIENT_TIMEOUT: 'Timeout' + * ,HYPERDEX_CLIENT_UNKNOWNATTR: 'Unknown attribute "%s"' % attr # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_DUPEATTR: 'Duplicate attribute "%s"' % attr + * ,HYPERDEX_CLIENT_NONEPENDING: 'None pending' + */ + __pyx_t_2 = PyInt_FromLong(HYPERDEX_CLIENT_UNKNOWNATTR); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "_hyperdex_client.pyx":239 + * ,HYPERDEX_CLIENT_TIMEOUT: 'Timeout' + * ,HYPERDEX_CLIENT_UNKNOWNATTR: 'Unknown attribute "%s"' % attr + * ,HYPERDEX_CLIENT_DUPEATTR: 'Duplicate attribute "%s"' % attr # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_NONEPENDING: 'None pending' + * ,HYPERDEX_CLIENT_DONTUSEKEY: "Do not specify the key in a search predicate and do not redundantly specify the key for an insert" + */ + __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_10), __pyx_v_attr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __pyx_t_3 = PyInt_FromLong(HYPERDEX_CLIENT_DUPEATTR); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "_hyperdex_client.pyx":240 + * ,HYPERDEX_CLIENT_UNKNOWNATTR: 'Unknown attribute "%s"' % attr + * ,HYPERDEX_CLIENT_DUPEATTR: 'Duplicate attribute "%s"' % attr + * ,HYPERDEX_CLIENT_NONEPENDING: 'None pending' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_DONTUSEKEY: "Do not specify the key in a search predicate and do not redundantly specify the key for an insert" + * ,HYPERDEX_CLIENT_WRONGTYPE: 'Attribute "%s" has the wrong type' % attr + */ + __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_11), __pyx_v_attr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromLong(HYPERDEX_CLIENT_NONEPENDING); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_kp_s_12)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":241 + * ,HYPERDEX_CLIENT_DUPEATTR: 'Duplicate attribute "%s"' % attr + * ,HYPERDEX_CLIENT_NONEPENDING: 'None pending' + * ,HYPERDEX_CLIENT_DONTUSEKEY: "Do not specify the key in a search predicate and do not redundantly specify the key for an insert" # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_WRONGTYPE: 'Attribute "%s" has the wrong type' % attr + * ,HYPERDEX_CLIENT_NOMEM: 'Memory allocation failed' + */ + __pyx_t_2 = PyInt_FromLong(HYPERDEX_CLIENT_DONTUSEKEY); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_kp_s_13)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":242 + * ,HYPERDEX_CLIENT_NONEPENDING: 'None pending' + * ,HYPERDEX_CLIENT_DONTUSEKEY: "Do not specify the key in a search predicate and do not redundantly specify the key for an insert" + * ,HYPERDEX_CLIENT_WRONGTYPE: 'Attribute "%s" has the wrong type' % attr # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_NOMEM: 'Memory allocation failed' + * ,HYPERDEX_CLIENT_INTERRUPTED: 'Interrupted by a signal' + */ + __pyx_t_2 = PyInt_FromLong(HYPERDEX_CLIENT_WRONGTYPE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "_hyperdex_client.pyx":243 + * ,HYPERDEX_CLIENT_DONTUSEKEY: "Do not specify the key in a search predicate and do not redundantly specify the key for an insert" + * ,HYPERDEX_CLIENT_WRONGTYPE: 'Attribute "%s" has the wrong type' % attr + * ,HYPERDEX_CLIENT_NOMEM: 'Memory allocation failed' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_INTERRUPTED: 'Interrupted by a signal' + * ,HYPERDEX_CLIENT_CLUSTER_JUMP: 'The cluster changed identities' + */ + __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_14), __pyx_v_attr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __pyx_t_3 = PyInt_FromLong(HYPERDEX_CLIENT_NOMEM); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, ((PyObject *)__pyx_kp_s_15)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":244 + * ,HYPERDEX_CLIENT_WRONGTYPE: 'Attribute "%s" has the wrong type' % attr + * ,HYPERDEX_CLIENT_NOMEM: 'Memory allocation failed' + * ,HYPERDEX_CLIENT_INTERRUPTED: 'Interrupted by a signal' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_CLUSTER_JUMP: 'The cluster changed identities' + * ,HYPERDEX_CLIENT_INTERNAL: 'Internal Error (file a bug)' + */ + __pyx_t_3 = PyInt_FromLong(HYPERDEX_CLIENT_INTERRUPTED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, ((PyObject *)__pyx_kp_s_16)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":245 + * ,HYPERDEX_CLIENT_NOMEM: 'Memory allocation failed' + * ,HYPERDEX_CLIENT_INTERRUPTED: 'Interrupted by a signal' + * ,HYPERDEX_CLIENT_CLUSTER_JUMP: 'The cluster changed identities' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_INTERNAL: 'Internal Error (file a bug)' + * ,HYPERDEX_CLIENT_EXCEPTION: 'Internal Exception (file a bug)' + */ + __pyx_t_3 = PyInt_FromLong(HYPERDEX_CLIENT_CLUSTER_JUMP); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, ((PyObject *)__pyx_kp_s_17)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":246 + * ,HYPERDEX_CLIENT_INTERRUPTED: 'Interrupted by a signal' + * ,HYPERDEX_CLIENT_CLUSTER_JUMP: 'The cluster changed identities' + * ,HYPERDEX_CLIENT_INTERNAL: 'Internal Error (file a bug)' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_EXCEPTION: 'Internal Exception (file a bug)' + * ,HYPERDEX_CLIENT_GARBAGE: 'Internal Corruption (file a bug)' + */ + __pyx_t_3 = PyInt_FromLong(HYPERDEX_CLIENT_INTERNAL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, ((PyObject *)__pyx_kp_s_18)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":247 + * ,HYPERDEX_CLIENT_CLUSTER_JUMP: 'The cluster changed identities' + * ,HYPERDEX_CLIENT_INTERNAL: 'Internal Error (file a bug)' + * ,HYPERDEX_CLIENT_EXCEPTION: 'Internal Exception (file a bug)' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_GARBAGE: 'Internal Corruption (file a bug)' + * }.get(status, 'Unknown Error (file a bug)') + */ + __pyx_t_3 = PyInt_FromLong(HYPERDEX_CLIENT_EXCEPTION); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, ((PyObject *)__pyx_kp_s_19)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":248 + * ,HYPERDEX_CLIENT_INTERNAL: 'Internal Error (file a bug)' + * ,HYPERDEX_CLIENT_EXCEPTION: 'Internal Exception (file a bug)' + * ,HYPERDEX_CLIENT_GARBAGE: 'Internal Corruption (file a bug)' # <<<<<<<<<<<<<< + * }.get(status, 'Unknown Error (file a bug)') + * self._e = {HYPERDEX_CLIENT_SUCCESS: 'HYPERDEX_CLIENT_SUCCESS' + */ + __pyx_t_3 = PyInt_FromLong(HYPERDEX_CLIENT_GARBAGE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, ((PyObject *)__pyx_kp_s_20)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":249 + * ,HYPERDEX_CLIENT_EXCEPTION: 'Internal Exception (file a bug)' + * ,HYPERDEX_CLIENT_GARBAGE: 'Internal Corruption (file a bug)' + * }.get(status, 'Unknown Error (file a bug)') # <<<<<<<<<<<<<< + * self._e = {HYPERDEX_CLIENT_SUCCESS: 'HYPERDEX_CLIENT_SUCCESS' + * ,HYPERDEX_CLIENT_NOTFOUND: 'HYPERDEX_CLIENT_NOTFOUND' + */ + __pyx_t_3 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_t_1), __pyx_v_status, ((PyObject *)__pyx_kp_s_21)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":226 + * def __init__(self, status, attr=None): + * self._status = status + * self._s = {HYPERDEX_CLIENT_SUCCESS: 'Success' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_NOTFOUND: 'Not Found' + * ,HYPERDEX_CLIENT_SEARCHDONE: 'Search Done' + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s___s, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":250 + * ,HYPERDEX_CLIENT_GARBAGE: 'Internal Corruption (file a bug)' + * }.get(status, 'Unknown Error (file a bug)') + * self._e = {HYPERDEX_CLIENT_SUCCESS: 'HYPERDEX_CLIENT_SUCCESS' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_NOTFOUND: 'HYPERDEX_CLIENT_NOTFOUND' + * ,HYPERDEX_CLIENT_SEARCHDONE: 'HYPERDEX_CLIENT_SEARCHDONE' + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __pyx_t_1 = PyInt_FromLong(HYPERDEX_CLIENT_SUCCESS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_n_s_22)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":251 + * }.get(status, 'Unknown Error (file a bug)') + * self._e = {HYPERDEX_CLIENT_SUCCESS: 'HYPERDEX_CLIENT_SUCCESS' + * ,HYPERDEX_CLIENT_NOTFOUND: 'HYPERDEX_CLIENT_NOTFOUND' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_SEARCHDONE: 'HYPERDEX_CLIENT_SEARCHDONE' + * ,HYPERDEX_CLIENT_CMPFAIL: 'HYPERDEX_CLIENT_CMPFAIL' + */ + __pyx_t_1 = PyInt_FromLong(HYPERDEX_CLIENT_NOTFOUND); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_n_s_23)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":252 + * self._e = {HYPERDEX_CLIENT_SUCCESS: 'HYPERDEX_CLIENT_SUCCESS' + * ,HYPERDEX_CLIENT_NOTFOUND: 'HYPERDEX_CLIENT_NOTFOUND' + * ,HYPERDEX_CLIENT_SEARCHDONE: 'HYPERDEX_CLIENT_SEARCHDONE' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_CMPFAIL: 'HYPERDEX_CLIENT_CMPFAIL' + * ,HYPERDEX_CLIENT_READONLY: 'HYPERDEX_CLIENT_READONLY' + */ + __pyx_t_1 = PyInt_FromLong(HYPERDEX_CLIENT_SEARCHDONE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_n_s_24)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":253 + * ,HYPERDEX_CLIENT_NOTFOUND: 'HYPERDEX_CLIENT_NOTFOUND' + * ,HYPERDEX_CLIENT_SEARCHDONE: 'HYPERDEX_CLIENT_SEARCHDONE' + * ,HYPERDEX_CLIENT_CMPFAIL: 'HYPERDEX_CLIENT_CMPFAIL' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_READONLY: 'HYPERDEX_CLIENT_READONLY' + * ,HYPERDEX_CLIENT_UNKNOWNSPACE: 'HYPERDEX_CLIENT_UNKNOWNSPACE' + */ + __pyx_t_1 = PyInt_FromLong(HYPERDEX_CLIENT_CMPFAIL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_n_s_25)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":254 + * ,HYPERDEX_CLIENT_SEARCHDONE: 'HYPERDEX_CLIENT_SEARCHDONE' + * ,HYPERDEX_CLIENT_CMPFAIL: 'HYPERDEX_CLIENT_CMPFAIL' + * ,HYPERDEX_CLIENT_READONLY: 'HYPERDEX_CLIENT_READONLY' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_UNKNOWNSPACE: 'HYPERDEX_CLIENT_UNKNOWNSPACE' + * ,HYPERDEX_CLIENT_COORDFAIL: 'HYPERDEX_CLIENT_COORDFAIL' + */ + __pyx_t_1 = PyInt_FromLong(HYPERDEX_CLIENT_READONLY); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_n_s_26)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":255 + * ,HYPERDEX_CLIENT_CMPFAIL: 'HYPERDEX_CLIENT_CMPFAIL' + * ,HYPERDEX_CLIENT_READONLY: 'HYPERDEX_CLIENT_READONLY' + * ,HYPERDEX_CLIENT_UNKNOWNSPACE: 'HYPERDEX_CLIENT_UNKNOWNSPACE' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_COORDFAIL: 'HYPERDEX_CLIENT_COORDFAIL' + * ,HYPERDEX_CLIENT_SERVERERROR: 'HYPERDEX_CLIENT_SERVERERROR' + */ + __pyx_t_1 = PyInt_FromLong(HYPERDEX_CLIENT_UNKNOWNSPACE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_n_s_27)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":256 + * ,HYPERDEX_CLIENT_READONLY: 'HYPERDEX_CLIENT_READONLY' + * ,HYPERDEX_CLIENT_UNKNOWNSPACE: 'HYPERDEX_CLIENT_UNKNOWNSPACE' + * ,HYPERDEX_CLIENT_COORDFAIL: 'HYPERDEX_CLIENT_COORDFAIL' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_SERVERERROR: 'HYPERDEX_CLIENT_SERVERERROR' + * ,HYPERDEX_CLIENT_POLLFAILED: 'HYPERDEX_CLIENT_POLLFAILED' + */ + __pyx_t_1 = PyInt_FromLong(HYPERDEX_CLIENT_COORDFAIL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_n_s_28)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":257 + * ,HYPERDEX_CLIENT_UNKNOWNSPACE: 'HYPERDEX_CLIENT_UNKNOWNSPACE' + * ,HYPERDEX_CLIENT_COORDFAIL: 'HYPERDEX_CLIENT_COORDFAIL' + * ,HYPERDEX_CLIENT_SERVERERROR: 'HYPERDEX_CLIENT_SERVERERROR' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_POLLFAILED: 'HYPERDEX_CLIENT_POLLFAILED' + * ,HYPERDEX_CLIENT_OVERFLOW: 'HYPERDEX_CLIENT_OVERFLOW' + */ + __pyx_t_1 = PyInt_FromLong(HYPERDEX_CLIENT_SERVERERROR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_n_s_29)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":258 + * ,HYPERDEX_CLIENT_COORDFAIL: 'HYPERDEX_CLIENT_COORDFAIL' + * ,HYPERDEX_CLIENT_SERVERERROR: 'HYPERDEX_CLIENT_SERVERERROR' + * ,HYPERDEX_CLIENT_POLLFAILED: 'HYPERDEX_CLIENT_POLLFAILED' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_OVERFLOW: 'HYPERDEX_CLIENT_OVERFLOW' + * ,HYPERDEX_CLIENT_RECONFIGURE: 'HYPERDEX_CLIENT_RECONFIGURE' + */ + __pyx_t_1 = PyInt_FromLong(HYPERDEX_CLIENT_POLLFAILED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_n_s_30)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":259 + * ,HYPERDEX_CLIENT_SERVERERROR: 'HYPERDEX_CLIENT_SERVERERROR' + * ,HYPERDEX_CLIENT_POLLFAILED: 'HYPERDEX_CLIENT_POLLFAILED' + * ,HYPERDEX_CLIENT_OVERFLOW: 'HYPERDEX_CLIENT_OVERFLOW' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_RECONFIGURE: 'HYPERDEX_CLIENT_RECONFIGURE' + * ,HYPERDEX_CLIENT_TIMEOUT: 'HYPERDEX_CLIENT_TIMEOUT' + */ + __pyx_t_1 = PyInt_FromLong(HYPERDEX_CLIENT_OVERFLOW); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_n_s_31)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":260 + * ,HYPERDEX_CLIENT_POLLFAILED: 'HYPERDEX_CLIENT_POLLFAILED' + * ,HYPERDEX_CLIENT_OVERFLOW: 'HYPERDEX_CLIENT_OVERFLOW' + * ,HYPERDEX_CLIENT_RECONFIGURE: 'HYPERDEX_CLIENT_RECONFIGURE' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_TIMEOUT: 'HYPERDEX_CLIENT_TIMEOUT' + * ,HYPERDEX_CLIENT_UNKNOWNATTR: 'HYPERDEX_CLIENT_UNKNOWNATTR' + */ + __pyx_t_1 = PyInt_FromLong(HYPERDEX_CLIENT_RECONFIGURE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_n_s_32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":261 + * ,HYPERDEX_CLIENT_OVERFLOW: 'HYPERDEX_CLIENT_OVERFLOW' + * ,HYPERDEX_CLIENT_RECONFIGURE: 'HYPERDEX_CLIENT_RECONFIGURE' + * ,HYPERDEX_CLIENT_TIMEOUT: 'HYPERDEX_CLIENT_TIMEOUT' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_UNKNOWNATTR: 'HYPERDEX_CLIENT_UNKNOWNATTR' + * ,HYPERDEX_CLIENT_DUPEATTR: 'HYPERDEX_CLIENT_DUPEATTR' + */ + __pyx_t_1 = PyInt_FromLong(HYPERDEX_CLIENT_TIMEOUT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_n_s_33)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":262 + * ,HYPERDEX_CLIENT_RECONFIGURE: 'HYPERDEX_CLIENT_RECONFIGURE' + * ,HYPERDEX_CLIENT_TIMEOUT: 'HYPERDEX_CLIENT_TIMEOUT' + * ,HYPERDEX_CLIENT_UNKNOWNATTR: 'HYPERDEX_CLIENT_UNKNOWNATTR' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_DUPEATTR: 'HYPERDEX_CLIENT_DUPEATTR' + * ,HYPERDEX_CLIENT_NONEPENDING: 'HYPERDEX_CLIENT_NONEPENDING' + */ + __pyx_t_1 = PyInt_FromLong(HYPERDEX_CLIENT_UNKNOWNATTR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_n_s_34)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":263 + * ,HYPERDEX_CLIENT_TIMEOUT: 'HYPERDEX_CLIENT_TIMEOUT' + * ,HYPERDEX_CLIENT_UNKNOWNATTR: 'HYPERDEX_CLIENT_UNKNOWNATTR' + * ,HYPERDEX_CLIENT_DUPEATTR: 'HYPERDEX_CLIENT_DUPEATTR' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_NONEPENDING: 'HYPERDEX_CLIENT_NONEPENDING' + * ,HYPERDEX_CLIENT_DONTUSEKEY: 'HYPERDEX_CLIENT_DONTUSEKEY' + */ + __pyx_t_1 = PyInt_FromLong(HYPERDEX_CLIENT_DUPEATTR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_n_s_35)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":264 + * ,HYPERDEX_CLIENT_UNKNOWNATTR: 'HYPERDEX_CLIENT_UNKNOWNATTR' + * ,HYPERDEX_CLIENT_DUPEATTR: 'HYPERDEX_CLIENT_DUPEATTR' + * ,HYPERDEX_CLIENT_NONEPENDING: 'HYPERDEX_CLIENT_NONEPENDING' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_DONTUSEKEY: 'HYPERDEX_CLIENT_DONTUSEKEY' + * ,HYPERDEX_CLIENT_WRONGTYPE: 'HYPERDEX_CLIENT_WRONGTYPE' + */ + __pyx_t_1 = PyInt_FromLong(HYPERDEX_CLIENT_NONEPENDING); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_n_s_36)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":265 + * ,HYPERDEX_CLIENT_DUPEATTR: 'HYPERDEX_CLIENT_DUPEATTR' + * ,HYPERDEX_CLIENT_NONEPENDING: 'HYPERDEX_CLIENT_NONEPENDING' + * ,HYPERDEX_CLIENT_DONTUSEKEY: 'HYPERDEX_CLIENT_DONTUSEKEY' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_WRONGTYPE: 'HYPERDEX_CLIENT_WRONGTYPE' + * ,HYPERDEX_CLIENT_NOMEM: 'HYPERDEX_CLIENT_NOMEM' + */ + __pyx_t_1 = PyInt_FromLong(HYPERDEX_CLIENT_DONTUSEKEY); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_n_s_37)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":266 + * ,HYPERDEX_CLIENT_NONEPENDING: 'HYPERDEX_CLIENT_NONEPENDING' + * ,HYPERDEX_CLIENT_DONTUSEKEY: 'HYPERDEX_CLIENT_DONTUSEKEY' + * ,HYPERDEX_CLIENT_WRONGTYPE: 'HYPERDEX_CLIENT_WRONGTYPE' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_NOMEM: 'HYPERDEX_CLIENT_NOMEM' + * ,HYPERDEX_CLIENT_INTERRUPTED: 'HYPERDEX_CLIENT_INTERRUPTED' + */ + __pyx_t_1 = PyInt_FromLong(HYPERDEX_CLIENT_WRONGTYPE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_n_s_38)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":267 + * ,HYPERDEX_CLIENT_DONTUSEKEY: 'HYPERDEX_CLIENT_DONTUSEKEY' + * ,HYPERDEX_CLIENT_WRONGTYPE: 'HYPERDEX_CLIENT_WRONGTYPE' + * ,HYPERDEX_CLIENT_NOMEM: 'HYPERDEX_CLIENT_NOMEM' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_INTERRUPTED: 'HYPERDEX_CLIENT_INTERRUPTED' + * ,HYPERDEX_CLIENT_CLUSTER_JUMP: 'HYPERDEX_CLIENT_CLUSTER_JUMP' + */ + __pyx_t_1 = PyInt_FromLong(HYPERDEX_CLIENT_NOMEM); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_n_s_39)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":268 + * ,HYPERDEX_CLIENT_WRONGTYPE: 'HYPERDEX_CLIENT_WRONGTYPE' + * ,HYPERDEX_CLIENT_NOMEM: 'HYPERDEX_CLIENT_NOMEM' + * ,HYPERDEX_CLIENT_INTERRUPTED: 'HYPERDEX_CLIENT_INTERRUPTED' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_CLUSTER_JUMP: 'HYPERDEX_CLIENT_CLUSTER_JUMP' + * ,HYPERDEX_CLIENT_INTERNAL: 'HYPERDEX_CLIENT_INTERNAL' + */ + __pyx_t_1 = PyInt_FromLong(HYPERDEX_CLIENT_INTERRUPTED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_n_s_40)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":269 + * ,HYPERDEX_CLIENT_NOMEM: 'HYPERDEX_CLIENT_NOMEM' + * ,HYPERDEX_CLIENT_INTERRUPTED: 'HYPERDEX_CLIENT_INTERRUPTED' + * ,HYPERDEX_CLIENT_CLUSTER_JUMP: 'HYPERDEX_CLIENT_CLUSTER_JUMP' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_INTERNAL: 'HYPERDEX_CLIENT_INTERNAL' + * ,HYPERDEX_CLIENT_EXCEPTION: 'HYPERDEX_CLIENT_EXCEPTION' + */ + __pyx_t_1 = PyInt_FromLong(HYPERDEX_CLIENT_CLUSTER_JUMP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_n_s_41)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":270 + * ,HYPERDEX_CLIENT_INTERRUPTED: 'HYPERDEX_CLIENT_INTERRUPTED' + * ,HYPERDEX_CLIENT_CLUSTER_JUMP: 'HYPERDEX_CLIENT_CLUSTER_JUMP' + * ,HYPERDEX_CLIENT_INTERNAL: 'HYPERDEX_CLIENT_INTERNAL' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_EXCEPTION: 'HYPERDEX_CLIENT_EXCEPTION' + * ,HYPERDEX_CLIENT_GARBAGE: 'HYPERDEX_CLIENT_GARBAGE' + */ + __pyx_t_1 = PyInt_FromLong(HYPERDEX_CLIENT_INTERNAL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_n_s_42)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":271 + * ,HYPERDEX_CLIENT_CLUSTER_JUMP: 'HYPERDEX_CLIENT_CLUSTER_JUMP' + * ,HYPERDEX_CLIENT_INTERNAL: 'HYPERDEX_CLIENT_INTERNAL' + * ,HYPERDEX_CLIENT_EXCEPTION: 'HYPERDEX_CLIENT_EXCEPTION' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_GARBAGE: 'HYPERDEX_CLIENT_GARBAGE' + * }.get(status, 'BUG') + */ + __pyx_t_1 = PyInt_FromLong(HYPERDEX_CLIENT_EXCEPTION); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_n_s_43)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":272 + * ,HYPERDEX_CLIENT_INTERNAL: 'HYPERDEX_CLIENT_INTERNAL' + * ,HYPERDEX_CLIENT_EXCEPTION: 'HYPERDEX_CLIENT_EXCEPTION' + * ,HYPERDEX_CLIENT_GARBAGE: 'HYPERDEX_CLIENT_GARBAGE' # <<<<<<<<<<<<<< + * }.get(status, 'BUG') + * + */ + __pyx_t_1 = PyInt_FromLong(HYPERDEX_CLIENT_GARBAGE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_n_s_44)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":273 + * ,HYPERDEX_CLIENT_EXCEPTION: 'HYPERDEX_CLIENT_EXCEPTION' + * ,HYPERDEX_CLIENT_GARBAGE: 'HYPERDEX_CLIENT_GARBAGE' + * }.get(status, 'BUG') # <<<<<<<<<<<<<< + * + * def status(self): + */ + __pyx_t_1 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_t_3), __pyx_v_status, ((PyObject *)__pyx_n_s__BUG)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":250 + * ,HYPERDEX_CLIENT_GARBAGE: 'Internal Corruption (file a bug)' + * }.get(status, 'Unknown Error (file a bug)') + * self._e = {HYPERDEX_CLIENT_SUCCESS: 'HYPERDEX_CLIENT_SUCCESS' # <<<<<<<<<<<<<< + * ,HYPERDEX_CLIENT_NOTFOUND: 'HYPERDEX_CLIENT_NOTFOUND' + * ,HYPERDEX_CLIENT_SEARCHDONE: 'HYPERDEX_CLIENT_SEARCHDONE' + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s___e, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + __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("_hyperdex_client.HyperClientException.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_20HyperClientException_3status(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_16_hyperdex_client_20HyperClientException_3status = {__Pyx_NAMESTR("status"), (PyCFunction)__pyx_pw_16_hyperdex_client_20HyperClientException_3status, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_16_hyperdex_client_20HyperClientException_3status(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("status (wrapper)", 0); + __pyx_r = __pyx_pf_16_hyperdex_client_20HyperClientException_2status(__pyx_self, ((PyObject *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":275 + * }.get(status, 'BUG') + * + * def status(self): # <<<<<<<<<<<<<< + * return self._status + * + */ + +static PyObject *__pyx_pf_16_hyperdex_client_20HyperClientException_2status(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("status", 0); + + /* "_hyperdex_client.pyx":276 + * + * def status(self): + * return self._status # <<<<<<<<<<<<<< + * + * def symbol(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s___status); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("_hyperdex_client.HyperClientException.status", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_20HyperClientException_5symbol(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_16_hyperdex_client_20HyperClientException_5symbol = {__Pyx_NAMESTR("symbol"), (PyCFunction)__pyx_pw_16_hyperdex_client_20HyperClientException_5symbol, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_16_hyperdex_client_20HyperClientException_5symbol(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("symbol (wrapper)", 0); + __pyx_r = __pyx_pf_16_hyperdex_client_20HyperClientException_4symbol(__pyx_self, ((PyObject *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":278 + * return self._status + * + * def symbol(self): # <<<<<<<<<<<<<< + * return self._e + * + */ + +static PyObject *__pyx_pf_16_hyperdex_client_20HyperClientException_4symbol(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("symbol", 0); + + /* "_hyperdex_client.pyx":279 + * + * def symbol(self): + * return self._e # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s___e); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("_hyperdex_client.HyperClientException.symbol", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_20HyperClientException_7__str__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_16_hyperdex_client_20HyperClientException_7__str__ = {__Pyx_NAMESTR("__str__"), (PyCFunction)__pyx_pw_16_hyperdex_client_20HyperClientException_7__str__, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_16_hyperdex_client_20HyperClientException_7__str__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_pf_16_hyperdex_client_20HyperClientException_6__str__(__pyx_self, ((PyObject *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":281 + * return self._e + * + * def __str__(self): # <<<<<<<<<<<<<< + * return 'HyperClient(%s, %s)' % (self._e, self._s) + * + */ + +static PyObject *__pyx_pf_16_hyperdex_client_20HyperClientException_6__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; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__str__", 0); + + /* "_hyperdex_client.pyx":282 + * + * def __str__(self): + * return 'HyperClient(%s, %s)' % (self._e, self._s) # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s___e); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s___s); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_45), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __pyx_r = ((PyObject *)__pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.HyperClientException.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_20HyperClientException_9__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_16_hyperdex_client_20HyperClientException_9__repr__ = {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pw_16_hyperdex_client_20HyperClientException_9__repr__, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_16_hyperdex_client_20HyperClientException_9__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_16_hyperdex_client_20HyperClientException_8__repr__(__pyx_self, ((PyObject *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":284 + * return 'HyperClient(%s, %s)' % (self._e, self._s) + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return str(self) + * + */ + +static PyObject *__pyx_pf_16_hyperdex_client_20HyperClientException_8__repr__(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; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "_hyperdex_client.pyx":285 + * + * def __repr__(self): + * return str(self) # <<<<<<<<<<<<<< + * + * def __eq__(self, other): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.HyperClientException.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_20HyperClientException_11__eq__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_16_hyperdex_client_20HyperClientException_11__eq__ = {__Pyx_NAMESTR("__eq__"), (PyCFunction)__pyx_pw_16_hyperdex_client_20HyperClientException_11__eq__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_16_hyperdex_client_20HyperClientException_11__eq__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_other = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__other,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__other)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__eq__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __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_other = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.HyperClientException.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_16_hyperdex_client_20HyperClientException_10__eq__(__pyx_self, __pyx_v_self, __pyx_v_other); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":287 + * return str(self) + * + * def __eq__(self, other): # <<<<<<<<<<<<<< + * if self.__class__ != other.__class__: + * return False + */ + +static PyObject *__pyx_pf_16_hyperdex_client_20HyperClientException_10__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other) { + 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_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__eq__", 0); + + /* "_hyperdex_client.pyx":288 + * + * def __eq__(self, other): + * if self.__class__ != other.__class__: # <<<<<<<<<<<<<< + * return False + * return self._status == other._status + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s____class__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s____class__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { + + /* "_hyperdex_client.pyx":289 + * def __eq__(self, other): + * if self.__class__ != other.__class__: + * return False # <<<<<<<<<<<<<< + * return self._status == other._status + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "_hyperdex_client.pyx":290 + * if self.__class__ != other.__class__: + * return False + * return self._status == other._status # <<<<<<<<<<<<<< + * + * def __ne__(self, other): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s___status); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s___status); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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; + + __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("_hyperdex_client.HyperClientException.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_20HyperClientException_13__ne__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_16_hyperdex_client_20HyperClientException_13__ne__ = {__Pyx_NAMESTR("__ne__"), (PyCFunction)__pyx_pw_16_hyperdex_client_20HyperClientException_13__ne__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_16_hyperdex_client_20HyperClientException_13__ne__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_other = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__ne__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__other,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__other)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__ne__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__ne__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __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_other = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__ne__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.HyperClientException.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_16_hyperdex_client_20HyperClientException_12__ne__(__pyx_self, __pyx_v_self, __pyx_v_other); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":292 + * return self._status == other._status + * + * def __ne__(self, other): # <<<<<<<<<<<<<< + * return not (self == other) + * + */ + +static PyObject *__pyx_pf_16_hyperdex_client_20HyperClientException_12__ne__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__ne__", 0); + + /* "_hyperdex_client.pyx":293 + * + * def __ne__(self, other): + * return not (self == other) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyObject_RichCompare(__pyx_v_self, __pyx_v_other, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyBool_FromLong((!__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("_hyperdex_client.HyperClientException.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_1__sort_key(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/ +static PyMethodDef __pyx_mdef_16_hyperdex_client_1__sort_key = {__Pyx_NAMESTR("__sort_key"), (PyCFunction)__pyx_pw_16_hyperdex_client_1__sort_key, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_16_hyperdex_client_1__sort_key(PyObject *__pyx_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__sort_key (wrapper)", 0); + __pyx_r = __pyx_pf_16_hyperdex_client___sort_key(__pyx_self, ((PyObject *)__pyx_v_obj)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":296 + * + * + * def __sort_key(obj): # <<<<<<<<<<<<<< + * if isinstance(obj, bytes): + * return tuple([ord(c) for c in obj]) + */ + +static PyObject *__pyx_pf_16_hyperdex_client___sort_key(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_v_c = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__sort_key", 0); + + /* "_hyperdex_client.pyx":297 + * + * def __sort_key(obj): + * if isinstance(obj, bytes): # <<<<<<<<<<<<<< + * return tuple([ord(c) for c in obj]) + * return obj + */ + __pyx_t_1 = PyBytes_Check(__pyx_v_obj); + if (__pyx_t_1) { + + /* "_hyperdex_client.pyx":298 + * def __sort_key(obj): + * if isinstance(obj, bytes): + * return tuple([ord(c) for c in obj]) # <<<<<<<<<<<<<< + * return obj + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyList_CheckExact(__pyx_v_obj) || PyTuple_CheckExact(__pyx_v_obj)) { + __pyx_t_3 = __pyx_v_obj; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_obj); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + for (;;) { + if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_6 = __pyx_t_5(__pyx_t_3); + if (unlikely(!__pyx_t_6)) { + if (PyErr_Occurred()) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF(__pyx_v_c); + __pyx_v_c = __pyx_t_6; + __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_c); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_c); + __Pyx_GIVEREF(__pyx_v_c); + __pyx_t_7 = PyObject_Call(__pyx_builtin_ord, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_7))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = ((PyObject *)PyList_AsTuple(((PyObject*)__pyx_t_2))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_r = ((PyObject *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "_hyperdex_client.pyx":299 + * if isinstance(obj, bytes): + * return tuple([ord(c) for c in obj]) + * return obj # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_obj); + __pyx_r = __pyx_v_obj; + goto __pyx_L0; + + __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_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("_hyperdex_client.__sort_key", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_c); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":302 + * + * + * cdef _obj_to_backing(v): # <<<<<<<<<<<<<< + * cdef backing = b'' + * cdef datatype = None + */ + +static PyObject *__pyx_f_16_hyperdex_client__obj_to_backing(PyObject *__pyx_v_v) { + PyObject *__pyx_v_backing = 0; + PyObject *__pyx_v_datatype = 0; + enum hyperdatatype __pyx_v_keytype; + enum hyperdatatype __pyx_v_valtype; + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_innerxtype = NULL; + PyObject *__pyx_v_innerxbacking = NULL; + PyObject *__pyx_v_dtypes = NULL; + PyObject *__pyx_v_y = NULL; + PyObject *__pyx_v_innerytype = NULL; + PyObject *__pyx_v_innerybacking = 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; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *(*__pyx_t_8)(PyObject *); + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + enum hyperdatatype __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *(*__pyx_t_13)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_obj_to_backing", 0); + + /* "_hyperdex_client.pyx":303 + * + * cdef _obj_to_backing(v): + * cdef backing = b'' # <<<<<<<<<<<<<< + * cdef datatype = None + * cdef hyperdatatype keytype = HYPERDATATYPE_GARBAGE + */ + __Pyx_INCREF(((PyObject *)__pyx_kp_b_46)); + __pyx_v_backing = ((PyObject *)__pyx_kp_b_46); + + /* "_hyperdex_client.pyx":304 + * cdef _obj_to_backing(v): + * cdef backing = b'' + * cdef datatype = None # <<<<<<<<<<<<<< + * cdef hyperdatatype keytype = HYPERDATATYPE_GARBAGE + * cdef hyperdatatype valtype = HYPERDATATYPE_GARBAGE + */ + __Pyx_INCREF(Py_None); + __pyx_v_datatype = Py_None; + + /* "_hyperdex_client.pyx":305 + * cdef backing = b'' + * cdef datatype = None + * cdef hyperdatatype keytype = HYPERDATATYPE_GARBAGE # <<<<<<<<<<<<<< + * cdef hyperdatatype valtype = HYPERDATATYPE_GARBAGE + * if isinstance(v, bytes): + */ + __pyx_v_keytype = HYPERDATATYPE_GARBAGE; + + /* "_hyperdex_client.pyx":306 + * cdef datatype = None + * cdef hyperdatatype keytype = HYPERDATATYPE_GARBAGE + * cdef hyperdatatype valtype = HYPERDATATYPE_GARBAGE # <<<<<<<<<<<<<< + * if isinstance(v, bytes): + * backing = v + */ + __pyx_v_valtype = HYPERDATATYPE_GARBAGE; + + /* "_hyperdex_client.pyx":307 + * cdef hyperdatatype keytype = HYPERDATATYPE_GARBAGE + * cdef hyperdatatype valtype = HYPERDATATYPE_GARBAGE + * if isinstance(v, bytes): # <<<<<<<<<<<<<< + * backing = v + * datatype = HYPERDATATYPE_STRING + */ + __pyx_t_1 = PyBytes_Check(__pyx_v_v); + if (__pyx_t_1) { + + /* "_hyperdex_client.pyx":308 + * cdef hyperdatatype valtype = HYPERDATATYPE_GARBAGE + * if isinstance(v, bytes): + * backing = v # <<<<<<<<<<<<<< + * datatype = HYPERDATATYPE_STRING + * elif isinstance(v, int): + */ + __Pyx_INCREF(__pyx_v_v); + __Pyx_DECREF(__pyx_v_backing); + __pyx_v_backing = __pyx_v_v; + + /* "_hyperdex_client.pyx":309 + * if isinstance(v, bytes): + * backing = v + * datatype = HYPERDATATYPE_STRING # <<<<<<<<<<<<<< + * elif isinstance(v, int): + * backing = struct.pack('tp_iternext; + } + for (;;) { + if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_4 = __pyx_t_8(__pyx_t_3); + if (unlikely(!__pyx_t_4)) { + if (PyErr_Occurred()) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XDECREF(__pyx_v_x); + __pyx_v_x = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_t_6 = PyInt_Check(__pyx_v_x); + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_builtin_all, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_6) { + + /* "_hyperdex_client.pyx":322 + * datatype = HYPERDATATYPE_LIST_GENERIC + * if all([isinstance(x, int) for x in v]): + * for x in v: # <<<<<<<<<<<<<< + * backing += struct.pack('tp_iternext; + } + for (;;) { + if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_3 = __pyx_t_8(__pyx_t_2); + if (unlikely(!__pyx_t_3)) { + if (PyErr_Occurred()) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_XDECREF(__pyx_v_x); + __pyx_v_x = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":323 + * if all([isinstance(x, int) for x in v]): + * for x in v: + * backing += struct.pack('tp_iternext; + } + for (;;) { + if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_9 = __pyx_t_8(__pyx_t_3); + if (unlikely(!__pyx_t_9)) { + if (PyErr_Occurred()) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_9); + } + __Pyx_XDECREF(__pyx_v_x); + __pyx_v_x = __pyx_t_9; + __pyx_t_9 = 0; + __pyx_t_6 = PyBytes_Check(__pyx_v_x); + __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_9))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_builtin_all, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_6) { + + /* "_hyperdex_client.pyx":326 + * datatype = HYPERDATATYPE_LIST_INT64 + * elif all([isinstance(x, bytes) for x in v]): + * for x in v: # <<<<<<<<<<<<<< + * backing += struct.pack('tp_iternext; + } + for (;;) { + if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_3 = __pyx_t_8(__pyx_t_2); + if (unlikely(!__pyx_t_3)) { + if (PyErr_Occurred()) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_XDECREF(__pyx_v_x); + __pyx_v_x = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":327 + * elif all([isinstance(x, bytes) for x in v]): + * for x in v: + * backing += struct.pack('tp_iternext; + } + for (;;) { + if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_3 = __pyx_t_8(__pyx_t_4); + if (unlikely(!__pyx_t_3)) { + if (PyErr_Occurred()) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_XDECREF(__pyx_v_x); + __pyx_v_x = __pyx_t_3; + __pyx_t_3 = 0; + __pyx_t_6 = PyFloat_Check(__pyx_v_x); + __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_2)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_builtin_all, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_6) { + + /* "_hyperdex_client.pyx":331 + * datatype = HYPERDATATYPE_LIST_STRING + * elif all([isinstance(x, float) for x in v]): + * for x in v: # <<<<<<<<<<<<<< + * backing += struct.pack('tp_iternext; + } + for (;;) { + if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_4 = __pyx_t_8(__pyx_t_2); + if (unlikely(!__pyx_t_4)) { + if (PyErr_Occurred()) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XDECREF(__pyx_v_x); + __pyx_v_x = __pyx_t_4; + __pyx_t_4 = 0; + + /* "_hyperdex_client.pyx":332 + * elif all([isinstance(x, float) for x in v]): + * for x in v: + * backing += struct.pack(' 1: + */ + __pyx_t_6 = PySet_Check(__pyx_v_v); + if (__pyx_t_6) { + + /* "_hyperdex_client.pyx":337 + * raise TypeError("Cannot store heterogeneous lists") + * elif isinstance(v, set): + * keytype = HYPERDATATYPE_SET_GENERIC # <<<<<<<<<<<<<< + * if len(set([x.__class__ for x in v])) > 1: + * raise TypeError("Cannot store heterogeneous sets") + */ + __pyx_v_keytype = HYPERDATATYPE_SET_GENERIC; + + /* "_hyperdex_client.pyx":338 + * elif isinstance(v, set): + * keytype = HYPERDATATYPE_SET_GENERIC + * if len(set([x.__class__ for x in v])) > 1: # <<<<<<<<<<<<<< + * raise TypeError("Cannot store heterogeneous sets") + * for x in sorted(v, key=__sort_key): + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyList_CheckExact(__pyx_v_v) || PyTuple_CheckExact(__pyx_v_v)) { + __pyx_t_4 = __pyx_v_v; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_v); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + for (;;) { + if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_9 = __pyx_t_8(__pyx_t_4); + if (unlikely(!__pyx_t_9)) { + if (PyErr_Occurred()) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_9); + } + __Pyx_XDECREF(__pyx_v_x); + __pyx_v_x = __pyx_t_9; + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s____class__); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_9))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_2)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __pyx_t_7 = PySet_Size(__pyx_t_2); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = (__pyx_t_7 > 1); + if (__pyx_t_6) { + + /* "_hyperdex_client.pyx":339 + * keytype = HYPERDATATYPE_SET_GENERIC + * if len(set([x.__class__ for x in v])) > 1: + * raise TypeError("Cannot store heterogeneous sets") # <<<<<<<<<<<<<< + * for x in sorted(v, key=__sort_key): + * if isinstance(x, bytes): + */ + __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_53), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L17; + } + __pyx_L17:; + + /* "_hyperdex_client.pyx":340 + * if len(set([x.__class__ for x in v])) > 1: + * raise TypeError("Cannot store heterogeneous sets") + * for x in sorted(v, key=__sort_key): # <<<<<<<<<<<<<< + * if isinstance(x, bytes): + * innerxtype = HYPERDATATYPE_SET_STRING + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_v); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_v); + __Pyx_GIVEREF(__pyx_v_v); + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s____sort_key); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__key), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + if (PyList_CheckExact(__pyx_t_9) || PyTuple_CheckExact(__pyx_t_9)) { + __pyx_t_4 = __pyx_t_9; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + for (;;) { + if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_9 = __pyx_t_8(__pyx_t_4); + if (unlikely(!__pyx_t_9)) { + if (PyErr_Occurred()) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_9); + } + __Pyx_XDECREF(__pyx_v_x); + __pyx_v_x = __pyx_t_9; + __pyx_t_9 = 0; + + /* "_hyperdex_client.pyx":341 + * raise TypeError("Cannot store heterogeneous sets") + * for x in sorted(v, key=__sort_key): + * if isinstance(x, bytes): # <<<<<<<<<<<<<< + * innerxtype = HYPERDATATYPE_SET_STRING + * innerxbacking = struct.pack(' 1: + */ + __pyx_v_keytype = HYPERDATATYPE_MAP_GENERIC; + + /* "_hyperdex_client.pyx":362 + * elif isinstance(v, dict): + * keytype = HYPERDATATYPE_MAP_GENERIC + * valtype = HYPERDATATYPE_MAP_GENERIC # <<<<<<<<<<<<<< + * if len(set([x.__class__ for x in v.keys()])) > 1: + * raise TypeError("Cannot store heterogeneous maps") + */ + __pyx_v_valtype = HYPERDATATYPE_MAP_GENERIC; + + /* "_hyperdex_client.pyx":363 + * keytype = HYPERDATATYPE_MAP_GENERIC + * valtype = HYPERDATATYPE_MAP_GENERIC + * if len(set([x.__class__ for x in v.keys()])) > 1: # <<<<<<<<<<<<<< + * raise TypeError("Cannot store heterogeneous maps") + * if len(set([x.__class__ for x in v.values()])) > 1: + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s__keys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_8(__pyx_t_4); + if (unlikely(!__pyx_t_2)) { + if (PyErr_Occurred()) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF(__pyx_v_x); + __pyx_v_x = __pyx_t_2; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s____class__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __pyx_t_7 = PySet_Size(__pyx_t_3); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = (__pyx_t_7 > 1); + if (__pyx_t_5) { + + /* "_hyperdex_client.pyx":364 + * valtype = HYPERDATATYPE_MAP_GENERIC + * if len(set([x.__class__ for x in v.keys()])) > 1: + * raise TypeError("Cannot store heterogeneous maps") # <<<<<<<<<<<<<< + * if len(set([x.__class__ for x in v.values()])) > 1: + * raise TypeError("Cannot store heterogeneous maps") + */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_56), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L23; + } + __pyx_L23:; + + /* "_hyperdex_client.pyx":365 + * if len(set([x.__class__ for x in v.keys()])) > 1: + * raise TypeError("Cannot store heterogeneous maps") + * if len(set([x.__class__ for x in v.values()])) > 1: # <<<<<<<<<<<<<< + * raise TypeError("Cannot store heterogeneous maps") + * for x, y in sorted(v.items(), key=__sort_key): + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s__values); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_8(__pyx_t_4); + if (unlikely(!__pyx_t_2)) { + if (PyErr_Occurred()) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF(__pyx_v_x); + __pyx_v_x = __pyx_t_2; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s____class__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __pyx_t_7 = PySet_Size(__pyx_t_3); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = (__pyx_t_7 > 1); + if (__pyx_t_5) { + + /* "_hyperdex_client.pyx":366 + * raise TypeError("Cannot store heterogeneous maps") + * if len(set([x.__class__ for x in v.values()])) > 1: + * raise TypeError("Cannot store heterogeneous maps") # <<<<<<<<<<<<<< + * for x, y in sorted(v.items(), key=__sort_key): + * if isinstance(x, bytes): + */ + __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_57), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L26; + } + __pyx_L26:; + + /* "_hyperdex_client.pyx":367 + * if len(set([x.__class__ for x in v.values()])) > 1: + * raise TypeError("Cannot store heterogeneous maps") + * for x, y in sorted(v.items(), key=__sort_key): # <<<<<<<<<<<<<< + * if isinstance(x, bytes): + * innerxtype = HYPERDATATYPE_STRING + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s__items); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s____sort_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__key), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_8(__pyx_t_4); + if (unlikely(!__pyx_t_2)) { + if (PyErr_Occurred()) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #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_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_9 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_9); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else + { + Py_ssize_t index = -1; + __pyx_t_12 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext; + index = 0; __pyx_t_3 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_3)) goto __pyx_L31_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_9 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_9)) goto __pyx_L31_unpacking_failed; + __Pyx_GOTREF(__pyx_t_9); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = NULL; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L32_unpacking_done; + __pyx_L31_unpacking_failed:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_13 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L32_unpacking_done:; + } + __Pyx_XDECREF(__pyx_v_x); + __pyx_v_x = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_v_y); + __pyx_v_y = __pyx_t_9; + __pyx_t_9 = 0; + + /* "_hyperdex_client.pyx":368 + * raise TypeError("Cannot store heterogeneous maps") + * for x, y in sorted(v.items(), key=__sort_key): + * if isinstance(x, bytes): # <<<<<<<<<<<<<< + * innerxtype = HYPERDATATYPE_STRING + * innerxbacking = struct.pack(' \ + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_backings = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":415 + * cdef bytes backing + * attrs[0] = \ + * malloc(sizeof(hyperdex_client_attribute) * len(value)) # <<<<<<<<<<<<<< + * if attrs[0] == NULL: + * raise MemoryError() + */ + if (unlikely(((PyObject *)__pyx_v_value) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = PyList_GET_SIZE(((PyObject *)__pyx_v_value)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "_hyperdex_client.pyx":414 + * cdef list backings = [] + * cdef bytes backing + * attrs[0] = \ # <<<<<<<<<<<<<< + * malloc(sizeof(hyperdex_client_attribute) * len(value)) + * if attrs[0] == NULL: + */ + (__pyx_v_attrs[0]) = ((struct hyperdex_client_attribute *)malloc(((sizeof(struct hyperdex_client_attribute)) * __pyx_t_2))); + + /* "_hyperdex_client.pyx":416 + * attrs[0] = \ + * malloc(sizeof(hyperdex_client_attribute) * len(value)) + * if attrs[0] == NULL: # <<<<<<<<<<<<<< + * raise MemoryError() + * for i, a in enumerate(value): + */ + __pyx_t_3 = ((__pyx_v_attrs[0]) == NULL); + if (__pyx_t_3) { + + /* "_hyperdex_client.pyx":417 + * malloc(sizeof(hyperdex_client_attribute) * len(value)) + * if attrs[0] == NULL: + * raise MemoryError() # <<<<<<<<<<<<<< + * for i, a in enumerate(value): + * a, v = a + */ + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L3; + } + __pyx_L3:; + + /* "_hyperdex_client.pyx":418 + * if attrs[0] == NULL: + * raise MemoryError() + * for i, a in enumerate(value): # <<<<<<<<<<<<<< + * a, v = a + * datatype, backing = _obj_to_backing(v) + */ + __pyx_t_2 = 0; + __pyx_t_1 = ((PyObject *)__pyx_v_value); __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; + for (;;) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF(__pyx_v_a); + __pyx_v_a = __pyx_t_5; + __pyx_t_5 = 0; + __pyx_v_i = __pyx_t_2; + __pyx_t_2 = (__pyx_t_2 + 1); + + /* "_hyperdex_client.pyx":419 + * raise MemoryError() + * for i, a in enumerate(value): + * a, v = a # <<<<<<<<<<<<<< + * datatype, backing = _obj_to_backing(v) + * if backing is None: + */ + if ((likely(PyTuple_CheckExact(__pyx_v_a))) || (PyList_CheckExact(__pyx_v_a))) { + PyObject* sequence = __pyx_v_a; + #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_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + #endif + } else + { + Py_ssize_t index = -1; + __pyx_t_7 = PyObject_GetIter(__pyx_v_a); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __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_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L7_unpacking_done; + __pyx_L6_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L7_unpacking_done:; + } + __Pyx_DECREF(__pyx_v_a); + __pyx_v_a = __pyx_t_5; + __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_v_v); + __pyx_v_v = __pyx_t_6; + __pyx_t_6 = 0; + + /* "_hyperdex_client.pyx":420 + * for i, a in enumerate(value): + * a, v = a + * datatype, backing = _obj_to_backing(v) # <<<<<<<<<<<<<< + * if backing is None: + * raise TypeError("Do not know how to convert attribute {0}".format(a)) + */ + __pyx_t_6 = __pyx_f_16_hyperdex_client__obj_to_backing(__pyx_v_v); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; + #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_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + #endif + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + { + Py_ssize_t index = -1; + __pyx_t_9 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_9)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_9); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_7 = __pyx_t_8(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L8_unpacking_failed; + __Pyx_GOTREF(__pyx_t_7); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_9), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L9_unpacking_done; + __pyx_L8_unpacking_failed:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L9_unpacking_done:; + } + if (!(likely(PyBytes_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_7)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF(__pyx_v_datatype); + __pyx_v_datatype = __pyx_t_5; + __pyx_t_5 = 0; + __Pyx_XDECREF(((PyObject *)__pyx_v_backing)); + __pyx_v_backing = ((PyObject*)__pyx_t_7); + __pyx_t_7 = 0; + + /* "_hyperdex_client.pyx":421 + * a, v = a + * datatype, backing = _obj_to_backing(v) + * if backing is None: # <<<<<<<<<<<<<< + * raise TypeError("Do not know how to convert attribute {0}".format(a)) + * backings.append(backing) + */ + __pyx_t_3 = (__pyx_v_backing == ((PyObject*)Py_None)); + if (__pyx_t_3) { + + /* "_hyperdex_client.pyx":422 + * datatype, backing = _obj_to_backing(v) + * if backing is None: + * raise TypeError("Do not know how to convert attribute {0}".format(a)) # <<<<<<<<<<<<<< + * backings.append(backing) + * attrs[0][i].attr = a + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_62), __pyx_n_s__format); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_a); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_a); + __Pyx_GIVEREF(__pyx_v_a); + __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L10; + } + __pyx_L10:; + + /* "_hyperdex_client.pyx":423 + * if backing is None: + * raise TypeError("Do not know how to convert attribute {0}".format(a)) + * backings.append(backing) # <<<<<<<<<<<<<< + * attrs[0][i].attr = a + * attrs[0][i].value = backing + */ + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_backings, ((PyObject *)__pyx_v_backing)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "_hyperdex_client.pyx":424 + * raise TypeError("Do not know how to convert attribute {0}".format(a)) + * backings.append(backing) + * attrs[0][i].attr = a # <<<<<<<<<<<<<< + * attrs[0][i].value = backing + * attrs[0][i].value_sz = len(backing) + */ + __pyx_t_11 = __Pyx_PyObject_AsString(__pyx_v_a); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((__pyx_v_attrs[0])[__pyx_v_i]).attr = __pyx_t_11; + + /* "_hyperdex_client.pyx":425 + * backings.append(backing) + * attrs[0][i].attr = a + * attrs[0][i].value = backing # <<<<<<<<<<<<<< + * attrs[0][i].value_sz = len(backing) + * attrs[0][i].datatype = datatype + */ + __pyx_t_11 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_backing)); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((__pyx_v_attrs[0])[__pyx_v_i]).value = __pyx_t_11; + + /* "_hyperdex_client.pyx":426 + * attrs[0][i].attr = a + * attrs[0][i].value = backing + * attrs[0][i].value_sz = len(backing) # <<<<<<<<<<<<<< + * attrs[0][i].datatype = datatype + * return backings + */ + if (unlikely(((PyObject *)__pyx_v_backing) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_12 = PyBytes_GET_SIZE(((PyObject *)__pyx_v_backing)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((__pyx_v_attrs[0])[__pyx_v_i]).value_sz = __pyx_t_12; + + /* "_hyperdex_client.pyx":427 + * attrs[0][i].value = backing + * attrs[0][i].value_sz = len(backing) + * attrs[0][i].datatype = datatype # <<<<<<<<<<<<<< + * return backings + * + */ + __pyx_t_13 = ((enum hyperdatatype)PyInt_AsLong(__pyx_v_datatype)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((__pyx_v_attrs[0])[__pyx_v_i]).datatype = __pyx_t_13; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":428 + * attrs[0][i].value_sz = len(backing) + * attrs[0][i].datatype = datatype + * return backings # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_backings)); + __pyx_r = ((PyObject *)__pyx_v_backings); + goto __pyx_L0; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("_hyperdex_client._dict_to_attrs", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_backings); + __Pyx_XDECREF(__pyx_v_backing); + __Pyx_XDECREF(__pyx_v_a); + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XDECREF(__pyx_v_datatype); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":431 + * + * + * cdef _dict_to_map_attrs(list value, hyperdex_client_map_attribute** attrs, size_t* attrs_sz): # <<<<<<<<<<<<<< + * cdef list backings = [] + * cdef bytes kbacking + */ + +static PyObject *__pyx_f_16_hyperdex_client__dict_to_map_attrs(PyObject *__pyx_v_value, struct hyperdex_client_map_attribute **__pyx_v_attrs, size_t *__pyx_v_attrs_sz) { + PyObject *__pyx_v_backings = 0; + PyObject *__pyx_v_kbacking = 0; + PyObject *__pyx_v_vbacking = 0; + PyObject *__pyx_v_a = 0; + PyObject *__pyx_v_name = 0; + long __pyx_v_i; + PyObject *__pyx_v_b = NULL; + PyObject *__pyx_v_keytype = NULL; + PyObject *__pyx_v_valtype = NULL; + CYTHON_UNUSED long __pyx_v_j; + PyObject *__pyx_v_k = NULL; + PyObject *__pyx_v_v = NULL; + PyObject *__pyx_v_kdatatype = NULL; + PyObject *__pyx_v_vdatatype = NULL; + CYTHON_UNUSED PyObject *__pyx_v_mixedtype = 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 = NULL; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + size_t __pyx_t_9; + PyObject *(*__pyx_t_10)(PyObject *); + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + int __pyx_t_16; + int __pyx_t_17; + char *__pyx_t_18; + Py_ssize_t __pyx_t_19; + enum hyperdatatype __pyx_t_20; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_dict_to_map_attrs", 0); + + /* "_hyperdex_client.pyx":432 + * + * cdef _dict_to_map_attrs(list value, hyperdex_client_map_attribute** attrs, size_t* attrs_sz): + * cdef list backings = [] # <<<<<<<<<<<<<< + * cdef bytes kbacking + * cdef bytes vbacking + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_backings = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":437 + * cdef tuple a + * cdef bytes name + * cdef long i = 0 # <<<<<<<<<<<<<< + * attrs_sz[0] = sum([len(a[1]) for a in value if isinstance(a[1], dict)]) \ + * + len([a for a in value if not isinstance(a[1], dict)]) + */ + __pyx_v_i = 0; + + /* "_hyperdex_client.pyx":438 + * cdef bytes name + * cdef long i = 0 + * attrs_sz[0] = sum([len(a[1]) for a in value if isinstance(a[1], dict)]) \ # <<<<<<<<<<<<<< + * + len([a for a in value if not isinstance(a[1], dict)]) + * attrs[0] = \ + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(((PyObject *)__pyx_v_value) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = ((PyObject *)__pyx_v_value); __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + for (;;) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (!(likely(PyTuple_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF(((PyObject *)__pyx_v_a)); + __pyx_v_a = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + if (unlikely(((PyObject *)__pyx_v_a) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = __Pyx_GetItemInt_Tuple(((PyObject *)__pyx_v_a), 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyDict_Check(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_5) { + if (unlikely(((PyObject *)__pyx_v_a) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = __Pyx_GetItemInt_Tuple(((PyObject *)__pyx_v_a), 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L5; + } + __pyx_L5:; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); + __pyx_t_1 = 0; + __pyx_t_1 = PyObject_Call(__pyx_builtin_sum, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":439 + * cdef long i = 0 + * attrs_sz[0] = sum([len(a[1]) for a in value if isinstance(a[1], dict)]) \ + * + len([a for a in value if not isinstance(a[1], dict)]) # <<<<<<<<<<<<<< + * attrs[0] = \ + * malloc(sizeof(hyperdex_client_map_attribute) * attrs_sz[0]) + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(((PyObject *)__pyx_v_value) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = ((PyObject *)__pyx_v_value); __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = 0; + for (;;) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_3); __Pyx_INCREF(__pyx_t_7); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (!(likely(PyTuple_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_7)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF(((PyObject *)__pyx_v_a)); + __pyx_v_a = ((PyObject*)__pyx_t_7); + __pyx_t_7 = 0; + if (unlikely(((PyObject *)__pyx_v_a) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = __Pyx_GetItemInt_Tuple(((PyObject *)__pyx_v_a), 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = PyDict_Check(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = (!__pyx_t_5); + if (__pyx_t_8) { + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_v_a))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L8; + } + __pyx_L8:; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = PyList_GET_SIZE(((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = __Pyx_PyInt_AsSize_t(__pyx_t_4); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "_hyperdex_client.pyx":438 + * cdef bytes name + * cdef long i = 0 + * attrs_sz[0] = sum([len(a[1]) for a in value if isinstance(a[1], dict)]) \ # <<<<<<<<<<<<<< + * + len([a for a in value if not isinstance(a[1], dict)]) + * attrs[0] = \ + */ + (__pyx_v_attrs_sz[0]) = __pyx_t_9; + + /* "_hyperdex_client.pyx":440 + * attrs_sz[0] = sum([len(a[1]) for a in value if isinstance(a[1], dict)]) \ + * + len([a for a in value if not isinstance(a[1], dict)]) + * attrs[0] = \ # <<<<<<<<<<<<<< + * malloc(sizeof(hyperdex_client_map_attribute) * attrs_sz[0]) + * if attrs[0] == NULL: + */ + (__pyx_v_attrs[0]) = ((struct hyperdex_client_map_attribute *)malloc(((sizeof(struct hyperdex_client_map_attribute)) * (__pyx_v_attrs_sz[0])))); + + /* "_hyperdex_client.pyx":442 + * attrs[0] = \ + * malloc(sizeof(hyperdex_client_map_attribute) * attrs_sz[0]) + * if attrs[0] == NULL: # <<<<<<<<<<<<<< + * raise MemoryError() + * for a in value: + */ + __pyx_t_8 = ((__pyx_v_attrs[0]) == NULL); + if (__pyx_t_8) { + + /* "_hyperdex_client.pyx":443 + * malloc(sizeof(hyperdex_client_map_attribute) * attrs_sz[0]) + * if attrs[0] == NULL: + * raise MemoryError() # <<<<<<<<<<<<<< + * for a in value: + * name, b = a + */ + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L9; + } + __pyx_L9:; + + /* "_hyperdex_client.pyx":444 + * if attrs[0] == NULL: + * raise MemoryError() + * for a in value: # <<<<<<<<<<<<<< + * name, b = a + * keytype = None + */ + if (unlikely(((PyObject *)__pyx_v_value) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_4 = ((PyObject *)__pyx_v_value); __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = 0; + for (;;) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF(((PyObject *)__pyx_v_a)); + __pyx_v_a = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":445 + * raise MemoryError() + * for a in value: + * name, b = a # <<<<<<<<<<<<<< + * keytype = None + * valtype = None + */ + if (likely(PyTuple_CheckExact(((PyObject *)__pyx_v_a)))) { + PyObject* sequence = ((PyObject *)__pyx_v_a); + #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_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_1); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + #endif + } else if (1) { + __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } else + { + Py_ssize_t index = -1; + __pyx_t_7 = PyObject_GetIter(((PyObject *)__pyx_v_a)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_10 = Py_TYPE(__pyx_t_7)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_10(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L12_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_1 = __pyx_t_10(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L12_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L13_unpacking_done; + __pyx_L12_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_10 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L13_unpacking_done:; + } + if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF(((PyObject *)__pyx_v_name)); + __pyx_v_name = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_v_b); + __pyx_v_b = __pyx_t_1; + __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":446 + * for a in value: + * name, b = a + * keytype = None # <<<<<<<<<<<<<< + * valtype = None + * j = i + */ + __Pyx_INCREF(Py_None); + __Pyx_XDECREF(__pyx_v_keytype); + __pyx_v_keytype = Py_None; + + /* "_hyperdex_client.pyx":447 + * name, b = a + * keytype = None + * valtype = None # <<<<<<<<<<<<<< + * j = i + * if isinstance(b, dict): + */ + __Pyx_INCREF(Py_None); + __Pyx_XDECREF(__pyx_v_valtype); + __pyx_v_valtype = Py_None; + + /* "_hyperdex_client.pyx":448 + * keytype = None + * valtype = None + * j = i # <<<<<<<<<<<<<< + * if isinstance(b, dict): + * for k, v in b.iteritems(): + */ + __pyx_v_j = __pyx_v_i; + + /* "_hyperdex_client.pyx":449 + * valtype = None + * j = i + * if isinstance(b, dict): # <<<<<<<<<<<<<< + * for k, v in b.iteritems(): + * kdatatype, kbacking = _obj_to_backing(k) + */ + __pyx_t_8 = PyDict_Check(__pyx_v_b); + if (__pyx_t_8) { + + /* "_hyperdex_client.pyx":450 + * j = i + * if isinstance(b, dict): + * for k, v in b.iteritems(): # <<<<<<<<<<<<<< + * kdatatype, kbacking = _obj_to_backing(k) + * vdatatype, vbacking = _obj_to_backing(v) + */ + __pyx_t_6 = 0; + if (unlikely(__pyx_v_b == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_b, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_11), (&__pyx_t_12)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_1); + __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = 0; + while (1) { + __pyx_t_13 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_11, &__pyx_t_6, &__pyx_t_2, &__pyx_t_7, NULL, __pyx_t_12); + if (unlikely(__pyx_t_13 == 0)) break; + if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_v_k); + __pyx_v_k = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_v_v); + __pyx_v_v = __pyx_t_7; + __pyx_t_7 = 0; + + /* "_hyperdex_client.pyx":451 + * if isinstance(b, dict): + * for k, v in b.iteritems(): + * kdatatype, kbacking = _obj_to_backing(k) # <<<<<<<<<<<<<< + * vdatatype, vbacking = _obj_to_backing(v) + * if kdatatype not in (keytype, None): + */ + __pyx_t_7 = __pyx_f_16_hyperdex_client__obj_to_backing(__pyx_v_k); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) { + PyObject* sequence = __pyx_t_7; + #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_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_14 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_14 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_14); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_14 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + #endif + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } else + { + Py_ssize_t index = -1; + __pyx_t_15 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_10 = Py_TYPE(__pyx_t_15)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_10(__pyx_t_15); if (unlikely(!__pyx_t_2)) goto __pyx_L17_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_14 = __pyx_t_10(__pyx_t_15); if (unlikely(!__pyx_t_14)) goto __pyx_L17_unpacking_failed; + __Pyx_GOTREF(__pyx_t_14); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_15), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = NULL; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + goto __pyx_L18_unpacking_done; + __pyx_L17_unpacking_failed:; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_10 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L18_unpacking_done:; + } + if (!(likely(PyBytes_CheckExact(__pyx_t_14))||((__pyx_t_14) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_14)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF(__pyx_v_kdatatype); + __pyx_v_kdatatype = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_XDECREF(((PyObject *)__pyx_v_kbacking)); + __pyx_v_kbacking = ((PyObject*)__pyx_t_14); + __pyx_t_14 = 0; + + /* "_hyperdex_client.pyx":452 + * for k, v in b.iteritems(): + * kdatatype, kbacking = _obj_to_backing(k) + * vdatatype, vbacking = _obj_to_backing(v) # <<<<<<<<<<<<<< + * if kdatatype not in (keytype, None): + * mixedtype = TypeError("Cannot store heterogeneous maps") + */ + __pyx_t_7 = __pyx_f_16_hyperdex_client__obj_to_backing(__pyx_v_v); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) { + PyObject* sequence = __pyx_t_7; + #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_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_14 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_14 = PyList_GET_ITEM(sequence, 0); + __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_14); + __Pyx_INCREF(__pyx_t_2); + #else + __pyx_t_14 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + #endif + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } else + { + Py_ssize_t index = -1; + __pyx_t_15 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_10 = Py_TYPE(__pyx_t_15)->tp_iternext; + index = 0; __pyx_t_14 = __pyx_t_10(__pyx_t_15); if (unlikely(!__pyx_t_14)) goto __pyx_L19_unpacking_failed; + __Pyx_GOTREF(__pyx_t_14); + index = 1; __pyx_t_2 = __pyx_t_10(__pyx_t_15); if (unlikely(!__pyx_t_2)) goto __pyx_L19_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_15), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = NULL; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + goto __pyx_L20_unpacking_done; + __pyx_L19_unpacking_failed:; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_10 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L20_unpacking_done:; + } + if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF(__pyx_v_vdatatype); + __pyx_v_vdatatype = __pyx_t_14; + __pyx_t_14 = 0; + __Pyx_XDECREF(((PyObject *)__pyx_v_vbacking)); + __pyx_v_vbacking = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":453 + * kdatatype, kbacking = _obj_to_backing(k) + * vdatatype, vbacking = _obj_to_backing(v) + * if kdatatype not in (keytype, None): # <<<<<<<<<<<<<< + * mixedtype = TypeError("Cannot store heterogeneous maps") + * keytype = kdatatype + */ + __Pyx_INCREF(__pyx_v_kdatatype); + __pyx_t_7 = __pyx_v_kdatatype; + __pyx_t_2 = PyObject_RichCompare(__pyx_t_7, __pyx_v_keytype, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (((int)__pyx_t_8)) { + __pyx_t_2 = PyObject_RichCompare(__pyx_t_7, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_16 = ((int)__pyx_t_5); + } else { + __pyx_t_16 = ((int)__pyx_t_8); + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = __pyx_t_16; + if (__pyx_t_8) { + + /* "_hyperdex_client.pyx":454 + * vdatatype, vbacking = _obj_to_backing(v) + * if kdatatype not in (keytype, None): + * mixedtype = TypeError("Cannot store heterogeneous maps") # <<<<<<<<<<<<<< + * keytype = kdatatype + * if vdatatype not in (valtype, None): + */ + __pyx_t_7 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_63), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_v_mixedtype); + __pyx_v_mixedtype = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L21; + } + __pyx_L21:; + + /* "_hyperdex_client.pyx":455 + * if kdatatype not in (keytype, None): + * mixedtype = TypeError("Cannot store heterogeneous maps") + * keytype = kdatatype # <<<<<<<<<<<<<< + * if vdatatype not in (valtype, None): + * mixedtype = TypeError("Cannot store heterogeneous maps") + */ + __Pyx_INCREF(__pyx_v_kdatatype); + __Pyx_DECREF(__pyx_v_keytype); + __pyx_v_keytype = __pyx_v_kdatatype; + + /* "_hyperdex_client.pyx":456 + * mixedtype = TypeError("Cannot store heterogeneous maps") + * keytype = kdatatype + * if vdatatype not in (valtype, None): # <<<<<<<<<<<<<< + * mixedtype = TypeError("Cannot store heterogeneous maps") + * valtype = vdatatype + */ + __Pyx_INCREF(__pyx_v_vdatatype); + __pyx_t_7 = __pyx_v_vdatatype; + __pyx_t_2 = PyObject_RichCompare(__pyx_t_7, __pyx_v_valtype, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (((int)__pyx_t_8)) { + __pyx_t_2 = PyObject_RichCompare(__pyx_t_7, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = ((int)__pyx_t_16); + } else { + __pyx_t_5 = ((int)__pyx_t_8); + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = __pyx_t_5; + if (__pyx_t_8) { + + /* "_hyperdex_client.pyx":457 + * keytype = kdatatype + * if vdatatype not in (valtype, None): + * mixedtype = TypeError("Cannot store heterogeneous maps") # <<<<<<<<<<<<<< + * valtype = vdatatype + * backings.append(kbacking) + */ + __pyx_t_7 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_64), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_v_mixedtype); + __pyx_v_mixedtype = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L22; + } + __pyx_L22:; + + /* "_hyperdex_client.pyx":458 + * if vdatatype not in (valtype, None): + * mixedtype = TypeError("Cannot store heterogeneous maps") + * valtype = vdatatype # <<<<<<<<<<<<<< + * backings.append(kbacking) + * backings.append(vbacking) + */ + __Pyx_INCREF(__pyx_v_vdatatype); + __Pyx_DECREF(__pyx_v_valtype); + __pyx_v_valtype = __pyx_v_vdatatype; + + /* "_hyperdex_client.pyx":459 + * mixedtype = TypeError("Cannot store heterogeneous maps") + * valtype = vdatatype + * backings.append(kbacking) # <<<<<<<<<<<<<< + * backings.append(vbacking) + * attrs[0][i].attr = name + */ + __pyx_t_17 = __Pyx_PyList_Append(__pyx_v_backings, ((PyObject *)__pyx_v_kbacking)); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "_hyperdex_client.pyx":460 + * valtype = vdatatype + * backings.append(kbacking) + * backings.append(vbacking) # <<<<<<<<<<<<<< + * attrs[0][i].attr = name + * attrs[0][i].map_key = kbacking + */ + __pyx_t_17 = __Pyx_PyList_Append(__pyx_v_backings, ((PyObject *)__pyx_v_vbacking)); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "_hyperdex_client.pyx":461 + * backings.append(kbacking) + * backings.append(vbacking) + * attrs[0][i].attr = name # <<<<<<<<<<<<<< + * attrs[0][i].map_key = kbacking + * attrs[0][i].map_key_sz = len(kbacking) + */ + __pyx_t_18 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_name)); if (unlikely((!__pyx_t_18) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((__pyx_v_attrs[0])[__pyx_v_i]).attr = __pyx_t_18; + + /* "_hyperdex_client.pyx":462 + * backings.append(vbacking) + * attrs[0][i].attr = name + * attrs[0][i].map_key = kbacking # <<<<<<<<<<<<<< + * attrs[0][i].map_key_sz = len(kbacking) + * attrs[0][i].map_key_datatype = kdatatype + */ + __pyx_t_18 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_kbacking)); if (unlikely((!__pyx_t_18) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((__pyx_v_attrs[0])[__pyx_v_i]).map_key = __pyx_t_18; + + /* "_hyperdex_client.pyx":463 + * attrs[0][i].attr = name + * attrs[0][i].map_key = kbacking + * attrs[0][i].map_key_sz = len(kbacking) # <<<<<<<<<<<<<< + * attrs[0][i].map_key_datatype = kdatatype + * attrs[0][i].value = vbacking + */ + if (unlikely(((PyObject *)__pyx_v_kbacking) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = PyBytes_GET_SIZE(((PyObject *)__pyx_v_kbacking)); if (unlikely(__pyx_t_19 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((__pyx_v_attrs[0])[__pyx_v_i]).map_key_sz = __pyx_t_19; + + /* "_hyperdex_client.pyx":464 + * attrs[0][i].map_key = kbacking + * attrs[0][i].map_key_sz = len(kbacking) + * attrs[0][i].map_key_datatype = kdatatype # <<<<<<<<<<<<<< + * attrs[0][i].value = vbacking + * attrs[0][i].value_sz = len(vbacking) + */ + __pyx_t_20 = ((enum hyperdatatype)PyInt_AsLong(__pyx_v_kdatatype)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((__pyx_v_attrs[0])[__pyx_v_i]).map_key_datatype = __pyx_t_20; + + /* "_hyperdex_client.pyx":465 + * attrs[0][i].map_key_sz = len(kbacking) + * attrs[0][i].map_key_datatype = kdatatype + * attrs[0][i].value = vbacking # <<<<<<<<<<<<<< + * attrs[0][i].value_sz = len(vbacking) + * attrs[0][i].value_datatype = vdatatype + */ + __pyx_t_18 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_vbacking)); if (unlikely((!__pyx_t_18) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((__pyx_v_attrs[0])[__pyx_v_i]).value = __pyx_t_18; + + /* "_hyperdex_client.pyx":466 + * attrs[0][i].map_key_datatype = kdatatype + * attrs[0][i].value = vbacking + * attrs[0][i].value_sz = len(vbacking) # <<<<<<<<<<<<<< + * attrs[0][i].value_datatype = vdatatype + * i += 1 + */ + if (unlikely(((PyObject *)__pyx_v_vbacking) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_19 = PyBytes_GET_SIZE(((PyObject *)__pyx_v_vbacking)); if (unlikely(__pyx_t_19 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((__pyx_v_attrs[0])[__pyx_v_i]).value_sz = __pyx_t_19; + + /* "_hyperdex_client.pyx":467 + * attrs[0][i].value = vbacking + * attrs[0][i].value_sz = len(vbacking) + * attrs[0][i].value_datatype = vdatatype # <<<<<<<<<<<<<< + * i += 1 + * else: + */ + __pyx_t_20 = ((enum hyperdatatype)PyInt_AsLong(__pyx_v_vdatatype)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((__pyx_v_attrs[0])[__pyx_v_i]).value_datatype = __pyx_t_20; + + /* "_hyperdex_client.pyx":468 + * attrs[0][i].value_sz = len(vbacking) + * attrs[0][i].value_datatype = vdatatype + * i += 1 # <<<<<<<<<<<<<< + * else: + * kdatatype, kbacking = _obj_to_backing(b) + */ + __pyx_v_i = (__pyx_v_i + 1); + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L14; + } + /*else*/ { + + /* "_hyperdex_client.pyx":470 + * i += 1 + * else: + * kdatatype, kbacking = _obj_to_backing(b) # <<<<<<<<<<<<<< + * attrs[0][i].attr = name + * attrs[0][i].map_key = kbacking + */ + __pyx_t_1 = __pyx_f_16_hyperdex_client__obj_to_backing(__pyx_v_b); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_7 = PyList_GET_ITEM(sequence, 0); + __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_2); + #else + __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + { + Py_ssize_t index = -1; + __pyx_t_14 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_10 = Py_TYPE(__pyx_t_14)->tp_iternext; + index = 0; __pyx_t_7 = __pyx_t_10(__pyx_t_14); if (unlikely(!__pyx_t_7)) goto __pyx_L23_unpacking_failed; + __Pyx_GOTREF(__pyx_t_7); + index = 1; __pyx_t_2 = __pyx_t_10(__pyx_t_14); if (unlikely(!__pyx_t_2)) goto __pyx_L23_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_14), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = NULL; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + goto __pyx_L24_unpacking_done; + __pyx_L23_unpacking_failed:; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_10 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L24_unpacking_done:; + } + if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF(__pyx_v_kdatatype); + __pyx_v_kdatatype = __pyx_t_7; + __pyx_t_7 = 0; + __Pyx_XDECREF(((PyObject *)__pyx_v_kbacking)); + __pyx_v_kbacking = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":471 + * else: + * kdatatype, kbacking = _obj_to_backing(b) + * attrs[0][i].attr = name # <<<<<<<<<<<<<< + * attrs[0][i].map_key = kbacking + * attrs[0][i].map_key_sz = len(kbacking) + */ + __pyx_t_18 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_name)); if (unlikely((!__pyx_t_18) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((__pyx_v_attrs[0])[__pyx_v_i]).attr = __pyx_t_18; + + /* "_hyperdex_client.pyx":472 + * kdatatype, kbacking = _obj_to_backing(b) + * attrs[0][i].attr = name + * attrs[0][i].map_key = kbacking # <<<<<<<<<<<<<< + * attrs[0][i].map_key_sz = len(kbacking) + * attrs[0][i].map_key_datatype = kdatatype + */ + __pyx_t_18 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_kbacking)); if (unlikely((!__pyx_t_18) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((__pyx_v_attrs[0])[__pyx_v_i]).map_key = __pyx_t_18; + + /* "_hyperdex_client.pyx":473 + * attrs[0][i].attr = name + * attrs[0][i].map_key = kbacking + * attrs[0][i].map_key_sz = len(kbacking) # <<<<<<<<<<<<<< + * attrs[0][i].map_key_datatype = kdatatype + * attrs[0][i].value = NULL + */ + if (unlikely(((PyObject *)__pyx_v_kbacking) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_11 = PyBytes_GET_SIZE(((PyObject *)__pyx_v_kbacking)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((__pyx_v_attrs[0])[__pyx_v_i]).map_key_sz = __pyx_t_11; + + /* "_hyperdex_client.pyx":474 + * attrs[0][i].map_key = kbacking + * attrs[0][i].map_key_sz = len(kbacking) + * attrs[0][i].map_key_datatype = kdatatype # <<<<<<<<<<<<<< + * attrs[0][i].value = NULL + * attrs[0][i].value_sz = 0 + */ + __pyx_t_20 = ((enum hyperdatatype)PyInt_AsLong(__pyx_v_kdatatype)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((__pyx_v_attrs[0])[__pyx_v_i]).map_key_datatype = __pyx_t_20; + + /* "_hyperdex_client.pyx":475 + * attrs[0][i].map_key_sz = len(kbacking) + * attrs[0][i].map_key_datatype = kdatatype + * attrs[0][i].value = NULL # <<<<<<<<<<<<<< + * attrs[0][i].value_sz = 0 + * attrs[0][i].value_datatype = HYPERDATATYPE_GENERIC; + */ + ((__pyx_v_attrs[0])[__pyx_v_i]).value = NULL; + + /* "_hyperdex_client.pyx":476 + * attrs[0][i].map_key_datatype = kdatatype + * attrs[0][i].value = NULL + * attrs[0][i].value_sz = 0 # <<<<<<<<<<<<<< + * attrs[0][i].value_datatype = HYPERDATATYPE_GENERIC; + * i += 1 + */ + ((__pyx_v_attrs[0])[__pyx_v_i]).value_sz = 0; + + /* "_hyperdex_client.pyx":477 + * attrs[0][i].value = NULL + * attrs[0][i].value_sz = 0 + * attrs[0][i].value_datatype = HYPERDATATYPE_GENERIC; # <<<<<<<<<<<<<< + * i += 1 + * return backings + */ + ((__pyx_v_attrs[0])[__pyx_v_i]).value_datatype = HYPERDATATYPE_GENERIC; + + /* "_hyperdex_client.pyx":478 + * attrs[0][i].value_sz = 0 + * attrs[0][i].value_datatype = HYPERDATATYPE_GENERIC; + * i += 1 # <<<<<<<<<<<<<< + * return backings + * + */ + __pyx_v_i = (__pyx_v_i + 1); + } + __pyx_L14:; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "_hyperdex_client.pyx":479 + * attrs[0][i].value_datatype = HYPERDATATYPE_GENERIC; + * i += 1 + * return backings # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_backings)); + __pyx_r = ((PyObject *)__pyx_v_backings); + goto __pyx_L0; + + __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_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_AddTraceback("_hyperdex_client._dict_to_map_attrs", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_backings); + __Pyx_XDECREF(__pyx_v_kbacking); + __Pyx_XDECREF(__pyx_v_vbacking); + __Pyx_XDECREF(__pyx_v_a); + __Pyx_XDECREF(__pyx_v_name); + __Pyx_XDECREF(__pyx_v_b); + __Pyx_XDECREF(__pyx_v_keytype); + __Pyx_XDECREF(__pyx_v_valtype); + __Pyx_XDECREF(__pyx_v_k); + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XDECREF(__pyx_v_kdatatype); + __Pyx_XDECREF(__pyx_v_vdatatype); + __Pyx_XDECREF(__pyx_v_mixedtype); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":482 + * + * + * cdef _attrs_to_dict(hyperdex_client_attribute* attrs, size_t attrs_sz): # <<<<<<<<<<<<<< + * ret = {} + * for idx in range(attrs_sz): + */ + +static PyObject *__pyx_f_16_hyperdex_client__attrs_to_dict(struct hyperdex_client_attribute *__pyx_v_attrs, size_t __pyx_v_attrs_sz) { + PyObject *__pyx_v_ret = NULL; + size_t __pyx_v_idx; + PyObject *__pyx_v_s = NULL; + PyObject *__pyx_v_i = NULL; + PyObject *__pyx_v_pos = NULL; + PyObject *__pyx_v_rem = NULL; + PyObject *__pyx_v_lst = NULL; + PyObject *__pyx_v_sz = NULL; + PyObject *__pyx_v_st = NULL; + PyObject *__pyx_v_dct = NULL; + PyObject *__pyx_v_key = NULL; + PyObject *__pyx_v_val = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + size_t __pyx_t_2; + size_t __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_attrs_to_dict", 0); + + /* "_hyperdex_client.pyx":483 + * + * cdef _attrs_to_dict(hyperdex_client_attribute* attrs, size_t attrs_sz): + * ret = {} # <<<<<<<<<<<<<< + * for idx in range(attrs_sz): + * if attrs[idx].datatype == HYPERDATATYPE_STRING: + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __pyx_v_ret = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":484 + * cdef _attrs_to_dict(hyperdex_client_attribute* attrs, size_t attrs_sz): + * ret = {} + * for idx in range(attrs_sz): # <<<<<<<<<<<<<< + * if attrs[idx].datatype == HYPERDATATYPE_STRING: + * ret[attrs[idx].attr] = attrs[idx].value[:attrs[idx].value_sz] + */ + __pyx_t_2 = __pyx_v_attrs_sz; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_idx = __pyx_t_3; + + /* "_hyperdex_client.pyx":485 + * ret = {} + * for idx in range(attrs_sz): + * if attrs[idx].datatype == HYPERDATATYPE_STRING: # <<<<<<<<<<<<<< + * ret[attrs[idx].attr] = attrs[idx].value[:attrs[idx].value_sz] + * elif attrs[idx].datatype == HYPERDATATYPE_INT64: + */ + __pyx_t_4 = ((__pyx_v_attrs[__pyx_v_idx]).datatype == HYPERDATATYPE_STRING); + if (__pyx_t_4) { + + /* "_hyperdex_client.pyx":486 + * for idx in range(attrs_sz): + * if attrs[idx].datatype == HYPERDATATYPE_STRING: + * ret[attrs[idx].attr] = attrs[idx].value[:attrs[idx].value_sz] # <<<<<<<<<<<<<< + * elif attrs[idx].datatype == HYPERDATATYPE_INT64: + * s = attrs[idx].value[:attrs[idx].value_sz] + */ + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize((__pyx_v_attrs[__pyx_v_idx]).value + 0, (__pyx_v_attrs[__pyx_v_idx]).value_sz - 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __pyx_t_5 = __Pyx_PyBytes_FromString((__pyx_v_attrs[__pyx_v_idx]).attr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + if (PyDict_SetItem(((PyObject *)__pyx_v_ret), ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + goto __pyx_L5; + } + + /* "_hyperdex_client.pyx":487 + * if attrs[idx].datatype == HYPERDATATYPE_STRING: + * ret[attrs[idx].attr] = attrs[idx].value[:attrs[idx].value_sz] + * elif attrs[idx].datatype == HYPERDATATYPE_INT64: # <<<<<<<<<<<<<< + * s = attrs[idx].value[:attrs[idx].value_sz] + * i = len(s) + */ + __pyx_t_4 = ((__pyx_v_attrs[__pyx_v_idx]).datatype == HYPERDATATYPE_INT64); + if (__pyx_t_4) { + + /* "_hyperdex_client.pyx":488 + * ret[attrs[idx].attr] = attrs[idx].value[:attrs[idx].value_sz] + * elif attrs[idx].datatype == HYPERDATATYPE_INT64: + * s = attrs[idx].value[:attrs[idx].value_sz] # <<<<<<<<<<<<<< + * i = len(s) + * if i > 8: + */ + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize((__pyx_v_attrs[__pyx_v_idx]).value + 0, (__pyx_v_attrs[__pyx_v_idx]).value_sz - 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_XDECREF(__pyx_v_s); + __pyx_v_s = ((PyObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":489 + * elif attrs[idx].datatype == HYPERDATATYPE_INT64: + * s = attrs[idx].value[:attrs[idx].value_sz] + * i = len(s) # <<<<<<<<<<<<<< + * if i > 8: + * s = s[:8] + */ + __pyx_t_6 = PyObject_Length(__pyx_v_s); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_v_i); + __pyx_v_i = __pyx_t_1; + __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":490 + * s = attrs[idx].value[:attrs[idx].value_sz] + * i = len(s) + * if i > 8: # <<<<<<<<<<<<<< + * s = s[:8] + * elif i < 8: + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_int_8, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_4) { + + /* "_hyperdex_client.pyx":491 + * i = len(s) + * if i > 8: + * s = s[:8] # <<<<<<<<<<<<<< + * elif i < 8: + * s += (8 - i) * '\x00' + */ + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_s, 0, 8, NULL, NULL, &__pyx_k_slice_65, 0, 1, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_v_s); + __pyx_v_s = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L6; + } + + /* "_hyperdex_client.pyx":492 + * if i > 8: + * s = s[:8] + * elif i < 8: # <<<<<<<<<<<<<< + * s += (8 - i) * '\x00' + * ret[attrs[idx].attr] = struct.unpack(' 8: + */ + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize((__pyx_v_attrs[__pyx_v_idx]).value + 0, (__pyx_v_attrs[__pyx_v_idx]).value_sz - 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_XDECREF(__pyx_v_s); + __pyx_v_s = ((PyObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":497 + * elif attrs[idx].datatype == HYPERDATATYPE_FLOAT: + * s = attrs[idx].value[:attrs[idx].value_sz] + * i = len(s) # <<<<<<<<<<<<<< + * if i > 8: + * s = s[:8] + */ + __pyx_t_6 = PyObject_Length(__pyx_v_s); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_v_i); + __pyx_v_i = __pyx_t_1; + __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":498 + * s = attrs[idx].value[:attrs[idx].value_sz] + * i = len(s) + * if i > 8: # <<<<<<<<<<<<<< + * s = s[:8] + * elif i < 8: + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_int_8, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_4) { + + /* "_hyperdex_client.pyx":499 + * i = len(s) + * if i > 8: + * s = s[:8] # <<<<<<<<<<<<<< + * elif i < 8: + * s += (8 - i) * '\x00' + */ + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_s, 0, 8, NULL, NULL, &__pyx_k_slice_67, 0, 1, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_v_s); + __pyx_v_s = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L7; + } + + /* "_hyperdex_client.pyx":500 + * if i > 8: + * s = s[:8] + * elif i < 8: # <<<<<<<<<<<<<< + * s += (8 - i) * '\x00' + * ret[attrs[idx].attr] = struct.unpack('= 4: + */ + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_attrs[__pyx_v_idx]).value_sz); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_v_rem); + __pyx_v_rem = __pyx_t_1; + __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":506 + * pos = 0 + * rem = attrs[idx].value_sz + * lst = [] # <<<<<<<<<<<<<< + * while rem >= 4: + * sz = struct.unpack('= 4: # <<<<<<<<<<<<<< + * sz = struct.unpack('= 4: + * sz = struct.unpack('= 4: + * sz = struct.unpack('= 8: + */ + __pyx_t_7 = __Pyx_PyInt_FromSize_t((__pyx_v_attrs[__pyx_v_idx]).value_sz); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_v_rem); + __pyx_v_rem = __pyx_t_7; + __pyx_t_7 = 0; + + /* "_hyperdex_client.pyx":520 + * pos = 0 + * rem = attrs[idx].value_sz + * lst = [] # <<<<<<<<<<<<<< + * while rem >= 8: + * lst.append(struct.unpack('= 8: # <<<<<<<<<<<<<< + * lst.append(struct.unpack('= 8: + * lst.append(struct.unpack('= 8: + * lst.append(struct.unpack('= 8: + */ + __pyx_t_5 = __Pyx_PyInt_FromSize_t((__pyx_v_attrs[__pyx_v_idx]).value_sz); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_v_rem); + __pyx_v_rem = __pyx_t_5; + __pyx_t_5 = 0; + + /* "_hyperdex_client.pyx":531 + * pos = 0 + * rem = attrs[idx].value_sz + * lst = [] # <<<<<<<<<<<<<< + * while rem >= 8: + * lst.append(struct.unpack('= 8: # <<<<<<<<<<<<<< + * lst.append(struct.unpack('= 8: + * lst.append(struct.unpack('= 8: + * lst.append(struct.unpack('= 4: + */ + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_attrs[__pyx_v_idx]).value_sz); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_v_rem); + __pyx_v_rem = __pyx_t_1; + __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":542 + * pos = 0 + * rem = attrs[idx].value_sz + * st = set([]) # <<<<<<<<<<<<<< + * while rem >= 4: + * sz = struct.unpack('= 4: # <<<<<<<<<<<<<< + * sz = struct.unpack('= 4: + * sz = struct.unpack('= 4: + * sz = struct.unpack('= 8: + */ + __pyx_t_7 = __Pyx_PyInt_FromSize_t((__pyx_v_attrs[__pyx_v_idx]).value_sz); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_v_rem); + __pyx_v_rem = __pyx_t_7; + __pyx_t_7 = 0; + + /* "_hyperdex_client.pyx":556 + * pos = 0 + * rem = attrs[idx].value_sz + * st = set([]) # <<<<<<<<<<<<<< + * while rem >= 8: + * st.add(struct.unpack('= 8: # <<<<<<<<<<<<<< + * st.add(struct.unpack('= 8: + * st.add(struct.unpack('= 8: + * st.add(struct.unpack('= 8: + */ + __pyx_t_5 = __Pyx_PyInt_FromSize_t((__pyx_v_attrs[__pyx_v_idx]).value_sz); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_v_rem); + __pyx_v_rem = __pyx_t_5; + __pyx_t_5 = 0; + + /* "_hyperdex_client.pyx":567 + * pos = 0 + * rem = attrs[idx].value_sz + * st = set([]) # <<<<<<<<<<<<<< + * while rem >= 8: + * st.add(struct.unpack('= 8: # <<<<<<<<<<<<<< + * st.add(struct.unpack('= 8: + * st.add(struct.unpack('= 8: + * st.add(struct.unpack('= 4: + */ + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_attrs[__pyx_v_idx]).value_sz); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_v_rem); + __pyx_v_rem = __pyx_t_1; + __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":578 + * pos = 0 + * rem = attrs[idx].value_sz + * dct = {} # <<<<<<<<<<<<<< + * while rem >= 4: + * sz = struct.unpack('= 4: # <<<<<<<<<<<<<< + * sz = struct.unpack('= 4: + * sz = struct.unpack('= 4: + * sz = struct.unpack('= 4: + */ + __pyx_t_5 = __Pyx_PyInt_FromSize_t((__pyx_v_attrs[__pyx_v_idx]).value_sz); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_v_rem); + __pyx_v_rem = __pyx_t_5; + __pyx_t_5 = 0; + + /* "_hyperdex_client.pyx":599 + * pos = 0 + * rem = attrs[idx].value_sz + * dct = {} # <<<<<<<<<<<<<< + * while rem >= 4: + * sz = struct.unpack('= 4: # <<<<<<<<<<<<<< + * sz = struct.unpack('= 4: + * sz = struct.unpack('= 4: + * sz = struct.unpack('= 8: + */ + __pyx_t_7 = __Pyx_PyInt_FromSize_t((__pyx_v_attrs[__pyx_v_idx]).value_sz); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_v_rem); + __pyx_v_rem = __pyx_t_7; + __pyx_t_7 = 0; + + /* "_hyperdex_client.pyx":619 + * pos = 0 + * rem = attrs[idx].value_sz + * dct = {} # <<<<<<<<<<<<<< + * while rem >= 8: + * key = struct.unpack('= 8: # <<<<<<<<<<<<<< + * key = struct.unpack('= 8: + * key = struct.unpack('= 8: + * key = struct.unpack('= 16: + */ + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_attrs[__pyx_v_idx]).value_sz); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_v_rem); + __pyx_v_rem = __pyx_t_1; + __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":637 + * pos = 0 + * rem = attrs[idx].value_sz + * dct = {} # <<<<<<<<<<<<<< + * while rem >= 16: + * key = struct.unpack('= 16: # <<<<<<<<<<<<<< + * key = struct.unpack('= 16: + * key = struct.unpack('= 16: + * key = struct.unpack('= 8: + */ + __pyx_t_5 = __Pyx_PyInt_FromSize_t((__pyx_v_attrs[__pyx_v_idx]).value_sz); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_v_rem); + __pyx_v_rem = __pyx_t_5; + __pyx_t_5 = 0; + + /* "_hyperdex_client.pyx":650 + * pos = 0 + * rem = attrs[idx].value_sz + * dct = {} # <<<<<<<<<<<<<< + * while rem >= 8: + * key = struct.unpack('= 8: # <<<<<<<<<<<<<< + * key = struct.unpack('= 8: + * key = struct.unpack('= 8: + * key = struct.unpack('= 8: + */ + __pyx_t_7 = __Pyx_PyInt_FromSize_t((__pyx_v_attrs[__pyx_v_idx]).value_sz); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_v_rem); + __pyx_v_rem = __pyx_t_7; + __pyx_t_7 = 0; + + /* "_hyperdex_client.pyx":668 + * pos = 0 + * rem = attrs[idx].value_sz + * dct = {} # <<<<<<<<<<<<<< + * while rem >= 8: + * key = struct.unpack('= 8: # <<<<<<<<<<<<<< + * key = struct.unpack('= 8: + * key = struct.unpack('= 8: + * key = struct.unpack('= 16: + */ + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_attrs[__pyx_v_idx]).value_sz); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_v_rem); + __pyx_v_rem = __pyx_t_1; + __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":685 + * pos = 0 + * rem = attrs[idx].value_sz + * dct = {} # <<<<<<<<<<<<<< + * while rem >= 16: + * key = struct.unpack('= 16: # <<<<<<<<<<<<<< + * key = struct.unpack('= 16: + * key = struct.unpack('= 16: + * key = struct.unpack('= 4: + */ + __pyx_t_5 = __Pyx_PyInt_FromSize_t((__pyx_v_attrs[__pyx_v_idx]).value_sz); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_v_rem); + __pyx_v_rem = __pyx_t_5; + __pyx_t_5 = 0; + + /* "_hyperdex_client.pyx":698 + * pos = 0 + * rem = attrs[idx].value_sz + * dct = {} # <<<<<<<<<<<<<< + * while rem >= 4: + * sz = struct.unpack('= 4: # <<<<<<<<<<<<<< + * sz = struct.unpack('= 4: + * sz = struct.unpack('= 4: + * sz = struct.unpack('= 8: + */ + __pyx_t_7 = __Pyx_PyInt_FromSize_t((__pyx_v_attrs[__pyx_v_idx]).value_sz); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_v_rem); + __pyx_v_rem = __pyx_t_7; + __pyx_t_7 = 0; + + /* "_hyperdex_client.pyx":718 + * pos = 0 + * rem = attrs[idx].value_sz + * dct = {} # <<<<<<<<<<<<<< + * while rem >= 8: + * key = struct.unpack('= 8: # <<<<<<<<<<<<<< + * key = struct.unpack('= 8: + * key = struct.unpack('= 8: + * key = struct.unpack('= 0 and idx < attrs_sz and attrs and attrs[idx].attr: + */ + __pyx_v_idx = (-2 - __pyx_v_reqid); + + /* "_hyperdex_client.pyx":747 + * if reqid < 0: + * idx = -2 - reqid + * attr = None # <<<<<<<<<<<<<< + * if idx >= 0 and idx < attrs_sz and attrs and attrs[idx].attr: + * attr = attrs[idx].attr + */ + __Pyx_INCREF(Py_None); + __pyx_v_attr = ((PyObject*)Py_None); + + /* "_hyperdex_client.pyx":748 + * idx = -2 - reqid + * attr = None + * if idx >= 0 and idx < attrs_sz and attrs and attrs[idx].attr: # <<<<<<<<<<<<<< + * attr = attrs[idx].attr + * raise HyperClientException(status, attr) + */ + __pyx_t_1 = (__pyx_v_idx >= 0); + if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_idx < __pyx_v_attrs_sz); + if (__pyx_t_2) { + if ((__pyx_v_attrs != 0)) { + __pyx_t_3 = ((__pyx_v_attrs[__pyx_v_idx]).attr != 0); + } else { + __pyx_t_3 = (__pyx_v_attrs != 0); + } + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = __pyx_t_2; + } + __pyx_t_2 = __pyx_t_4; + } else { + __pyx_t_2 = __pyx_t_1; + } + if (__pyx_t_2) { + + /* "_hyperdex_client.pyx":749 + * attr = None + * if idx >= 0 and idx < attrs_sz and attrs and attrs[idx].attr: + * attr = attrs[idx].attr # <<<<<<<<<<<<<< + * raise HyperClientException(status, attr) + * + */ + __pyx_t_5 = __Pyx_PyBytes_FromString((__pyx_v_attrs[__pyx_v_idx]).attr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_DECREF(((PyObject *)__pyx_v_attr)); + __pyx_v_attr = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L4; + } + __pyx_L4:; + + /* "_hyperdex_client.pyx":750 + * if idx >= 0 and idx < attrs_sz and attrs and attrs[idx].attr: + * attr = attrs[idx].attr + * raise HyperClientException(status, attr) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_122); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyInt_FromLong(__pyx_v_status); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_attr)); + PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_v_attr)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_attr)); + __pyx_t_6 = 0; + __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L3; + } + __pyx_L3:; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("_hyperdex_client._check_reqid_key_attrs", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_attr); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":753 + * + * + * cdef _check_reqid_key_conds(int64_t reqid, hyperdex_client_returncode status, # <<<<<<<<<<<<<< + * hyperdex_client_attribute_check* conds, size_t conds_sz): + * cdef bytes attr + */ + +static PyObject *__pyx_f_16_hyperdex_client__check_reqid_key_conds(int64_t __pyx_v_reqid, enum hyperdex_client_returncode __pyx_v_status, struct hyperdex_client_attribute_check *__pyx_v_conds, size_t __pyx_v_conds_sz) { + PyObject *__pyx_v_attr = 0; + int64_t __pyx_v_idx; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_check_reqid_key_conds", 0); + + /* "_hyperdex_client.pyx":756 + * hyperdex_client_attribute_check* conds, size_t conds_sz): + * cdef bytes attr + * if reqid < 0: # <<<<<<<<<<<<<< + * idx = -2 - reqid + * attr = None + */ + __pyx_t_1 = (__pyx_v_reqid < 0); + if (__pyx_t_1) { + + /* "_hyperdex_client.pyx":757 + * cdef bytes attr + * if reqid < 0: + * idx = -2 - reqid # <<<<<<<<<<<<<< + * attr = None + * if idx >= 0 and idx < conds_sz and conds and conds[idx].attr: + */ + __pyx_v_idx = (-2 - __pyx_v_reqid); + + /* "_hyperdex_client.pyx":758 + * if reqid < 0: + * idx = -2 - reqid + * attr = None # <<<<<<<<<<<<<< + * if idx >= 0 and idx < conds_sz and conds and conds[idx].attr: + * attr = conds[idx].attr + */ + __Pyx_INCREF(Py_None); + __pyx_v_attr = ((PyObject*)Py_None); + + /* "_hyperdex_client.pyx":759 + * idx = -2 - reqid + * attr = None + * if idx >= 0 and idx < conds_sz and conds and conds[idx].attr: # <<<<<<<<<<<<<< + * attr = conds[idx].attr + * raise HyperClientException(status, attr) + */ + __pyx_t_1 = (__pyx_v_idx >= 0); + if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_idx < __pyx_v_conds_sz); + if (__pyx_t_2) { + if ((__pyx_v_conds != 0)) { + __pyx_t_3 = ((__pyx_v_conds[__pyx_v_idx]).attr != 0); + } else { + __pyx_t_3 = (__pyx_v_conds != 0); + } + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = __pyx_t_2; + } + __pyx_t_2 = __pyx_t_4; + } else { + __pyx_t_2 = __pyx_t_1; + } + if (__pyx_t_2) { + + /* "_hyperdex_client.pyx":760 + * attr = None + * if idx >= 0 and idx < conds_sz and conds and conds[idx].attr: + * attr = conds[idx].attr # <<<<<<<<<<<<<< + * raise HyperClientException(status, attr) + * + */ + __pyx_t_5 = __Pyx_PyBytes_FromString((__pyx_v_conds[__pyx_v_idx]).attr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_DECREF(((PyObject *)__pyx_v_attr)); + __pyx_v_attr = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L4; + } + __pyx_L4:; + + /* "_hyperdex_client.pyx":761 + * if idx >= 0 and idx < conds_sz and conds and conds[idx].attr: + * attr = conds[idx].attr + * raise HyperClientException(status, attr) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_122); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyInt_FromLong(__pyx_v_status); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_attr)); + PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_v_attr)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_attr)); + __pyx_t_6 = 0; + __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L3; + } + __pyx_L3:; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("_hyperdex_client._check_reqid_key_conds", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_attr); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":764 + * + * + * cdef _check_reqid_key_attrs2(int64_t reqid, hyperdex_client_returncode status, # <<<<<<<<<<<<<< + * hyperdex_client_attribute_check* attrs1, size_t attrs_sz1, + * hyperdex_client_attribute* attrs2, size_t attrs_sz2): + */ + +static PyObject *__pyx_f_16_hyperdex_client__check_reqid_key_attrs2(int64_t __pyx_v_reqid, enum hyperdex_client_returncode __pyx_v_status, struct hyperdex_client_attribute_check *__pyx_v_attrs1, size_t __pyx_v_attrs_sz1, struct hyperdex_client_attribute *__pyx_v_attrs2, size_t __pyx_v_attrs_sz2) { + PyObject *__pyx_v_attr = 0; + PyObject *__pyx_v_idx = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_check_reqid_key_attrs2", 0); + + /* "_hyperdex_client.pyx":768 + * hyperdex_client_attribute* attrs2, size_t attrs_sz2): + * cdef bytes attr + * if reqid < 0: # <<<<<<<<<<<<<< + * idx = -2 - reqid + * attr = None + */ + __pyx_t_1 = (__pyx_v_reqid < 0); + if (__pyx_t_1) { + + /* "_hyperdex_client.pyx":769 + * cdef bytes attr + * if reqid < 0: + * idx = -2 - reqid # <<<<<<<<<<<<<< + * attr = None + * if idx >= 0 and idx < attrs_sz1 and attrs1 and attrs1[idx].attr: + */ + __pyx_t_2 = __Pyx_PyInt_to_py_int64_t((-2 - __pyx_v_reqid)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_idx = __pyx_t_2; + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":770 + * if reqid < 0: + * idx = -2 - reqid + * attr = None # <<<<<<<<<<<<<< + * if idx >= 0 and idx < attrs_sz1 and attrs1 and attrs1[idx].attr: + * attr = attrs1[idx].attr + */ + __Pyx_INCREF(Py_None); + __pyx_v_attr = ((PyObject*)Py_None); + + /* "_hyperdex_client.pyx":771 + * idx = -2 - reqid + * attr = None + * if idx >= 0 and idx < attrs_sz1 and attrs1 and attrs1[idx].attr: # <<<<<<<<<<<<<< + * attr = attrs1[idx].attr + * idx -= attrs_sz2 + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_idx, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_attrs_sz1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_idx, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { + if ((__pyx_v_attrs1 != 0)) { + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((__pyx_v_attrs1[__pyx_t_5]).attr != 0); + } else { + __pyx_t_6 = (__pyx_v_attrs1 != 0); + } + __pyx_t_7 = __pyx_t_6; + } else { + __pyx_t_7 = __pyx_t_4; + } + __pyx_t_4 = __pyx_t_7; + } else { + __pyx_t_4 = __pyx_t_1; + } + if (__pyx_t_4) { + + /* "_hyperdex_client.pyx":772 + * attr = None + * if idx >= 0 and idx < attrs_sz1 and attrs1 and attrs1[idx].attr: + * attr = attrs1[idx].attr # <<<<<<<<<<<<<< + * idx -= attrs_sz2 + * if idx >= 0 and idx < attrs_sz2 and attrs2 and attrs2[idx].attr: + */ + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyBytes_FromString((__pyx_v_attrs1[__pyx_t_5]).attr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_DECREF(((PyObject *)__pyx_v_attr)); + __pyx_v_attr = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L4; + } + __pyx_L4:; + + /* "_hyperdex_client.pyx":773 + * if idx >= 0 and idx < attrs_sz1 and attrs1 and attrs1[idx].attr: + * attr = attrs1[idx].attr + * idx -= attrs_sz2 # <<<<<<<<<<<<<< + * if idx >= 0 and idx < attrs_sz2 and attrs2 and attrs2[idx].attr: + * attr = attrs2[idx].attr + */ + __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_attrs_sz2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_InPlaceSubtract(__pyx_v_idx, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_v_idx); + __pyx_v_idx = __pyx_t_2; + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":774 + * attr = attrs1[idx].attr + * idx -= attrs_sz2 + * if idx >= 0 and idx < attrs_sz2 and attrs2 and attrs2[idx].attr: # <<<<<<<<<<<<<< + * attr = attrs2[idx].attr + * raise HyperClientException(status, attr) + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_idx, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_4) { + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_attrs_sz2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_idx, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + if ((__pyx_v_attrs2 != 0)) { + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((__pyx_v_attrs2[__pyx_t_5]).attr != 0); + } else { + __pyx_t_7 = (__pyx_v_attrs2 != 0); + } + __pyx_t_6 = __pyx_t_7; + } else { + __pyx_t_6 = __pyx_t_1; + } + __pyx_t_1 = __pyx_t_6; + } else { + __pyx_t_1 = __pyx_t_4; + } + if (__pyx_t_1) { + + /* "_hyperdex_client.pyx":775 + * idx -= attrs_sz2 + * if idx >= 0 and idx < attrs_sz2 and attrs2 and attrs2[idx].attr: + * attr = attrs2[idx].attr # <<<<<<<<<<<<<< + * raise HyperClientException(status, attr) + * + */ + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyBytes_FromString((__pyx_v_attrs2[__pyx_t_5]).attr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_DECREF(((PyObject *)__pyx_v_attr)); + __pyx_v_attr = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L5; + } + __pyx_L5:; + + /* "_hyperdex_client.pyx":776 + * if idx >= 0 and idx < attrs_sz2 and attrs2 and attrs2[idx].attr: + * attr = attrs2[idx].attr + * raise HyperClientException(status, attr) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_122); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyInt_FromLong(__pyx_v_status); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_attr)); + PyTuple_SET_ITEM(__pyx_t_8, 1, ((PyObject *)__pyx_v_attr)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_attr)); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L3; + } + __pyx_L3:; + + __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_8); + __Pyx_AddTraceback("_hyperdex_client._check_reqid_key_attrs2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_attr); + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":779 + * + * + * cdef _check_reqid_key_cond_map_attrs(int64_t reqid, hyperdex_client_returncode status, # <<<<<<<<<<<<<< + * hyperdex_client_attribute_check* attrs1, size_t attrs_sz1, + * hyperdex_client_map_attribute* attrs2, size_t attrs_sz2): + */ + +static PyObject *__pyx_f_16_hyperdex_client__check_reqid_key_cond_map_attrs(int64_t __pyx_v_reqid, enum hyperdex_client_returncode __pyx_v_status, struct hyperdex_client_attribute_check *__pyx_v_attrs1, size_t __pyx_v_attrs_sz1, struct hyperdex_client_map_attribute *__pyx_v_attrs2, size_t __pyx_v_attrs_sz2) { + PyObject *__pyx_v_attr = 0; + PyObject *__pyx_v_idx = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_check_reqid_key_cond_map_attrs", 0); + + /* "_hyperdex_client.pyx":783 + * hyperdex_client_map_attribute* attrs2, size_t attrs_sz2): + * cdef bytes attr + * if reqid < 0: # <<<<<<<<<<<<<< + * idx = -2 - reqid + * attr = None + */ + __pyx_t_1 = (__pyx_v_reqid < 0); + if (__pyx_t_1) { + + /* "_hyperdex_client.pyx":784 + * cdef bytes attr + * if reqid < 0: + * idx = -2 - reqid # <<<<<<<<<<<<<< + * attr = None + * if idx >= 0 and idx < attrs_sz1 and attrs1 and attrs1[idx].attr: + */ + __pyx_t_2 = __Pyx_PyInt_to_py_int64_t((-2 - __pyx_v_reqid)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_idx = __pyx_t_2; + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":785 + * if reqid < 0: + * idx = -2 - reqid + * attr = None # <<<<<<<<<<<<<< + * if idx >= 0 and idx < attrs_sz1 and attrs1 and attrs1[idx].attr: + * attr = attrs1[idx].attr + */ + __Pyx_INCREF(Py_None); + __pyx_v_attr = ((PyObject*)Py_None); + + /* "_hyperdex_client.pyx":786 + * idx = -2 - reqid + * attr = None + * if idx >= 0 and idx < attrs_sz1 and attrs1 and attrs1[idx].attr: # <<<<<<<<<<<<<< + * attr = attrs1[idx].attr + * idx -= attrs_sz2 + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_idx, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_attrs_sz1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_idx, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { + if ((__pyx_v_attrs1 != 0)) { + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((__pyx_v_attrs1[__pyx_t_5]).attr != 0); + } else { + __pyx_t_6 = (__pyx_v_attrs1 != 0); + } + __pyx_t_7 = __pyx_t_6; + } else { + __pyx_t_7 = __pyx_t_4; + } + __pyx_t_4 = __pyx_t_7; + } else { + __pyx_t_4 = __pyx_t_1; + } + if (__pyx_t_4) { + + /* "_hyperdex_client.pyx":787 + * attr = None + * if idx >= 0 and idx < attrs_sz1 and attrs1 and attrs1[idx].attr: + * attr = attrs1[idx].attr # <<<<<<<<<<<<<< + * idx -= attrs_sz2 + * if idx >= 0 and idx < attrs_sz2 and attrs2 and attrs2[idx].attr: + */ + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyBytes_FromString((__pyx_v_attrs1[__pyx_t_5]).attr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_DECREF(((PyObject *)__pyx_v_attr)); + __pyx_v_attr = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L4; + } + __pyx_L4:; + + /* "_hyperdex_client.pyx":788 + * if idx >= 0 and idx < attrs_sz1 and attrs1 and attrs1[idx].attr: + * attr = attrs1[idx].attr + * idx -= attrs_sz2 # <<<<<<<<<<<<<< + * if idx >= 0 and idx < attrs_sz2 and attrs2 and attrs2[idx].attr: + * attr = attrs2[idx].attr + */ + __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_attrs_sz2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_InPlaceSubtract(__pyx_v_idx, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_v_idx); + __pyx_v_idx = __pyx_t_2; + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":789 + * attr = attrs1[idx].attr + * idx -= attrs_sz2 + * if idx >= 0 and idx < attrs_sz2 and attrs2 and attrs2[idx].attr: # <<<<<<<<<<<<<< + * attr = attrs2[idx].attr + * raise HyperClientException(status, attr) + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_idx, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_4) { + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_attrs_sz2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_idx, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + if ((__pyx_v_attrs2 != 0)) { + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((__pyx_v_attrs2[__pyx_t_5]).attr != 0); + } else { + __pyx_t_7 = (__pyx_v_attrs2 != 0); + } + __pyx_t_6 = __pyx_t_7; + } else { + __pyx_t_6 = __pyx_t_1; + } + __pyx_t_1 = __pyx_t_6; + } else { + __pyx_t_1 = __pyx_t_4; + } + if (__pyx_t_1) { + + /* "_hyperdex_client.pyx":790 + * idx -= attrs_sz2 + * if idx >= 0 and idx < attrs_sz2 and attrs2 and attrs2[idx].attr: + * attr = attrs2[idx].attr # <<<<<<<<<<<<<< + * raise HyperClientException(status, attr) + * + */ + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyBytes_FromString((__pyx_v_attrs2[__pyx_t_5]).attr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_DECREF(((PyObject *)__pyx_v_attr)); + __pyx_v_attr = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L5; + } + __pyx_L5:; + + /* "_hyperdex_client.pyx":791 + * if idx >= 0 and idx < attrs_sz2 and attrs2 and attrs2[idx].attr: + * attr = attrs2[idx].attr + * raise HyperClientException(status, attr) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_122); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyInt_FromLong(__pyx_v_status); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_attr)); + PyTuple_SET_ITEM(__pyx_t_8, 1, ((PyObject *)__pyx_v_attr)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_attr)); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L3; + } + __pyx_L3:; + + __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_8); + __Pyx_AddTraceback("_hyperdex_client._check_reqid_key_cond_map_attrs", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_attr); + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":794 + * + * + * cdef _check_reqid_key_map_attrs(int64_t reqid, hyperdex_client_returncode status, # <<<<<<<<<<<<<< + * hyperdex_client_map_attribute* attrs, size_t attrs_sz): + * cdef bytes attr + */ + +static PyObject *__pyx_f_16_hyperdex_client__check_reqid_key_map_attrs(int64_t __pyx_v_reqid, enum hyperdex_client_returncode __pyx_v_status, struct hyperdex_client_map_attribute *__pyx_v_attrs, size_t __pyx_v_attrs_sz) { + PyObject *__pyx_v_attr = 0; + int64_t __pyx_v_idx; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_check_reqid_key_map_attrs", 0); + + /* "_hyperdex_client.pyx":797 + * hyperdex_client_map_attribute* attrs, size_t attrs_sz): + * cdef bytes attr + * if reqid < 0: # <<<<<<<<<<<<<< + * idx = -2 - reqid + * attr = None + */ + __pyx_t_1 = (__pyx_v_reqid < 0); + if (__pyx_t_1) { + + /* "_hyperdex_client.pyx":798 + * cdef bytes attr + * if reqid < 0: + * idx = -2 - reqid # <<<<<<<<<<<<<< + * attr = None + * if idx >= 0 and idx < attrs_sz and attrs and attrs[idx].attr: + */ + __pyx_v_idx = (-2 - __pyx_v_reqid); + + /* "_hyperdex_client.pyx":799 + * if reqid < 0: + * idx = -2 - reqid + * attr = None # <<<<<<<<<<<<<< + * if idx >= 0 and idx < attrs_sz and attrs and attrs[idx].attr: + * attr = attrs[idx].attr + */ + __Pyx_INCREF(Py_None); + __pyx_v_attr = ((PyObject*)Py_None); + + /* "_hyperdex_client.pyx":800 + * idx = -2 - reqid + * attr = None + * if idx >= 0 and idx < attrs_sz and attrs and attrs[idx].attr: # <<<<<<<<<<<<<< + * attr = attrs[idx].attr + * raise HyperClientException(status, attr) + */ + __pyx_t_1 = (__pyx_v_idx >= 0); + if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_idx < __pyx_v_attrs_sz); + if (__pyx_t_2) { + if ((__pyx_v_attrs != 0)) { + __pyx_t_3 = ((__pyx_v_attrs[__pyx_v_idx]).attr != 0); + } else { + __pyx_t_3 = (__pyx_v_attrs != 0); + } + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = __pyx_t_2; + } + __pyx_t_2 = __pyx_t_4; + } else { + __pyx_t_2 = __pyx_t_1; + } + if (__pyx_t_2) { + + /* "_hyperdex_client.pyx":801 + * attr = None + * if idx >= 0 and idx < attrs_sz and attrs and attrs[idx].attr: + * attr = attrs[idx].attr # <<<<<<<<<<<<<< + * raise HyperClientException(status, attr) + * + */ + __pyx_t_5 = __Pyx_PyBytes_FromString((__pyx_v_attrs[__pyx_v_idx]).attr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_DECREF(((PyObject *)__pyx_v_attr)); + __pyx_v_attr = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L4; + } + __pyx_L4:; + + /* "_hyperdex_client.pyx":802 + * if idx >= 0 and idx < attrs_sz and attrs and attrs[idx].attr: + * attr = attrs[idx].attr + * raise HyperClientException(status, attr) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_122); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyInt_FromLong(__pyx_v_status); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_attr)); + PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_v_attr)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_attr)); + __pyx_t_6 = 0; + __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L3; + } + __pyx_L3:; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("_hyperdex_client._check_reqid_key_map_attrs", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_attr); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":805 + * + * + * cdef _check_reqid_search(int64_t reqid, hyperdex_client_returncode status, # <<<<<<<<<<<<<< + * hyperdex_client_attribute_check* chks, size_t chks_sz): + * cdef bytes attr + */ + +static PyObject *__pyx_f_16_hyperdex_client__check_reqid_search(int64_t __pyx_v_reqid, enum hyperdex_client_returncode __pyx_v_status, struct hyperdex_client_attribute_check *__pyx_v_chks, size_t __pyx_v_chks_sz) { + PyObject *__pyx_v_attr = 0; + int64_t __pyx_v_idx; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_check_reqid_search", 0); + + /* "_hyperdex_client.pyx":808 + * hyperdex_client_attribute_check* chks, size_t chks_sz): + * cdef bytes attr + * if reqid < 0: # <<<<<<<<<<<<<< + * idx = -1 - reqid + * attr = None + */ + __pyx_t_1 = (__pyx_v_reqid < 0); + if (__pyx_t_1) { + + /* "_hyperdex_client.pyx":809 + * cdef bytes attr + * if reqid < 0: + * idx = -1 - reqid # <<<<<<<<<<<<<< + * attr = None + * if idx >= 0 and idx < chks_sz and chks and chks[idx].attr: + */ + __pyx_v_idx = (-1 - __pyx_v_reqid); + + /* "_hyperdex_client.pyx":810 + * if reqid < 0: + * idx = -1 - reqid + * attr = None # <<<<<<<<<<<<<< + * if idx >= 0 and idx < chks_sz and chks and chks[idx].attr: + * attr = chks[idx].attr + */ + __Pyx_INCREF(Py_None); + __pyx_v_attr = ((PyObject*)Py_None); + + /* "_hyperdex_client.pyx":811 + * idx = -1 - reqid + * attr = None + * if idx >= 0 and idx < chks_sz and chks and chks[idx].attr: # <<<<<<<<<<<<<< + * attr = chks[idx].attr + * raise HyperClientException(status, attr) + */ + __pyx_t_1 = (__pyx_v_idx >= 0); + if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_idx < __pyx_v_chks_sz); + if (__pyx_t_2) { + if ((__pyx_v_chks != 0)) { + __pyx_t_3 = ((__pyx_v_chks[__pyx_v_idx]).attr != 0); + } else { + __pyx_t_3 = (__pyx_v_chks != 0); + } + __pyx_t_4 = __pyx_t_3; + } else { + __pyx_t_4 = __pyx_t_2; + } + __pyx_t_2 = __pyx_t_4; + } else { + __pyx_t_2 = __pyx_t_1; + } + if (__pyx_t_2) { + + /* "_hyperdex_client.pyx":812 + * attr = None + * if idx >= 0 and idx < chks_sz and chks and chks[idx].attr: + * attr = chks[idx].attr # <<<<<<<<<<<<<< + * raise HyperClientException(status, attr) + * + */ + __pyx_t_5 = __Pyx_PyBytes_FromString((__pyx_v_chks[__pyx_v_idx]).attr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_DECREF(((PyObject *)__pyx_v_attr)); + __pyx_v_attr = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L4; + } + __pyx_L4:; + + /* "_hyperdex_client.pyx":813 + * if idx >= 0 and idx < chks_sz and chks and chks[idx].attr: + * attr = chks[idx].attr + * raise HyperClientException(status, attr) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_122); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyInt_FromLong(__pyx_v_status); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_attr)); + PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_v_attr)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_attr)); + __pyx_t_6 = 0; + __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L3; + } + __pyx_L3:; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("_hyperdex_client._check_reqid_search", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_attr); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_16_hyperdex_client_8Deferred_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_16_hyperdex_client_8Deferred_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client = 0; + CYTHON_UNUSED PyObject *__pyx_v_args = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + 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_RefNannyFinishContext(); + return -1; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__client,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__client)) != 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, 0, values, used_pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __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_client = ((struct __pyx_obj_16_hyperdex_client_Client *)values[0]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("_hyperdex_client.Deferred.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_client), __pyx_ptype_16_hyperdex_client_Client, 1, "client", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_8Deferred___cinit__(((struct __pyx_obj_16_hyperdex_client_Deferred *)__pyx_v_self), __pyx_v_client, __pyx_v_args); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":823 + * cdef bint _finished + * + * def __cinit__(self, Client client, *args): # <<<<<<<<<<<<<< + * self._client = client + * self._reqid = 0 + */ + +static int __pyx_pf_16_hyperdex_client_8Deferred___cinit__(struct __pyx_obj_16_hyperdex_client_Deferred *__pyx_v_self, struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client, CYTHON_UNUSED PyObject *__pyx_v_args) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "_hyperdex_client.pyx":824 + * + * def __cinit__(self, Client client, *args): + * self._client = client # <<<<<<<<<<<<<< + * self._reqid = 0 + * self._status = HYPERDEX_CLIENT_GARBAGE + */ + __Pyx_INCREF(((PyObject *)__pyx_v_client)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_client)); + __Pyx_GOTREF(__pyx_v_self->_client); + __Pyx_DECREF(((PyObject *)__pyx_v_self->_client)); + __pyx_v_self->_client = __pyx_v_client; + + /* "_hyperdex_client.pyx":825 + * def __cinit__(self, Client client, *args): + * self._client = client + * self._reqid = 0 # <<<<<<<<<<<<<< + * self._status = HYPERDEX_CLIENT_GARBAGE + * self._finished = False + */ + __pyx_v_self->_reqid = 0; + + /* "_hyperdex_client.pyx":826 + * self._client = client + * self._reqid = 0 + * self._status = HYPERDEX_CLIENT_GARBAGE # <<<<<<<<<<<<<< + * self._finished = False + * + */ + __pyx_v_self->_status = HYPERDEX_CLIENT_GARBAGE; + + /* "_hyperdex_client.pyx":827 + * self._reqid = 0 + * self._status = HYPERDEX_CLIENT_GARBAGE + * self._finished = False # <<<<<<<<<<<<<< + * + * def _callback(self): + */ + __pyx_v_self->_finished = 0; + + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_8Deferred_3_callback(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_8Deferred_3_callback(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_callback (wrapper)", 0); + __pyx_r = __pyx_pf_16_hyperdex_client_8Deferred_2_callback(((struct __pyx_obj_16_hyperdex_client_Deferred *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":829 + * self._finished = False + * + * def _callback(self): # <<<<<<<<<<<<<< + * self._finished = True + * del self._client._ops[self._reqid] + */ + +static PyObject *__pyx_pf_16_hyperdex_client_8Deferred_2_callback(struct __pyx_obj_16_hyperdex_client_Deferred *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_callback", 0); + + /* "_hyperdex_client.pyx":830 + * + * def _callback(self): + * self._finished = True # <<<<<<<<<<<<<< + * del self._client._ops[self._reqid] + * + */ + __pyx_v_self->_finished = 1; + + /* "_hyperdex_client.pyx":831 + * def _callback(self): + * self._finished = True + * del self._client._ops[self._reqid] # <<<<<<<<<<<<<< + * + * def wait(self): + */ + if (unlikely(((PyObject *)__pyx_v_self->_client->_ops) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (__Pyx_DelItemInt(((PyObject *)__pyx_v_self->_client->_ops), __pyx_v_self->_reqid, sizeof(int64_t), __Pyx_PyInt_to_py_int64_t, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("_hyperdex_client.Deferred._callback", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_8Deferred_5wait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_8Deferred_5wait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wait (wrapper)", 0); + __pyx_r = __pyx_pf_16_hyperdex_client_8Deferred_4wait(((struct __pyx_obj_16_hyperdex_client_Deferred *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":833 + * del self._client._ops[self._reqid] + * + * def wait(self): # <<<<<<<<<<<<<< + * while not self._finished and self._reqid > 0: + * self._client.loop() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_8Deferred_4wait(struct __pyx_obj_16_hyperdex_client_Deferred *__pyx_v_self) { + 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; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wait", 0); + + /* "_hyperdex_client.pyx":834 + * + * def wait(self): + * while not self._finished and self._reqid > 0: # <<<<<<<<<<<<<< + * self._client.loop() + * self._finished = True + */ + while (1) { + __pyx_t_1 = (!__pyx_v_self->_finished); + if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_self->_reqid > 0); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_1; + } + if (!__pyx_t_3) break; + + /* "_hyperdex_client.pyx":835 + * def wait(self): + * while not self._finished and self._reqid > 0: + * self._client.loop() # <<<<<<<<<<<<<< + * self._finished = True + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_client), __pyx_n_s__loop); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + + /* "_hyperdex_client.pyx":836 + * while not self._finished and self._reqid > 0: + * self._client.loop() + * self._finished = True # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_self->_finished = 1; + + __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_AddTraceback("_hyperdex_client.Deferred.wait", __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_16_hyperdex_client_11DeferredGet_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_16_hyperdex_client_11DeferredGet_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client = 0; + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__client,&__pyx_n_s__space,&__pyx_n_s__key,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__client)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__space)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __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_client = ((struct __pyx_obj_16_hyperdex_client_Client *)values[0]); + __pyx_v_space = ((PyObject*)values[1]); + __pyx_v_key = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.DeferredGet.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_client), __pyx_ptype_16_hyperdex_client_Client, 1, "client", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_11DeferredGet___cinit__(((struct __pyx_obj_16_hyperdex_client_DeferredGet *)__pyx_v_self), __pyx_v_client, __pyx_v_space, __pyx_v_key); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":845 + * cdef bytes _space + * + * def __cinit__(self, Client client, bytes space, key): # <<<<<<<<<<<<<< + * self._attrs = NULL + * self._attrs_sz = 0 + */ + +static int __pyx_pf_16_hyperdex_client_11DeferredGet___cinit__(struct __pyx_obj_16_hyperdex_client_DeferredGet *__pyx_v_self, struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client, PyObject *__pyx_v_space, PyObject *__pyx_v_key) { + PyObject *__pyx_v_key_backing = 0; + CYTHON_UNUSED PyObject *__pyx_v_datatype = NULL; + char *__pyx_v_space_cstr; + char *__pyx_v_key_cstr; + 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)(PyObject *); + char *__pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "_hyperdex_client.pyx":846 + * + * def __cinit__(self, Client client, bytes space, key): + * self._attrs = NULL # <<<<<<<<<<<<<< + * self._attrs_sz = 0 + * self._space = space + */ + __pyx_v_self->_attrs = ((struct hyperdex_client_attribute *)NULL); + + /* "_hyperdex_client.pyx":847 + * def __cinit__(self, Client client, bytes space, key): + * self._attrs = NULL + * self._attrs_sz = 0 # <<<<<<<<<<<<<< + * self._space = space + * cdef bytes key_backing + */ + __pyx_v_self->_attrs_sz = 0; + + /* "_hyperdex_client.pyx":848 + * self._attrs = NULL + * self._attrs_sz = 0 + * self._space = space # <<<<<<<<<<<<<< + * cdef bytes key_backing + * datatype, key_backing = _obj_to_backing(key) + */ + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_GOTREF(__pyx_v_self->_space); + __Pyx_DECREF(((PyObject *)__pyx_v_self->_space)); + __pyx_v_self->_space = __pyx_v_space; + + /* "_hyperdex_client.pyx":850 + * self._space = space + * cdef bytes key_backing + * datatype, key_backing = _obj_to_backing(key) # <<<<<<<<<<<<<< + * cdef char* space_cstr = space + * cdef char* key_cstr = key_backing + */ + __pyx_t_1 = __pyx_f_16_hyperdex_client__obj_to_backing(__pyx_v_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __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_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_datatype = __pyx_t_2; + __pyx_t_2 = 0; + __pyx_v_key_backing = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":851 + * cdef bytes key_backing + * datatype, key_backing = _obj_to_backing(key) + * cdef char* space_cstr = space # <<<<<<<<<<<<<< + * cdef char* key_cstr = key_backing + * self._reqid = hyperdex_client_get(client._client, space_cstr, + */ + __pyx_t_6 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_space)); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_space_cstr = __pyx_t_6; + + /* "_hyperdex_client.pyx":852 + * datatype, key_backing = _obj_to_backing(key) + * cdef char* space_cstr = space + * cdef char* key_cstr = key_backing # <<<<<<<<<<<<<< + * self._reqid = hyperdex_client_get(client._client, space_cstr, + * key_cstr, len(key_backing), + */ + __pyx_t_6 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_key_backing)); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_key_cstr = __pyx_t_6; + + /* "_hyperdex_client.pyx":854 + * cdef char* key_cstr = key_backing + * self._reqid = hyperdex_client_get(client._client, space_cstr, + * key_cstr, len(key_backing), # <<<<<<<<<<<<<< + * &self._status, + * &self._attrs, &self._attrs_sz) + */ + if (unlikely(((PyObject *)__pyx_v_key_backing) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = PyBytes_GET_SIZE(((PyObject *)__pyx_v_key_backing)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "_hyperdex_client.pyx":853 + * cdef char* space_cstr = space + * cdef char* key_cstr = key_backing + * self._reqid = hyperdex_client_get(client._client, space_cstr, # <<<<<<<<<<<<<< + * key_cstr, len(key_backing), + * &self._status, + */ + __pyx_v_self->__pyx_base._reqid = hyperdex_client_get(__pyx_v_client->_client, __pyx_v_space_cstr, __pyx_v_key_cstr, __pyx_t_7, (&__pyx_v_self->__pyx_base._status), (&__pyx_v_self->_attrs), (&__pyx_v_self->_attrs_sz)); + + /* "_hyperdex_client.pyx":857 + * &self._status, + * &self._attrs, &self._attrs_sz) + * _check_reqid(self._reqid, self._status) # <<<<<<<<<<<<<< + * client._ops[self._reqid] = self + * + */ + __pyx_t_1 = __pyx_f_16_hyperdex_client__check_reqid(__pyx_v_self->__pyx_base._reqid, __pyx_v_self->__pyx_base._status); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":858 + * &self._attrs, &self._attrs_sz) + * _check_reqid(self._reqid, self._status) + * client._ops[self._reqid] = self # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + if (unlikely(((PyObject *)__pyx_v_client->_ops) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (__Pyx_SetItemInt(((PyObject *)__pyx_v_client->_ops), __pyx_v_self->__pyx_base._reqid, ((PyObject *)__pyx_v_self), sizeof(int64_t), __Pyx_PyInt_to_py_int64_t, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + __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_4); + __Pyx_AddTraceback("_hyperdex_client.DeferredGet.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_key_backing); + __Pyx_XDECREF(__pyx_v_datatype); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static void __pyx_pw_16_hyperdex_client_11DeferredGet_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_16_hyperdex_client_11DeferredGet_3__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_16_hyperdex_client_11DeferredGet_2__dealloc__(((struct __pyx_obj_16_hyperdex_client_DeferredGet *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); +} + +/* "_hyperdex_client.pyx":860 + * client._ops[self._reqid] = self + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * if self._attrs: + * hyperdex_client_destroy_attrs(self._attrs, self._attrs_sz) + */ + +static void __pyx_pf_16_hyperdex_client_11DeferredGet_2__dealloc__(struct __pyx_obj_16_hyperdex_client_DeferredGet *__pyx_v_self) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "_hyperdex_client.pyx":861 + * + * def __dealloc__(self): + * if self._attrs: # <<<<<<<<<<<<<< + * hyperdex_client_destroy_attrs(self._attrs, self._attrs_sz) + * + */ + __pyx_t_1 = (__pyx_v_self->_attrs != 0); + if (__pyx_t_1) { + + /* "_hyperdex_client.pyx":862 + * def __dealloc__(self): + * if self._attrs: + * hyperdex_client_destroy_attrs(self._attrs, self._attrs_sz) # <<<<<<<<<<<<<< + * + * def wait(self): + */ + hyperdex_client_destroy_attrs(__pyx_v_self->_attrs, __pyx_v_self->_attrs_sz); + goto __pyx_L3; + } + __pyx_L3:; + + __Pyx_RefNannyFinishContext(); +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_11DeferredGet_5wait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_11DeferredGet_5wait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wait (wrapper)", 0); + __pyx_r = __pyx_pf_16_hyperdex_client_11DeferredGet_4wait(((struct __pyx_obj_16_hyperdex_client_DeferredGet *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":864 + * hyperdex_client_destroy_attrs(self._attrs, self._attrs_sz) + * + * def wait(self): # <<<<<<<<<<<<<< + * Deferred.wait(self) + * if self._status == HYPERDEX_CLIENT_SUCCESS: + */ + +static PyObject *__pyx_pf_16_hyperdex_client_11DeferredGet_4wait(struct __pyx_obj_16_hyperdex_client_DeferredGet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wait", 0); + + /* "_hyperdex_client.pyx":865 + * + * def wait(self): + * Deferred.wait(self) # <<<<<<<<<<<<<< + * if self._status == HYPERDEX_CLIENT_SUCCESS: + * return _attrs_to_dict(self._attrs, self._attrs_sz) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_Deferred)), __pyx_n_s__wait); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":868 + * if self._status == HYPERDEX_CLIENT_SUCCESS: + * return _attrs_to_dict(self._attrs, self._attrs_sz) + * elif self._status == HYPERDEX_CLIENT_NOTFOUND: # <<<<<<<<<<<<<< + * return None + * else: + */ + switch (__pyx_v_self->__pyx_base._status) { + + /* "_hyperdex_client.pyx":866 + * def wait(self): + * Deferred.wait(self) + * if self._status == HYPERDEX_CLIENT_SUCCESS: # <<<<<<<<<<<<<< + * return _attrs_to_dict(self._attrs, self._attrs_sz) + * elif self._status == HYPERDEX_CLIENT_NOTFOUND: + */ + case HYPERDEX_CLIENT_SUCCESS: + + /* "_hyperdex_client.pyx":867 + * Deferred.wait(self) + * if self._status == HYPERDEX_CLIENT_SUCCESS: + * return _attrs_to_dict(self._attrs, self._attrs_sz) # <<<<<<<<<<<<<< + * elif self._status == HYPERDEX_CLIENT_NOTFOUND: + * return None + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __pyx_f_16_hyperdex_client__attrs_to_dict(__pyx_v_self->_attrs, __pyx_v_self->_attrs_sz); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + break; + + /* "_hyperdex_client.pyx":868 + * if self._status == HYPERDEX_CLIENT_SUCCESS: + * return _attrs_to_dict(self._attrs, self._attrs_sz) + * elif self._status == HYPERDEX_CLIENT_NOTFOUND: # <<<<<<<<<<<<<< + * return None + * else: + */ + case HYPERDEX_CLIENT_NOTFOUND: + + /* "_hyperdex_client.pyx":869 + * return _attrs_to_dict(self._attrs, self._attrs_sz) + * elif self._status == HYPERDEX_CLIENT_NOTFOUND: + * return None # <<<<<<<<<<<<<< + * else: + * raise HyperClientException(self._status) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + break; + default: + + /* "_hyperdex_client.pyx":871 + * return None + * else: + * raise HyperClientException(self._status) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_122); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyInt_FromLong(__pyx_v_self->__pyx_base._status); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + break; + } + + __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("_hyperdex_client.DeferredGet.wait", __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_16_hyperdex_client_17DeferredFromAttrs_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_16_hyperdex_client_17DeferredFromAttrs_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__client,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__client)) != 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_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __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_client = ((struct __pyx_obj_16_hyperdex_client_Client *)values[0]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.DeferredFromAttrs.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_client), __pyx_ptype_16_hyperdex_client_Client, 1, "client", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_17DeferredFromAttrs___cinit__(((struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *)__pyx_v_self), __pyx_v_client); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":878 + * cdef bint _cmped + * + * def __cinit__(self, Client client): # <<<<<<<<<<<<<< + * self._cmped = False + * + */ + +static int __pyx_pf_16_hyperdex_client_17DeferredFromAttrs___cinit__(struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "_hyperdex_client.pyx":879 + * + * def __cinit__(self, Client client): + * self._cmped = False # <<<<<<<<<<<<<< + * + * cdef setcmp(self): + */ + __pyx_v_self->_cmped = 0; + + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":881 + * self._cmped = False + * + * cdef setcmp(self): # <<<<<<<<<<<<<< + * self._cmped = True + * + */ + +static PyObject *__pyx_f_16_hyperdex_client_17DeferredFromAttrs_setcmp(struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("setcmp", 0); + + /* "_hyperdex_client.pyx":882 + * + * cdef setcmp(self): + * self._cmped = True # <<<<<<<<<<<<<< + * + * cdef call(self, hyperdex_client_simple_op op, bytes space, key, dict value): + */ + __pyx_v_self->_cmped = 1; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":884 + * self._cmped = True + * + * cdef call(self, hyperdex_client_simple_op op, bytes space, key, dict value): # <<<<<<<<<<<<<< + * cdef bytes key_backing + * datatype, key_backing = _obj_to_backing(key) + */ + +static PyObject *__pyx_f_16_hyperdex_client_17DeferredFromAttrs_call(struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *__pyx_v_self, __pyx_t_16_hyperdex_client_hyperdex_client_simple_op __pyx_v_op, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + PyObject *__pyx_v_key_backing = 0; + CYTHON_UNUSED PyObject *__pyx_v_datatype = NULL; + char *__pyx_v_space_cstr; + char *__pyx_v_key_cstr; + struct hyperdex_client_attribute *__pyx_v_attrs; + CYTHON_UNUSED PyObject *__pyx_v_backings = 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)(PyObject *); + char *__pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("call", 0); + + /* "_hyperdex_client.pyx":886 + * cdef call(self, hyperdex_client_simple_op op, bytes space, key, dict value): + * cdef bytes key_backing + * datatype, key_backing = _obj_to_backing(key) # <<<<<<<<<<<<<< + * cdef char* space_cstr = space + * cdef char* key_cstr = key_backing + */ + __pyx_t_1 = __pyx_f_16_hyperdex_client__obj_to_backing(__pyx_v_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __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_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_datatype = __pyx_t_2; + __pyx_t_2 = 0; + __pyx_v_key_backing = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":887 + * cdef bytes key_backing + * datatype, key_backing = _obj_to_backing(key) + * cdef char* space_cstr = space # <<<<<<<<<<<<<< + * cdef char* key_cstr = key_backing + * cdef hyperdex_client_attribute* attrs = NULL + */ + __pyx_t_6 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_space)); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_space_cstr = __pyx_t_6; + + /* "_hyperdex_client.pyx":888 + * datatype, key_backing = _obj_to_backing(key) + * cdef char* space_cstr = space + * cdef char* key_cstr = key_backing # <<<<<<<<<<<<<< + * cdef hyperdex_client_attribute* attrs = NULL + * try: + */ + __pyx_t_6 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_key_backing)); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_key_cstr = __pyx_t_6; + + /* "_hyperdex_client.pyx":889 + * cdef char* space_cstr = space + * cdef char* key_cstr = key_backing + * cdef hyperdex_client_attribute* attrs = NULL # <<<<<<<<<<<<<< + * try: + * backings = _dict_to_attrs(value.items(), &attrs) + */ + __pyx_v_attrs = NULL; + + /* "_hyperdex_client.pyx":890 + * cdef char* key_cstr = key_backing + * cdef hyperdex_client_attribute* attrs = NULL + * try: # <<<<<<<<<<<<<< + * backings = _dict_to_attrs(value.items(), &attrs) + * self._reqid = op(self._client._client, space_cstr, + */ + /*try:*/ { + + /* "_hyperdex_client.pyx":891 + * cdef hyperdex_client_attribute* attrs = NULL + * try: + * backings = _dict_to_attrs(value.items(), &attrs) # <<<<<<<<<<<<<< + * self._reqid = op(self._client._client, space_cstr, + * key_cstr, len(key_backing), + */ + if (unlikely(((PyObject *)__pyx_v_value) == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "items"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L6;} + } + __pyx_t_1 = __Pyx_PyDict_Items(__pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L6;} + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L6;} + __pyx_t_3 = __pyx_f_16_hyperdex_client__dict_to_attrs(((PyObject*)__pyx_t_1), (&__pyx_v_attrs)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L6;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_backings = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":893 + * backings = _dict_to_attrs(value.items(), &attrs) + * self._reqid = op(self._client._client, space_cstr, + * key_cstr, len(key_backing), # <<<<<<<<<<<<<< + * attrs, len(value), &self._status) + * _check_reqid_key_attrs(self._reqid, self._status, attrs, len(value)) + */ + if (unlikely(((PyObject *)__pyx_v_key_backing) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L6;} + } + __pyx_t_7 = PyBytes_GET_SIZE(((PyObject *)__pyx_v_key_backing)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L6;} + + /* "_hyperdex_client.pyx":894 + * self._reqid = op(self._client._client, space_cstr, + * key_cstr, len(key_backing), + * attrs, len(value), &self._status) # <<<<<<<<<<<<<< + * _check_reqid_key_attrs(self._reqid, self._status, attrs, len(value)) + * self._client._ops[self._reqid] = self + */ + if (unlikely(((PyObject *)__pyx_v_value) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L6;} + } + __pyx_t_8 = PyDict_Size(((PyObject *)__pyx_v_value)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L6;} + + /* "_hyperdex_client.pyx":892 + * try: + * backings = _dict_to_attrs(value.items(), &attrs) + * self._reqid = op(self._client._client, space_cstr, # <<<<<<<<<<<<<< + * key_cstr, len(key_backing), + * attrs, len(value), &self._status) + */ + __pyx_v_self->__pyx_base._reqid = __pyx_v_op(__pyx_v_self->__pyx_base._client->_client, __pyx_v_space_cstr, __pyx_v_key_cstr, __pyx_t_7, __pyx_v_attrs, __pyx_t_8, (&__pyx_v_self->__pyx_base._status)); + + /* "_hyperdex_client.pyx":895 + * key_cstr, len(key_backing), + * attrs, len(value), &self._status) + * _check_reqid_key_attrs(self._reqid, self._status, attrs, len(value)) # <<<<<<<<<<<<<< + * self._client._ops[self._reqid] = self + * finally: + */ + if (unlikely(((PyObject *)__pyx_v_value) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L6;} + } + __pyx_t_8 = PyDict_Size(((PyObject *)__pyx_v_value)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L6;} + __pyx_t_3 = __pyx_f_16_hyperdex_client__check_reqid_key_attrs(__pyx_v_self->__pyx_base._reqid, __pyx_v_self->__pyx_base._status, __pyx_v_attrs, __pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L6;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":896 + * attrs, len(value), &self._status) + * _check_reqid_key_attrs(self._reqid, self._status, attrs, len(value)) + * self._client._ops[self._reqid] = self # <<<<<<<<<<<<<< + * finally: + * if attrs: + */ + if (unlikely(((PyObject *)__pyx_v_self->__pyx_base._client->_ops) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L6;} + } + if (__Pyx_SetItemInt(((PyObject *)__pyx_v_self->__pyx_base._client->_ops), __pyx_v_self->__pyx_base._reqid, ((PyObject *)__pyx_v_self), sizeof(int64_t), __Pyx_PyInt_to_py_int64_t, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L6;} + } + + /* "_hyperdex_client.pyx":898 + * self._client._ops[self._reqid] = self + * finally: + * if attrs: # <<<<<<<<<<<<<< + * free(attrs) + * + */ + /*finally:*/ { + int __pyx_why; + PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; + int __pyx_exc_lineno; + __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; + __pyx_why = 0; goto __pyx_L7; + __pyx_L6: { + __pyx_why = 4; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 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; + __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); + __pyx_exc_lineno = __pyx_lineno; + goto __pyx_L7; + } + __pyx_L7:; + __pyx_t_9 = (__pyx_v_attrs != 0); + if (__pyx_t_9) { + + /* "_hyperdex_client.pyx":899 + * finally: + * if attrs: + * free(attrs) # <<<<<<<<<<<<<< + * + * def wait(self): + */ + free(__pyx_v_attrs); + goto __pyx_L9; + } + __pyx_L9:; + switch (__pyx_why) { + case 4: { + __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); + __pyx_lineno = __pyx_exc_lineno; + __pyx_exc_type = 0; + __pyx_exc_value = 0; + __pyx_exc_tb = 0; + goto __pyx_L1_error; + } + } + } + + __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("_hyperdex_client.DeferredFromAttrs.call", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_key_backing); + __Pyx_XDECREF(__pyx_v_datatype); + __Pyx_XDECREF(__pyx_v_backings); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_17DeferredFromAttrs_3wait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_17DeferredFromAttrs_3wait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wait (wrapper)", 0); + __pyx_r = __pyx_pf_16_hyperdex_client_17DeferredFromAttrs_2wait(((struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":901 + * free(attrs) + * + * def wait(self): # <<<<<<<<<<<<<< + * Deferred.wait(self) + * if self._status == HYPERDEX_CLIENT_SUCCESS: + */ + +static PyObject *__pyx_pf_16_hyperdex_client_17DeferredFromAttrs_2wait(struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *__pyx_v_self) { + 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; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wait", 0); + + /* "_hyperdex_client.pyx":902 + * + * def wait(self): + * Deferred.wait(self) # <<<<<<<<<<<<<< + * if self._status == HYPERDEX_CLIENT_SUCCESS: + * return True + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_Deferred)), __pyx_n_s__wait); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":903 + * def wait(self): + * Deferred.wait(self) + * if self._status == HYPERDEX_CLIENT_SUCCESS: # <<<<<<<<<<<<<< + * return True + * elif self._cmped and self._status == HYPERDEX_CLIENT_CMPFAIL: + */ + __pyx_t_4 = (__pyx_v_self->__pyx_base._status == HYPERDEX_CLIENT_SUCCESS); + if (__pyx_t_4) { + + /* "_hyperdex_client.pyx":904 + * Deferred.wait(self) + * if self._status == HYPERDEX_CLIENT_SUCCESS: + * return True # <<<<<<<<<<<<<< + * elif self._cmped and self._status == HYPERDEX_CLIENT_CMPFAIL: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + goto __pyx_L3; + } + + /* "_hyperdex_client.pyx":905 + * if self._status == HYPERDEX_CLIENT_SUCCESS: + * return True + * elif self._cmped and self._status == HYPERDEX_CLIENT_CMPFAIL: # <<<<<<<<<<<<<< + * return False + * else: + */ + if (__pyx_v_self->_cmped) { + __pyx_t_4 = (__pyx_v_self->__pyx_base._status == HYPERDEX_CLIENT_CMPFAIL); + __pyx_t_5 = __pyx_t_4; + } else { + __pyx_t_5 = __pyx_v_self->_cmped; + } + if (__pyx_t_5) { + + /* "_hyperdex_client.pyx":906 + * return True + * elif self._cmped and self._status == HYPERDEX_CLIENT_CMPFAIL: + * return False # <<<<<<<<<<<<<< + * else: + * raise HyperClientException(self._status) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + goto __pyx_L3; + } + /*else*/ { + + /* "_hyperdex_client.pyx":908 + * return False + * else: + * raise HyperClientException(self._status) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_122); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyInt_FromLong(__pyx_v_self->__pyx_base._status); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L3:; + + __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("_hyperdex_client.DeferredFromAttrs.wait", __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_16_hyperdex_client_21DeferredCondFromAttrs_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_16_hyperdex_client_21DeferredCondFromAttrs_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__client,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__client)) != 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_filename = __pyx_f[0]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __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_client = ((struct __pyx_obj_16_hyperdex_client_Client *)values[0]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.DeferredCondFromAttrs.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_client), __pyx_ptype_16_hyperdex_client_Client, 1, "client", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_21DeferredCondFromAttrs___cinit__(((struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_v_self), __pyx_v_client); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":913 + * cdef class DeferredCondFromAttrs(Deferred): + * + * def __cinit__(self, Client client): # <<<<<<<<<<<<<< + * pass + * + */ + +static int __pyx_pf_16_hyperdex_client_21DeferredCondFromAttrs___cinit__(CYTHON_UNUSED struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__", 0); + + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":916 + * pass + * + * cdef call(self, hyperdex_client_cond_op op, bytes space, key, dict condition, dict value): # <<<<<<<<<<<<<< + * cdef bytes key_backing + * datatype, key_backing = _obj_to_backing(key) + */ + +static PyObject *__pyx_f_16_hyperdex_client_21DeferredCondFromAttrs_call(struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *__pyx_v_self, __pyx_t_16_hyperdex_client_hyperdex_client_cond_op __pyx_v_op, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_condition, PyObject *__pyx_v_value) { + PyObject *__pyx_v_key_backing = 0; + CYTHON_UNUSED PyObject *__pyx_v_datatype = NULL; + char *__pyx_v_space_cstr; + char *__pyx_v_key_cstr; + struct hyperdex_client_attribute_check *__pyx_v_condattrs; + size_t __pyx_v_condattrs_sz; + struct hyperdex_client_attribute *__pyx_v_attrs; + CYTHON_UNUSED PyObject *__pyx_v_backingsc = NULL; + CYTHON_UNUSED PyObject *__pyx_v_backingsa = 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)(PyObject *); + char *__pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("call", 0); + + /* "_hyperdex_client.pyx":918 + * cdef call(self, hyperdex_client_cond_op op, bytes space, key, dict condition, dict value): + * cdef bytes key_backing + * datatype, key_backing = _obj_to_backing(key) # <<<<<<<<<<<<<< + * cdef char* space_cstr = space + * cdef char* key_cstr = key_backing + */ + __pyx_t_1 = __pyx_f_16_hyperdex_client__obj_to_backing(__pyx_v_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __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_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_datatype = __pyx_t_2; + __pyx_t_2 = 0; + __pyx_v_key_backing = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":919 + * cdef bytes key_backing + * datatype, key_backing = _obj_to_backing(key) + * cdef char* space_cstr = space # <<<<<<<<<<<<<< + * cdef char* key_cstr = key_backing + * cdef hyperdex_client_attribute_check* condattrs = NULL + */ + __pyx_t_6 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_space)); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_space_cstr = __pyx_t_6; + + /* "_hyperdex_client.pyx":920 + * datatype, key_backing = _obj_to_backing(key) + * cdef char* space_cstr = space + * cdef char* key_cstr = key_backing # <<<<<<<<<<<<<< + * cdef hyperdex_client_attribute_check* condattrs = NULL + * cdef size_t condattrs_sz + */ + __pyx_t_6 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_key_backing)); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_key_cstr = __pyx_t_6; + + /* "_hyperdex_client.pyx":921 + * cdef char* space_cstr = space + * cdef char* key_cstr = key_backing + * cdef hyperdex_client_attribute_check* condattrs = NULL # <<<<<<<<<<<<<< + * cdef size_t condattrs_sz + * cdef hyperdex_client_attribute* attrs = NULL + */ + __pyx_v_condattrs = NULL; + + /* "_hyperdex_client.pyx":923 + * cdef hyperdex_client_attribute_check* condattrs = NULL + * cdef size_t condattrs_sz + * cdef hyperdex_client_attribute* attrs = NULL # <<<<<<<<<<<<<< + * try: + * backingsc = _predicate_to_c(condition, &condattrs, &condattrs_sz) + */ + __pyx_v_attrs = NULL; + + /* "_hyperdex_client.pyx":924 + * cdef size_t condattrs_sz + * cdef hyperdex_client_attribute* attrs = NULL + * try: # <<<<<<<<<<<<<< + * backingsc = _predicate_to_c(condition, &condattrs, &condattrs_sz) + * backingsa = _dict_to_attrs(value.items(), &attrs) + */ + /*try:*/ { + + /* "_hyperdex_client.pyx":925 + * cdef hyperdex_client_attribute* attrs = NULL + * try: + * backingsc = _predicate_to_c(condition, &condattrs, &condattrs_sz) # <<<<<<<<<<<<<< + * backingsa = _dict_to_attrs(value.items(), &attrs) + * self._reqid = op(self._client._client, space_cstr, + */ + __pyx_t_1 = __pyx_f_16_hyperdex_client__predicate_to_c(__pyx_v_condition, (&__pyx_v_condattrs), (&__pyx_v_condattrs_sz)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L6;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_backingsc = __pyx_t_1; + __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":926 + * try: + * backingsc = _predicate_to_c(condition, &condattrs, &condattrs_sz) + * backingsa = _dict_to_attrs(value.items(), &attrs) # <<<<<<<<<<<<<< + * self._reqid = op(self._client._client, space_cstr, + * key_cstr, len(key_backing), + */ + if (unlikely(((PyObject *)__pyx_v_value) == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "items"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L6;} + } + __pyx_t_1 = __Pyx_PyDict_Items(__pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L6;} + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L6;} + __pyx_t_3 = __pyx_f_16_hyperdex_client__dict_to_attrs(((PyObject*)__pyx_t_1), (&__pyx_v_attrs)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L6;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_backingsa = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":928 + * backingsa = _dict_to_attrs(value.items(), &attrs) + * self._reqid = op(self._client._client, space_cstr, + * key_cstr, len(key_backing), # <<<<<<<<<<<<<< + * condattrs, condattrs_sz, + * attrs, len(value), + */ + if (unlikely(((PyObject *)__pyx_v_key_backing) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L6;} + } + __pyx_t_7 = PyBytes_GET_SIZE(((PyObject *)__pyx_v_key_backing)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L6;} + + /* "_hyperdex_client.pyx":930 + * key_cstr, len(key_backing), + * condattrs, condattrs_sz, + * attrs, len(value), # <<<<<<<<<<<<<< + * &self._status) + * _check_reqid_key_attrs2(self._reqid, self._status, + */ + if (unlikely(((PyObject *)__pyx_v_value) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L6;} + } + __pyx_t_8 = PyDict_Size(((PyObject *)__pyx_v_value)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L6;} + + /* "_hyperdex_client.pyx":927 + * backingsc = _predicate_to_c(condition, &condattrs, &condattrs_sz) + * backingsa = _dict_to_attrs(value.items(), &attrs) + * self._reqid = op(self._client._client, space_cstr, # <<<<<<<<<<<<<< + * key_cstr, len(key_backing), + * condattrs, condattrs_sz, + */ + __pyx_v_self->__pyx_base._reqid = __pyx_v_op(__pyx_v_self->__pyx_base._client->_client, __pyx_v_space_cstr, __pyx_v_key_cstr, __pyx_t_7, __pyx_v_condattrs, __pyx_v_condattrs_sz, __pyx_v_attrs, __pyx_t_8, (&__pyx_v_self->__pyx_base._status)); + + /* "_hyperdex_client.pyx":934 + * _check_reqid_key_attrs2(self._reqid, self._status, + * condattrs, condattrs_sz, + * attrs, len(value)) # <<<<<<<<<<<<<< + * self._client._ops[self._reqid] = self + * finally: + */ + if (unlikely(((PyObject *)__pyx_v_value) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L6;} + } + __pyx_t_8 = PyDict_Size(((PyObject *)__pyx_v_value)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L6;} + __pyx_t_3 = __pyx_f_16_hyperdex_client__check_reqid_key_attrs2(__pyx_v_self->__pyx_base._reqid, __pyx_v_self->__pyx_base._status, __pyx_v_condattrs, __pyx_v_condattrs_sz, __pyx_v_attrs, __pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L6;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":935 + * condattrs, condattrs_sz, + * attrs, len(value)) + * self._client._ops[self._reqid] = self # <<<<<<<<<<<<<< + * finally: + * if condattrs: + */ + if (unlikely(((PyObject *)__pyx_v_self->__pyx_base._client->_ops) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L6;} + } + if (__Pyx_SetItemInt(((PyObject *)__pyx_v_self->__pyx_base._client->_ops), __pyx_v_self->__pyx_base._reqid, ((PyObject *)__pyx_v_self), sizeof(int64_t), __Pyx_PyInt_to_py_int64_t, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L6;} + } + + /* "_hyperdex_client.pyx":937 + * self._client._ops[self._reqid] = self + * finally: + * if condattrs: # <<<<<<<<<<<<<< + * free(condattrs) + * if attrs: + */ + /*finally:*/ { + int __pyx_why; + PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; + int __pyx_exc_lineno; + __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; + __pyx_why = 0; goto __pyx_L7; + __pyx_L6: { + __pyx_why = 4; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 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; + __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); + __pyx_exc_lineno = __pyx_lineno; + goto __pyx_L7; + } + __pyx_L7:; + __pyx_t_9 = (__pyx_v_condattrs != 0); + if (__pyx_t_9) { + + /* "_hyperdex_client.pyx":938 + * finally: + * if condattrs: + * free(condattrs) # <<<<<<<<<<<<<< + * if attrs: + * free(attrs) + */ + free(__pyx_v_condattrs); + goto __pyx_L9; + } + __pyx_L9:; + + /* "_hyperdex_client.pyx":939 + * if condattrs: + * free(condattrs) + * if attrs: # <<<<<<<<<<<<<< + * free(attrs) + * + */ + __pyx_t_9 = (__pyx_v_attrs != 0); + if (__pyx_t_9) { + + /* "_hyperdex_client.pyx":940 + * free(condattrs) + * if attrs: + * free(attrs) # <<<<<<<<<<<<<< + * + * def wait(self): + */ + free(__pyx_v_attrs); + goto __pyx_L10; + } + __pyx_L10:; + switch (__pyx_why) { + case 4: { + __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); + __pyx_lineno = __pyx_exc_lineno; + __pyx_exc_type = 0; + __pyx_exc_value = 0; + __pyx_exc_tb = 0; + goto __pyx_L1_error; + } + } + } + + __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("_hyperdex_client.DeferredCondFromAttrs.call", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_key_backing); + __Pyx_XDECREF(__pyx_v_datatype); + __Pyx_XDECREF(__pyx_v_backingsc); + __Pyx_XDECREF(__pyx_v_backingsa); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_21DeferredCondFromAttrs_3wait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_21DeferredCondFromAttrs_3wait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wait (wrapper)", 0); + __pyx_r = __pyx_pf_16_hyperdex_client_21DeferredCondFromAttrs_2wait(((struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":942 + * free(attrs) + * + * def wait(self): # <<<<<<<<<<<<<< + * Deferred.wait(self) + * if self._status == HYPERDEX_CLIENT_SUCCESS: + */ + +static PyObject *__pyx_pf_16_hyperdex_client_21DeferredCondFromAttrs_2wait(struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wait", 0); + + /* "_hyperdex_client.pyx":943 + * + * def wait(self): + * Deferred.wait(self) # <<<<<<<<<<<<<< + * if self._status == HYPERDEX_CLIENT_SUCCESS: + * return True + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_Deferred)), __pyx_n_s__wait); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":946 + * if self._status == HYPERDEX_CLIENT_SUCCESS: + * return True + * elif self._status == HYPERDEX_CLIENT_CMPFAIL: # <<<<<<<<<<<<<< + * return False + * else: + */ + switch (__pyx_v_self->__pyx_base._status) { + + /* "_hyperdex_client.pyx":944 + * def wait(self): + * Deferred.wait(self) + * if self._status == HYPERDEX_CLIENT_SUCCESS: # <<<<<<<<<<<<<< + * return True + * elif self._status == HYPERDEX_CLIENT_CMPFAIL: + */ + case HYPERDEX_CLIENT_SUCCESS: + + /* "_hyperdex_client.pyx":945 + * Deferred.wait(self) + * if self._status == HYPERDEX_CLIENT_SUCCESS: + * return True # <<<<<<<<<<<<<< + * elif self._status == HYPERDEX_CLIENT_CMPFAIL: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + break; + + /* "_hyperdex_client.pyx":946 + * if self._status == HYPERDEX_CLIENT_SUCCESS: + * return True + * elif self._status == HYPERDEX_CLIENT_CMPFAIL: # <<<<<<<<<<<<<< + * return False + * else: + */ + case HYPERDEX_CLIENT_CMPFAIL: + + /* "_hyperdex_client.pyx":947 + * return True + * elif self._status == HYPERDEX_CLIENT_CMPFAIL: + * return False # <<<<<<<<<<<<<< + * else: + * raise HyperClientException(self._status) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + break; + default: + + /* "_hyperdex_client.pyx":949 + * return False + * else: + * raise HyperClientException(self._status) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_122); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyInt_FromLong(__pyx_v_self->__pyx_base._status); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + break; + } + + __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("_hyperdex_client.DeferredCondFromAttrs.wait", __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_16_hyperdex_client_14DeferredDelete_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_16_hyperdex_client_14DeferredDelete_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client = 0; + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__client,&__pyx_n_s__space,&__pyx_n_s__key,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__client)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__space)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __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_client = ((struct __pyx_obj_16_hyperdex_client_Client *)values[0]); + __pyx_v_space = ((PyObject*)values[1]); + __pyx_v_key = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.DeferredDelete.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_client), __pyx_ptype_16_hyperdex_client_Client, 1, "client", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_14DeferredDelete___cinit__(((struct __pyx_obj_16_hyperdex_client_DeferredDelete *)__pyx_v_self), __pyx_v_client, __pyx_v_space, __pyx_v_key); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":954 + * cdef class DeferredDelete(Deferred): + * + * def __cinit__(self, Client client, bytes space, key): # <<<<<<<<<<<<<< + * cdef bytes key_backing + * datatype, key_backing = _obj_to_backing(key) + */ + +static int __pyx_pf_16_hyperdex_client_14DeferredDelete___cinit__(struct __pyx_obj_16_hyperdex_client_DeferredDelete *__pyx_v_self, struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client, PyObject *__pyx_v_space, PyObject *__pyx_v_key) { + PyObject *__pyx_v_key_backing = 0; + CYTHON_UNUSED PyObject *__pyx_v_datatype = NULL; + char *__pyx_v_space_cstr; + char *__pyx_v_key_cstr; + 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)(PyObject *); + char *__pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "_hyperdex_client.pyx":956 + * def __cinit__(self, Client client, bytes space, key): + * cdef bytes key_backing + * datatype, key_backing = _obj_to_backing(key) # <<<<<<<<<<<<<< + * cdef char* space_cstr = space + * cdef char* key_cstr = key_backing + */ + __pyx_t_1 = __pyx_f_16_hyperdex_client__obj_to_backing(__pyx_v_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __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_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_datatype = __pyx_t_2; + __pyx_t_2 = 0; + __pyx_v_key_backing = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":957 + * cdef bytes key_backing + * datatype, key_backing = _obj_to_backing(key) + * cdef char* space_cstr = space # <<<<<<<<<<<<<< + * cdef char* key_cstr = key_backing + * self._reqid = hyperdex_client_del(client._client, space_cstr, + */ + __pyx_t_6 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_space)); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_space_cstr = __pyx_t_6; + + /* "_hyperdex_client.pyx":958 + * datatype, key_backing = _obj_to_backing(key) + * cdef char* space_cstr = space + * cdef char* key_cstr = key_backing # <<<<<<<<<<<<<< + * self._reqid = hyperdex_client_del(client._client, space_cstr, + * key_cstr, len(key_backing), &self._status) + */ + __pyx_t_6 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_key_backing)); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_key_cstr = __pyx_t_6; + + /* "_hyperdex_client.pyx":960 + * cdef char* key_cstr = key_backing + * self._reqid = hyperdex_client_del(client._client, space_cstr, + * key_cstr, len(key_backing), &self._status) # <<<<<<<<<<<<<< + * _check_reqid(self._reqid, self._status) + * client._ops[self._reqid] = self + */ + if (unlikely(((PyObject *)__pyx_v_key_backing) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_7 = PyBytes_GET_SIZE(((PyObject *)__pyx_v_key_backing)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "_hyperdex_client.pyx":959 + * cdef char* space_cstr = space + * cdef char* key_cstr = key_backing + * self._reqid = hyperdex_client_del(client._client, space_cstr, # <<<<<<<<<<<<<< + * key_cstr, len(key_backing), &self._status) + * _check_reqid(self._reqid, self._status) + */ + __pyx_v_self->__pyx_base._reqid = hyperdex_client_del(__pyx_v_client->_client, __pyx_v_space_cstr, __pyx_v_key_cstr, __pyx_t_7, (&__pyx_v_self->__pyx_base._status)); + + /* "_hyperdex_client.pyx":961 + * self._reqid = hyperdex_client_del(client._client, space_cstr, + * key_cstr, len(key_backing), &self._status) + * _check_reqid(self._reqid, self._status) # <<<<<<<<<<<<<< + * client._ops[self._reqid] = self + * + */ + __pyx_t_1 = __pyx_f_16_hyperdex_client__check_reqid(__pyx_v_self->__pyx_base._reqid, __pyx_v_self->__pyx_base._status); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":962 + * key_cstr, len(key_backing), &self._status) + * _check_reqid(self._reqid, self._status) + * client._ops[self._reqid] = self # <<<<<<<<<<<<<< + * + * def wait(self): + */ + if (unlikely(((PyObject *)__pyx_v_client->_ops) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (__Pyx_SetItemInt(((PyObject *)__pyx_v_client->_ops), __pyx_v_self->__pyx_base._reqid, ((PyObject *)__pyx_v_self), sizeof(int64_t), __Pyx_PyInt_to_py_int64_t, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + __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_4); + __Pyx_AddTraceback("_hyperdex_client.DeferredDelete.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_key_backing); + __Pyx_XDECREF(__pyx_v_datatype); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_14DeferredDelete_3wait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_14DeferredDelete_3wait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wait (wrapper)", 0); + __pyx_r = __pyx_pf_16_hyperdex_client_14DeferredDelete_2wait(((struct __pyx_obj_16_hyperdex_client_DeferredDelete *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":964 + * client._ops[self._reqid] = self + * + * def wait(self): # <<<<<<<<<<<<<< + * Deferred.wait(self) + * if self._status == HYPERDEX_CLIENT_SUCCESS: + */ + +static PyObject *__pyx_pf_16_hyperdex_client_14DeferredDelete_2wait(struct __pyx_obj_16_hyperdex_client_DeferredDelete *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wait", 0); + + /* "_hyperdex_client.pyx":965 + * + * def wait(self): + * Deferred.wait(self) # <<<<<<<<<<<<<< + * if self._status == HYPERDEX_CLIENT_SUCCESS: + * return True + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_Deferred)), __pyx_n_s__wait); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":968 + * if self._status == HYPERDEX_CLIENT_SUCCESS: + * return True + * elif self._status == HYPERDEX_CLIENT_NOTFOUND: # <<<<<<<<<<<<<< + * return False + * else: + */ + switch (__pyx_v_self->__pyx_base._status) { + + /* "_hyperdex_client.pyx":966 + * def wait(self): + * Deferred.wait(self) + * if self._status == HYPERDEX_CLIENT_SUCCESS: # <<<<<<<<<<<<<< + * return True + * elif self._status == HYPERDEX_CLIENT_NOTFOUND: + */ + case HYPERDEX_CLIENT_SUCCESS: + + /* "_hyperdex_client.pyx":967 + * Deferred.wait(self) + * if self._status == HYPERDEX_CLIENT_SUCCESS: + * return True # <<<<<<<<<<<<<< + * elif self._status == HYPERDEX_CLIENT_NOTFOUND: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + break; + + /* "_hyperdex_client.pyx":968 + * if self._status == HYPERDEX_CLIENT_SUCCESS: + * return True + * elif self._status == HYPERDEX_CLIENT_NOTFOUND: # <<<<<<<<<<<<<< + * return False + * else: + */ + case HYPERDEX_CLIENT_NOTFOUND: + + /* "_hyperdex_client.pyx":969 + * return True + * elif self._status == HYPERDEX_CLIENT_NOTFOUND: + * return False # <<<<<<<<<<<<<< + * else: + * raise HyperClientException(self._status) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + break; + default: + + /* "_hyperdex_client.pyx":971 + * return False + * else: + * raise HyperClientException(self._status) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_122); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyInt_FromLong(__pyx_v_self->__pyx_base._status); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + break; + } + + __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("_hyperdex_client.DeferredDelete.wait", __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_16_hyperdex_client_18DeferredCondDelete_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_16_hyperdex_client_18DeferredCondDelete_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client = 0; + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__client,&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,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__client)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__space)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __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_client = ((struct __pyx_obj_16_hyperdex_client_Client *)values[0]); + __pyx_v_space = ((PyObject*)values[1]); + __pyx_v_key = values[2]; + __pyx_v_cond = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.DeferredCondDelete.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_client), __pyx_ptype_16_hyperdex_client_Client, 1, "client", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_18DeferredCondDelete___cinit__(((struct __pyx_obj_16_hyperdex_client_DeferredCondDelete *)__pyx_v_self), __pyx_v_client, __pyx_v_space, __pyx_v_key, __pyx_v_cond); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":976 + * cdef class DeferredCondDelete(Deferred): + * + * def __cinit__(self, Client client, bytes space, key, dict cond): # <<<<<<<<<<<<<< + * cdef bytes key_backing + * datatype, key_backing = _obj_to_backing(key) + */ + +static int __pyx_pf_16_hyperdex_client_18DeferredCondDelete___cinit__(struct __pyx_obj_16_hyperdex_client_DeferredCondDelete *__pyx_v_self, struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond) { + PyObject *__pyx_v_key_backing = 0; + CYTHON_UNUSED PyObject *__pyx_v_datatype = NULL; + char *__pyx_v_space_cstr; + char *__pyx_v_key_cstr; + struct hyperdex_client_attribute_check *__pyx_v_condattrs; + size_t __pyx_v_condattrs_sz; + CYTHON_UNUSED PyObject *__pyx_v_backings = NULL; + 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)(PyObject *); + char *__pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "_hyperdex_client.pyx":978 + * def __cinit__(self, Client client, bytes space, key, dict cond): + * cdef bytes key_backing + * datatype, key_backing = _obj_to_backing(key) # <<<<<<<<<<<<<< + * cdef char* space_cstr = space + * cdef char* key_cstr = key_backing + */ + __pyx_t_1 = __pyx_f_16_hyperdex_client__obj_to_backing(__pyx_v_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __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_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_datatype = __pyx_t_2; + __pyx_t_2 = 0; + __pyx_v_key_backing = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":979 + * cdef bytes key_backing + * datatype, key_backing = _obj_to_backing(key) + * cdef char* space_cstr = space # <<<<<<<<<<<<<< + * cdef char* key_cstr = key_backing + * cdef hyperdex_client_attribute_check* condattrs = NULL + */ + __pyx_t_6 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_space)); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_space_cstr = __pyx_t_6; + + /* "_hyperdex_client.pyx":980 + * datatype, key_backing = _obj_to_backing(key) + * cdef char* space_cstr = space + * cdef char* key_cstr = key_backing # <<<<<<<<<<<<<< + * cdef hyperdex_client_attribute_check* condattrs = NULL + * cdef size_t condattrs_sz + */ + __pyx_t_6 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_key_backing)); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_key_cstr = __pyx_t_6; + + /* "_hyperdex_client.pyx":981 + * cdef char* space_cstr = space + * cdef char* key_cstr = key_backing + * cdef hyperdex_client_attribute_check* condattrs = NULL # <<<<<<<<<<<<<< + * cdef size_t condattrs_sz + * try: + */ + __pyx_v_condattrs = NULL; + + /* "_hyperdex_client.pyx":983 + * cdef hyperdex_client_attribute_check* condattrs = NULL + * cdef size_t condattrs_sz + * try: # <<<<<<<<<<<<<< + * backings = _predicate_to_c(cond, &condattrs, &condattrs_sz) + * self._reqid = hyperdex_client_cond_del(client._client, space_cstr, + */ + /*try:*/ { + + /* "_hyperdex_client.pyx":984 + * cdef size_t condattrs_sz + * try: + * backings = _predicate_to_c(cond, &condattrs, &condattrs_sz) # <<<<<<<<<<<<<< + * self._reqid = hyperdex_client_cond_del(client._client, space_cstr, + * key_cstr, len(key_backing), + */ + __pyx_t_1 = __pyx_f_16_hyperdex_client__predicate_to_c(__pyx_v_cond, (&__pyx_v_condattrs), (&__pyx_v_condattrs_sz)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L6;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_backings = __pyx_t_1; + __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":986 + * backings = _predicate_to_c(cond, &condattrs, &condattrs_sz) + * self._reqid = hyperdex_client_cond_del(client._client, space_cstr, + * key_cstr, len(key_backing), # <<<<<<<<<<<<<< + * condattrs, condattrs_sz, + * &self._status) + */ + if (unlikely(((PyObject *)__pyx_v_key_backing) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L6;} + } + __pyx_t_7 = PyBytes_GET_SIZE(((PyObject *)__pyx_v_key_backing)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L6;} + + /* "_hyperdex_client.pyx":985 + * try: + * backings = _predicate_to_c(cond, &condattrs, &condattrs_sz) + * self._reqid = hyperdex_client_cond_del(client._client, space_cstr, # <<<<<<<<<<<<<< + * key_cstr, len(key_backing), + * condattrs, condattrs_sz, + */ + __pyx_v_self->__pyx_base._reqid = hyperdex_client_cond_del(__pyx_v_client->_client, __pyx_v_space_cstr, __pyx_v_key_cstr, __pyx_t_7, __pyx_v_condattrs, __pyx_v_condattrs_sz, (&__pyx_v_self->__pyx_base._status)); + + /* "_hyperdex_client.pyx":989 + * condattrs, condattrs_sz, + * &self._status) + * _check_reqid_key_conds(self._reqid, self._status, condattrs, condattrs_sz); # <<<<<<<<<<<<<< + * client._ops[self._reqid] = self + * finally: + */ + __pyx_t_1 = __pyx_f_16_hyperdex_client__check_reqid_key_conds(__pyx_v_self->__pyx_base._reqid, __pyx_v_self->__pyx_base._status, __pyx_v_condattrs, __pyx_v_condattrs_sz); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L6;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":990 + * &self._status) + * _check_reqid_key_conds(self._reqid, self._status, condattrs, condattrs_sz); + * client._ops[self._reqid] = self # <<<<<<<<<<<<<< + * finally: + * if condattrs: + */ + if (unlikely(((PyObject *)__pyx_v_client->_ops) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L6;} + } + if (__Pyx_SetItemInt(((PyObject *)__pyx_v_client->_ops), __pyx_v_self->__pyx_base._reqid, ((PyObject *)__pyx_v_self), sizeof(int64_t), __Pyx_PyInt_to_py_int64_t, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L6;} + } + + /* "_hyperdex_client.pyx":992 + * client._ops[self._reqid] = self + * finally: + * if condattrs: # <<<<<<<<<<<<<< + * free(condattrs) + * + */ + /*finally:*/ { + int __pyx_why; + PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; + int __pyx_exc_lineno; + __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; + __pyx_why = 0; goto __pyx_L7; + __pyx_L6: { + __pyx_why = 4; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); + __pyx_exc_lineno = __pyx_lineno; + goto __pyx_L7; + } + __pyx_L7:; + __pyx_t_8 = (__pyx_v_condattrs != 0); + if (__pyx_t_8) { + + /* "_hyperdex_client.pyx":993 + * finally: + * if condattrs: + * free(condattrs) # <<<<<<<<<<<<<< + * + * def wait(self): + */ + free(__pyx_v_condattrs); + goto __pyx_L9; + } + __pyx_L9:; + switch (__pyx_why) { + case 4: { + __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); + __pyx_lineno = __pyx_exc_lineno; + __pyx_exc_type = 0; + __pyx_exc_value = 0; + __pyx_exc_tb = 0; + goto __pyx_L1_error; + } + } + } + + __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_4); + __Pyx_AddTraceback("_hyperdex_client.DeferredCondDelete.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_key_backing); + __Pyx_XDECREF(__pyx_v_datatype); + __Pyx_XDECREF(__pyx_v_backings); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_18DeferredCondDelete_3wait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_18DeferredCondDelete_3wait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wait (wrapper)", 0); + __pyx_r = __pyx_pf_16_hyperdex_client_18DeferredCondDelete_2wait(((struct __pyx_obj_16_hyperdex_client_DeferredCondDelete *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":995 + * free(condattrs) + * + * def wait(self): # <<<<<<<<<<<<<< + * Deferred.wait(self) + * if self._status == HYPERDEX_CLIENT_SUCCESS: + */ + +static PyObject *__pyx_pf_16_hyperdex_client_18DeferredCondDelete_2wait(struct __pyx_obj_16_hyperdex_client_DeferredCondDelete *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wait", 0); + + /* "_hyperdex_client.pyx":996 + * + * def wait(self): + * Deferred.wait(self) # <<<<<<<<<<<<<< + * if self._status == HYPERDEX_CLIENT_SUCCESS: + * return True + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_Deferred)), __pyx_n_s__wait); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1001 + * elif self._status == HYPERDEX_CLIENT_CMPFAIL: + * return False + * elif self._status == HYPERDEX_CLIENT_NOTFOUND: # <<<<<<<<<<<<<< + * return False + * else: + */ + switch (__pyx_v_self->__pyx_base._status) { + + /* "_hyperdex_client.pyx":997 + * def wait(self): + * Deferred.wait(self) + * if self._status == HYPERDEX_CLIENT_SUCCESS: # <<<<<<<<<<<<<< + * return True + * elif self._status == HYPERDEX_CLIENT_CMPFAIL: + */ + case HYPERDEX_CLIENT_SUCCESS: + + /* "_hyperdex_client.pyx":998 + * Deferred.wait(self) + * if self._status == HYPERDEX_CLIENT_SUCCESS: + * return True # <<<<<<<<<<<<<< + * elif self._status == HYPERDEX_CLIENT_CMPFAIL: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + break; + + /* "_hyperdex_client.pyx":999 + * if self._status == HYPERDEX_CLIENT_SUCCESS: + * return True + * elif self._status == HYPERDEX_CLIENT_CMPFAIL: # <<<<<<<<<<<<<< + * return False + * elif self._status == HYPERDEX_CLIENT_NOTFOUND: + */ + case HYPERDEX_CLIENT_CMPFAIL: + + /* "_hyperdex_client.pyx":1000 + * return True + * elif self._status == HYPERDEX_CLIENT_CMPFAIL: + * return False # <<<<<<<<<<<<<< + * elif self._status == HYPERDEX_CLIENT_NOTFOUND: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + break; + + /* "_hyperdex_client.pyx":1001 + * elif self._status == HYPERDEX_CLIENT_CMPFAIL: + * return False + * elif self._status == HYPERDEX_CLIENT_NOTFOUND: # <<<<<<<<<<<<<< + * return False + * else: + */ + case HYPERDEX_CLIENT_NOTFOUND: + + /* "_hyperdex_client.pyx":1002 + * return False + * elif self._status == HYPERDEX_CLIENT_NOTFOUND: + * return False # <<<<<<<<<<<<<< + * else: + * raise HyperClientException(self._status) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + break; + default: + + /* "_hyperdex_client.pyx":1004 + * return False + * else: + * raise HyperClientException(self._status) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_122); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyInt_FromLong(__pyx_v_self->__pyx_base._status); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + break; + } + + __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("_hyperdex_client.DeferredCondDelete.wait", __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_16_hyperdex_client_13DeferredMapOp_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_16_hyperdex_client_13DeferredMapOp_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__client,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__client)) != 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_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __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_client = ((struct __pyx_obj_16_hyperdex_client_Client *)values[0]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.DeferredMapOp.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_client), __pyx_ptype_16_hyperdex_client_Client, 1, "client", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_13DeferredMapOp___cinit__(((struct __pyx_obj_16_hyperdex_client_DeferredMapOp *)__pyx_v_self), __pyx_v_client); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1009 + * cdef class DeferredMapOp(Deferred): + * + * def __cinit__(self, Client client): # <<<<<<<<<<<<<< + * pass + * + */ + +static int __pyx_pf_16_hyperdex_client_13DeferredMapOp___cinit__(CYTHON_UNUSED struct __pyx_obj_16_hyperdex_client_DeferredMapOp *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__", 0); + + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1012 + * pass + * + * cdef call(self, hyperdex_client_map_op op, bytes space, key, dict value): # <<<<<<<<<<<<<< + * cdef bytes key_backing + * datatype, key_backing = _obj_to_backing(key) + */ + +static PyObject *__pyx_f_16_hyperdex_client_13DeferredMapOp_call(struct __pyx_obj_16_hyperdex_client_DeferredMapOp *__pyx_v_self, __pyx_t_16_hyperdex_client_hyperdex_client_map_op __pyx_v_op, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + PyObject *__pyx_v_key_backing = 0; + CYTHON_UNUSED PyObject *__pyx_v_datatype = NULL; + char *__pyx_v_space_cstr; + char *__pyx_v_key_cstr; + struct hyperdex_client_map_attribute *__pyx_v_attrs; + size_t __pyx_v_attrs_sz; + CYTHON_UNUSED PyObject *__pyx_v_backings = 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)(PyObject *); + char *__pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("call", 0); + + /* "_hyperdex_client.pyx":1014 + * cdef call(self, hyperdex_client_map_op op, bytes space, key, dict value): + * cdef bytes key_backing + * datatype, key_backing = _obj_to_backing(key) # <<<<<<<<<<<<<< + * cdef char* space_cstr = space + * cdef char* key_cstr = key_backing + */ + __pyx_t_1 = __pyx_f_16_hyperdex_client__obj_to_backing(__pyx_v_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __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_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_datatype = __pyx_t_2; + __pyx_t_2 = 0; + __pyx_v_key_backing = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1015 + * cdef bytes key_backing + * datatype, key_backing = _obj_to_backing(key) + * cdef char* space_cstr = space # <<<<<<<<<<<<<< + * cdef char* key_cstr = key_backing + * cdef hyperdex_client_map_attribute* attrs = NULL + */ + __pyx_t_6 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_space)); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_space_cstr = __pyx_t_6; + + /* "_hyperdex_client.pyx":1016 + * datatype, key_backing = _obj_to_backing(key) + * cdef char* space_cstr = space + * cdef char* key_cstr = key_backing # <<<<<<<<<<<<<< + * cdef hyperdex_client_map_attribute* attrs = NULL + * cdef size_t attrs_sz = 0 + */ + __pyx_t_6 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_key_backing)); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_key_cstr = __pyx_t_6; + + /* "_hyperdex_client.pyx":1017 + * cdef char* space_cstr = space + * cdef char* key_cstr = key_backing + * cdef hyperdex_client_map_attribute* attrs = NULL # <<<<<<<<<<<<<< + * cdef size_t attrs_sz = 0 + * try: + */ + __pyx_v_attrs = NULL; + + /* "_hyperdex_client.pyx":1018 + * cdef char* key_cstr = key_backing + * cdef hyperdex_client_map_attribute* attrs = NULL + * cdef size_t attrs_sz = 0 # <<<<<<<<<<<<<< + * try: + * backings = _dict_to_map_attrs(value.items(), &attrs, &attrs_sz) + */ + __pyx_v_attrs_sz = 0; + + /* "_hyperdex_client.pyx":1019 + * cdef hyperdex_client_map_attribute* attrs = NULL + * cdef size_t attrs_sz = 0 + * try: # <<<<<<<<<<<<<< + * backings = _dict_to_map_attrs(value.items(), &attrs, &attrs_sz) + * self._reqid = op(self._client._client, space_cstr, + */ + /*try:*/ { + + /* "_hyperdex_client.pyx":1020 + * cdef size_t attrs_sz = 0 + * try: + * backings = _dict_to_map_attrs(value.items(), &attrs, &attrs_sz) # <<<<<<<<<<<<<< + * self._reqid = op(self._client._client, space_cstr, + * key_cstr, len(key_backing), + */ + if (unlikely(((PyObject *)__pyx_v_value) == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "items"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L6;} + } + __pyx_t_1 = __Pyx_PyDict_Items(__pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L6;} + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L6;} + __pyx_t_3 = __pyx_f_16_hyperdex_client__dict_to_map_attrs(((PyObject*)__pyx_t_1), (&__pyx_v_attrs), (&__pyx_v_attrs_sz)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L6;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_backings = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1022 + * backings = _dict_to_map_attrs(value.items(), &attrs, &attrs_sz) + * self._reqid = op(self._client._client, space_cstr, + * key_cstr, len(key_backing), # <<<<<<<<<<<<<< + * attrs, attrs_sz, &self._status) + * _check_reqid_key_map_attrs(self._reqid, self._status, attrs, attrs_sz) + */ + if (unlikely(((PyObject *)__pyx_v_key_backing) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L6;} + } + __pyx_t_7 = PyBytes_GET_SIZE(((PyObject *)__pyx_v_key_backing)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L6;} + + /* "_hyperdex_client.pyx":1021 + * try: + * backings = _dict_to_map_attrs(value.items(), &attrs, &attrs_sz) + * self._reqid = op(self._client._client, space_cstr, # <<<<<<<<<<<<<< + * key_cstr, len(key_backing), + * attrs, attrs_sz, &self._status) + */ + __pyx_v_self->__pyx_base._reqid = __pyx_v_op(__pyx_v_self->__pyx_base._client->_client, __pyx_v_space_cstr, __pyx_v_key_cstr, __pyx_t_7, __pyx_v_attrs, __pyx_v_attrs_sz, (&__pyx_v_self->__pyx_base._status)); + + /* "_hyperdex_client.pyx":1024 + * key_cstr, len(key_backing), + * attrs, attrs_sz, &self._status) + * _check_reqid_key_map_attrs(self._reqid, self._status, attrs, attrs_sz) # <<<<<<<<<<<<<< + * self._client._ops[self._reqid] = self + * finally: + */ + __pyx_t_3 = __pyx_f_16_hyperdex_client__check_reqid_key_map_attrs(__pyx_v_self->__pyx_base._reqid, __pyx_v_self->__pyx_base._status, __pyx_v_attrs, __pyx_v_attrs_sz); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L6;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1025 + * attrs, attrs_sz, &self._status) + * _check_reqid_key_map_attrs(self._reqid, self._status, attrs, attrs_sz) + * self._client._ops[self._reqid] = self # <<<<<<<<<<<<<< + * finally: + * if attrs: + */ + if (unlikely(((PyObject *)__pyx_v_self->__pyx_base._client->_ops) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L6;} + } + if (__Pyx_SetItemInt(((PyObject *)__pyx_v_self->__pyx_base._client->_ops), __pyx_v_self->__pyx_base._reqid, ((PyObject *)__pyx_v_self), sizeof(int64_t), __Pyx_PyInt_to_py_int64_t, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L6;} + } + + /* "_hyperdex_client.pyx":1027 + * self._client._ops[self._reqid] = self + * finally: + * if attrs: # <<<<<<<<<<<<<< + * free(attrs) + * + */ + /*finally:*/ { + int __pyx_why; + PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; + int __pyx_exc_lineno; + __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; + __pyx_why = 0; goto __pyx_L7; + __pyx_L6: { + __pyx_why = 4; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 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; + __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); + __pyx_exc_lineno = __pyx_lineno; + goto __pyx_L7; + } + __pyx_L7:; + __pyx_t_8 = (__pyx_v_attrs != 0); + if (__pyx_t_8) { + + /* "_hyperdex_client.pyx":1028 + * finally: + * if attrs: + * free(attrs) # <<<<<<<<<<<<<< + * + * def wait(self): + */ + free(__pyx_v_attrs); + goto __pyx_L9; + } + __pyx_L9:; + switch (__pyx_why) { + case 4: { + __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); + __pyx_lineno = __pyx_exc_lineno; + __pyx_exc_type = 0; + __pyx_exc_value = 0; + __pyx_exc_tb = 0; + goto __pyx_L1_error; + } + } + } + + __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("_hyperdex_client.DeferredMapOp.call", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_key_backing); + __Pyx_XDECREF(__pyx_v_datatype); + __Pyx_XDECREF(__pyx_v_backings); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_13DeferredMapOp_3wait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_13DeferredMapOp_3wait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wait (wrapper)", 0); + __pyx_r = __pyx_pf_16_hyperdex_client_13DeferredMapOp_2wait(((struct __pyx_obj_16_hyperdex_client_DeferredMapOp *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1030 + * free(attrs) + * + * def wait(self): # <<<<<<<<<<<<<< + * Deferred.wait(self) + * if self._status == HYPERDEX_CLIENT_SUCCESS: + */ + +static PyObject *__pyx_pf_16_hyperdex_client_13DeferredMapOp_2wait(struct __pyx_obj_16_hyperdex_client_DeferredMapOp *__pyx_v_self) { + 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_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wait", 0); + + /* "_hyperdex_client.pyx":1031 + * + * def wait(self): + * Deferred.wait(self) # <<<<<<<<<<<<<< + * if self._status == HYPERDEX_CLIENT_SUCCESS: + * return True + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_Deferred)), __pyx_n_s__wait); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1032 + * def wait(self): + * Deferred.wait(self) + * if self._status == HYPERDEX_CLIENT_SUCCESS: # <<<<<<<<<<<<<< + * return True + * else: + */ + __pyx_t_4 = (__pyx_v_self->__pyx_base._status == HYPERDEX_CLIENT_SUCCESS); + if (__pyx_t_4) { + + /* "_hyperdex_client.pyx":1033 + * Deferred.wait(self) + * if self._status == HYPERDEX_CLIENT_SUCCESS: + * return True # <<<<<<<<<<<<<< + * else: + * raise HyperClientException(self._status) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + goto __pyx_L3; + } + /*else*/ { + + /* "_hyperdex_client.pyx":1035 + * return True + * else: + * raise HyperClientException(self._status) # <<<<<<<<<<<<<< + * + * cdef class DeferredCondMapOp(Deferred): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_122); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyInt_FromLong(__pyx_v_self->__pyx_base._status); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L3:; + + __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("_hyperdex_client.DeferredMapOp.wait", __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_16_hyperdex_client_17DeferredCondMapOp_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_16_hyperdex_client_17DeferredCondMapOp_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__client,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__client)) != 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_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __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_client = ((struct __pyx_obj_16_hyperdex_client_Client *)values[0]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.DeferredCondMapOp.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_client), __pyx_ptype_16_hyperdex_client_Client, 1, "client", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_17DeferredCondMapOp___cinit__(((struct __pyx_obj_16_hyperdex_client_DeferredCondMapOp *)__pyx_v_self), __pyx_v_client); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1039 + * cdef class DeferredCondMapOp(Deferred): + * + * def __cinit__(self, Client client): # <<<<<<<<<<<<<< + * pass + * + */ + +static int __pyx_pf_16_hyperdex_client_17DeferredCondMapOp___cinit__(CYTHON_UNUSED struct __pyx_obj_16_hyperdex_client_DeferredCondMapOp *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__", 0); + + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1042 + * pass + * + * cdef call(self, hyperdex_client_cond_map_op op, bytes space, key, dict condition, dict value): # <<<<<<<<<<<<<< + * cdef bytes key_backing + * datatype, key_backing = _obj_to_backing(key) + */ + +static PyObject *__pyx_f_16_hyperdex_client_17DeferredCondMapOp_call(struct __pyx_obj_16_hyperdex_client_DeferredCondMapOp *__pyx_v_self, __pyx_t_16_hyperdex_client_hyperdex_client_cond_map_op __pyx_v_op, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_condition, PyObject *__pyx_v_value) { + PyObject *__pyx_v_key_backing = 0; + CYTHON_UNUSED PyObject *__pyx_v_datatype = NULL; + char *__pyx_v_space_cstr; + char *__pyx_v_key_cstr; + struct hyperdex_client_attribute_check *__pyx_v_condattrs; + size_t __pyx_v_condattrs_sz; + struct hyperdex_client_map_attribute *__pyx_v_attrs; + size_t __pyx_v_attrs_sz; + CYTHON_UNUSED PyObject *__pyx_v_backingsc = NULL; + CYTHON_UNUSED PyObject *__pyx_v_backingsa = 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)(PyObject *); + char *__pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("call", 0); + + /* "_hyperdex_client.pyx":1044 + * cdef call(self, hyperdex_client_cond_map_op op, bytes space, key, dict condition, dict value): + * cdef bytes key_backing + * datatype, key_backing = _obj_to_backing(key) # <<<<<<<<<<<<<< + * cdef char* space_cstr = space + * cdef char* key_cstr = key_backing + */ + __pyx_t_1 = __pyx_f_16_hyperdex_client__obj_to_backing(__pyx_v_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __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_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L4_unpacking_done:; + } + if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_datatype = __pyx_t_2; + __pyx_t_2 = 0; + __pyx_v_key_backing = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1045 + * cdef bytes key_backing + * datatype, key_backing = _obj_to_backing(key) + * cdef char* space_cstr = space # <<<<<<<<<<<<<< + * cdef char* key_cstr = key_backing + * cdef hyperdex_client_attribute_check* condattrs = NULL + */ + __pyx_t_6 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_space)); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_space_cstr = __pyx_t_6; + + /* "_hyperdex_client.pyx":1046 + * datatype, key_backing = _obj_to_backing(key) + * cdef char* space_cstr = space + * cdef char* key_cstr = key_backing # <<<<<<<<<<<<<< + * cdef hyperdex_client_attribute_check* condattrs = NULL + * cdef size_t condattrs_sz = 0 + */ + __pyx_t_6 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_key_backing)); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_key_cstr = __pyx_t_6; + + /* "_hyperdex_client.pyx":1047 + * cdef char* space_cstr = space + * cdef char* key_cstr = key_backing + * cdef hyperdex_client_attribute_check* condattrs = NULL # <<<<<<<<<<<<<< + * cdef size_t condattrs_sz = 0 + * cdef hyperdex_client_map_attribute* attrs = NULL + */ + __pyx_v_condattrs = NULL; + + /* "_hyperdex_client.pyx":1048 + * cdef char* key_cstr = key_backing + * cdef hyperdex_client_attribute_check* condattrs = NULL + * cdef size_t condattrs_sz = 0 # <<<<<<<<<<<<<< + * cdef hyperdex_client_map_attribute* attrs = NULL + * cdef size_t attrs_sz = 0 + */ + __pyx_v_condattrs_sz = 0; + + /* "_hyperdex_client.pyx":1049 + * cdef hyperdex_client_attribute_check* condattrs = NULL + * cdef size_t condattrs_sz = 0 + * cdef hyperdex_client_map_attribute* attrs = NULL # <<<<<<<<<<<<<< + * cdef size_t attrs_sz = 0 + * try: + */ + __pyx_v_attrs = NULL; + + /* "_hyperdex_client.pyx":1050 + * cdef size_t condattrs_sz = 0 + * cdef hyperdex_client_map_attribute* attrs = NULL + * cdef size_t attrs_sz = 0 # <<<<<<<<<<<<<< + * try: + * backingsc = _predicate_to_c(condition, &condattrs, &condattrs_sz) + */ + __pyx_v_attrs_sz = 0; + + /* "_hyperdex_client.pyx":1051 + * cdef hyperdex_client_map_attribute* attrs = NULL + * cdef size_t attrs_sz = 0 + * try: # <<<<<<<<<<<<<< + * backingsc = _predicate_to_c(condition, &condattrs, &condattrs_sz) + * backingsa = _dict_to_map_attrs(value.items(), &attrs, &attrs_sz) + */ + /*try:*/ { + + /* "_hyperdex_client.pyx":1052 + * cdef size_t attrs_sz = 0 + * try: + * backingsc = _predicate_to_c(condition, &condattrs, &condattrs_sz) # <<<<<<<<<<<<<< + * backingsa = _dict_to_map_attrs(value.items(), &attrs, &attrs_sz) + * self._reqid = op(self._client._client, space_cstr, + */ + __pyx_t_1 = __pyx_f_16_hyperdex_client__predicate_to_c(__pyx_v_condition, (&__pyx_v_condattrs), (&__pyx_v_condattrs_sz)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L6;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_backingsc = __pyx_t_1; + __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":1053 + * try: + * backingsc = _predicate_to_c(condition, &condattrs, &condattrs_sz) + * backingsa = _dict_to_map_attrs(value.items(), &attrs, &attrs_sz) # <<<<<<<<<<<<<< + * self._reqid = op(self._client._client, space_cstr, + * key_cstr, len(key_backing), + */ + if (unlikely(((PyObject *)__pyx_v_value) == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "items"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L6;} + } + __pyx_t_1 = __Pyx_PyDict_Items(__pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L6;} + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L6;} + __pyx_t_3 = __pyx_f_16_hyperdex_client__dict_to_map_attrs(((PyObject*)__pyx_t_1), (&__pyx_v_attrs), (&__pyx_v_attrs_sz)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L6;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_backingsa = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1055 + * backingsa = _dict_to_map_attrs(value.items(), &attrs, &attrs_sz) + * self._reqid = op(self._client._client, space_cstr, + * key_cstr, len(key_backing), # <<<<<<<<<<<<<< + * condattrs, condattrs_sz, + * attrs, attrs_sz, &self._status) + */ + if (unlikely(((PyObject *)__pyx_v_key_backing) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L6;} + } + __pyx_t_7 = PyBytes_GET_SIZE(((PyObject *)__pyx_v_key_backing)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L6;} + + /* "_hyperdex_client.pyx":1054 + * backingsc = _predicate_to_c(condition, &condattrs, &condattrs_sz) + * backingsa = _dict_to_map_attrs(value.items(), &attrs, &attrs_sz) + * self._reqid = op(self._client._client, space_cstr, # <<<<<<<<<<<<<< + * key_cstr, len(key_backing), + * condattrs, condattrs_sz, + */ + __pyx_v_self->__pyx_base._reqid = __pyx_v_op(__pyx_v_self->__pyx_base._client->_client, __pyx_v_space_cstr, __pyx_v_key_cstr, __pyx_t_7, __pyx_v_condattrs, __pyx_v_condattrs_sz, __pyx_v_attrs, __pyx_v_attrs_sz, (&__pyx_v_self->__pyx_base._status)); + + /* "_hyperdex_client.pyx":1058 + * condattrs, condattrs_sz, + * attrs, attrs_sz, &self._status) + * _check_reqid_key_cond_map_attrs(self._reqid, self._status, condattrs, condattrs_sz, attrs, attrs_sz) # <<<<<<<<<<<<<< + * self._client._ops[self._reqid] = self + * finally: + */ + __pyx_t_3 = __pyx_f_16_hyperdex_client__check_reqid_key_cond_map_attrs(__pyx_v_self->__pyx_base._reqid, __pyx_v_self->__pyx_base._status, __pyx_v_condattrs, __pyx_v_condattrs_sz, __pyx_v_attrs, __pyx_v_attrs_sz); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L6;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1059 + * attrs, attrs_sz, &self._status) + * _check_reqid_key_cond_map_attrs(self._reqid, self._status, condattrs, condattrs_sz, attrs, attrs_sz) + * self._client._ops[self._reqid] = self # <<<<<<<<<<<<<< + * finally: + * if condattrs: + */ + if (unlikely(((PyObject *)__pyx_v_self->__pyx_base._client->_ops) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L6;} + } + if (__Pyx_SetItemInt(((PyObject *)__pyx_v_self->__pyx_base._client->_ops), __pyx_v_self->__pyx_base._reqid, ((PyObject *)__pyx_v_self), sizeof(int64_t), __Pyx_PyInt_to_py_int64_t, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L6;} + } + + /* "_hyperdex_client.pyx":1061 + * self._client._ops[self._reqid] = self + * finally: + * if condattrs: # <<<<<<<<<<<<<< + * free(condattrs) + * if attrs: + */ + /*finally:*/ { + int __pyx_why; + PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; + int __pyx_exc_lineno; + __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; + __pyx_why = 0; goto __pyx_L7; + __pyx_L6: { + __pyx_why = 4; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 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; + __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); + __pyx_exc_lineno = __pyx_lineno; + goto __pyx_L7; + } + __pyx_L7:; + __pyx_t_8 = (__pyx_v_condattrs != 0); + if (__pyx_t_8) { + + /* "_hyperdex_client.pyx":1062 + * finally: + * if condattrs: + * free(condattrs) # <<<<<<<<<<<<<< + * if attrs: + * free(attrs) + */ + free(__pyx_v_condattrs); + goto __pyx_L9; + } + __pyx_L9:; + + /* "_hyperdex_client.pyx":1063 + * if condattrs: + * free(condattrs) + * if attrs: # <<<<<<<<<<<<<< + * free(attrs) + * + */ + __pyx_t_8 = (__pyx_v_attrs != 0); + if (__pyx_t_8) { + + /* "_hyperdex_client.pyx":1064 + * free(condattrs) + * if attrs: + * free(attrs) # <<<<<<<<<<<<<< + * + * def wait(self): + */ + free(__pyx_v_attrs); + goto __pyx_L10; + } + __pyx_L10:; + switch (__pyx_why) { + case 4: { + __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); + __pyx_lineno = __pyx_exc_lineno; + __pyx_exc_type = 0; + __pyx_exc_value = 0; + __pyx_exc_tb = 0; + goto __pyx_L1_error; + } + } + } + + __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("_hyperdex_client.DeferredCondMapOp.call", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_key_backing); + __Pyx_XDECREF(__pyx_v_datatype); + __Pyx_XDECREF(__pyx_v_backingsc); + __Pyx_XDECREF(__pyx_v_backingsa); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_17DeferredCondMapOp_3wait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_17DeferredCondMapOp_3wait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wait (wrapper)", 0); + __pyx_r = __pyx_pf_16_hyperdex_client_17DeferredCondMapOp_2wait(((struct __pyx_obj_16_hyperdex_client_DeferredCondMapOp *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1066 + * free(attrs) + * + * def wait(self): # <<<<<<<<<<<<<< + * Deferred.wait(self) + * if self._status == HYPERDEX_CLIENT_SUCCESS: + */ + +static PyObject *__pyx_pf_16_hyperdex_client_17DeferredCondMapOp_2wait(struct __pyx_obj_16_hyperdex_client_DeferredCondMapOp *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wait", 0); + + /* "_hyperdex_client.pyx":1067 + * + * def wait(self): + * Deferred.wait(self) # <<<<<<<<<<<<<< + * if self._status == HYPERDEX_CLIENT_SUCCESS: + * return True + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_Deferred)), __pyx_n_s__wait); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1070 + * if self._status == HYPERDEX_CLIENT_SUCCESS: + * return True + * elif self._status == HYPERDEX_CLIENT_CMPFAIL: # <<<<<<<<<<<<<< + * return False + * else: + */ + switch (__pyx_v_self->__pyx_base._status) { + + /* "_hyperdex_client.pyx":1068 + * def wait(self): + * Deferred.wait(self) + * if self._status == HYPERDEX_CLIENT_SUCCESS: # <<<<<<<<<<<<<< + * return True + * elif self._status == HYPERDEX_CLIENT_CMPFAIL: + */ + case HYPERDEX_CLIENT_SUCCESS: + + /* "_hyperdex_client.pyx":1069 + * Deferred.wait(self) + * if self._status == HYPERDEX_CLIENT_SUCCESS: + * return True # <<<<<<<<<<<<<< + * elif self._status == HYPERDEX_CLIENT_CMPFAIL: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + break; + + /* "_hyperdex_client.pyx":1070 + * if self._status == HYPERDEX_CLIENT_SUCCESS: + * return True + * elif self._status == HYPERDEX_CLIENT_CMPFAIL: # <<<<<<<<<<<<<< + * return False + * else: + */ + case HYPERDEX_CLIENT_CMPFAIL: + + /* "_hyperdex_client.pyx":1071 + * return True + * elif self._status == HYPERDEX_CLIENT_CMPFAIL: + * return False # <<<<<<<<<<<<<< + * else: + * raise HyperClientException(self._status) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + break; + default: + + /* "_hyperdex_client.pyx":1073 + * return False + * else: + * raise HyperClientException(self._status) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_122); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyInt_FromLong(__pyx_v_self->__pyx_base._status); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + break; + } + + __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("_hyperdex_client.DeferredCondMapOp.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1076 + * + * + * cdef _predicate_to_c(dict predicate, # <<<<<<<<<<<<<< + * hyperdex_client_attribute_check** chks, size_t* chks_sz): + * raw_checks = [] + */ + +static PyObject *__pyx_f_16_hyperdex_client__predicate_to_c(PyObject *__pyx_v_predicate, struct hyperdex_client_attribute_check **__pyx_v_chks, size_t *__pyx_v_chks_sz) { + PyObject *__pyx_v_raw_checks = NULL; + PyObject *__pyx_v_attr = NULL; + PyObject *__pyx_v_preds = NULL; + PyObject *__pyx_v_p = NULL; + PyObject *__pyx_v_backings = NULL; + PyObject *__pyx_v_i = NULL; + PyObject *__pyx_v_pred = NULL; + PyObject *__pyx_v_val = NULL; + PyObject *__pyx_v_datatype = NULL; + PyObject *__pyx_v_backing = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject *(*__pyx_t_10)(PyObject *); + Py_ssize_t __pyx_t_11; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + int __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + PyObject *(*__pyx_t_20)(PyObject *); + int __pyx_t_21; + char *__pyx_t_22; + enum hyperdatatype __pyx_t_23; + enum hyperpredicate __pyx_t_24; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_predicate_to_c", 0); + + /* "_hyperdex_client.pyx":1078 + * cdef _predicate_to_c(dict predicate, + * hyperdex_client_attribute_check** chks, size_t* chks_sz): + * raw_checks = [] # <<<<<<<<<<<<<< + * for attr, preds in predicate.iteritems(): + * if isinstance(preds, list): + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_raw_checks = ((PyObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":1079 + * hyperdex_client_attribute_check** chks, size_t* chks_sz): + * raw_checks = [] + * for attr, preds in predicate.iteritems(): # <<<<<<<<<<<<<< + * if isinstance(preds, list): + * for p in preds: + */ + __pyx_t_2 = 0; + if (unlikely(((PyObject *)__pyx_v_predicate) == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_5 = __Pyx_dict_iterator(((PyObject *)__pyx_v_predicate), 1, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_1); + __pyx_t_1 = __pyx_t_5; + __pyx_t_5 = 0; + while (1) { + __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4); + if (unlikely(__pyx_t_7 == 0)) break; + if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_v_attr); + __pyx_v_attr = __pyx_t_5; + __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_v_preds); + __pyx_v_preds = __pyx_t_6; + __pyx_t_6 = 0; + + /* "_hyperdex_client.pyx":1080 + * raw_checks = [] + * for attr, preds in predicate.iteritems(): + * if isinstance(preds, list): # <<<<<<<<<<<<<< + * for p in preds: + * if isinstance(p, tuple) and len(p) == 2 and \ + */ + __pyx_t_8 = PyList_Check(__pyx_v_preds); + if (__pyx_t_8) { + + /* "_hyperdex_client.pyx":1081 + * for attr, preds in predicate.iteritems(): + * if isinstance(preds, list): + * for p in preds: # <<<<<<<<<<<<<< + * if isinstance(p, tuple) and len(p) == 2 and \ + * type(p[0]) == type(p[1]) and type(p[0]): + */ + if (PyList_CheckExact(__pyx_v_preds) || PyTuple_CheckExact(__pyx_v_preds)) { + __pyx_t_6 = __pyx_v_preds; __Pyx_INCREF(__pyx_t_6); __pyx_t_9 = 0; + __pyx_t_10 = NULL; + } else { + __pyx_t_9 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_preds); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_10 = Py_TYPE(__pyx_t_6)->tp_iternext; + } + for (;;) { + if (!__pyx_t_10 && PyList_CheckExact(__pyx_t_6)) { + if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_6)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_5); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_10 && PyTuple_CheckExact(__pyx_t_6)) { + if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_6)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_5); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_5 = __pyx_t_10(__pyx_t_6); + if (unlikely(!__pyx_t_5)) { + if (PyErr_Occurred()) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF(__pyx_v_p); + __pyx_v_p = __pyx_t_5; + __pyx_t_5 = 0; + + /* "_hyperdex_client.pyx":1082 + * if isinstance(preds, list): + * for p in preds: + * if isinstance(p, tuple) and len(p) == 2 and \ # <<<<<<<<<<<<<< + * type(p[0]) == type(p[1]) and type(p[0]): + * raw_checks.append((attr, HYPERPREDICATE_GREATER_EQUAL, p[0])) + */ + __pyx_t_8 = PyTuple_Check(__pyx_v_p); + if (__pyx_t_8) { + __pyx_t_11 = PyObject_Length(__pyx_v_p); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = (__pyx_t_11 == 2); + if (__pyx_t_12) { + + /* "_hyperdex_client.pyx":1083 + * for p in preds: + * if isinstance(p, tuple) and len(p) == 2 and \ + * type(p[0]) == type(p[1]) and type(p[0]): # <<<<<<<<<<<<<< + * raw_checks.append((attr, HYPERPREDICATE_GREATER_EQUAL, p[0])) + * raw_checks.append((attr, HYPERPREDICATE_LESS_EQUAL, p[1])) + */ + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_p, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_p, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_t_5)), ((PyObject *)Py_TYPE(__pyx_t_13)), Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__pyx_t_15) { + __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_p, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_16 = __Pyx_PyObject_IsTrue(((PyObject *)Py_TYPE(__pyx_t_14))); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_17 = __pyx_t_16; + } else { + __pyx_t_17 = __pyx_t_15; + } + __pyx_t_15 = __pyx_t_17; + } else { + __pyx_t_15 = __pyx_t_12; + } + __pyx_t_12 = __pyx_t_15; + } else { + __pyx_t_12 = __pyx_t_8; + } + if (__pyx_t_12) { + + /* "_hyperdex_client.pyx":1084 + * if isinstance(p, tuple) and len(p) == 2 and \ + * type(p[0]) == type(p[1]) and type(p[0]): + * raw_checks.append((attr, HYPERPREDICATE_GREATER_EQUAL, p[0])) # <<<<<<<<<<<<<< + * raw_checks.append((attr, HYPERPREDICATE_LESS_EQUAL, p[1])) + * elif isinstance(p, Predicate): + */ + __pyx_t_14 = PyInt_FromLong(HYPERPREDICATE_GREATER_EQUAL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_p, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_attr); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_attr); + __Pyx_GIVEREF(__pyx_v_attr); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_14 = 0; + __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Append(__pyx_v_raw_checks, ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "_hyperdex_client.pyx":1085 + * type(p[0]) == type(p[1]) and type(p[0]): + * raw_checks.append((attr, HYPERPREDICATE_GREATER_EQUAL, p[0])) + * raw_checks.append((attr, HYPERPREDICATE_LESS_EQUAL, p[1])) # <<<<<<<<<<<<<< + * elif isinstance(p, Predicate): + * raw_checks += p._raw(attr) + */ + __pyx_t_13 = PyInt_FromLong(HYPERPREDICATE_LESS_EQUAL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_p, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_INCREF(__pyx_v_attr); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_attr); + __Pyx_GIVEREF(__pyx_v_attr); + PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_13 = 0; + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_raw_checks, ((PyObject *)__pyx_t_14)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L8; + } + + /* "_hyperdex_client.pyx":1086 + * raw_checks.append((attr, HYPERPREDICATE_GREATER_EQUAL, p[0])) + * raw_checks.append((attr, HYPERPREDICATE_LESS_EQUAL, p[1])) + * elif isinstance(p, Predicate): # <<<<<<<<<<<<<< + * raw_checks += p._raw(attr) + * else: + */ + __pyx_t_12 = __Pyx_TypeCheck(__pyx_v_p, ((PyObject*)__pyx_ptype_16_hyperdex_client_Predicate)); + if (__pyx_t_12) { + + /* "_hyperdex_client.pyx":1087 + * raw_checks.append((attr, HYPERPREDICATE_LESS_EQUAL, p[1])) + * elif isinstance(p, Predicate): + * raw_checks += p._raw(attr) # <<<<<<<<<<<<<< + * else: + * raw_checks.append((attr, HYPERPREDICATE_EQUALS, p)) + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s___raw); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_INCREF(__pyx_v_attr); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_attr); + __Pyx_GIVEREF(__pyx_v_attr); + __pyx_t_13 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0; + __pyx_t_14 = PyNumber_InPlaceAdd(__pyx_v_raw_checks, __pyx_t_13); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_v_raw_checks); + __pyx_v_raw_checks = __pyx_t_14; + __pyx_t_14 = 0; + goto __pyx_L8; + } + /*else*/ { + + /* "_hyperdex_client.pyx":1089 + * raw_checks += p._raw(attr) + * else: + * raw_checks.append((attr, HYPERPREDICATE_EQUALS, p)) # <<<<<<<<<<<<<< + * elif isinstance(preds, tuple) and len(preds) == 2 and \ + * type(preds[0]) == type(preds[1]): + */ + __pyx_t_14 = PyInt_FromLong(HYPERPREDICATE_EQUALS); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_INCREF(__pyx_v_attr); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_attr); + __Pyx_GIVEREF(__pyx_v_attr); + PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); + __Pyx_INCREF(__pyx_v_p); + PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_v_p); + __Pyx_GIVEREF(__pyx_v_p); + __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_Append(__pyx_v_raw_checks, ((PyObject *)__pyx_t_13)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + } + __pyx_L8:; + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L5; + } + + /* "_hyperdex_client.pyx":1090 + * else: + * raw_checks.append((attr, HYPERPREDICATE_EQUALS, p)) + * elif isinstance(preds, tuple) and len(preds) == 2 and \ # <<<<<<<<<<<<<< + * type(preds[0]) == type(preds[1]): + * raw_checks.append((attr, HYPERPREDICATE_GREATER_EQUAL, preds[0])) + */ + __pyx_t_12 = PyTuple_Check(__pyx_v_preds); + if (__pyx_t_12) { + __pyx_t_9 = PyObject_Length(__pyx_v_preds); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = (__pyx_t_9 == 2); + if (__pyx_t_8) { + + /* "_hyperdex_client.pyx":1091 + * raw_checks.append((attr, HYPERPREDICATE_EQUALS, p)) + * elif isinstance(preds, tuple) and len(preds) == 2 and \ + * type(preds[0]) == type(preds[1]): # <<<<<<<<<<<<<< + * raw_checks.append((attr, HYPERPREDICATE_GREATER_EQUAL, preds[0])) + * raw_checks.append((attr, HYPERPREDICATE_LESS_EQUAL, preds[1])) + */ + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_preds, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_preds, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_13 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_t_6)), ((PyObject *)Py_TYPE(__pyx_t_14)), Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_17 = __pyx_t_15; + } else { + __pyx_t_17 = __pyx_t_8; + } + __pyx_t_8 = __pyx_t_17; + } else { + __pyx_t_8 = __pyx_t_12; + } + if (__pyx_t_8) { + + /* "_hyperdex_client.pyx":1092 + * elif isinstance(preds, tuple) and len(preds) == 2 and \ + * type(preds[0]) == type(preds[1]): + * raw_checks.append((attr, HYPERPREDICATE_GREATER_EQUAL, preds[0])) # <<<<<<<<<<<<<< + * raw_checks.append((attr, HYPERPREDICATE_LESS_EQUAL, preds[1])) + * elif isinstance(preds, Predicate): + */ + __pyx_t_13 = PyInt_FromLong(HYPERPREDICATE_GREATER_EQUAL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_preds, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_attr); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_attr); + __Pyx_GIVEREF(__pyx_v_attr); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); + __pyx_t_13 = 0; + __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_Append(__pyx_v_raw_checks, ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + + /* "_hyperdex_client.pyx":1093 + * type(preds[0]) == type(preds[1]): + * raw_checks.append((attr, HYPERPREDICATE_GREATER_EQUAL, preds[0])) + * raw_checks.append((attr, HYPERPREDICATE_LESS_EQUAL, preds[1])) # <<<<<<<<<<<<<< + * elif isinstance(preds, Predicate): + * raw_checks += preds._raw(attr) + */ + __pyx_t_14 = PyInt_FromLong(HYPERPREDICATE_LESS_EQUAL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_preds, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_INCREF(__pyx_v_attr); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_attr); + __Pyx_GIVEREF(__pyx_v_attr); + PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); + PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_14 = 0; + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_raw_checks, ((PyObject *)__pyx_t_13)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L5; + } + + /* "_hyperdex_client.pyx":1094 + * raw_checks.append((attr, HYPERPREDICATE_GREATER_EQUAL, preds[0])) + * raw_checks.append((attr, HYPERPREDICATE_LESS_EQUAL, preds[1])) + * elif isinstance(preds, Predicate): # <<<<<<<<<<<<<< + * raw_checks += preds._raw(attr) + * else: + */ + __pyx_t_8 = __Pyx_TypeCheck(__pyx_v_preds, ((PyObject*)__pyx_ptype_16_hyperdex_client_Predicate)); + if (__pyx_t_8) { + + /* "_hyperdex_client.pyx":1095 + * raw_checks.append((attr, HYPERPREDICATE_LESS_EQUAL, preds[1])) + * elif isinstance(preds, Predicate): + * raw_checks += preds._raw(attr) # <<<<<<<<<<<<<< + * else: + * raw_checks.append((attr, HYPERPREDICATE_EQUALS, preds)) + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_preds, __pyx_n_s___raw); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_INCREF(__pyx_v_attr); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_attr); + __Pyx_GIVEREF(__pyx_v_attr); + __pyx_t_14 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0; + __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_v_raw_checks, __pyx_t_14); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_v_raw_checks); + __pyx_v_raw_checks = __pyx_t_13; + __pyx_t_13 = 0; + goto __pyx_L5; + } + /*else*/ { + + /* "_hyperdex_client.pyx":1097 + * raw_checks += preds._raw(attr) + * else: + * raw_checks.append((attr, HYPERPREDICATE_EQUALS, preds)) # <<<<<<<<<<<<<< + * chks_sz[0] = len(raw_checks) + * chks[0] = malloc(sizeof(hyperdex_client_attribute_check) * chks_sz[0]) + */ + __pyx_t_13 = PyInt_FromLong(HYPERPREDICATE_EQUALS); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_INCREF(__pyx_v_attr); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_attr); + __Pyx_GIVEREF(__pyx_v_attr); + PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __Pyx_INCREF(__pyx_v_preds); + PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_v_preds); + __Pyx_GIVEREF(__pyx_v_preds); + __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Append(__pyx_v_raw_checks, ((PyObject *)__pyx_t_14)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + } + __pyx_L5:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":1098 + * else: + * raw_checks.append((attr, HYPERPREDICATE_EQUALS, preds)) + * chks_sz[0] = len(raw_checks) # <<<<<<<<<<<<<< + * chks[0] = malloc(sizeof(hyperdex_client_attribute_check) * chks_sz[0]) + * if chks[0] == NULL: + */ + __pyx_t_3 = PyObject_Length(__pyx_v_raw_checks); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + (__pyx_v_chks_sz[0]) = __pyx_t_3; + + /* "_hyperdex_client.pyx":1099 + * raw_checks.append((attr, HYPERPREDICATE_EQUALS, preds)) + * chks_sz[0] = len(raw_checks) + * chks[0] = malloc(sizeof(hyperdex_client_attribute_check) * chks_sz[0]) # <<<<<<<<<<<<<< + * if chks[0] == NULL: + * raise MemoryError() + */ + (__pyx_v_chks[0]) = ((struct hyperdex_client_attribute_check *)malloc(((sizeof(struct hyperdex_client_attribute_check)) * (__pyx_v_chks_sz[0])))); + + /* "_hyperdex_client.pyx":1100 + * chks_sz[0] = len(raw_checks) + * chks[0] = malloc(sizeof(hyperdex_client_attribute_check) * chks_sz[0]) + * if chks[0] == NULL: # <<<<<<<<<<<<<< + * raise MemoryError() + * backings = [] + */ + __pyx_t_8 = ((__pyx_v_chks[0]) == NULL); + if (__pyx_t_8) { + + /* "_hyperdex_client.pyx":1101 + * chks[0] = malloc(sizeof(hyperdex_client_attribute_check) * chks_sz[0]) + * if chks[0] == NULL: + * raise MemoryError() # <<<<<<<<<<<<<< + * backings = [] + * for i, (attr, pred, val) in enumerate(raw_checks): + */ + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L9; + } + __pyx_L9:; + + /* "_hyperdex_client.pyx":1102 + * if chks[0] == NULL: + * raise MemoryError() + * backings = [] # <<<<<<<<<<<<<< + * for i, (attr, pred, val) in enumerate(raw_checks): + * datatype, backing = _obj_to_backing(val) + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_backings = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":1103 + * raise MemoryError() + * backings = [] + * for i, (attr, pred, val) in enumerate(raw_checks): # <<<<<<<<<<<<<< + * datatype, backing = _obj_to_backing(val) + * backings.append(backing) + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_t_1 = __pyx_int_0; + if (PyList_CheckExact(__pyx_v_raw_checks) || PyTuple_CheckExact(__pyx_v_raw_checks)) { + __pyx_t_13 = __pyx_v_raw_checks; __Pyx_INCREF(__pyx_t_13); __pyx_t_3 = 0; + __pyx_t_10 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_v_raw_checks); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_10 = Py_TYPE(__pyx_t_13)->tp_iternext; + } + for (;;) { + if (!__pyx_t_10 && PyList_CheckExact(__pyx_t_13)) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_13)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_14 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_3); __Pyx_INCREF(__pyx_t_14); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_14 = PySequence_ITEM(__pyx_t_13, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_10 && PyTuple_CheckExact(__pyx_t_13)) { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_13)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_3); __Pyx_INCREF(__pyx_t_14); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_14 = PySequence_ITEM(__pyx_t_13, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_14 = __pyx_t_10(__pyx_t_13); + if (unlikely(!__pyx_t_14)) { + if (PyErr_Occurred()) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_14); + } + if ((likely(PyTuple_CheckExact(__pyx_t_14))) || (PyList_CheckExact(__pyx_t_14))) { + PyObject* sequence = __pyx_t_14; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 3)) { + if (size > 3) __Pyx_RaiseTooManyValuesError(3); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_18 = PyTuple_GET_ITEM(sequence, 2); + } else { + __pyx_t_6 = PyList_GET_ITEM(sequence, 0); + __pyx_t_5 = PyList_GET_ITEM(sequence, 1); + __pyx_t_18 = PyList_GET_ITEM(sequence, 2); + } + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_18); + #else + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_18 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + #endif + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + } else + { + Py_ssize_t index = -1; + __pyx_t_19 = PyObject_GetIter(__pyx_t_14); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext; + index = 0; __pyx_t_6 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_6)) goto __pyx_L12_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + index = 1; __pyx_t_5 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_5)) goto __pyx_L12_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 2; __pyx_t_18 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_18)) goto __pyx_L12_unpacking_failed; + __Pyx_GOTREF(__pyx_t_18); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_20 = NULL; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + goto __pyx_L13_unpacking_done; + __pyx_L12_unpacking_failed:; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_20 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L13_unpacking_done:; + } + __Pyx_XDECREF(__pyx_v_attr); + __pyx_v_attr = __pyx_t_6; + __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_v_pred); + __pyx_v_pred = __pyx_t_5; + __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_v_val); + __pyx_v_val = __pyx_t_18; + __pyx_t_18 = 0; + __Pyx_INCREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_v_i); + __pyx_v_i = __pyx_t_1; + __pyx_t_14 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_1); + __pyx_t_1 = __pyx_t_14; + __pyx_t_14 = 0; + + /* "_hyperdex_client.pyx":1104 + * backings = [] + * for i, (attr, pred, val) in enumerate(raw_checks): + * datatype, backing = _obj_to_backing(val) # <<<<<<<<<<<<<< + * backings.append(backing) + * backings.append(attr) + */ + __pyx_t_14 = __pyx_f_16_hyperdex_client__obj_to_backing(__pyx_v_val); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + if ((likely(PyTuple_CheckExact(__pyx_t_14))) || (PyList_CheckExact(__pyx_t_14))) { + PyObject* sequence = __pyx_t_14; + #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_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_18 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_18 = PyList_GET_ITEM(sequence, 0); + __pyx_t_5 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_18); + __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_18 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + } else + { + Py_ssize_t index = -1; + __pyx_t_6 = PyObject_GetIter(__pyx_t_14); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_20 = Py_TYPE(__pyx_t_6)->tp_iternext; + index = 0; __pyx_t_18 = __pyx_t_20(__pyx_t_6); if (unlikely(!__pyx_t_18)) goto __pyx_L14_unpacking_failed; + __Pyx_GOTREF(__pyx_t_18); + index = 1; __pyx_t_5 = __pyx_t_20(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L14_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_20 = NULL; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L15_unpacking_done; + __pyx_L14_unpacking_failed:; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_20 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L15_unpacking_done:; + } + __Pyx_XDECREF(__pyx_v_datatype); + __pyx_v_datatype = __pyx_t_18; + __pyx_t_18 = 0; + __Pyx_XDECREF(__pyx_v_backing); + __pyx_v_backing = __pyx_t_5; + __pyx_t_5 = 0; + + /* "_hyperdex_client.pyx":1105 + * for i, (attr, pred, val) in enumerate(raw_checks): + * datatype, backing = _obj_to_backing(val) + * backings.append(backing) # <<<<<<<<<<<<<< + * backings.append(attr) + * chks[0][i].attr = attr + */ + __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_backings, __pyx_v_backing); if (unlikely(__pyx_t_21 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "_hyperdex_client.pyx":1106 + * datatype, backing = _obj_to_backing(val) + * backings.append(backing) + * backings.append(attr) # <<<<<<<<<<<<<< + * chks[0][i].attr = attr + * chks[0][i].value = backing + */ + __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_backings, __pyx_v_attr); if (unlikely(__pyx_t_21 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "_hyperdex_client.pyx":1107 + * backings.append(backing) + * backings.append(attr) + * chks[0][i].attr = attr # <<<<<<<<<<<<<< + * chks[0][i].value = backing + * chks[0][i].value_sz = len(backing) + */ + __pyx_t_22 = __Pyx_PyObject_AsString(__pyx_v_attr); if (unlikely((!__pyx_t_22) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((__pyx_v_chks[0])[__pyx_t_2]).attr = __pyx_t_22; + + /* "_hyperdex_client.pyx":1108 + * backings.append(attr) + * chks[0][i].attr = attr + * chks[0][i].value = backing # <<<<<<<<<<<<<< + * chks[0][i].value_sz = len(backing) + * chks[0][i].datatype = datatype + */ + __pyx_t_22 = __Pyx_PyObject_AsString(__pyx_v_backing); if (unlikely((!__pyx_t_22) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((__pyx_v_chks[0])[__pyx_t_2]).value = __pyx_t_22; + + /* "_hyperdex_client.pyx":1109 + * chks[0][i].attr = attr + * chks[0][i].value = backing + * chks[0][i].value_sz = len(backing) # <<<<<<<<<<<<<< + * chks[0][i].datatype = datatype + * chks[0][i].predicate = pred + */ + __pyx_t_2 = PyObject_Length(__pyx_v_backing); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((__pyx_v_chks[0])[__pyx_t_9]).value_sz = __pyx_t_2; + + /* "_hyperdex_client.pyx":1110 + * chks[0][i].value = backing + * chks[0][i].value_sz = len(backing) + * chks[0][i].datatype = datatype # <<<<<<<<<<<<<< + * chks[0][i].predicate = pred + * return backings + */ + __pyx_t_23 = ((enum hyperdatatype)PyInt_AsLong(__pyx_v_datatype)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((__pyx_v_chks[0])[__pyx_t_9]).datatype = __pyx_t_23; + + /* "_hyperdex_client.pyx":1111 + * chks[0][i].value_sz = len(backing) + * chks[0][i].datatype = datatype + * chks[0][i].predicate = pred # <<<<<<<<<<<<<< + * return backings + * + */ + __pyx_t_24 = ((enum hyperpredicate)PyInt_AsLong(__pyx_v_pred)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((__pyx_v_chks[0])[__pyx_t_9]).predicate = __pyx_t_24; + } + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":1112 + * chks[0][i].datatype = datatype + * chks[0][i].predicate = pred + * return backings # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_backings)); + __pyx_r = ((PyObject *)__pyx_v_backings); + goto __pyx_L0; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_18); + __Pyx_XDECREF(__pyx_t_19); + __Pyx_AddTraceback("_hyperdex_client._predicate_to_c", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_raw_checks); + __Pyx_XDECREF(__pyx_v_attr); + __Pyx_XDECREF(__pyx_v_preds); + __Pyx_XDECREF(__pyx_v_p); + __Pyx_XDECREF(__pyx_v_backings); + __Pyx_XDECREF(__pyx_v_i); + __Pyx_XDECREF(__pyx_v_pred); + __Pyx_XDECREF(__pyx_v_val); + __Pyx_XDECREF(__pyx_v_datatype); + __Pyx_XDECREF(__pyx_v_backing); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_16_hyperdex_client_16DeferredGroupDel_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_16_hyperdex_client_16DeferredGroupDel_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client = 0; + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_predicate = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__client,&__pyx_n_s__space,&__pyx_n_s__predicate,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__client)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__space)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__predicate)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __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_client = ((struct __pyx_obj_16_hyperdex_client_Client *)values[0]); + __pyx_v_space = ((PyObject*)values[1]); + __pyx_v_predicate = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.DeferredGroupDel.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_client), __pyx_ptype_16_hyperdex_client_Client, 1, "client", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_predicate), (&PyDict_Type), 1, "predicate", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_16DeferredGroupDel___cinit__(((struct __pyx_obj_16_hyperdex_client_DeferredGroupDel *)__pyx_v_self), __pyx_v_client, __pyx_v_space, __pyx_v_predicate); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1117 + * cdef class DeferredGroupDel(Deferred): + * + * def __cinit__(self, Client client, bytes space, dict predicate): # <<<<<<<<<<<<<< + * self._client = client + * self._reqid = 0 + */ + +static int __pyx_pf_16_hyperdex_client_16DeferredGroupDel___cinit__(struct __pyx_obj_16_hyperdex_client_DeferredGroupDel *__pyx_v_self, struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client, PyObject *__pyx_v_space, PyObject *__pyx_v_predicate) { + struct hyperdex_client_attribute_check *__pyx_v_chks; + size_t __pyx_v_chks_sz; + CYTHON_UNUSED PyObject *__pyx_v_backings = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + char *__pyx_t_2; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "_hyperdex_client.pyx":1118 + * + * def __cinit__(self, Client client, bytes space, dict predicate): + * self._client = client # <<<<<<<<<<<<<< + * self._reqid = 0 + * self._status = HYPERDEX_CLIENT_GARBAGE + */ + __Pyx_INCREF(((PyObject *)__pyx_v_client)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_client)); + __Pyx_GOTREF(__pyx_v_self->__pyx_base._client); + __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base._client)); + __pyx_v_self->__pyx_base._client = __pyx_v_client; + + /* "_hyperdex_client.pyx":1119 + * def __cinit__(self, Client client, bytes space, dict predicate): + * self._client = client + * self._reqid = 0 # <<<<<<<<<<<<<< + * self._status = HYPERDEX_CLIENT_GARBAGE + * cdef hyperdex_client_attribute_check* chks = NULL + */ + __pyx_v_self->__pyx_base._reqid = 0; + + /* "_hyperdex_client.pyx":1120 + * self._client = client + * self._reqid = 0 + * self._status = HYPERDEX_CLIENT_GARBAGE # <<<<<<<<<<<<<< + * cdef hyperdex_client_attribute_check* chks = NULL + * cdef size_t chks_sz = 0 + */ + __pyx_v_self->__pyx_base._status = HYPERDEX_CLIENT_GARBAGE; + + /* "_hyperdex_client.pyx":1121 + * self._reqid = 0 + * self._status = HYPERDEX_CLIENT_GARBAGE + * cdef hyperdex_client_attribute_check* chks = NULL # <<<<<<<<<<<<<< + * cdef size_t chks_sz = 0 + * try: + */ + __pyx_v_chks = NULL; + + /* "_hyperdex_client.pyx":1122 + * self._status = HYPERDEX_CLIENT_GARBAGE + * cdef hyperdex_client_attribute_check* chks = NULL + * cdef size_t chks_sz = 0 # <<<<<<<<<<<<<< + * try: + * backings = _predicate_to_c(predicate, &chks, &chks_sz) + */ + __pyx_v_chks_sz = 0; + + /* "_hyperdex_client.pyx":1123 + * cdef hyperdex_client_attribute_check* chks = NULL + * cdef size_t chks_sz = 0 + * try: # <<<<<<<<<<<<<< + * backings = _predicate_to_c(predicate, &chks, &chks_sz) + * self._reqid = hyperdex_client_group_del(client._client, space, + */ + /*try:*/ { + + /* "_hyperdex_client.pyx":1124 + * cdef size_t chks_sz = 0 + * try: + * backings = _predicate_to_c(predicate, &chks, &chks_sz) # <<<<<<<<<<<<<< + * self._reqid = hyperdex_client_group_del(client._client, space, + * chks, chks_sz, + */ + __pyx_t_1 = __pyx_f_16_hyperdex_client__predicate_to_c(__pyx_v_predicate, (&__pyx_v_chks), (&__pyx_v_chks_sz)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L4;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_backings = __pyx_t_1; + __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":1125 + * try: + * backings = _predicate_to_c(predicate, &chks, &chks_sz) + * self._reqid = hyperdex_client_group_del(client._client, space, # <<<<<<<<<<<<<< + * chks, chks_sz, + * &self._status) + */ + __pyx_t_2 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_space)); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L4;} + + /* "_hyperdex_client.pyx":1127 + * self._reqid = hyperdex_client_group_del(client._client, space, + * chks, chks_sz, + * &self._status) # <<<<<<<<<<<<<< + * _check_reqid_search(self._reqid, self._status, chks, chks_sz) + * client._ops[self._reqid] = self + */ + __pyx_v_self->__pyx_base._reqid = hyperdex_client_group_del(__pyx_v_client->_client, __pyx_t_2, __pyx_v_chks, __pyx_v_chks_sz, (&__pyx_v_self->__pyx_base._status)); + + /* "_hyperdex_client.pyx":1128 + * chks, chks_sz, + * &self._status) + * _check_reqid_search(self._reqid, self._status, chks, chks_sz) # <<<<<<<<<<<<<< + * client._ops[self._reqid] = self + * finally: + */ + __pyx_t_1 = __pyx_f_16_hyperdex_client__check_reqid_search(__pyx_v_self->__pyx_base._reqid, __pyx_v_self->__pyx_base._status, __pyx_v_chks, __pyx_v_chks_sz); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L4;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":1129 + * &self._status) + * _check_reqid_search(self._reqid, self._status, chks, chks_sz) + * client._ops[self._reqid] = self # <<<<<<<<<<<<<< + * finally: + * if chks: free(chks) + */ + if (unlikely(((PyObject *)__pyx_v_client->_ops) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L4;} + } + if (__Pyx_SetItemInt(((PyObject *)__pyx_v_client->_ops), __pyx_v_self->__pyx_base._reqid, ((PyObject *)__pyx_v_self), sizeof(int64_t), __Pyx_PyInt_to_py_int64_t, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L4;} + } + + /* "_hyperdex_client.pyx":1131 + * client._ops[self._reqid] = self + * finally: + * if chks: free(chks) # <<<<<<<<<<<<<< + * + * def wait(self): + */ + /*finally:*/ { + int __pyx_why; + PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; + int __pyx_exc_lineno; + __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; + __pyx_why = 0; goto __pyx_L5; + __pyx_L4: { + __pyx_why = 4; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); + __pyx_exc_lineno = __pyx_lineno; + goto __pyx_L5; + } + __pyx_L5:; + __pyx_t_3 = (__pyx_v_chks != 0); + if (__pyx_t_3) { + free(__pyx_v_chks); + goto __pyx_L7; + } + __pyx_L7:; + switch (__pyx_why) { + case 4: { + __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); + __pyx_lineno = __pyx_exc_lineno; + __pyx_exc_type = 0; + __pyx_exc_value = 0; + __pyx_exc_tb = 0; + goto __pyx_L1_error; + } + } + } + + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("_hyperdex_client.DeferredGroupDel.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_backings); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_16DeferredGroupDel_3wait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_16DeferredGroupDel_3wait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wait (wrapper)", 0); + __pyx_r = __pyx_pf_16_hyperdex_client_16DeferredGroupDel_2wait(((struct __pyx_obj_16_hyperdex_client_DeferredGroupDel *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1133 + * if chks: free(chks) + * + * def wait(self): # <<<<<<<<<<<<<< + * Deferred.wait(self) + * if self._status == HYPERDEX_CLIENT_SUCCESS: + */ + +static PyObject *__pyx_pf_16_hyperdex_client_16DeferredGroupDel_2wait(struct __pyx_obj_16_hyperdex_client_DeferredGroupDel *__pyx_v_self) { + 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_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wait", 0); + + /* "_hyperdex_client.pyx":1134 + * + * def wait(self): + * Deferred.wait(self) # <<<<<<<<<<<<<< + * if self._status == HYPERDEX_CLIENT_SUCCESS: + * return True + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_Deferred)), __pyx_n_s__wait); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1135 + * def wait(self): + * Deferred.wait(self) + * if self._status == HYPERDEX_CLIENT_SUCCESS: # <<<<<<<<<<<<<< + * return True + * else: + */ + __pyx_t_4 = (__pyx_v_self->__pyx_base._status == HYPERDEX_CLIENT_SUCCESS); + if (__pyx_t_4) { + + /* "_hyperdex_client.pyx":1136 + * Deferred.wait(self) + * if self._status == HYPERDEX_CLIENT_SUCCESS: + * return True # <<<<<<<<<<<<<< + * else: + * raise HyperClientException(self._status) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + goto __pyx_L3; + } + /*else*/ { + + /* "_hyperdex_client.pyx":1138 + * return True + * else: + * raise HyperClientException(self._status) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_122); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyInt_FromLong(__pyx_v_self->__pyx_base._status); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L3:; + + __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("_hyperdex_client.DeferredGroupDel.wait", __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_16_hyperdex_client_22DeferredSearchDescribe_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_16_hyperdex_client_22DeferredSearchDescribe_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client = 0; + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_predicate = 0; + CYTHON_UNUSED PyBoolObject *__pyx_v_unsafe = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__client,&__pyx_n_s__space,&__pyx_n_s__predicate,&__pyx_n_s__unsafe,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__client)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__space)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__predicate)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__unsafe)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __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_client = ((struct __pyx_obj_16_hyperdex_client_Client *)values[0]); + __pyx_v_space = ((PyObject*)values[1]); + __pyx_v_predicate = ((PyObject*)values[2]); + __pyx_v_unsafe = ((PyBoolObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.DeferredSearchDescribe.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_client), __pyx_ptype_16_hyperdex_client_Client, 1, "client", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_predicate), (&PyDict_Type), 1, "predicate", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unsafe), __pyx_ptype_7cpython_4bool_bool, 1, "unsafe", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_22DeferredSearchDescribe___cinit__(((struct __pyx_obj_16_hyperdex_client_DeferredSearchDescribe *)__pyx_v_self), __pyx_v_client, __pyx_v_space, __pyx_v_predicate, __pyx_v_unsafe); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1145 + * cdef char* _text + * + * def __cinit__(self, Client client, bytes space, dict predicate, bool unsafe): # <<<<<<<<<<<<<< + * self._client = client + * self._reqid = 0 + */ + +static int __pyx_pf_16_hyperdex_client_22DeferredSearchDescribe___cinit__(struct __pyx_obj_16_hyperdex_client_DeferredSearchDescribe *__pyx_v_self, struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client, PyObject *__pyx_v_space, PyObject *__pyx_v_predicate, CYTHON_UNUSED PyBoolObject *__pyx_v_unsafe) { + struct hyperdex_client_attribute_check *__pyx_v_chks; + size_t __pyx_v_chks_sz; + CYTHON_UNUSED PyObject *__pyx_v_backings = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + char *__pyx_t_2; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "_hyperdex_client.pyx":1146 + * + * def __cinit__(self, Client client, bytes space, dict predicate, bool unsafe): + * self._client = client # <<<<<<<<<<<<<< + * self._reqid = 0 + * self._status = HYPERDEX_CLIENT_GARBAGE + */ + __Pyx_INCREF(((PyObject *)__pyx_v_client)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_client)); + __Pyx_GOTREF(__pyx_v_self->__pyx_base._client); + __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base._client)); + __pyx_v_self->__pyx_base._client = __pyx_v_client; + + /* "_hyperdex_client.pyx":1147 + * def __cinit__(self, Client client, bytes space, dict predicate, bool unsafe): + * self._client = client + * self._reqid = 0 # <<<<<<<<<<<<<< + * self._status = HYPERDEX_CLIENT_GARBAGE + * self._text = NULL + */ + __pyx_v_self->__pyx_base._reqid = 0; + + /* "_hyperdex_client.pyx":1148 + * self._client = client + * self._reqid = 0 + * self._status = HYPERDEX_CLIENT_GARBAGE # <<<<<<<<<<<<<< + * self._text = NULL + * cdef hyperdex_client_attribute_check* chks = NULL + */ + __pyx_v_self->__pyx_base._status = HYPERDEX_CLIENT_GARBAGE; + + /* "_hyperdex_client.pyx":1149 + * self._reqid = 0 + * self._status = HYPERDEX_CLIENT_GARBAGE + * self._text = NULL # <<<<<<<<<<<<<< + * cdef hyperdex_client_attribute_check* chks = NULL + * cdef size_t chks_sz = 0 + */ + __pyx_v_self->_text = NULL; + + /* "_hyperdex_client.pyx":1150 + * self._status = HYPERDEX_CLIENT_GARBAGE + * self._text = NULL + * cdef hyperdex_client_attribute_check* chks = NULL # <<<<<<<<<<<<<< + * cdef size_t chks_sz = 0 + * try: + */ + __pyx_v_chks = NULL; + + /* "_hyperdex_client.pyx":1151 + * self._text = NULL + * cdef hyperdex_client_attribute_check* chks = NULL + * cdef size_t chks_sz = 0 # <<<<<<<<<<<<<< + * try: + * backings = _predicate_to_c(predicate, &chks, &chks_sz) + */ + __pyx_v_chks_sz = 0; + + /* "_hyperdex_client.pyx":1152 + * cdef hyperdex_client_attribute_check* chks = NULL + * cdef size_t chks_sz = 0 + * try: # <<<<<<<<<<<<<< + * backings = _predicate_to_c(predicate, &chks, &chks_sz) + * self._reqid = hyperdex_client_search_describe(client._client, space, + */ + /*try:*/ { + + /* "_hyperdex_client.pyx":1153 + * cdef size_t chks_sz = 0 + * try: + * backings = _predicate_to_c(predicate, &chks, &chks_sz) # <<<<<<<<<<<<<< + * self._reqid = hyperdex_client_search_describe(client._client, space, + * chks, chks_sz, + */ + __pyx_t_1 = __pyx_f_16_hyperdex_client__predicate_to_c(__pyx_v_predicate, (&__pyx_v_chks), (&__pyx_v_chks_sz)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L4;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_backings = __pyx_t_1; + __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":1154 + * try: + * backings = _predicate_to_c(predicate, &chks, &chks_sz) + * self._reqid = hyperdex_client_search_describe(client._client, space, # <<<<<<<<<<<<<< + * chks, chks_sz, + * &self._status, &self._text) + */ + __pyx_t_2 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_space)); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L4;} + + /* "_hyperdex_client.pyx":1156 + * self._reqid = hyperdex_client_search_describe(client._client, space, + * chks, chks_sz, + * &self._status, &self._text) # <<<<<<<<<<<<<< + * _check_reqid_search(self._reqid, self._status, chks, chks_sz) + * client._ops[self._reqid] = self + */ + __pyx_v_self->__pyx_base._reqid = hyperdex_client_search_describe(__pyx_v_client->_client, __pyx_t_2, __pyx_v_chks, __pyx_v_chks_sz, (&__pyx_v_self->__pyx_base._status), (&__pyx_v_self->_text)); + + /* "_hyperdex_client.pyx":1157 + * chks, chks_sz, + * &self._status, &self._text) + * _check_reqid_search(self._reqid, self._status, chks, chks_sz) # <<<<<<<<<<<<<< + * client._ops[self._reqid] = self + * finally: + */ + __pyx_t_1 = __pyx_f_16_hyperdex_client__check_reqid_search(__pyx_v_self->__pyx_base._reqid, __pyx_v_self->__pyx_base._status, __pyx_v_chks, __pyx_v_chks_sz); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L4;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":1158 + * &self._status, &self._text) + * _check_reqid_search(self._reqid, self._status, chks, chks_sz) + * client._ops[self._reqid] = self # <<<<<<<<<<<<<< + * finally: + * if chks: free(chks) + */ + if (unlikely(((PyObject *)__pyx_v_client->_ops) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L4;} + } + if (__Pyx_SetItemInt(((PyObject *)__pyx_v_client->_ops), __pyx_v_self->__pyx_base._reqid, ((PyObject *)__pyx_v_self), sizeof(int64_t), __Pyx_PyInt_to_py_int64_t, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L4;} + } + + /* "_hyperdex_client.pyx":1160 + * client._ops[self._reqid] = self + * finally: + * if chks: free(chks) # <<<<<<<<<<<<<< + * + * def wait(self): + */ + /*finally:*/ { + int __pyx_why; + PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; + int __pyx_exc_lineno; + __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; + __pyx_why = 0; goto __pyx_L5; + __pyx_L4: { + __pyx_why = 4; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); + __pyx_exc_lineno = __pyx_lineno; + goto __pyx_L5; + } + __pyx_L5:; + __pyx_t_3 = (__pyx_v_chks != 0); + if (__pyx_t_3) { + free(__pyx_v_chks); + goto __pyx_L7; + } + __pyx_L7:; + switch (__pyx_why) { + case 4: { + __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); + __pyx_lineno = __pyx_exc_lineno; + __pyx_exc_type = 0; + __pyx_exc_value = 0; + __pyx_exc_tb = 0; + goto __pyx_L1_error; + } + } + } + + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("_hyperdex_client.DeferredSearchDescribe.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_backings); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_22DeferredSearchDescribe_3wait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_22DeferredSearchDescribe_3wait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wait (wrapper)", 0); + __pyx_r = __pyx_pf_16_hyperdex_client_22DeferredSearchDescribe_2wait(((struct __pyx_obj_16_hyperdex_client_DeferredSearchDescribe *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1162 + * if chks: free(chks) + * + * def wait(self): # <<<<<<<<<<<<<< + * Deferred.wait(self) + * if self._status == HYPERDEX_CLIENT_SUCCESS: + */ + +static PyObject *__pyx_pf_16_hyperdex_client_22DeferredSearchDescribe_2wait(struct __pyx_obj_16_hyperdex_client_DeferredSearchDescribe *__pyx_v_self) { + 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_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wait", 0); + + /* "_hyperdex_client.pyx":1163 + * + * def wait(self): + * Deferred.wait(self) # <<<<<<<<<<<<<< + * if self._status == HYPERDEX_CLIENT_SUCCESS: + * if self._text == NULL: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_Deferred)), __pyx_n_s__wait); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1164 + * def wait(self): + * Deferred.wait(self) + * if self._status == HYPERDEX_CLIENT_SUCCESS: # <<<<<<<<<<<<<< + * if self._text == NULL: + * return None + */ + __pyx_t_4 = (__pyx_v_self->__pyx_base._status == HYPERDEX_CLIENT_SUCCESS); + if (__pyx_t_4) { + + /* "_hyperdex_client.pyx":1165 + * Deferred.wait(self) + * if self._status == HYPERDEX_CLIENT_SUCCESS: + * if self._text == NULL: # <<<<<<<<<<<<<< + * return None + * return self._text.strip() + */ + __pyx_t_4 = (__pyx_v_self->_text == NULL); + if (__pyx_t_4) { + + /* "_hyperdex_client.pyx":1166 + * if self._status == HYPERDEX_CLIENT_SUCCESS: + * if self._text == NULL: + * return None # <<<<<<<<<<<<<< + * return self._text.strip() + * else: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + goto __pyx_L4; + } + __pyx_L4:; + + /* "_hyperdex_client.pyx":1167 + * if self._text == NULL: + * return None + * return self._text.strip() # <<<<<<<<<<<<<< + * else: + * raise HyperClientException(self._status) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_self->_text); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_t_3), __pyx_n_s__strip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + goto __pyx_L3; + } + /*else*/ { + + /* "_hyperdex_client.pyx":1169 + * return self._text.strip() + * else: + * raise HyperClientException(self._status) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_122); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyInt_FromLong(__pyx_v_self->__pyx_base._status); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L3:; + + __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("_hyperdex_client.DeferredSearchDescribe.wait", __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_16_hyperdex_client_13DeferredCount_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_16_hyperdex_client_13DeferredCount_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client = 0; + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_predicate = 0; + PyBoolObject *__pyx_v_unsafe = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__client,&__pyx_n_s__space,&__pyx_n_s__predicate,&__pyx_n_s__unsafe,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__client)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__space)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__predicate)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__unsafe)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __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_client = ((struct __pyx_obj_16_hyperdex_client_Client *)values[0]); + __pyx_v_space = ((PyObject*)values[1]); + __pyx_v_predicate = ((PyObject*)values[2]); + __pyx_v_unsafe = ((PyBoolObject *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.DeferredCount.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_client), __pyx_ptype_16_hyperdex_client_Client, 1, "client", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_predicate), (&PyDict_Type), 1, "predicate", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unsafe), __pyx_ptype_7cpython_4bool_bool, 1, "unsafe", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_13DeferredCount___cinit__(((struct __pyx_obj_16_hyperdex_client_DeferredCount *)__pyx_v_self), __pyx_v_client, __pyx_v_space, __pyx_v_predicate, __pyx_v_unsafe); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1177 + * cdef int _unsafe + * + * def __cinit__(self, Client client, bytes space, dict predicate, bool unsafe): # <<<<<<<<<<<<<< + * self._client = client + * self._reqid = 0 + */ + +static int __pyx_pf_16_hyperdex_client_13DeferredCount___cinit__(struct __pyx_obj_16_hyperdex_client_DeferredCount *__pyx_v_self, struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client, PyObject *__pyx_v_space, PyObject *__pyx_v_predicate, PyBoolObject *__pyx_v_unsafe) { + struct hyperdex_client_attribute_check *__pyx_v_chks; + size_t __pyx_v_chks_sz; + CYTHON_UNUSED PyObject *__pyx_v_backings = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + long __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + char *__pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "_hyperdex_client.pyx":1178 + * + * def __cinit__(self, Client client, bytes space, dict predicate, bool unsafe): + * self._client = client # <<<<<<<<<<<<<< + * self._reqid = 0 + * self._status = HYPERDEX_CLIENT_GARBAGE + */ + __Pyx_INCREF(((PyObject *)__pyx_v_client)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_client)); + __Pyx_GOTREF(__pyx_v_self->__pyx_base._client); + __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base._client)); + __pyx_v_self->__pyx_base._client = __pyx_v_client; + + /* "_hyperdex_client.pyx":1179 + * def __cinit__(self, Client client, bytes space, dict predicate, bool unsafe): + * self._client = client + * self._reqid = 0 # <<<<<<<<<<<<<< + * self._status = HYPERDEX_CLIENT_GARBAGE + * self._result = 0 + */ + __pyx_v_self->__pyx_base._reqid = 0; + + /* "_hyperdex_client.pyx":1180 + * self._client = client + * self._reqid = 0 + * self._status = HYPERDEX_CLIENT_GARBAGE # <<<<<<<<<<<<<< + * self._result = 0 + * self._unsafe = 1 if unsafe else 0 + */ + __pyx_v_self->__pyx_base._status = HYPERDEX_CLIENT_GARBAGE; + + /* "_hyperdex_client.pyx":1181 + * self._reqid = 0 + * self._status = HYPERDEX_CLIENT_GARBAGE + * self._result = 0 # <<<<<<<<<<<<<< + * self._unsafe = 1 if unsafe else 0 + * cdef hyperdex_client_attribute_check* chks = NULL + */ + __pyx_v_self->_result = 0; + + /* "_hyperdex_client.pyx":1182 + * self._status = HYPERDEX_CLIENT_GARBAGE + * self._result = 0 + * self._unsafe = 1 if unsafe else 0 # <<<<<<<<<<<<<< + * cdef hyperdex_client_attribute_check* chks = NULL + * cdef size_t chks_sz = 0 + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_unsafe)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_2) { + __pyx_t_1 = 1; + } else { + __pyx_t_1 = 0; + } + __pyx_v_self->_unsafe = __pyx_t_1; + + /* "_hyperdex_client.pyx":1183 + * self._result = 0 + * self._unsafe = 1 if unsafe else 0 + * cdef hyperdex_client_attribute_check* chks = NULL # <<<<<<<<<<<<<< + * cdef size_t chks_sz = 0 + * try: + */ + __pyx_v_chks = NULL; + + /* "_hyperdex_client.pyx":1184 + * self._unsafe = 1 if unsafe else 0 + * cdef hyperdex_client_attribute_check* chks = NULL + * cdef size_t chks_sz = 0 # <<<<<<<<<<<<<< + * try: + * backings = _predicate_to_c(predicate, &chks, &chks_sz) + */ + __pyx_v_chks_sz = 0; + + /* "_hyperdex_client.pyx":1185 + * cdef hyperdex_client_attribute_check* chks = NULL + * cdef size_t chks_sz = 0 + * try: # <<<<<<<<<<<<<< + * backings = _predicate_to_c(predicate, &chks, &chks_sz) + * self._reqid = hyperdex_client_count(client._client, space, + */ + /*try:*/ { + + /* "_hyperdex_client.pyx":1186 + * cdef size_t chks_sz = 0 + * try: + * backings = _predicate_to_c(predicate, &chks, &chks_sz) # <<<<<<<<<<<<<< + * self._reqid = hyperdex_client_count(client._client, space, + * chks, chks_sz, + */ + __pyx_t_3 = __pyx_f_16_hyperdex_client__predicate_to_c(__pyx_v_predicate, (&__pyx_v_chks), (&__pyx_v_chks_sz)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L4;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_backings = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1187 + * try: + * backings = _predicate_to_c(predicate, &chks, &chks_sz) + * self._reqid = hyperdex_client_count(client._client, space, # <<<<<<<<<<<<<< + * chks, chks_sz, + * &self._status, &self._result) + */ + __pyx_t_4 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_space)); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L4;} + + /* "_hyperdex_client.pyx":1189 + * self._reqid = hyperdex_client_count(client._client, space, + * chks, chks_sz, + * &self._status, &self._result) # <<<<<<<<<<<<<< + * _check_reqid_search(self._reqid, self._status, chks, chks_sz) + * client._ops[self._reqid] = self + */ + __pyx_v_self->__pyx_base._reqid = hyperdex_client_count(__pyx_v_client->_client, __pyx_t_4, __pyx_v_chks, __pyx_v_chks_sz, (&__pyx_v_self->__pyx_base._status), (&__pyx_v_self->_result)); + + /* "_hyperdex_client.pyx":1190 + * chks, chks_sz, + * &self._status, &self._result) + * _check_reqid_search(self._reqid, self._status, chks, chks_sz) # <<<<<<<<<<<<<< + * client._ops[self._reqid] = self + * finally: + */ + __pyx_t_3 = __pyx_f_16_hyperdex_client__check_reqid_search(__pyx_v_self->__pyx_base._reqid, __pyx_v_self->__pyx_base._status, __pyx_v_chks, __pyx_v_chks_sz); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L4;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1191 + * &self._status, &self._result) + * _check_reqid_search(self._reqid, self._status, chks, chks_sz) + * client._ops[self._reqid] = self # <<<<<<<<<<<<<< + * finally: + * if chks: free(chks) + */ + if (unlikely(((PyObject *)__pyx_v_client->_ops) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L4;} + } + if (__Pyx_SetItemInt(((PyObject *)__pyx_v_client->_ops), __pyx_v_self->__pyx_base._reqid, ((PyObject *)__pyx_v_self), sizeof(int64_t), __Pyx_PyInt_to_py_int64_t, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L4;} + } + + /* "_hyperdex_client.pyx":1193 + * client._ops[self._reqid] = self + * finally: + * if chks: free(chks) # <<<<<<<<<<<<<< + * + * def wait(self): + */ + /*finally:*/ { + int __pyx_why; + PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; + int __pyx_exc_lineno; + __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; + __pyx_why = 0; goto __pyx_L5; + __pyx_L4: { + __pyx_why = 4; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); + __pyx_exc_lineno = __pyx_lineno; + goto __pyx_L5; + } + __pyx_L5:; + __pyx_t_2 = (__pyx_v_chks != 0); + if (__pyx_t_2) { + free(__pyx_v_chks); + goto __pyx_L7; + } + __pyx_L7:; + switch (__pyx_why) { + case 4: { + __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); + __pyx_lineno = __pyx_exc_lineno; + __pyx_exc_type = 0; + __pyx_exc_value = 0; + __pyx_exc_tb = 0; + goto __pyx_L1_error; + } + } + } + + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("_hyperdex_client.DeferredCount.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_backings); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_13DeferredCount_3wait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_13DeferredCount_3wait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wait (wrapper)", 0); + __pyx_r = __pyx_pf_16_hyperdex_client_13DeferredCount_2wait(((struct __pyx_obj_16_hyperdex_client_DeferredCount *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1195 + * if chks: free(chks) + * + * def wait(self): # <<<<<<<<<<<<<< + * Deferred.wait(self) + * if self._status == HYPERDEX_CLIENT_SUCCESS or self._unsafe == 0: + */ + +static PyObject *__pyx_pf_16_hyperdex_client_13DeferredCount_2wait(struct __pyx_obj_16_hyperdex_client_DeferredCount *__pyx_v_self) { + 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; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wait", 0); + + /* "_hyperdex_client.pyx":1196 + * + * def wait(self): + * Deferred.wait(self) # <<<<<<<<<<<<<< + * if self._status == HYPERDEX_CLIENT_SUCCESS or self._unsafe == 0: + * return self._result + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_Deferred)), __pyx_n_s__wait); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1197 + * def wait(self): + * Deferred.wait(self) + * if self._status == HYPERDEX_CLIENT_SUCCESS or self._unsafe == 0: # <<<<<<<<<<<<<< + * return self._result + * else: + */ + __pyx_t_4 = (__pyx_v_self->__pyx_base._status == HYPERDEX_CLIENT_SUCCESS); + if (!__pyx_t_4) { + __pyx_t_5 = (__pyx_v_self->_unsafe == 0); + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_4; + } + if (__pyx_t_6) { + + /* "_hyperdex_client.pyx":1198 + * Deferred.wait(self) + * if self._status == HYPERDEX_CLIENT_SUCCESS or self._unsafe == 0: + * return self._result # <<<<<<<<<<<<<< + * else: + * raise HyperClientException(self._status) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyInt_to_py_uint64_t(__pyx_v_self->_result); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + goto __pyx_L3; + } + /*else*/ { + + /* "_hyperdex_client.pyx":1200 + * return self._result + * else: + * raise HyperClientException(self._status) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_122); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyInt_FromLong(__pyx_v_self->__pyx_base._status); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L3:; + + __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("_hyperdex_client.DeferredCount.wait", __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_16_hyperdex_client_10SearchBase_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_16_hyperdex_client_10SearchBase_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client = 0; + CYTHON_UNUSED PyObject *__pyx_v_args = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + 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_RefNannyFinishContext(); + return -1; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__client,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__client)) != 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, 0, values, used_pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __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_client = ((struct __pyx_obj_16_hyperdex_client_Client *)values[0]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("_hyperdex_client.SearchBase.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_client), __pyx_ptype_16_hyperdex_client_Client, 1, "client", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_10SearchBase___cinit__(((struct __pyx_obj_16_hyperdex_client_SearchBase *)__pyx_v_self), __pyx_v_client, __pyx_v_args); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1213 + * cdef list _backlogged + * + * def __cinit__(self, Client client, *args): # <<<<<<<<<<<<<< + * self._client = client + * self._reqid = 0 + */ + +static int __pyx_pf_16_hyperdex_client_10SearchBase___cinit__(struct __pyx_obj_16_hyperdex_client_SearchBase *__pyx_v_self, struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client, CYTHON_UNUSED PyObject *__pyx_v_args) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "_hyperdex_client.pyx":1214 + * + * def __cinit__(self, Client client, *args): + * self._client = client # <<<<<<<<<<<<<< + * self._reqid = 0 + * self._status = HYPERDEX_CLIENT_GARBAGE + */ + __Pyx_INCREF(((PyObject *)__pyx_v_client)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_client)); + __Pyx_GOTREF(__pyx_v_self->_client); + __Pyx_DECREF(((PyObject *)__pyx_v_self->_client)); + __pyx_v_self->_client = __pyx_v_client; + + /* "_hyperdex_client.pyx":1215 + * def __cinit__(self, Client client, *args): + * self._client = client + * self._reqid = 0 # <<<<<<<<<<<<<< + * self._status = HYPERDEX_CLIENT_GARBAGE + * self._finished = False + */ + __pyx_v_self->_reqid = 0; + + /* "_hyperdex_client.pyx":1216 + * self._client = client + * self._reqid = 0 + * self._status = HYPERDEX_CLIENT_GARBAGE # <<<<<<<<<<<<<< + * self._finished = False + * self._attrs = NULL + */ + __pyx_v_self->_status = HYPERDEX_CLIENT_GARBAGE; + + /* "_hyperdex_client.pyx":1217 + * self._reqid = 0 + * self._status = HYPERDEX_CLIENT_GARBAGE + * self._finished = False # <<<<<<<<<<<<<< + * self._attrs = NULL + * self._attrs_sz = 0 + */ + __pyx_v_self->_finished = 0; + + /* "_hyperdex_client.pyx":1218 + * self._status = HYPERDEX_CLIENT_GARBAGE + * self._finished = False + * self._attrs = NULL # <<<<<<<<<<<<<< + * self._attrs_sz = 0 + * self._backlogged = [] + */ + __pyx_v_self->_attrs = ((struct hyperdex_client_attribute *)NULL); + + /* "_hyperdex_client.pyx":1219 + * self._finished = False + * self._attrs = NULL + * self._attrs_sz = 0 # <<<<<<<<<<<<<< + * self._backlogged = [] + * + */ + __pyx_v_self->_attrs_sz = 0; + + /* "_hyperdex_client.pyx":1220 + * self._attrs = NULL + * self._attrs_sz = 0 + * self._backlogged = [] # <<<<<<<<<<<<<< + * + * def __iter__(self): + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_v_self->_backlogged); + __Pyx_DECREF(((PyObject *)__pyx_v_self->_backlogged)); + __pyx_v_self->_backlogged = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("_hyperdex_client.SearchBase.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_10SearchBase_3__iter__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_10SearchBase_3__iter__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); + __pyx_r = __pyx_pf_16_hyperdex_client_10SearchBase_2__iter__(((struct __pyx_obj_16_hyperdex_client_SearchBase *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1222 + * self._backlogged = [] + * + * def __iter__(self): # <<<<<<<<<<<<<< + * return self + * + */ + +static PyObject *__pyx_pf_16_hyperdex_client_10SearchBase_2__iter__(struct __pyx_obj_16_hyperdex_client_SearchBase *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__", 0); + + /* "_hyperdex_client.pyx":1223 + * + * 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; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_10SearchBase_5__next__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_10SearchBase_5__next__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); + __pyx_r = __pyx_pf_16_hyperdex_client_10SearchBase_4__next__(((struct __pyx_obj_16_hyperdex_client_SearchBase *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1225 + * return self + * + * def __next__(self): # <<<<<<<<<<<<<< + * while not self._finished and not self._backlogged: + * self._client.loop() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_10SearchBase_4__next__(struct __pyx_obj_16_hyperdex_client_SearchBase *__pyx_v_self) { + 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; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__next__", 0); + + /* "_hyperdex_client.pyx":1226 + * + * def __next__(self): + * while not self._finished and not self._backlogged: # <<<<<<<<<<<<<< + * self._client.loop() + * if self._backlogged: + */ + while (1) { + __pyx_t_1 = (!__pyx_v_self->_finished); + if (__pyx_t_1) { + __pyx_t_2 = (((PyObject *)__pyx_v_self->_backlogged) != Py_None) && (PyList_GET_SIZE(((PyObject *)__pyx_v_self->_backlogged)) != 0); + __pyx_t_3 = (!__pyx_t_2); + __pyx_t_2 = __pyx_t_3; + } else { + __pyx_t_2 = __pyx_t_1; + } + if (!__pyx_t_2) break; + + /* "_hyperdex_client.pyx":1227 + * def __next__(self): + * while not self._finished and not self._backlogged: + * self._client.loop() # <<<<<<<<<<<<<< + * if self._backlogged: + * return self._backlogged.pop() + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_client), __pyx_n_s__loop); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + + /* "_hyperdex_client.pyx":1228 + * while not self._finished and not self._backlogged: + * self._client.loop() + * if self._backlogged: # <<<<<<<<<<<<<< + * return self._backlogged.pop() + * raise StopIteration() + */ + __pyx_t_2 = (((PyObject *)__pyx_v_self->_backlogged) != Py_None) && (PyList_GET_SIZE(((PyObject *)__pyx_v_self->_backlogged)) != 0); + if (__pyx_t_2) { + + /* "_hyperdex_client.pyx":1229 + * self._client.loop() + * if self._backlogged: + * return self._backlogged.pop() # <<<<<<<<<<<<<< + * raise StopIteration() + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_PyObject_Pop(((PyObject *)__pyx_v_self->_backlogged)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + goto __pyx_L5; + } + __pyx_L5:; + + /* "_hyperdex_client.pyx":1230 + * if self._backlogged: + * return self._backlogged.pop() + * raise StopIteration() # <<<<<<<<<<<<<< + * + * def _callback(self): + */ + __pyx_t_5 = PyObject_Call(__pyx_builtin_StopIteration, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + __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_AddTraceback("_hyperdex_client.SearchBase.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_10SearchBase_7_callback(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_10SearchBase_7_callback(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_callback (wrapper)", 0); + __pyx_r = __pyx_pf_16_hyperdex_client_10SearchBase_6_callback(((struct __pyx_obj_16_hyperdex_client_SearchBase *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1232 + * raise StopIteration() + * + * def _callback(self): # <<<<<<<<<<<<<< + * if self._status == HYPERDEX_CLIENT_SEARCHDONE: + * self._finished = True + */ + +static PyObject *__pyx_pf_16_hyperdex_client_10SearchBase_6_callback(struct __pyx_obj_16_hyperdex_client_SearchBase *__pyx_v_self) { + PyObject *__pyx_v_attrs = 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; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_callback", 0); + + /* "_hyperdex_client.pyx":1236 + * self._finished = True + * del self._client._ops[self._reqid] + * elif self._status == HYPERDEX_CLIENT_SUCCESS: # <<<<<<<<<<<<<< + * try: + * attrs = _attrs_to_dict(self._attrs, self._attrs_sz) + */ + switch (__pyx_v_self->_status) { + + /* "_hyperdex_client.pyx":1233 + * + * def _callback(self): + * if self._status == HYPERDEX_CLIENT_SEARCHDONE: # <<<<<<<<<<<<<< + * self._finished = True + * del self._client._ops[self._reqid] + */ + case HYPERDEX_CLIENT_SEARCHDONE: + + /* "_hyperdex_client.pyx":1234 + * def _callback(self): + * if self._status == HYPERDEX_CLIENT_SEARCHDONE: + * self._finished = True # <<<<<<<<<<<<<< + * del self._client._ops[self._reqid] + * elif self._status == HYPERDEX_CLIENT_SUCCESS: + */ + __pyx_v_self->_finished = 1; + + /* "_hyperdex_client.pyx":1235 + * if self._status == HYPERDEX_CLIENT_SEARCHDONE: + * self._finished = True + * del self._client._ops[self._reqid] # <<<<<<<<<<<<<< + * elif self._status == HYPERDEX_CLIENT_SUCCESS: + * try: + */ + if (unlikely(((PyObject *)__pyx_v_self->_client->_ops) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (__Pyx_DelItemInt(((PyObject *)__pyx_v_self->_client->_ops), __pyx_v_self->_reqid, sizeof(int64_t), __Pyx_PyInt_to_py_int64_t, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + break; + + /* "_hyperdex_client.pyx":1236 + * self._finished = True + * del self._client._ops[self._reqid] + * elif self._status == HYPERDEX_CLIENT_SUCCESS: # <<<<<<<<<<<<<< + * try: + * attrs = _attrs_to_dict(self._attrs, self._attrs_sz) + */ + case HYPERDEX_CLIENT_SUCCESS: + + /* "_hyperdex_client.pyx":1237 + * del self._client._ops[self._reqid] + * elif self._status == HYPERDEX_CLIENT_SUCCESS: + * try: # <<<<<<<<<<<<<< + * attrs = _attrs_to_dict(self._attrs, self._attrs_sz) + * finally: + */ + /*try:*/ { + + /* "_hyperdex_client.pyx":1238 + * elif self._status == HYPERDEX_CLIENT_SUCCESS: + * try: + * attrs = _attrs_to_dict(self._attrs, self._attrs_sz) # <<<<<<<<<<<<<< + * finally: + * if self._attrs: + */ + __pyx_t_1 = __pyx_f_16_hyperdex_client__attrs_to_dict(__pyx_v_self->_attrs, __pyx_v_self->_attrs_sz); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L4;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_attrs = __pyx_t_1; + __pyx_t_1 = 0; + } + + /* "_hyperdex_client.pyx":1240 + * attrs = _attrs_to_dict(self._attrs, self._attrs_sz) + * finally: + * if self._attrs: # <<<<<<<<<<<<<< + * hyperdex_client_destroy_attrs(self._attrs, self._attrs_sz) + * self._backlogged.append(attrs) + */ + /*finally:*/ { + int __pyx_why; + PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; + int __pyx_exc_lineno; + __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; + __pyx_why = 0; goto __pyx_L5; + __pyx_L4: { + __pyx_why = 4; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); + __pyx_exc_lineno = __pyx_lineno; + goto __pyx_L5; + } + __pyx_L5:; + __pyx_t_2 = (__pyx_v_self->_attrs != 0); + if (__pyx_t_2) { + + /* "_hyperdex_client.pyx":1241 + * finally: + * if self._attrs: + * hyperdex_client_destroy_attrs(self._attrs, self._attrs_sz) # <<<<<<<<<<<<<< + * self._backlogged.append(attrs) + * else: + */ + hyperdex_client_destroy_attrs(__pyx_v_self->_attrs, __pyx_v_self->_attrs_sz); + goto __pyx_L7; + } + __pyx_L7:; + switch (__pyx_why) { + case 4: { + __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); + __pyx_lineno = __pyx_exc_lineno; + __pyx_exc_type = 0; + __pyx_exc_value = 0; + __pyx_exc_tb = 0; + goto __pyx_L1_error; + } + } + } + + /* "_hyperdex_client.pyx":1242 + * if self._attrs: + * hyperdex_client_destroy_attrs(self._attrs, self._attrs_sz) + * self._backlogged.append(attrs) # <<<<<<<<<<<<<< + * else: + * self._backlogged.append(HyperClientException(self._status)) + */ + if (unlikely(((PyObject *)__pyx_v_self->_backlogged) == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_self->_backlogged, __pyx_v_attrs); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + break; + default: + + /* "_hyperdex_client.pyx":1244 + * self._backlogged.append(attrs) + * else: + * self._backlogged.append(HyperClientException(self._status)) # <<<<<<<<<<<<<< + * + * + */ + if (unlikely(((PyObject *)__pyx_v_self->_backlogged) == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_122); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyInt_FromLong(__pyx_v_self->_status); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_self->_backlogged, __pyx_t_4); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + break; + } + + __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_AddTraceback("_hyperdex_client.SearchBase._callback", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_attrs); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_16_hyperdex_client_6Search_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_16_hyperdex_client_6Search_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client = 0; + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_predicate = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__client,&__pyx_n_s__space,&__pyx_n_s__predicate,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__client)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__space)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__predicate)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; __pyx_clineno = __LINE__; goto __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_client = ((struct __pyx_obj_16_hyperdex_client_Client *)values[0]); + __pyx_v_space = ((PyObject*)values[1]); + __pyx_v_predicate = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Search.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_client), __pyx_ptype_16_hyperdex_client_Client, 1, "client", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_predicate), (&PyDict_Type), 1, "predicate", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Search___cinit__(((struct __pyx_obj_16_hyperdex_client_Search *)__pyx_v_self), __pyx_v_client, __pyx_v_space, __pyx_v_predicate); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1249 + * cdef class Search(SearchBase): + * + * def __cinit__(self, Client client, bytes space, dict predicate): # <<<<<<<<<<<<<< + * cdef hyperdex_client_attribute_check* chks = NULL + * cdef size_t chks_sz = 0 + */ + +static int __pyx_pf_16_hyperdex_client_6Search___cinit__(struct __pyx_obj_16_hyperdex_client_Search *__pyx_v_self, struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client, PyObject *__pyx_v_space, PyObject *__pyx_v_predicate) { + struct hyperdex_client_attribute_check *__pyx_v_chks; + size_t __pyx_v_chks_sz; + CYTHON_UNUSED PyObject *__pyx_v_backings = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + char *__pyx_t_2; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "_hyperdex_client.pyx":1250 + * + * def __cinit__(self, Client client, bytes space, dict predicate): + * cdef hyperdex_client_attribute_check* chks = NULL # <<<<<<<<<<<<<< + * cdef size_t chks_sz = 0 + * try: + */ + __pyx_v_chks = NULL; + + /* "_hyperdex_client.pyx":1251 + * def __cinit__(self, Client client, bytes space, dict predicate): + * cdef hyperdex_client_attribute_check* chks = NULL + * cdef size_t chks_sz = 0 # <<<<<<<<<<<<<< + * try: + * backings = _predicate_to_c(predicate, &chks, &chks_sz) + */ + __pyx_v_chks_sz = 0; + + /* "_hyperdex_client.pyx":1252 + * cdef hyperdex_client_attribute_check* chks = NULL + * cdef size_t chks_sz = 0 + * try: # <<<<<<<<<<<<<< + * backings = _predicate_to_c(predicate, &chks, &chks_sz) + * self._reqid = hyperdex_client_search(client._client, space, + */ + /*try:*/ { + + /* "_hyperdex_client.pyx":1253 + * cdef size_t chks_sz = 0 + * try: + * backings = _predicate_to_c(predicate, &chks, &chks_sz) # <<<<<<<<<<<<<< + * self._reqid = hyperdex_client_search(client._client, space, + * chks, chks_sz, + */ + __pyx_t_1 = __pyx_f_16_hyperdex_client__predicate_to_c(__pyx_v_predicate, (&__pyx_v_chks), (&__pyx_v_chks_sz)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L4;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_backings = __pyx_t_1; + __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":1254 + * try: + * backings = _predicate_to_c(predicate, &chks, &chks_sz) + * self._reqid = hyperdex_client_search(client._client, space, # <<<<<<<<<<<<<< + * chks, chks_sz, + * &self._status, + */ + __pyx_t_2 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_space)); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L4;} + + /* "_hyperdex_client.pyx":1258 + * &self._status, + * &self._attrs, + * &self._attrs_sz) # <<<<<<<<<<<<<< + * _check_reqid_search(self._reqid, self._status, chks, chks_sz) + * client._ops[self._reqid] = self + */ + __pyx_v_self->__pyx_base._reqid = hyperdex_client_search(__pyx_v_client->_client, __pyx_t_2, __pyx_v_chks, __pyx_v_chks_sz, (&__pyx_v_self->__pyx_base._status), (&__pyx_v_self->__pyx_base._attrs), (&__pyx_v_self->__pyx_base._attrs_sz)); + + /* "_hyperdex_client.pyx":1259 + * &self._attrs, + * &self._attrs_sz) + * _check_reqid_search(self._reqid, self._status, chks, chks_sz) # <<<<<<<<<<<<<< + * client._ops[self._reqid] = self + * finally: + */ + __pyx_t_1 = __pyx_f_16_hyperdex_client__check_reqid_search(__pyx_v_self->__pyx_base._reqid, __pyx_v_self->__pyx_base._status, __pyx_v_chks, __pyx_v_chks_sz); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L4;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":1260 + * &self._attrs_sz) + * _check_reqid_search(self._reqid, self._status, chks, chks_sz) + * client._ops[self._reqid] = self # <<<<<<<<<<<<<< + * finally: + * if chks: free(chks) + */ + if (unlikely(((PyObject *)__pyx_v_client->_ops) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L4;} + } + if (__Pyx_SetItemInt(((PyObject *)__pyx_v_client->_ops), __pyx_v_self->__pyx_base._reqid, ((PyObject *)__pyx_v_self), sizeof(int64_t), __Pyx_PyInt_to_py_int64_t, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L4;} + } + + /* "_hyperdex_client.pyx":1262 + * client._ops[self._reqid] = self + * finally: + * if chks: free(chks) # <<<<<<<<<<<<<< + * + * + */ + /*finally:*/ { + int __pyx_why; + PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; + int __pyx_exc_lineno; + __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; + __pyx_why = 0; goto __pyx_L5; + __pyx_L4: { + __pyx_why = 4; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); + __pyx_exc_lineno = __pyx_lineno; + goto __pyx_L5; + } + __pyx_L5:; + __pyx_t_3 = (__pyx_v_chks != 0); + if (__pyx_t_3) { + free(__pyx_v_chks); + goto __pyx_L7; + } + __pyx_L7:; + switch (__pyx_why) { + case 4: { + __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); + __pyx_lineno = __pyx_exc_lineno; + __pyx_exc_type = 0; + __pyx_exc_value = 0; + __pyx_exc_tb = 0; + goto __pyx_L1_error; + } + } + } + + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("_hyperdex_client.Search.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_backings); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_16_hyperdex_client_12SortedSearch_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_16_hyperdex_client_12SortedSearch_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client = 0; + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_predicate = 0; + PyObject *__pyx_v_sort_by = 0; + long __pyx_v_limit; + PyObject *__pyx_v_compare = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__client,&__pyx_n_s__space,&__pyx_n_s__predicate,&__pyx_n_s__sort_by,&__pyx_n_s__limit,&__pyx_n_s__compare,0}; + PyObject* values[6] = {0,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 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__client)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__space)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__predicate)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sort_by)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__limit)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 5: + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__compare)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { + 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); + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + } + __pyx_v_client = ((struct __pyx_obj_16_hyperdex_client_Client *)values[0]); + __pyx_v_space = ((PyObject*)values[1]); + __pyx_v_predicate = ((PyObject*)values[2]); + __pyx_v_sort_by = ((PyObject*)values[3]); + __pyx_v_limit = __Pyx_PyInt_AsLong(values[4]); if (unlikely((__pyx_v_limit == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1268; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_compare = ((PyObject*)values[5]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.SortedSearch.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_client), __pyx_ptype_16_hyperdex_client_Client, 1, "client", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_predicate), (&PyDict_Type), 1, "predicate", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sort_by), (&PyBytes_Type), 1, "sort_by", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_compare), (&PyBytes_Type), 1, "compare", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_12SortedSearch___cinit__(((struct __pyx_obj_16_hyperdex_client_SortedSearch *)__pyx_v_self), __pyx_v_client, __pyx_v_space, __pyx_v_predicate, __pyx_v_sort_by, __pyx_v_limit, __pyx_v_compare); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1267 + * cdef class SortedSearch(SearchBase): + * + * def __cinit__(self, Client client, bytes space, dict predicate, # <<<<<<<<<<<<<< + * bytes sort_by, long limit, bytes compare): + * cdef uint64_t lim = limit + */ + +static int __pyx_pf_16_hyperdex_client_12SortedSearch___cinit__(struct __pyx_obj_16_hyperdex_client_SortedSearch *__pyx_v_self, struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_client, PyObject *__pyx_v_space, PyObject *__pyx_v_predicate, PyObject *__pyx_v_sort_by, long __pyx_v_limit, PyObject *__pyx_v_compare) { + uint64_t __pyx_v_lim; + int __pyx_v_maxi; + struct hyperdex_client_attribute_check *__pyx_v_chks; + size_t __pyx_v_chks_sz; + CYTHON_UNUSED PyObject *__pyx_v_backings = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + char *__pyx_t_6; + char *__pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "_hyperdex_client.pyx":1269 + * def __cinit__(self, Client client, bytes space, dict predicate, + * bytes sort_by, long limit, bytes compare): + * cdef uint64_t lim = limit # <<<<<<<<<<<<<< + * cdef int maxi = 0 + * cdef hyperdex_client_attribute_check* chks = NULL + */ + __pyx_v_lim = __pyx_v_limit; + + /* "_hyperdex_client.pyx":1270 + * bytes sort_by, long limit, bytes compare): + * cdef uint64_t lim = limit + * cdef int maxi = 0 # <<<<<<<<<<<<<< + * cdef hyperdex_client_attribute_check* chks = NULL + * cdef size_t chks_sz = 0 + */ + __pyx_v_maxi = 0; + + /* "_hyperdex_client.pyx":1271 + * cdef uint64_t lim = limit + * cdef int maxi = 0 + * cdef hyperdex_client_attribute_check* chks = NULL # <<<<<<<<<<<<<< + * cdef size_t chks_sz = 0 + * if compare not in ('maximize', 'max', 'minimize', 'min'): + */ + __pyx_v_chks = NULL; + + /* "_hyperdex_client.pyx":1272 + * cdef int maxi = 0 + * cdef hyperdex_client_attribute_check* chks = NULL + * cdef size_t chks_sz = 0 # <<<<<<<<<<<<<< + * if compare not in ('maximize', 'max', 'minimize', 'min'): + * raise ValueError("'compare' must be either 'max' or 'min'") + */ + __pyx_v_chks_sz = 0; + + /* "_hyperdex_client.pyx":1273 + * cdef hyperdex_client_attribute_check* chks = NULL + * cdef size_t chks_sz = 0 + * if compare not in ('maximize', 'max', 'minimize', 'min'): # <<<<<<<<<<<<<< + * raise ValueError("'compare' must be either 'max' or 'min'") + * if compare in ('max', 'maximize'): + */ + __Pyx_INCREF(((PyObject *)__pyx_v_compare)); + __pyx_t_1 = __pyx_v_compare; + __pyx_t_2 = (__Pyx_PyBytes_Equals(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_n_s__maximize), Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (((int)__pyx_t_2)) { + __pyx_t_3 = (__Pyx_PyBytes_Equals(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_n_s__max), Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((int)__pyx_t_3); + } else { + __pyx_t_4 = ((int)__pyx_t_2); + } + if (__pyx_t_4) { + __pyx_t_2 = (__Pyx_PyBytes_Equals(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_n_s__minimize), Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((int)__pyx_t_2); + } else { + __pyx_t_3 = __pyx_t_4; + } + if (__pyx_t_3) { + __pyx_t_4 = (__Pyx_PyBytes_Equals(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_n_s__min), Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((int)__pyx_t_4); + } else { + __pyx_t_2 = __pyx_t_3; + } + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_t_3 = __pyx_t_2; + if (__pyx_t_3) { + + /* "_hyperdex_client.pyx":1274 + * cdef size_t chks_sz = 0 + * if compare not in ('maximize', 'max', 'minimize', 'min'): + * raise ValueError("'compare' must be either 'max' or 'min'") # <<<<<<<<<<<<<< + * if compare in ('max', 'maximize'): + * maxi = 1 + */ + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_124), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L3; + } + __pyx_L3:; + + /* "_hyperdex_client.pyx":1275 + * if compare not in ('maximize', 'max', 'minimize', 'min'): + * raise ValueError("'compare' must be either 'max' or 'min'") + * if compare in ('max', 'maximize'): # <<<<<<<<<<<<<< + * maxi = 1 + * try: + */ + __Pyx_INCREF(((PyObject *)__pyx_v_compare)); + __pyx_t_1 = __pyx_v_compare; + __pyx_t_3 = (__Pyx_PyBytes_Equals(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_n_s__max), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!((int)__pyx_t_3)) { + __pyx_t_2 = (__Pyx_PyBytes_Equals(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_n_s__maximize), Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((int)__pyx_t_2); + } else { + __pyx_t_4 = ((int)__pyx_t_3); + } + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_t_3 = __pyx_t_4; + if (__pyx_t_3) { + + /* "_hyperdex_client.pyx":1276 + * raise ValueError("'compare' must be either 'max' or 'min'") + * if compare in ('max', 'maximize'): + * maxi = 1 # <<<<<<<<<<<<<< + * try: + * backings = _predicate_to_c(predicate, &chks, &chks_sz) + */ + __pyx_v_maxi = 1; + goto __pyx_L4; + } + __pyx_L4:; + + /* "_hyperdex_client.pyx":1277 + * if compare in ('max', 'maximize'): + * maxi = 1 + * try: # <<<<<<<<<<<<<< + * backings = _predicate_to_c(predicate, &chks, &chks_sz) + * self._reqid = hyperdex_client_sorted_search(client._client, space, + */ + /*try:*/ { + + /* "_hyperdex_client.pyx":1278 + * maxi = 1 + * try: + * backings = _predicate_to_c(predicate, &chks, &chks_sz) # <<<<<<<<<<<<<< + * self._reqid = hyperdex_client_sorted_search(client._client, space, + * chks, chks_sz, + */ + __pyx_t_5 = __pyx_f_16_hyperdex_client__predicate_to_c(__pyx_v_predicate, (&__pyx_v_chks), (&__pyx_v_chks_sz)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L6;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_backings = __pyx_t_5; + __pyx_t_5 = 0; + + /* "_hyperdex_client.pyx":1279 + * try: + * backings = _predicate_to_c(predicate, &chks, &chks_sz) + * self._reqid = hyperdex_client_sorted_search(client._client, space, # <<<<<<<<<<<<<< + * chks, chks_sz, + * sort_by, + */ + __pyx_t_6 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_space)); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L6;} + + /* "_hyperdex_client.pyx":1281 + * self._reqid = hyperdex_client_sorted_search(client._client, space, + * chks, chks_sz, + * sort_by, # <<<<<<<<<<<<<< + * lim, + * maxi, + */ + __pyx_t_7 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_sort_by)); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L6;} + + /* "_hyperdex_client.pyx":1279 + * try: + * backings = _predicate_to_c(predicate, &chks, &chks_sz) + * self._reqid = hyperdex_client_sorted_search(client._client, space, # <<<<<<<<<<<<<< + * chks, chks_sz, + * sort_by, + */ + __pyx_v_self->__pyx_base._reqid = hyperdex_client_sorted_search(__pyx_v_client->_client, __pyx_t_6, __pyx_v_chks, __pyx_v_chks_sz, __pyx_t_7, __pyx_v_lim, __pyx_v_maxi, (&__pyx_v_self->__pyx_base._status), (&__pyx_v_self->__pyx_base._attrs), (&__pyx_v_self->__pyx_base._attrs_sz)); + + /* "_hyperdex_client.pyx":1287 + * &self._attrs, + * &self._attrs_sz) + * _check_reqid_search(self._reqid, self._status, chks, chks_sz) # <<<<<<<<<<<<<< + * client._ops[self._reqid] = self + * finally: + */ + __pyx_t_5 = __pyx_f_16_hyperdex_client__check_reqid_search(__pyx_v_self->__pyx_base._reqid, __pyx_v_self->__pyx_base._status, __pyx_v_chks, __pyx_v_chks_sz); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L6;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "_hyperdex_client.pyx":1288 + * &self._attrs_sz) + * _check_reqid_search(self._reqid, self._status, chks, chks_sz) + * client._ops[self._reqid] = self # <<<<<<<<<<<<<< + * finally: + * if chks: free(chks) + */ + if (unlikely(((PyObject *)__pyx_v_client->_ops) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L6;} + } + if (__Pyx_SetItemInt(((PyObject *)__pyx_v_client->_ops), __pyx_v_self->__pyx_base._reqid, ((PyObject *)__pyx_v_self), sizeof(int64_t), __Pyx_PyInt_to_py_int64_t, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L6;} + } + + /* "_hyperdex_client.pyx":1290 + * client._ops[self._reqid] = self + * finally: + * if chks: free(chks) # <<<<<<<<<<<<<< + * + * + */ + /*finally:*/ { + int __pyx_why; + PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; + int __pyx_exc_lineno; + __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; + __pyx_why = 0; goto __pyx_L7; + __pyx_L6: { + __pyx_why = 4; + __Pyx_XDECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); + __pyx_exc_lineno = __pyx_lineno; + goto __pyx_L7; + } + __pyx_L7:; + __pyx_t_3 = (__pyx_v_chks != 0); + if (__pyx_t_3) { + free(__pyx_v_chks); + goto __pyx_L9; + } + __pyx_L9:; + switch (__pyx_why) { + case 4: { + __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); + __pyx_lineno = __pyx_exc_lineno; + __pyx_exc_type = 0; + __pyx_exc_value = 0; + __pyx_exc_tb = 0; + goto __pyx_L1_error; + } + } + } + + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(((PyObject *)__pyx_t_1)); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("_hyperdex_client.SortedSearch.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_backings); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_16_hyperdex_client_9Predicate_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_16_hyperdex_client_9Predicate_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_raw = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__raw,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__raw)) != 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_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __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_raw = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Predicate.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_16_hyperdex_client_9Predicate___init__(((struct __pyx_obj_16_hyperdex_client_Predicate *)__pyx_v_self), __pyx_v_raw); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1297 + * cdef list _raw_check + * + * def __init__(self, raw): # <<<<<<<<<<<<<< + * self._raw_check = raw + * + */ + +static int __pyx_pf_16_hyperdex_client_9Predicate___init__(struct __pyx_obj_16_hyperdex_client_Predicate *__pyx_v_self, PyObject *__pyx_v_raw) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "_hyperdex_client.pyx":1298 + * + * def __init__(self, raw): + * self._raw_check = raw # <<<<<<<<<<<<<< + * + * def _raw(self, attr): + */ + if (!(likely(PyList_CheckExact(__pyx_v_raw))||((__pyx_v_raw) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_v_raw)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_INCREF(__pyx_v_raw); + __Pyx_GIVEREF(__pyx_v_raw); + __Pyx_GOTREF(__pyx_v_self->_raw_check); + __Pyx_DECREF(((PyObject *)__pyx_v_self->_raw_check)); + __pyx_v_self->_raw_check = ((PyObject*)__pyx_v_raw); + + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("_hyperdex_client.Predicate.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_9Predicate_3_raw(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_9Predicate_3_raw(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_raw (wrapper)", 0); + __pyx_r = __pyx_pf_16_hyperdex_client_9Predicate_2_raw(((struct __pyx_obj_16_hyperdex_client_Predicate *)__pyx_v_self), ((PyObject *)__pyx_v_attr)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1300 + * self._raw_check = raw + * + * def _raw(self, attr): # <<<<<<<<<<<<<< + * return [(attr, p, v) for p, v in self._raw_check] + * + */ + +static PyObject *__pyx_pf_16_hyperdex_client_9Predicate_2_raw(struct __pyx_obj_16_hyperdex_client_Predicate *__pyx_v_self, PyObject *__pyx_v_attr) { + PyObject *__pyx_v_p = NULL; + PyObject *__pyx_v_v = 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 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *(*__pyx_t_8)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_raw", 0); + + /* "_hyperdex_client.pyx":1301 + * + * def _raw(self, attr): + * return [(attr, p, v) for p, v in self._raw_check] # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(((PyObject *)__pyx_v_self->_raw_check) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = ((PyObject *)__pyx_v_self->_raw_check); __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + for (;;) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + 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_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + #endif + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + { + Py_ssize_t index = -1; + __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L6_unpacking_done:; + } + __Pyx_XDECREF(__pyx_v_p); + __pyx_v_p = __pyx_t_5; + __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_v_v); + __pyx_v_v = __pyx_t_6; + __pyx_t_6 = 0; + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_attr); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_attr); + __Pyx_GIVEREF(__pyx_v_attr); + __Pyx_INCREF(__pyx_v_p); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_p); + __Pyx_GIVEREF(__pyx_v_p); + __Pyx_INCREF(__pyx_v_v); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_v); + __Pyx_GIVEREF(__pyx_v_v); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = ((PyObject *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + __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_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("_hyperdex_client.Predicate._raw", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_p); + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_16_hyperdex_client_5Range_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_16_hyperdex_client_5Range_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_lower = 0; + PyObject *__pyx_v_upper = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__lower,&__pyx_n_s__upper,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__lower)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__upper)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __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_lower = values[0]; + __pyx_v_upper = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Range.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_16_hyperdex_client_5Range___init__(((struct __pyx_obj_16_hyperdex_client_Range *)__pyx_v_self), __pyx_v_lower, __pyx_v_upper); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1306 + * cdef class Range(Predicate): + * + * def __init__(self, lower, upper): # <<<<<<<<<<<<<< + * if type(lower) != type(upper) or type(lower) not in (bytes, int, long, float): + * raise AttributeError("Range search bounds must be of like types") + */ + +static int __pyx_pf_16_hyperdex_client_5Range___init__(struct __pyx_obj_16_hyperdex_client_Range *__pyx_v_self, PyObject *__pyx_v_lower, PyObject *__pyx_v_upper) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "_hyperdex_client.pyx":1307 + * + * def __init__(self, lower, upper): + * if type(lower) != type(upper) or type(lower) not in (bytes, int, long, float): # <<<<<<<<<<<<<< + * raise AttributeError("Range search bounds must be of like types") + * Predicate.__init__(self, [(HYPERPREDICATE_GREATER_EQUAL, lower), + */ + __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_lower)), ((PyObject *)Py_TYPE(__pyx_v_upper)), Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!__pyx_t_2) { + __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_lower))); + __pyx_t_1 = ((PyObject *)Py_TYPE(__pyx_v_lower)); + __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_1), ((PyObject *)((PyObject*)(&PyBytes_Type))), Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (((int)__pyx_t_4)) { + __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_1), ((PyObject *)((PyObject*)(&PyInt_Type))), Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = ((int)__pyx_t_5); + } else { + __pyx_t_6 = ((int)__pyx_t_4); + } + if (__pyx_t_6) { + __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_1), ((PyObject *)((PyObject*)(&PyLong_Type))), Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = ((int)__pyx_t_4); + } else { + __pyx_t_5 = __pyx_t_6; + } + if (__pyx_t_5) { + __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_1), ((PyObject *)((PyObject*)(&PyFloat_Type))), Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = ((int)__pyx_t_6); + } else { + __pyx_t_4 = __pyx_t_5; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __pyx_t_4; + __pyx_t_4 = __pyx_t_5; + } else { + __pyx_t_4 = __pyx_t_2; + } + if (__pyx_t_4) { + + /* "_hyperdex_client.pyx":1308 + * def __init__(self, lower, upper): + * if type(lower) != type(upper) or type(lower) not in (bytes, int, long, float): + * raise AttributeError("Range search bounds must be of like types") # <<<<<<<<<<<<<< + * Predicate.__init__(self, [(HYPERPREDICATE_GREATER_EQUAL, lower), + * (HYPERPREDICATE_LESS_EQUAL, upper)]) + */ + __pyx_t_1 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_126), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L3; + } + __pyx_L3:; + + /* "_hyperdex_client.pyx":1309 + * if type(lower) != type(upper) or type(lower) not in (bytes, int, long, float): + * raise AttributeError("Range search bounds must be of like types") + * Predicate.__init__(self, [(HYPERPREDICATE_GREATER_EQUAL, lower), # <<<<<<<<<<<<<< + * (HYPERPREDICATE_LESS_EQUAL, upper)]) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_Predicate)), __pyx_n_s____init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyInt_FromLong(HYPERPREDICATE_GREATER_EQUAL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_lower); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_lower); + __Pyx_GIVEREF(__pyx_v_lower); + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1310 + * raise AttributeError("Range search bounds must be of like types") + * Predicate.__init__(self, [(HYPERPREDICATE_GREATER_EQUAL, lower), + * (HYPERPREDICATE_LESS_EQUAL, upper)]) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = PyInt_FromLong(HYPERPREDICATE_LESS_EQUAL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_upper); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_upper); + __Pyx_GIVEREF(__pyx_v_upper); + __pyx_t_3 = 0; + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_7)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_7)); + PyList_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_t_8)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_8)); + __pyx_t_7 = 0; + __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_8, 1, ((PyObject *)__pyx_t_3)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("_hyperdex_client.Range.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_16_hyperdex_client_8Contains_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_16_hyperdex_client_8Contains_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_elem = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__elem,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__elem)) != 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_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __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_elem = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Contains.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_16_hyperdex_client_8Contains___init__(((struct __pyx_obj_16_hyperdex_client_Contains *)__pyx_v_self), __pyx_v_elem); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1315 + * cdef class Contains(Predicate): + * + * def __init__(self, elem): # <<<<<<<<<<<<<< + * if type(elem) not in (bytes, int, long, float): + * raise AttributeError("Contains must be a byte, int, or float") + */ + +static int __pyx_pf_16_hyperdex_client_8Contains___init__(struct __pyx_obj_16_hyperdex_client_Contains *__pyx_v_self, PyObject *__pyx_v_elem) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "_hyperdex_client.pyx":1316 + * + * def __init__(self, elem): + * if type(elem) not in (bytes, int, long, float): # <<<<<<<<<<<<<< + * raise AttributeError("Contains must be a byte, int, or float") + * Predicate.__init__(self, [(HYPERPREDICATE_CONTAINS, elem)]) + */ + __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_elem))); + __pyx_t_1 = ((PyObject *)Py_TYPE(__pyx_v_elem)); + __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_t_1), ((PyObject *)((PyObject*)(&PyBytes_Type))), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (((int)__pyx_t_3)) { + __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_t_1), ((PyObject *)((PyObject*)(&PyInt_Type))), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = ((int)__pyx_t_4); + } else { + __pyx_t_5 = ((int)__pyx_t_3); + } + if (__pyx_t_5) { + __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_t_1), ((PyObject *)((PyObject*)(&PyLong_Type))), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = ((int)__pyx_t_3); + } else { + __pyx_t_4 = __pyx_t_5; + } + if (__pyx_t_4) { + __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_t_1), ((PyObject *)((PyObject*)(&PyFloat_Type))), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = ((int)__pyx_t_5); + } else { + __pyx_t_3 = __pyx_t_4; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __pyx_t_3; + if (__pyx_t_4) { + + /* "_hyperdex_client.pyx":1317 + * def __init__(self, elem): + * if type(elem) not in (bytes, int, long, float): + * raise AttributeError("Contains must be a byte, int, or float") # <<<<<<<<<<<<<< + * Predicate.__init__(self, [(HYPERPREDICATE_CONTAINS, elem)]) + * + */ + __pyx_t_1 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_128), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L3; + } + __pyx_L3:; + + /* "_hyperdex_client.pyx":1318 + * if type(elem) not in (bytes, int, long, float): + * raise AttributeError("Contains must be a byte, int, or float") + * Predicate.__init__(self, [(HYPERPREDICATE_CONTAINS, elem)]) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_Predicate)), __pyx_n_s____init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromLong(HYPERPREDICATE_CONTAINS); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_elem); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_elem); + __Pyx_GIVEREF(__pyx_v_elem); + __pyx_t_2 = 0; + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_6)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_6)); + __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_t_2)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("_hyperdex_client.Contains.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_16_hyperdex_client_9LessEqual_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_16_hyperdex_client_9LessEqual_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_upper = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__upper,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__upper)) != 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_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __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_upper = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.LessEqual.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_16_hyperdex_client_9LessEqual___init__(((struct __pyx_obj_16_hyperdex_client_LessEqual *)__pyx_v_self), __pyx_v_upper); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1323 + * cdef class LessEqual(Predicate): + * + * def __init__(self, upper): # <<<<<<<<<<<<<< + * if type(upper) not in (bytes, int, long, float): + * raise AttributeError("LessEqual must be a byte, int, or float") + */ + +static int __pyx_pf_16_hyperdex_client_9LessEqual___init__(struct __pyx_obj_16_hyperdex_client_LessEqual *__pyx_v_self, PyObject *__pyx_v_upper) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "_hyperdex_client.pyx":1324 + * + * def __init__(self, upper): + * if type(upper) not in (bytes, int, long, float): # <<<<<<<<<<<<<< + * raise AttributeError("LessEqual must be a byte, int, or float") + * Predicate.__init__(self, [(HYPERPREDICATE_LESS_EQUAL, upper)]) + */ + __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_upper))); + __pyx_t_1 = ((PyObject *)Py_TYPE(__pyx_v_upper)); + __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_t_1), ((PyObject *)((PyObject*)(&PyBytes_Type))), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (((int)__pyx_t_3)) { + __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_t_1), ((PyObject *)((PyObject*)(&PyInt_Type))), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = ((int)__pyx_t_4); + } else { + __pyx_t_5 = ((int)__pyx_t_3); + } + if (__pyx_t_5) { + __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_t_1), ((PyObject *)((PyObject*)(&PyLong_Type))), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = ((int)__pyx_t_3); + } else { + __pyx_t_4 = __pyx_t_5; + } + if (__pyx_t_4) { + __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_t_1), ((PyObject *)((PyObject*)(&PyFloat_Type))), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = ((int)__pyx_t_5); + } else { + __pyx_t_3 = __pyx_t_4; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __pyx_t_3; + if (__pyx_t_4) { + + /* "_hyperdex_client.pyx":1325 + * def __init__(self, upper): + * if type(upper) not in (bytes, int, long, float): + * raise AttributeError("LessEqual must be a byte, int, or float") # <<<<<<<<<<<<<< + * Predicate.__init__(self, [(HYPERPREDICATE_LESS_EQUAL, upper)]) + * + */ + __pyx_t_1 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_130), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L3; + } + __pyx_L3:; + + /* "_hyperdex_client.pyx":1326 + * if type(upper) not in (bytes, int, long, float): + * raise AttributeError("LessEqual must be a byte, int, or float") + * Predicate.__init__(self, [(HYPERPREDICATE_LESS_EQUAL, upper)]) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_Predicate)), __pyx_n_s____init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromLong(HYPERPREDICATE_LESS_EQUAL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_upper); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_upper); + __Pyx_GIVEREF(__pyx_v_upper); + __pyx_t_2 = 0; + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_6)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_6)); + __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_t_2)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("_hyperdex_client.LessEqual.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_16_hyperdex_client_12GreaterEqual_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_16_hyperdex_client_12GreaterEqual_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_lower = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__lower,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__lower)) != 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_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __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_lower = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.GreaterEqual.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_16_hyperdex_client_12GreaterEqual___init__(((struct __pyx_obj_16_hyperdex_client_GreaterEqual *)__pyx_v_self), __pyx_v_lower); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1331 + * cdef class GreaterEqual(Predicate): + * + * def __init__(self, lower): # <<<<<<<<<<<<<< + * if type(lower) not in (bytes, int, long, float): + * raise AttributeError("GreaterEqual must be a byte, int, or float") + */ + +static int __pyx_pf_16_hyperdex_client_12GreaterEqual___init__(struct __pyx_obj_16_hyperdex_client_GreaterEqual *__pyx_v_self, PyObject *__pyx_v_lower) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "_hyperdex_client.pyx":1332 + * + * def __init__(self, lower): + * if type(lower) not in (bytes, int, long, float): # <<<<<<<<<<<<<< + * raise AttributeError("GreaterEqual must be a byte, int, or float") + * Predicate.__init__(self, [(HYPERPREDICATE_GREATER_EQUAL, lower)]) + */ + __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_lower))); + __pyx_t_1 = ((PyObject *)Py_TYPE(__pyx_v_lower)); + __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_t_1), ((PyObject *)((PyObject*)(&PyBytes_Type))), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (((int)__pyx_t_3)) { + __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_t_1), ((PyObject *)((PyObject*)(&PyInt_Type))), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = ((int)__pyx_t_4); + } else { + __pyx_t_5 = ((int)__pyx_t_3); + } + if (__pyx_t_5) { + __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_t_1), ((PyObject *)((PyObject*)(&PyLong_Type))), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = ((int)__pyx_t_3); + } else { + __pyx_t_4 = __pyx_t_5; + } + if (__pyx_t_4) { + __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_t_1), ((PyObject *)((PyObject*)(&PyFloat_Type))), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = ((int)__pyx_t_5); + } else { + __pyx_t_3 = __pyx_t_4; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __pyx_t_3; + if (__pyx_t_4) { + + /* "_hyperdex_client.pyx":1333 + * def __init__(self, lower): + * if type(lower) not in (bytes, int, long, float): + * raise AttributeError("GreaterEqual must be a byte, int, or float") # <<<<<<<<<<<<<< + * Predicate.__init__(self, [(HYPERPREDICATE_GREATER_EQUAL, lower)]) + * + */ + __pyx_t_1 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_132), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L3; + } + __pyx_L3:; + + /* "_hyperdex_client.pyx":1334 + * if type(lower) not in (bytes, int, long, float): + * raise AttributeError("GreaterEqual must be a byte, int, or float") + * Predicate.__init__(self, [(HYPERPREDICATE_GREATER_EQUAL, lower)]) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_Predicate)), __pyx_n_s____init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromLong(HYPERPREDICATE_GREATER_EQUAL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_lower); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_lower); + __Pyx_GIVEREF(__pyx_v_lower); + __pyx_t_2 = 0; + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_6)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_6)); + __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_t_2)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("_hyperdex_client.GreaterEqual.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_16_hyperdex_client_5Regex_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_16_hyperdex_client_5Regex_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_regex = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__regex,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__regex)) != 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_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __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_regex = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Regex.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_16_hyperdex_client_5Regex___init__(((struct __pyx_obj_16_hyperdex_client_Regex *)__pyx_v_self), __pyx_v_regex); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1339 + * cdef class Regex(Predicate): + * + * def __init__(self, regex): # <<<<<<<<<<<<<< + * if type(regex) != bytes: + * raise AttributeError("Regex must be a byte") + */ + +static int __pyx_pf_16_hyperdex_client_5Regex___init__(struct __pyx_obj_16_hyperdex_client_Regex *__pyx_v_self, PyObject *__pyx_v_regex) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "_hyperdex_client.pyx":1340 + * + * def __init__(self, regex): + * if type(regex) != bytes: # <<<<<<<<<<<<<< + * raise AttributeError("Regex must be a byte") + * Predicate.__init__(self, [(HYPERPREDICATE_REGEX, regex)]) + */ + __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_regex)), ((PyObject *)((PyObject*)(&PyBytes_Type))), Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "_hyperdex_client.pyx":1341 + * def __init__(self, regex): + * if type(regex) != bytes: + * raise AttributeError("Regex must be a byte") # <<<<<<<<<<<<<< + * Predicate.__init__(self, [(HYPERPREDICATE_REGEX, regex)]) + * + */ + __pyx_t_1 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_134), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L3; + } + __pyx_L3:; + + /* "_hyperdex_client.pyx":1342 + * if type(regex) != bytes: + * raise AttributeError("Regex must be a byte") + * Predicate.__init__(self, [(HYPERPREDICATE_REGEX, regex)]) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_Predicate)), __pyx_n_s____init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyInt_FromLong(HYPERPREDICATE_REGEX); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_regex); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_regex); + __Pyx_GIVEREF(__pyx_v_regex); + __pyx_t_3 = 0; + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); + __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_t_3)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("_hyperdex_client.Regex.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_16_hyperdex_client_12LengthEquals_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_16_hyperdex_client_12LengthEquals_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_length = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__length,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__length)) != 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_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __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_length = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.LengthEquals.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_16_hyperdex_client_12LengthEquals___init__(((struct __pyx_obj_16_hyperdex_client_LengthEquals *)__pyx_v_self), __pyx_v_length); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1347 + * cdef class LengthEquals(Predicate): + * + * def __init__(self, length): # <<<<<<<<<<<<<< + * if type(length) not in (int, long): + * raise AttributeError("LengthEquals must be int or long") + */ + +static int __pyx_pf_16_hyperdex_client_12LengthEquals___init__(struct __pyx_obj_16_hyperdex_client_LengthEquals *__pyx_v_self, PyObject *__pyx_v_length) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "_hyperdex_client.pyx":1348 + * + * def __init__(self, length): + * if type(length) not in (int, long): # <<<<<<<<<<<<<< + * raise AttributeError("LengthEquals must be int or long") + * Predicate.__init__(self, [(HYPERPREDICATE_LENGTH_EQUALS, length)]) + */ + __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_length))); + __pyx_t_1 = ((PyObject *)Py_TYPE(__pyx_v_length)); + __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_t_1), ((PyObject *)((PyObject*)(&PyInt_Type))), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (((int)__pyx_t_3)) { + __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_t_1), ((PyObject *)((PyObject*)(&PyLong_Type))), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = ((int)__pyx_t_4); + } else { + __pyx_t_5 = ((int)__pyx_t_3); + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __pyx_t_5; + if (__pyx_t_3) { + + /* "_hyperdex_client.pyx":1349 + * def __init__(self, length): + * if type(length) not in (int, long): + * raise AttributeError("LengthEquals must be int or long") # <<<<<<<<<<<<<< + * Predicate.__init__(self, [(HYPERPREDICATE_LENGTH_EQUALS, length)]) + * + */ + __pyx_t_1 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_136), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L3; + } + __pyx_L3:; + + /* "_hyperdex_client.pyx":1350 + * if type(length) not in (int, long): + * raise AttributeError("LengthEquals must be int or long") + * Predicate.__init__(self, [(HYPERPREDICATE_LENGTH_EQUALS, length)]) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_Predicate)), __pyx_n_s____init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromLong(HYPERPREDICATE_LENGTH_EQUALS); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_length); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_length); + __Pyx_GIVEREF(__pyx_v_length); + __pyx_t_2 = 0; + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_6)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_6)); + __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_t_2)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("_hyperdex_client.LengthEquals.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_16_hyperdex_client_15LengthLessEqual_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_16_hyperdex_client_15LengthLessEqual_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_upper = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__upper,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__upper)) != 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_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __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_upper = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.LengthLessEqual.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_16_hyperdex_client_15LengthLessEqual___init__(((struct __pyx_obj_16_hyperdex_client_LengthLessEqual *)__pyx_v_self), __pyx_v_upper); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1355 + * cdef class LengthLessEqual(Predicate): + * + * def __init__(self, upper): # <<<<<<<<<<<<<< + * if type(upper) not in (int, long): + * raise AttributeError("LengthLessEqual must be int or long") + */ + +static int __pyx_pf_16_hyperdex_client_15LengthLessEqual___init__(struct __pyx_obj_16_hyperdex_client_LengthLessEqual *__pyx_v_self, PyObject *__pyx_v_upper) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "_hyperdex_client.pyx":1356 + * + * def __init__(self, upper): + * if type(upper) not in (int, long): # <<<<<<<<<<<<<< + * raise AttributeError("LengthLessEqual must be int or long") + * Predicate.__init__(self, [(HYPERPREDICATE_LENGTH_LESS_EQUAL, upper)]) + */ + __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_upper))); + __pyx_t_1 = ((PyObject *)Py_TYPE(__pyx_v_upper)); + __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_t_1), ((PyObject *)((PyObject*)(&PyInt_Type))), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (((int)__pyx_t_3)) { + __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_t_1), ((PyObject *)((PyObject*)(&PyLong_Type))), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = ((int)__pyx_t_4); + } else { + __pyx_t_5 = ((int)__pyx_t_3); + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __pyx_t_5; + if (__pyx_t_3) { + + /* "_hyperdex_client.pyx":1357 + * def __init__(self, upper): + * if type(upper) not in (int, long): + * raise AttributeError("LengthLessEqual must be int or long") # <<<<<<<<<<<<<< + * Predicate.__init__(self, [(HYPERPREDICATE_LENGTH_LESS_EQUAL, upper)]) + * + */ + __pyx_t_1 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_138), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L3; + } + __pyx_L3:; + + /* "_hyperdex_client.pyx":1358 + * if type(upper) not in (int, long): + * raise AttributeError("LengthLessEqual must be int or long") + * Predicate.__init__(self, [(HYPERPREDICATE_LENGTH_LESS_EQUAL, upper)]) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_Predicate)), __pyx_n_s____init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromLong(HYPERPREDICATE_LENGTH_LESS_EQUAL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_upper); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_upper); + __Pyx_GIVEREF(__pyx_v_upper); + __pyx_t_2 = 0; + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_6)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_6)); + __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_t_2)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("_hyperdex_client.LengthLessEqual.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_16_hyperdex_client_18LengthGreaterEqual_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_16_hyperdex_client_18LengthGreaterEqual_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_lower = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__lower,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__lower)) != 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_filename = __pyx_f[0]; __pyx_lineno = 1363; __pyx_clineno = __LINE__; goto __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_lower = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.LengthGreaterEqual.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_16_hyperdex_client_18LengthGreaterEqual___init__(((struct __pyx_obj_16_hyperdex_client_LengthGreaterEqual *)__pyx_v_self), __pyx_v_lower); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1363 + * cdef class LengthGreaterEqual(Predicate): + * + * def __init__(self, lower): # <<<<<<<<<<<<<< + * if type(lower) not in (int, long): + * raise AttributeError("LengthGreaterEqual must be int or long") + */ + +static int __pyx_pf_16_hyperdex_client_18LengthGreaterEqual___init__(struct __pyx_obj_16_hyperdex_client_LengthGreaterEqual *__pyx_v_self, PyObject *__pyx_v_lower) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "_hyperdex_client.pyx":1364 + * + * def __init__(self, lower): + * if type(lower) not in (int, long): # <<<<<<<<<<<<<< + * raise AttributeError("LengthGreaterEqual must be int or long") + * Predicate.__init__(self, [(HYPERPREDICATE_LENGTH_GREATER_EQUAL, lower)]) + */ + __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_lower))); + __pyx_t_1 = ((PyObject *)Py_TYPE(__pyx_v_lower)); + __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_t_1), ((PyObject *)((PyObject*)(&PyInt_Type))), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (((int)__pyx_t_3)) { + __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_t_1), ((PyObject *)((PyObject*)(&PyLong_Type))), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = ((int)__pyx_t_4); + } else { + __pyx_t_5 = ((int)__pyx_t_3); + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __pyx_t_5; + if (__pyx_t_3) { + + /* "_hyperdex_client.pyx":1365 + * def __init__(self, lower): + * if type(lower) not in (int, long): + * raise AttributeError("LengthGreaterEqual must be int or long") # <<<<<<<<<<<<<< + * Predicate.__init__(self, [(HYPERPREDICATE_LENGTH_GREATER_EQUAL, lower)]) + * + */ + __pyx_t_1 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_140), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L3; + } + __pyx_L3:; + + /* "_hyperdex_client.pyx":1366 + * if type(lower) not in (int, long): + * raise AttributeError("LengthGreaterEqual must be int or long") + * Predicate.__init__(self, [(HYPERPREDICATE_LENGTH_GREATER_EQUAL, lower)]) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_Predicate)), __pyx_n_s____init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromLong(HYPERPREDICATE_LENGTH_GREATER_EQUAL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_lower); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_lower); + __Pyx_GIVEREF(__pyx_v_lower); + __pyx_t_2 = 0; + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_6)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_6)); + __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_t_2)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("_hyperdex_client.LengthGreaterEqual.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_16_hyperdex_client_6Client_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_16_hyperdex_client_6Client_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_address = 0; + PyObject *__pyx_v_port = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__address,&__pyx_n_s__port,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__address)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__port)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1373; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1373; __pyx_clineno = __LINE__; goto __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_address = values[0]; + __pyx_v_port = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1373; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_16_hyperdex_client_6Client___cinit__(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_address, __pyx_v_port); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1373 + * cdef dict _ops + * + * def __cinit__(self, address, port): # <<<<<<<<<<<<<< + * self._client = hyperdex_client_create(address, port) + * self._ops = {} + */ + +static int __pyx_pf_16_hyperdex_client_6Client___cinit__(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_address, PyObject *__pyx_v_port) { + int __pyx_r; + __Pyx_RefNannyDeclarations + char *__pyx_t_1; + uint16_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "_hyperdex_client.pyx":1374 + * + * def __cinit__(self, address, port): + * self._client = hyperdex_client_create(address, port) # <<<<<<<<<<<<<< + * self._ops = {} + * + */ + __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_address); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_from_py_uint16_t(__pyx_v_port); if (unlikely((__pyx_t_2 == (uint16_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_self->_client = hyperdex_client_create(__pyx_t_1, __pyx_t_2); + + /* "_hyperdex_client.pyx":1375 + * def __cinit__(self, address, port): + * self._client = hyperdex_client_create(address, port) + * self._ops = {} # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_v_self->_ops); + __Pyx_DECREF(((PyObject *)__pyx_v_self->_ops)); + __pyx_v_self->_ops = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("_hyperdex_client.Client.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static void __pyx_pw_16_hyperdex_client_6Client_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_16_hyperdex_client_6Client_3__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_16_hyperdex_client_6Client_2__dealloc__(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); +} + +/* "_hyperdex_client.pyx":1377 + * self._ops = {} + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * if self._client: + * hyperdex_client_destroy(self._client) + */ + +static void __pyx_pf_16_hyperdex_client_6Client_2__dealloc__(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "_hyperdex_client.pyx":1378 + * + * def __dealloc__(self): + * if self._client: # <<<<<<<<<<<<<< + * hyperdex_client_destroy(self._client) + * + */ + __pyx_t_1 = (__pyx_v_self->_client != 0); + if (__pyx_t_1) { + + /* "_hyperdex_client.pyx":1379 + * def __dealloc__(self): + * if self._client: + * hyperdex_client_destroy(self._client) # <<<<<<<<<<<<<< + * + * def get(self, bytes space, key): + */ + hyperdex_client_destroy(__pyx_v_self->_client); + goto __pyx_L3; + } + __pyx_L3:; + + __Pyx_RefNannyFinishContext(); +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_5get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_5get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_4get(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1381 + * hyperdex_client_destroy(self._client) + * + * def get(self, bytes space, key): # <<<<<<<<<<<<<< + * async = self.async_get(space, key) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_4get(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get", 0); + + /* "_hyperdex_client.pyx":1382 + * + * def get(self, bytes space, key): + * async = self.async_get(space, key) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_get); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1383 + * def get(self, bytes space, key): + * async = self.async_get(space, key) + * return async.wait() # <<<<<<<<<<<<<< + * + * def put(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_7put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_7put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("put (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("put", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("put", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "put") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("put", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_6put(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1385 + * return async.wait() + * + * def put(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * async = self.async_put(space, key, value) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_6put(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("put", 0); + + /* "_hyperdex_client.pyx":1386 + * + * def put(self, bytes space, key, dict value): + * async = self.async_put(space, key, value) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_put); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1387 + * def put(self, bytes space, key, dict value): + * async = self.async_put(space, key, value) + * return async.wait() # <<<<<<<<<<<<<< + * + * def cond_put(self, bytes space, key, dict condition, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_9cond_put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_9cond_put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_condition = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cond_put (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__condition,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_put", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1389; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__condition)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_put", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1389; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_put", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1389; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cond_put") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1389; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_condition = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cond_put", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1389; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.cond_put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_condition), (&PyDict_Type), 1, "condition", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_8cond_put(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_condition, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1389 + * return async.wait() + * + * def cond_put(self, bytes space, key, dict condition, dict value): # <<<<<<<<<<<<<< + * async = self.async_cond_put(space, key, condition, value) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_8cond_put(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_condition, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cond_put", 0); + + /* "_hyperdex_client.pyx":1390 + * + * def cond_put(self, bytes space, key, dict condition, dict value): + * async = self.async_cond_put(space, key, condition, value) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_cond_put); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_condition)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_condition)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_condition)); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1391 + * def cond_put(self, bytes space, key, dict condition, dict value): + * async = self.async_cond_put(space, key, condition, value) + * return async.wait() # <<<<<<<<<<<<<< + * + * def put_if_not_exist(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.cond_put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_11put_if_not_exist(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_11put_if_not_exist(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("put_if_not_exist (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("put_if_not_exist", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("put_if_not_exist", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "put_if_not_exist") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("put_if_not_exist", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.put_if_not_exist", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_10put_if_not_exist(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1393 + * return async.wait() + * + * def put_if_not_exist(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * async = self.async_put_if_not_exist(space, key, value) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_10put_if_not_exist(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("put_if_not_exist", 0); + + /* "_hyperdex_client.pyx":1394 + * + * def put_if_not_exist(self, bytes space, key, dict value): + * async = self.async_put_if_not_exist(space, key, value) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_141); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1395 + * def put_if_not_exist(self, bytes space, key, dict value): + * async = self.async_put_if_not_exist(space, key, value) + * return async.wait() # <<<<<<<<<<<<<< + * + * def delete(self, bytes space, key): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.put_if_not_exist", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_13delete(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_13delete(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("delete (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("delete", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1397; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delete") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1397; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("delete", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1397; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.delete", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_12delete(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1397 + * return async.wait() + * + * def delete(self, bytes space, key): # <<<<<<<<<<<<<< + * async = self.async_delete(space, key) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_12delete(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("delete", 0); + + /* "_hyperdex_client.pyx":1398 + * + * def delete(self, bytes space, key): + * async = self.async_delete(space, key) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_delete); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1399 + * def delete(self, bytes space, key): + * async = self.async_delete(space, key) + * return async.wait() # <<<<<<<<<<<<<< + * + * def cond_delete(self, bytes space, key, dict cond): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.delete", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_15cond_delete(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_15cond_delete(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cond_delete (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_delete", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_delete", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cond_delete") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cond_delete", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.cond_delete", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_14cond_delete(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1401 + * return async.wait() + * + * def cond_delete(self, bytes space, key, dict cond): # <<<<<<<<<<<<<< + * async = self.async_delete(space, key, cond) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_14cond_delete(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cond_delete", 0); + + /* "_hyperdex_client.pyx":1402 + * + * def cond_delete(self, bytes space, key, dict cond): + * async = self.async_delete(space, key, cond) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_delete); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_cond)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_cond)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_cond)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1403 + * def cond_delete(self, bytes space, key, dict cond): + * async = self.async_delete(space, key, cond) + * return async.wait() # <<<<<<<<<<<<<< + * + * def atomic_add(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.cond_delete", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_17atomic_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_17atomic_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("atomic_add (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("atomic_add", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("atomic_add", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "atomic_add") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("atomic_add", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.atomic_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_16atomic_add(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1405 + * return async.wait() + * + * def atomic_add(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * async = self.async_atomic_add(space, key, value) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_16atomic_add(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("atomic_add", 0); + + /* "_hyperdex_client.pyx":1406 + * + * def atomic_add(self, bytes space, key, dict value): + * async = self.async_atomic_add(space, key, value) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_atomic_add); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1407 + * def atomic_add(self, bytes space, key, dict value): + * async = self.async_atomic_add(space, key, value) + * return async.wait() # <<<<<<<<<<<<<< + * + * def cond_atomic_add(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.atomic_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_19cond_atomic_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_19cond_atomic_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cond_atomic_add (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_atomic_add", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_atomic_add", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_atomic_add", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cond_atomic_add") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cond_atomic_add", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.cond_atomic_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_18cond_atomic_add(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1409 + * return async.wait() + * + * def cond_atomic_add(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * async = self.async_atomic_add(space, key, value, cond) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_18cond_atomic_add(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cond_atomic_add", 0); + + /* "_hyperdex_client.pyx":1410 + * + * def cond_atomic_add(self, bytes space, key, dict cond, dict value): + * async = self.async_atomic_add(space, key, value, cond) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_atomic_add); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __Pyx_INCREF(((PyObject *)__pyx_v_cond)); + PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_cond)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_cond)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1411 + * def cond_atomic_add(self, bytes space, key, dict cond, dict value): + * async = self.async_atomic_add(space, key, value, cond) + * return async.wait() # <<<<<<<<<<<<<< + * + * def atomic_sub(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.cond_atomic_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_21atomic_sub(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_21atomic_sub(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("atomic_sub (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("atomic_sub", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("atomic_sub", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "atomic_sub") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("atomic_sub", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.atomic_sub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_20atomic_sub(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1413 + * return async.wait() + * + * def atomic_sub(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * async = self.async_atomic_sub(space, key, value) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_20atomic_sub(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("atomic_sub", 0); + + /* "_hyperdex_client.pyx":1414 + * + * def atomic_sub(self, bytes space, key, dict value): + * async = self.async_atomic_sub(space, key, value) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_atomic_sub); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1415 + * def atomic_sub(self, bytes space, key, dict value): + * async = self.async_atomic_sub(space, key, value) + * return async.wait() # <<<<<<<<<<<<<< + * + * def cond_atomic_sub(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.atomic_sub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_23cond_atomic_sub(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_23cond_atomic_sub(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cond_atomic_sub (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_atomic_sub", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_atomic_sub", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_atomic_sub", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cond_atomic_sub") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cond_atomic_sub", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.cond_atomic_sub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_22cond_atomic_sub(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1417 + * return async.wait() + * + * def cond_atomic_sub(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * async = self.async_atomic_sub(space, key, value, cond) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_22cond_atomic_sub(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cond_atomic_sub", 0); + + /* "_hyperdex_client.pyx":1418 + * + * def cond_atomic_sub(self, bytes space, key, dict cond, dict value): + * async = self.async_atomic_sub(space, key, value, cond) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_atomic_sub); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __Pyx_INCREF(((PyObject *)__pyx_v_cond)); + PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_cond)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_cond)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1419 + * def cond_atomic_sub(self, bytes space, key, dict cond, dict value): + * async = self.async_atomic_sub(space, key, value, cond) + * return async.wait() # <<<<<<<<<<<<<< + * + * def atomic_mul(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.cond_atomic_sub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_25atomic_mul(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_25atomic_mul(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("atomic_mul (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("atomic_mul", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("atomic_mul", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "atomic_mul") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("atomic_mul", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.atomic_mul", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_24atomic_mul(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1421 + * return async.wait() + * + * def atomic_mul(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * async = self.async_atomic_mul(space, key, value) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_24atomic_mul(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("atomic_mul", 0); + + /* "_hyperdex_client.pyx":1422 + * + * def atomic_mul(self, bytes space, key, dict value): + * async = self.async_atomic_mul(space, key, value) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_atomic_mul); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1423 + * def atomic_mul(self, bytes space, key, dict value): + * async = self.async_atomic_mul(space, key, value) + * return async.wait() # <<<<<<<<<<<<<< + * + * def cond_atomic_mul(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.atomic_mul", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_27cond_atomic_mul(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_27cond_atomic_mul(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cond_atomic_mul (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_atomic_mul", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_atomic_mul", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_atomic_mul", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cond_atomic_mul") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cond_atomic_mul", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.cond_atomic_mul", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_26cond_atomic_mul(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1425 + * return async.wait() + * + * def cond_atomic_mul(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * async = self.async_atomic_mul(space, key, value, cond) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_26cond_atomic_mul(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cond_atomic_mul", 0); + + /* "_hyperdex_client.pyx":1426 + * + * def cond_atomic_mul(self, bytes space, key, dict cond, dict value): + * async = self.async_atomic_mul(space, key, value, cond) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_atomic_mul); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __Pyx_INCREF(((PyObject *)__pyx_v_cond)); + PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_cond)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_cond)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1427 + * def cond_atomic_mul(self, bytes space, key, dict cond, dict value): + * async = self.async_atomic_mul(space, key, value, cond) + * return async.wait() # <<<<<<<<<<<<<< + * + * def atomic_div(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.cond_atomic_mul", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_29atomic_div(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_29atomic_div(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("atomic_div (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("atomic_div", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("atomic_div", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "atomic_div") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("atomic_div", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.atomic_div", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_28atomic_div(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1429 + * return async.wait() + * + * def atomic_div(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * async = self.async_atomic_div(space, key, value) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_28atomic_div(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("atomic_div", 0); + + /* "_hyperdex_client.pyx":1430 + * + * def atomic_div(self, bytes space, key, dict value): + * async = self.async_atomic_div(space, key, value) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_atomic_div); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1431 + * def atomic_div(self, bytes space, key, dict value): + * async = self.async_atomic_div(space, key, value) + * return async.wait() # <<<<<<<<<<<<<< + * + * def cond_atomic_div(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.atomic_div", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_31cond_atomic_div(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_31cond_atomic_div(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cond_atomic_div (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_atomic_div", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_atomic_div", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_atomic_div", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cond_atomic_div") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cond_atomic_div", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.cond_atomic_div", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_30cond_atomic_div(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1433 + * return async.wait() + * + * def cond_atomic_div(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * async = self.async_atomic_div(space, key, value, cond) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_30cond_atomic_div(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cond_atomic_div", 0); + + /* "_hyperdex_client.pyx":1434 + * + * def cond_atomic_div(self, bytes space, key, dict cond, dict value): + * async = self.async_atomic_div(space, key, value, cond) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_atomic_div); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __Pyx_INCREF(((PyObject *)__pyx_v_cond)); + PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_cond)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_cond)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1435 + * def cond_atomic_div(self, bytes space, key, dict cond, dict value): + * async = self.async_atomic_div(space, key, value, cond) + * return async.wait() # <<<<<<<<<<<<<< + * + * def atomic_mod(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.cond_atomic_div", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_33atomic_mod(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_33atomic_mod(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("atomic_mod (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("atomic_mod", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("atomic_mod", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "atomic_mod") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("atomic_mod", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.atomic_mod", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_32atomic_mod(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1437 + * return async.wait() + * + * def atomic_mod(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * async = self.async_atomic_mod(space, key, value) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_32atomic_mod(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("atomic_mod", 0); + + /* "_hyperdex_client.pyx":1438 + * + * def atomic_mod(self, bytes space, key, dict value): + * async = self.async_atomic_mod(space, key, value) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_atomic_mod); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1439 + * def atomic_mod(self, bytes space, key, dict value): + * async = self.async_atomic_mod(space, key, value) + * return async.wait() # <<<<<<<<<<<<<< + * + * def cond_atomic_mod(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.atomic_mod", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_35cond_atomic_mod(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_35cond_atomic_mod(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cond_atomic_mod (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_atomic_mod", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_atomic_mod", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_atomic_mod", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cond_atomic_mod") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cond_atomic_mod", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.cond_atomic_mod", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_34cond_atomic_mod(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1441 + * return async.wait() + * + * def cond_atomic_mod(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * async = self.async_atomic_mod(space, key, value, cond) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_34cond_atomic_mod(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cond_atomic_mod", 0); + + /* "_hyperdex_client.pyx":1442 + * + * def cond_atomic_mod(self, bytes space, key, dict cond, dict value): + * async = self.async_atomic_mod(space, key, value, cond) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_atomic_mod); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __Pyx_INCREF(((PyObject *)__pyx_v_cond)); + PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_cond)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_cond)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1443 + * def cond_atomic_mod(self, bytes space, key, dict cond, dict value): + * async = self.async_atomic_mod(space, key, value, cond) + * return async.wait() # <<<<<<<<<<<<<< + * + * def atomic_and(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.cond_atomic_mod", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_37atomic_and(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_37atomic_and(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("atomic_and (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("atomic_and", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("atomic_and", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "atomic_and") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("atomic_and", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.atomic_and", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_36atomic_and(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1445 + * return async.wait() + * + * def atomic_and(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * async = self.async_atomic_and(space, key, value) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_36atomic_and(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("atomic_and", 0); + + /* "_hyperdex_client.pyx":1446 + * + * def atomic_and(self, bytes space, key, dict value): + * async = self.async_atomic_and(space, key, value) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_atomic_and); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1447 + * def atomic_and(self, bytes space, key, dict value): + * async = self.async_atomic_and(space, key, value) + * return async.wait() # <<<<<<<<<<<<<< + * + * def cond_atomic_and(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.atomic_and", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_39cond_atomic_and(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_39cond_atomic_and(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cond_atomic_and (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_atomic_and", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_atomic_and", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_atomic_and", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cond_atomic_and") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cond_atomic_and", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.cond_atomic_and", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_38cond_atomic_and(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1449 + * return async.wait() + * + * def cond_atomic_and(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * async = self.async_atomic_and(space, key, value, cond) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_38cond_atomic_and(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cond_atomic_and", 0); + + /* "_hyperdex_client.pyx":1450 + * + * def cond_atomic_and(self, bytes space, key, dict cond, dict value): + * async = self.async_atomic_and(space, key, value, cond) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_atomic_and); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __Pyx_INCREF(((PyObject *)__pyx_v_cond)); + PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_cond)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_cond)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1451 + * def cond_atomic_and(self, bytes space, key, dict cond, dict value): + * async = self.async_atomic_and(space, key, value, cond) + * return async.wait() # <<<<<<<<<<<<<< + * + * def atomic_or(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.cond_atomic_and", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_41atomic_or(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_41atomic_or(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("atomic_or (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("atomic_or", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("atomic_or", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "atomic_or") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("atomic_or", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.atomic_or", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_40atomic_or(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1453 + * return async.wait() + * + * def atomic_or(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * async = self.async_atomic_or(space, key, value) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_40atomic_or(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("atomic_or", 0); + + /* "_hyperdex_client.pyx":1454 + * + * def atomic_or(self, bytes space, key, dict value): + * async = self.async_atomic_or(space, key, value) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_atomic_or); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1455 + * def atomic_or(self, bytes space, key, dict value): + * async = self.async_atomic_or(space, key, value) + * return async.wait() # <<<<<<<<<<<<<< + * + * def cond_atomic_or(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.atomic_or", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_43cond_atomic_or(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_43cond_atomic_or(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cond_atomic_or (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_atomic_or", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1457; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_atomic_or", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1457; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_atomic_or", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1457; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cond_atomic_or") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1457; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cond_atomic_or", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1457; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.cond_atomic_or", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_42cond_atomic_or(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1457 + * return async.wait() + * + * def cond_atomic_or(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * async = self.async_atomic_or(space, key, value, cond) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_42cond_atomic_or(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cond_atomic_or", 0); + + /* "_hyperdex_client.pyx":1458 + * + * def cond_atomic_or(self, bytes space, key, dict cond, dict value): + * async = self.async_atomic_or(space, key, value, cond) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_atomic_or); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __Pyx_INCREF(((PyObject *)__pyx_v_cond)); + PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_cond)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_cond)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1459 + * def cond_atomic_or(self, bytes space, key, dict cond, dict value): + * async = self.async_atomic_or(space, key, value, cond) + * return async.wait() # <<<<<<<<<<<<<< + * + * def atomic_xor(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.cond_atomic_or", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_45atomic_xor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_45atomic_xor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("atomic_xor (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("atomic_xor", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1461; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("atomic_xor", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1461; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "atomic_xor") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1461; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("atomic_xor", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1461; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.atomic_xor", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_44atomic_xor(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1461 + * return async.wait() + * + * def atomic_xor(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * async = self.async_atomic_xor(space, key, value) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_44atomic_xor(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("atomic_xor", 0); + + /* "_hyperdex_client.pyx":1462 + * + * def atomic_xor(self, bytes space, key, dict value): + * async = self.async_atomic_xor(space, key, value) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_atomic_xor); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1463 + * def atomic_xor(self, bytes space, key, dict value): + * async = self.async_atomic_xor(space, key, value) + * return async.wait() # <<<<<<<<<<<<<< + * + * def cond_atomic_xor(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.atomic_xor", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_47cond_atomic_xor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_47cond_atomic_xor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cond_atomic_xor (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_atomic_xor", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_atomic_xor", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_atomic_xor", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cond_atomic_xor") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cond_atomic_xor", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.cond_atomic_xor", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_46cond_atomic_xor(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1465 + * return async.wait() + * + * def cond_atomic_xor(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * async = self.async_atomic_xor(space, key, value, cond) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_46cond_atomic_xor(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cond_atomic_xor", 0); + + /* "_hyperdex_client.pyx":1466 + * + * def cond_atomic_xor(self, bytes space, key, dict cond, dict value): + * async = self.async_atomic_xor(space, key, value, cond) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_atomic_xor); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __Pyx_INCREF(((PyObject *)__pyx_v_cond)); + PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_cond)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_cond)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1467 + * def cond_atomic_xor(self, bytes space, key, dict cond, dict value): + * async = self.async_atomic_xor(space, key, value, cond) + * return async.wait() # <<<<<<<<<<<<<< + * + * def string_prepend(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.cond_atomic_xor", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_49string_prepend(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_49string_prepend(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("string_prepend (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("string_prepend", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1469; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("string_prepend", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1469; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "string_prepend") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1469; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("string_prepend", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1469; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.string_prepend", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_48string_prepend(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1469 + * return async.wait() + * + * def string_prepend(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * async = self.async_string_prepend(space, key, value) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_48string_prepend(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("string_prepend", 0); + + /* "_hyperdex_client.pyx":1470 + * + * def string_prepend(self, bytes space, key, dict value): + * async = self.async_string_prepend(space, key, value) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_142); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1471 + * def string_prepend(self, bytes space, key, dict value): + * async = self.async_string_prepend(space, key, value) + * return async.wait() # <<<<<<<<<<<<<< + * + * def cond_string_prepend(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.string_prepend", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_51cond_string_prepend(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_51cond_string_prepend(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cond_string_prepend (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_string_prepend", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_string_prepend", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_string_prepend", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cond_string_prepend") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cond_string_prepend", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.cond_string_prepend", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_50cond_string_prepend(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1473 + * return async.wait() + * + * def cond_string_prepend(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * async = self.async_string_prepend(space, key, value, cond) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_50cond_string_prepend(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cond_string_prepend", 0); + + /* "_hyperdex_client.pyx":1474 + * + * def cond_string_prepend(self, bytes space, key, dict cond, dict value): + * async = self.async_string_prepend(space, key, value, cond) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_142); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __Pyx_INCREF(((PyObject *)__pyx_v_cond)); + PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_cond)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_cond)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1475 + * def cond_string_prepend(self, bytes space, key, dict cond, dict value): + * async = self.async_string_prepend(space, key, value, cond) + * return async.wait() # <<<<<<<<<<<<<< + * + * def string_append(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.cond_string_prepend", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_53string_append(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_53string_append(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("string_append (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("string_append", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("string_append", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "string_append") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("string_append", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.string_append", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_52string_append(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1477 + * return async.wait() + * + * def string_append(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * async = self.async_string_append(space, key, value) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_52string_append(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("string_append", 0); + + /* "_hyperdex_client.pyx":1478 + * + * def string_append(self, bytes space, key, dict value): + * async = self.async_string_append(space, key, value) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_string_append); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1479 + * def string_append(self, bytes space, key, dict value): + * async = self.async_string_append(space, key, value) + * return async.wait() # <<<<<<<<<<<<<< + * + * def cond_string_append(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.string_append", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_55cond_string_append(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_55cond_string_append(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cond_string_append (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_string_append", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_string_append", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_string_append", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cond_string_append") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cond_string_append", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.cond_string_append", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_54cond_string_append(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1481 + * return async.wait() + * + * def cond_string_append(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * async = self.async_string_append(space, key, value, cond) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_54cond_string_append(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cond_string_append", 0); + + /* "_hyperdex_client.pyx":1482 + * + * def cond_string_append(self, bytes space, key, dict cond, dict value): + * async = self.async_string_append(space, key, value, cond) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_string_append); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __Pyx_INCREF(((PyObject *)__pyx_v_cond)); + PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_cond)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_cond)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1483 + * def cond_string_append(self, bytes space, key, dict cond, dict value): + * async = self.async_string_append(space, key, value, cond) + * return async.wait() # <<<<<<<<<<<<<< + * + * def list_lpush(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.cond_string_append", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_57list_lpush(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_57list_lpush(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("list_lpush (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("list_lpush", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1485; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("list_lpush", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1485; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "list_lpush") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1485; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("list_lpush", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1485; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.list_lpush", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_56list_lpush(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1485 + * return async.wait() + * + * def list_lpush(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * async = self.async_list_lpush(space, key, value) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_56list_lpush(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("list_lpush", 0); + + /* "_hyperdex_client.pyx":1486 + * + * def list_lpush(self, bytes space, key, dict value): + * async = self.async_list_lpush(space, key, value) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_list_lpush); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1487 + * def list_lpush(self, bytes space, key, dict value): + * async = self.async_list_lpush(space, key, value) + * return async.wait() # <<<<<<<<<<<<<< + * + * def cond_list_lpush(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.list_lpush", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_59cond_list_lpush(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_59cond_list_lpush(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cond_list_lpush (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_list_lpush", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_list_lpush", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_list_lpush", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cond_list_lpush") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cond_list_lpush", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.cond_list_lpush", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_58cond_list_lpush(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1489 + * return async.wait() + * + * def cond_list_lpush(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * async = self.async_list_lpush(space, key, value, cond) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_58cond_list_lpush(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cond_list_lpush", 0); + + /* "_hyperdex_client.pyx":1490 + * + * def cond_list_lpush(self, bytes space, key, dict cond, dict value): + * async = self.async_list_lpush(space, key, value, cond) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_list_lpush); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __Pyx_INCREF(((PyObject *)__pyx_v_cond)); + PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_cond)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_cond)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1491 + * def cond_list_lpush(self, bytes space, key, dict cond, dict value): + * async = self.async_list_lpush(space, key, value, cond) + * return async.wait() # <<<<<<<<<<<<<< + * + * def list_rpush(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.cond_list_lpush", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_61list_rpush(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_61list_rpush(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("list_rpush (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("list_rpush", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("list_rpush", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "list_rpush") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("list_rpush", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.list_rpush", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_60list_rpush(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1493 + * return async.wait() + * + * def list_rpush(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * async = self.async_list_rpush(space, key, value) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_60list_rpush(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("list_rpush", 0); + + /* "_hyperdex_client.pyx":1494 + * + * def list_rpush(self, bytes space, key, dict value): + * async = self.async_list_rpush(space, key, value) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_list_rpush); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1495 + * def list_rpush(self, bytes space, key, dict value): + * async = self.async_list_rpush(space, key, value) + * return async.wait() # <<<<<<<<<<<<<< + * + * def cond_list_rpush(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.list_rpush", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_63cond_list_rpush(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_63cond_list_rpush(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cond_list_rpush (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_list_rpush", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1497; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_list_rpush", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1497; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_list_rpush", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1497; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cond_list_rpush") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1497; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cond_list_rpush", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1497; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.cond_list_rpush", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_62cond_list_rpush(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1497 + * return async.wait() + * + * def cond_list_rpush(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * async = self.async_list_rpush(space, key, value, cond) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_62cond_list_rpush(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cond_list_rpush", 0); + + /* "_hyperdex_client.pyx":1498 + * + * def cond_list_rpush(self, bytes space, key, dict cond, dict value): + * async = self.async_list_rpush(space, key, value, cond) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_list_rpush); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __Pyx_INCREF(((PyObject *)__pyx_v_cond)); + PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_cond)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_cond)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1499 + * def cond_list_rpush(self, bytes space, key, dict cond, dict value): + * async = self.async_list_rpush(space, key, value, cond) + * return async.wait() # <<<<<<<<<<<<<< + * + * def set_add(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.cond_list_rpush", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_65set_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_65set_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_add (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("set_add", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("set_add", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_add") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("set_add", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.set_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_64set_add(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1501 + * return async.wait() + * + * def set_add(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * async = self.async_set_add(space, key, value) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_64set_add(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_add", 0); + + /* "_hyperdex_client.pyx":1502 + * + * def set_add(self, bytes space, key, dict value): + * async = self.async_set_add(space, key, value) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_set_add); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1503 + * def set_add(self, bytes space, key, dict value): + * async = self.async_set_add(space, key, value) + * return async.wait() # <<<<<<<<<<<<<< + * + * def cond_set_add(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.set_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_67cond_set_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_67cond_set_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cond_set_add (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_set_add", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_set_add", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_set_add", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cond_set_add") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cond_set_add", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.cond_set_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_66cond_set_add(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1505 + * return async.wait() + * + * def cond_set_add(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * async = self.async_set_add(space, key, value, cond) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_66cond_set_add(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cond_set_add", 0); + + /* "_hyperdex_client.pyx":1506 + * + * def cond_set_add(self, bytes space, key, dict cond, dict value): + * async = self.async_set_add(space, key, value, cond) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_set_add); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __Pyx_INCREF(((PyObject *)__pyx_v_cond)); + PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_cond)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_cond)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1507 + * def cond_set_add(self, bytes space, key, dict cond, dict value): + * async = self.async_set_add(space, key, value, cond) + * return async.wait() # <<<<<<<<<<<<<< + * + * def set_remove(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.cond_set_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_69set_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_69set_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_remove (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("set_remove", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("set_remove", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_remove") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("set_remove", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.set_remove", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_68set_remove(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1509 + * return async.wait() + * + * def set_remove(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * async = self.async_set_remove(space, key, value) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_68set_remove(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_remove", 0); + + /* "_hyperdex_client.pyx":1510 + * + * def set_remove(self, bytes space, key, dict value): + * async = self.async_set_remove(space, key, value) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_set_remove); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1511 + * def set_remove(self, bytes space, key, dict value): + * async = self.async_set_remove(space, key, value) + * return async.wait() # <<<<<<<<<<<<<< + * + * def cond_set_remove(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.set_remove", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_71cond_set_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_71cond_set_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cond_set_remove (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_set_remove", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_set_remove", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_set_remove", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cond_set_remove") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cond_set_remove", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.cond_set_remove", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_70cond_set_remove(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1513 + * return async.wait() + * + * def cond_set_remove(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * async = self.async_set_remove(space, key, value, cond) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_70cond_set_remove(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cond_set_remove", 0); + + /* "_hyperdex_client.pyx":1514 + * + * def cond_set_remove(self, bytes space, key, dict cond, dict value): + * async = self.async_set_remove(space, key, value, cond) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_set_remove); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __Pyx_INCREF(((PyObject *)__pyx_v_cond)); + PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_cond)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_cond)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1515 + * def cond_set_remove(self, bytes space, key, dict cond, dict value): + * async = self.async_set_remove(space, key, value, cond) + * return async.wait() # <<<<<<<<<<<<<< + * + * def set_intersect(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.cond_set_remove", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_73set_intersect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_73set_intersect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_intersect (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("set_intersect", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1517; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("set_intersect", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1517; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_intersect") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1517; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("set_intersect", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1517; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.set_intersect", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_72set_intersect(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1517 + * return async.wait() + * + * def set_intersect(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * async = self.async_set_intersect(space, key, value) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_72set_intersect(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_intersect", 0); + + /* "_hyperdex_client.pyx":1518 + * + * def set_intersect(self, bytes space, key, dict value): + * async = self.async_set_intersect(space, key, value) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_set_intersect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1519 + * def set_intersect(self, bytes space, key, dict value): + * async = self.async_set_intersect(space, key, value) + * return async.wait() # <<<<<<<<<<<<<< + * + * def cond_set_intersect(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.set_intersect", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_75cond_set_intersect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_75cond_set_intersect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cond_set_intersect (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_set_intersect", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_set_intersect", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_set_intersect", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cond_set_intersect") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cond_set_intersect", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.cond_set_intersect", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_74cond_set_intersect(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1521 + * return async.wait() + * + * def cond_set_intersect(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * async = self.async_set_intersect(space, key, value, cond) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_74cond_set_intersect(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cond_set_intersect", 0); + + /* "_hyperdex_client.pyx":1522 + * + * def cond_set_intersect(self, bytes space, key, dict cond, dict value): + * async = self.async_set_intersect(space, key, value, cond) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_set_intersect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __Pyx_INCREF(((PyObject *)__pyx_v_cond)); + PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_cond)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_cond)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1523 + * def cond_set_intersect(self, bytes space, key, dict cond, dict value): + * async = self.async_set_intersect(space, key, value, cond) + * return async.wait() # <<<<<<<<<<<<<< + * + * def set_union(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.cond_set_intersect", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_77set_union(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_77set_union(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_union (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("set_union", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("set_union", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_union") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("set_union", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.set_union", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_76set_union(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1525 + * return async.wait() + * + * def set_union(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * async = self.async_set_union(space, key, value) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_76set_union(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("set_union", 0); + + /* "_hyperdex_client.pyx":1526 + * + * def set_union(self, bytes space, key, dict value): + * async = self.async_set_union(space, key, value) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_set_union); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1527 + * def set_union(self, bytes space, key, dict value): + * async = self.async_set_union(space, key, value) + * return async.wait() # <<<<<<<<<<<<<< + * + * def cond_set_union(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.set_union", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_79cond_set_union(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_79cond_set_union(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cond_set_union (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_set_union", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1529; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_set_union", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1529; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_set_union", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1529; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cond_set_union") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1529; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cond_set_union", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1529; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.cond_set_union", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_78cond_set_union(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1529 + * return async.wait() + * + * def cond_set_union(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * async = self.async_set_union(space, key, value, cond) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_78cond_set_union(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cond_set_union", 0); + + /* "_hyperdex_client.pyx":1530 + * + * def cond_set_union(self, bytes space, key, dict cond, dict value): + * async = self.async_set_union(space, key, value, cond) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_set_union); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __Pyx_INCREF(((PyObject *)__pyx_v_cond)); + PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_cond)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_cond)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1531 + * def cond_set_union(self, bytes space, key, dict cond, dict value): + * async = self.async_set_union(space, key, value, cond) + * return async.wait() # <<<<<<<<<<<<<< + * + * def map_add(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.cond_set_union", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_81map_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_81map_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_add (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("map_add", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("map_add", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_add") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("map_add", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.map_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_80map_add(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1533 + * return async.wait() + * + * def map_add(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * async = self.async_map_add(space, key, value) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_80map_add(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_add", 0); + + /* "_hyperdex_client.pyx":1534 + * + * def map_add(self, bytes space, key, dict value): + * async = self.async_map_add(space, key, value) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_map_add); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1535 + * def map_add(self, bytes space, key, dict value): + * async = self.async_map_add(space, key, value) + * return async.wait() # <<<<<<<<<<<<<< + * + * def cond_map_add(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.map_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_83cond_map_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_83cond_map_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cond_map_add (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_map_add", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_map_add", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_map_add", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cond_map_add") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cond_map_add", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.cond_map_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_82cond_map_add(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1537 + * return async.wait() + * + * def cond_map_add(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * async = self.async_cond_map_add(space, key, cond, value) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_82cond_map_add(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cond_map_add", 0); + + /* "_hyperdex_client.pyx":1538 + * + * def cond_map_add(self, bytes space, key, dict cond, dict value): + * async = self.async_cond_map_add(space, key, cond, value) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_cond_map_add); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_cond)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_cond)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_cond)); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1539 + * def cond_map_add(self, bytes space, key, dict cond, dict value): + * async = self.async_cond_map_add(space, key, cond, value) + * return async.wait() # <<<<<<<<<<<<<< + * + * def map_remove(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.cond_map_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_85map_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_85map_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_remove (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("map_remove", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("map_remove", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_remove") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("map_remove", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.map_remove", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_84map_remove(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1541 + * return async.wait() + * + * def map_remove(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * async = self.async_map_remove(space, key, value) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_84map_remove(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_remove", 0); + + /* "_hyperdex_client.pyx":1542 + * + * def map_remove(self, bytes space, key, dict value): + * async = self.async_map_remove(space, key, value) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_map_remove); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1542; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1542; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1542; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1543 + * def map_remove(self, bytes space, key, dict value): + * async = self.async_map_remove(space, key, value) + * return async.wait() # <<<<<<<<<<<<<< + * + * def cond_map_remove(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.map_remove", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_87cond_map_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_87cond_map_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cond_map_remove (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_map_remove", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_map_remove", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_map_remove", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cond_map_remove") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cond_map_remove", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.cond_map_remove", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_86cond_map_remove(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1545 + * return async.wait() + * + * def cond_map_remove(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * async = self.async_cond_map_remove(space, key, cond, value) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_86cond_map_remove(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cond_map_remove", 0); + + /* "_hyperdex_client.pyx":1546 + * + * def cond_map_remove(self, bytes space, key, dict cond, dict value): + * async = self.async_cond_map_remove(space, key, cond, value) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_143); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_cond)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_cond)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_cond)); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1547 + * def cond_map_remove(self, bytes space, key, dict cond, dict value): + * async = self.async_cond_map_remove(space, key, cond, value) + * return async.wait() # <<<<<<<<<<<<<< + * + * def map_atomic_add(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.cond_map_remove", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_89map_atomic_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_89map_atomic_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_atomic_add (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("map_atomic_add", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("map_atomic_add", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_atomic_add") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("map_atomic_add", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.map_atomic_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_88map_atomic_add(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1549 + * return async.wait() + * + * def map_atomic_add(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * async = self.async_map_atomic_add(space, key, value) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_88map_atomic_add(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_atomic_add", 0); + + /* "_hyperdex_client.pyx":1550 + * + * def map_atomic_add(self, bytes space, key, dict value): + * async = self.async_map_atomic_add(space, key, value) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_144); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1551 + * def map_atomic_add(self, bytes space, key, dict value): + * async = self.async_map_atomic_add(space, key, value) + * return async.wait() # <<<<<<<<<<<<<< + * + * def cond_map_atomic_add(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.map_atomic_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_91cond_map_atomic_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_91cond_map_atomic_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cond_map_atomic_add (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_map_atomic_add", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1553; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_map_atomic_add", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1553; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_map_atomic_add", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1553; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cond_map_atomic_add") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1553; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cond_map_atomic_add", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1553; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.cond_map_atomic_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_90cond_map_atomic_add(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1553 + * return async.wait() + * + * def cond_map_atomic_add(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * async = self.async_map_atomic_add(space, key, value, cond) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_90cond_map_atomic_add(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cond_map_atomic_add", 0); + + /* "_hyperdex_client.pyx":1554 + * + * def cond_map_atomic_add(self, bytes space, key, dict cond, dict value): + * async = self.async_map_atomic_add(space, key, value, cond) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_144); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __Pyx_INCREF(((PyObject *)__pyx_v_cond)); + PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_cond)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_cond)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1555 + * def cond_map_atomic_add(self, bytes space, key, dict cond, dict value): + * async = self.async_map_atomic_add(space, key, value, cond) + * return async.wait() # <<<<<<<<<<<<<< + * + * def map_atomic_sub(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.cond_map_atomic_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_93map_atomic_sub(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_93map_atomic_sub(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_atomic_sub (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("map_atomic_sub", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1557; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("map_atomic_sub", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1557; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_atomic_sub") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1557; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("map_atomic_sub", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1557; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.map_atomic_sub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_92map_atomic_sub(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1557 + * return async.wait() + * + * def map_atomic_sub(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * async = self.async_map_atomic_sub(space, key, value) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_92map_atomic_sub(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_atomic_sub", 0); + + /* "_hyperdex_client.pyx":1558 + * + * def map_atomic_sub(self, bytes space, key, dict value): + * async = self.async_map_atomic_sub(space, key, value) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_145); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1559 + * def map_atomic_sub(self, bytes space, key, dict value): + * async = self.async_map_atomic_sub(space, key, value) + * return async.wait() # <<<<<<<<<<<<<< + * + * def cond_map_atomic_sub(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.map_atomic_sub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_95cond_map_atomic_sub(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_95cond_map_atomic_sub(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cond_map_atomic_sub (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_map_atomic_sub", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_map_atomic_sub", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_map_atomic_sub", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cond_map_atomic_sub") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cond_map_atomic_sub", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.cond_map_atomic_sub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_94cond_map_atomic_sub(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1561 + * return async.wait() + * + * def cond_map_atomic_sub(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * async = self.async_map_atomic_sub(space, key, value, cond) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_94cond_map_atomic_sub(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cond_map_atomic_sub", 0); + + /* "_hyperdex_client.pyx":1562 + * + * def cond_map_atomic_sub(self, bytes space, key, dict cond, dict value): + * async = self.async_map_atomic_sub(space, key, value, cond) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_145); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __Pyx_INCREF(((PyObject *)__pyx_v_cond)); + PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_cond)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_cond)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1563 + * def cond_map_atomic_sub(self, bytes space, key, dict cond, dict value): + * async = self.async_map_atomic_sub(space, key, value, cond) + * return async.wait() # <<<<<<<<<<<<<< + * + * def map_atomic_mul(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.cond_map_atomic_sub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_97map_atomic_mul(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_97map_atomic_mul(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_atomic_mul (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("map_atomic_mul", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("map_atomic_mul", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_atomic_mul") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("map_atomic_mul", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.map_atomic_mul", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_96map_atomic_mul(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1565 + * return async.wait() + * + * def map_atomic_mul(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * async = self.async_map_atomic_mul(space, key, value) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_96map_atomic_mul(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_atomic_mul", 0); + + /* "_hyperdex_client.pyx":1566 + * + * def map_atomic_mul(self, bytes space, key, dict value): + * async = self.async_map_atomic_mul(space, key, value) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_146); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1567 + * def map_atomic_mul(self, bytes space, key, dict value): + * async = self.async_map_atomic_mul(space, key, value) + * return async.wait() # <<<<<<<<<<<<<< + * + * def cond_map_atomic_mul(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.map_atomic_mul", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_99cond_map_atomic_mul(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_99cond_map_atomic_mul(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cond_map_atomic_mul (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_map_atomic_mul", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_map_atomic_mul", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_map_atomic_mul", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cond_map_atomic_mul") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cond_map_atomic_mul", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.cond_map_atomic_mul", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_98cond_map_atomic_mul(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1569 + * return async.wait() + * + * def cond_map_atomic_mul(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * async = self.async_map_atomic_mul(space, key, value, cond) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_98cond_map_atomic_mul(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cond_map_atomic_mul", 0); + + /* "_hyperdex_client.pyx":1570 + * + * def cond_map_atomic_mul(self, bytes space, key, dict cond, dict value): + * async = self.async_map_atomic_mul(space, key, value, cond) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_146); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __Pyx_INCREF(((PyObject *)__pyx_v_cond)); + PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_cond)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_cond)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1571 + * def cond_map_atomic_mul(self, bytes space, key, dict cond, dict value): + * async = self.async_map_atomic_mul(space, key, value, cond) + * return async.wait() # <<<<<<<<<<<<<< + * + * def map_atomic_div(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.cond_map_atomic_mul", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_101map_atomic_div(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_101map_atomic_div(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_atomic_div (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("map_atomic_div", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("map_atomic_div", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_atomic_div") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("map_atomic_div", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.map_atomic_div", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_100map_atomic_div(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1573 + * return async.wait() + * + * def map_atomic_div(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * async = self.async_map_atomic_div(space, key, value) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_100map_atomic_div(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_atomic_div", 0); + + /* "_hyperdex_client.pyx":1574 + * + * def map_atomic_div(self, bytes space, key, dict value): + * async = self.async_map_atomic_div(space, key, value) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_147); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1575 + * def map_atomic_div(self, bytes space, key, dict value): + * async = self.async_map_atomic_div(space, key, value) + * return async.wait() # <<<<<<<<<<<<<< + * + * def cond_map_atomic_div(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.map_atomic_div", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_103cond_map_atomic_div(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_103cond_map_atomic_div(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cond_map_atomic_div (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_map_atomic_div", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_map_atomic_div", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_map_atomic_div", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cond_map_atomic_div") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cond_map_atomic_div", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.cond_map_atomic_div", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_102cond_map_atomic_div(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1577 + * return async.wait() + * + * def cond_map_atomic_div(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * async = self.async_map_atomic_div(space, key, value, cond) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_102cond_map_atomic_div(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cond_map_atomic_div", 0); + + /* "_hyperdex_client.pyx":1578 + * + * def cond_map_atomic_div(self, bytes space, key, dict cond, dict value): + * async = self.async_map_atomic_div(space, key, value, cond) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_147); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __Pyx_INCREF(((PyObject *)__pyx_v_cond)); + PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_cond)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_cond)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1579 + * def cond_map_atomic_div(self, bytes space, key, dict cond, dict value): + * async = self.async_map_atomic_div(space, key, value, cond) + * return async.wait() # <<<<<<<<<<<<<< + * + * def map_atomic_mod(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.cond_map_atomic_div", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_105map_atomic_mod(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_105map_atomic_mod(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_atomic_mod (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("map_atomic_mod", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1581; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("map_atomic_mod", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1581; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_atomic_mod") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1581; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("map_atomic_mod", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1581; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.map_atomic_mod", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_104map_atomic_mod(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1581 + * return async.wait() + * + * def map_atomic_mod(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * async = self.async_map_atomic_mod(space, key, value) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_104map_atomic_mod(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_atomic_mod", 0); + + /* "_hyperdex_client.pyx":1582 + * + * def map_atomic_mod(self, bytes space, key, dict value): + * async = self.async_map_atomic_mod(space, key, value) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_148); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1583 + * def map_atomic_mod(self, bytes space, key, dict value): + * async = self.async_map_atomic_mod(space, key, value) + * return async.wait() # <<<<<<<<<<<<<< + * + * def cond_map_atomic_mod(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.map_atomic_mod", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_107cond_map_atomic_mod(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_107cond_map_atomic_mod(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cond_map_atomic_mod (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_map_atomic_mod", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_map_atomic_mod", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_map_atomic_mod", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cond_map_atomic_mod") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cond_map_atomic_mod", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.cond_map_atomic_mod", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_106cond_map_atomic_mod(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1585 + * return async.wait() + * + * def cond_map_atomic_mod(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * async = self.async_map_atomic_mod(space, key, value, cond) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_106cond_map_atomic_mod(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cond_map_atomic_mod", 0); + + /* "_hyperdex_client.pyx":1586 + * + * def cond_map_atomic_mod(self, bytes space, key, dict cond, dict value): + * async = self.async_map_atomic_mod(space, key, value, cond) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_148); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __Pyx_INCREF(((PyObject *)__pyx_v_cond)); + PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_cond)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_cond)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1587 + * def cond_map_atomic_mod(self, bytes space, key, dict cond, dict value): + * async = self.async_map_atomic_mod(space, key, value, cond) + * return async.wait() # <<<<<<<<<<<<<< + * + * def map_atomic_and(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.cond_map_atomic_mod", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_109map_atomic_and(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_109map_atomic_and(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_atomic_and (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("map_atomic_and", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1589; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("map_atomic_and", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1589; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_atomic_and") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1589; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("map_atomic_and", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1589; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.map_atomic_and", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_108map_atomic_and(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1589 + * return async.wait() + * + * def map_atomic_and(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * async = self.async_map_atomic_and(space, key, value) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_108map_atomic_and(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_atomic_and", 0); + + /* "_hyperdex_client.pyx":1590 + * + * def map_atomic_and(self, bytes space, key, dict value): + * async = self.async_map_atomic_and(space, key, value) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_149); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1591 + * def map_atomic_and(self, bytes space, key, dict value): + * async = self.async_map_atomic_and(space, key, value) + * return async.wait() # <<<<<<<<<<<<<< + * + * def cond_map_atomic_and(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.map_atomic_and", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_111cond_map_atomic_and(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_111cond_map_atomic_and(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cond_map_atomic_and (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_map_atomic_and", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_map_atomic_and", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_map_atomic_and", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cond_map_atomic_and") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cond_map_atomic_and", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.cond_map_atomic_and", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_110cond_map_atomic_and(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1593 + * return async.wait() + * + * def cond_map_atomic_and(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * async = self.async_map_atomic_and(space, key, value, cond) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_110cond_map_atomic_and(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cond_map_atomic_and", 0); + + /* "_hyperdex_client.pyx":1594 + * + * def cond_map_atomic_and(self, bytes space, key, dict cond, dict value): + * async = self.async_map_atomic_and(space, key, value, cond) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_149); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __Pyx_INCREF(((PyObject *)__pyx_v_cond)); + PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_cond)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_cond)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1595 + * def cond_map_atomic_and(self, bytes space, key, dict cond, dict value): + * async = self.async_map_atomic_and(space, key, value, cond) + * return async.wait() # <<<<<<<<<<<<<< + * + * def map_atomic_or(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.cond_map_atomic_and", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_113map_atomic_or(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_113map_atomic_or(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_atomic_or (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("map_atomic_or", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1597; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("map_atomic_or", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1597; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_atomic_or") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1597; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("map_atomic_or", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1597; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.map_atomic_or", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_112map_atomic_or(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1597 + * return async.wait() + * + * def map_atomic_or(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * async = self.async_map_atomic_or(space, key, value) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_112map_atomic_or(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_atomic_or", 0); + + /* "_hyperdex_client.pyx":1598 + * + * def map_atomic_or(self, bytes space, key, dict value): + * async = self.async_map_atomic_or(space, key, value) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_map_atomic_or); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1599 + * def map_atomic_or(self, bytes space, key, dict value): + * async = self.async_map_atomic_or(space, key, value) + * return async.wait() # <<<<<<<<<<<<<< + * + * def cond_map_atomic_or(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.map_atomic_or", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_115cond_map_atomic_or(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_115cond_map_atomic_or(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cond_map_atomic_or (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_map_atomic_or", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_map_atomic_or", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_map_atomic_or", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cond_map_atomic_or") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cond_map_atomic_or", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.cond_map_atomic_or", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_114cond_map_atomic_or(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1601 + * return async.wait() + * + * def cond_map_atomic_or(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * async = self.async_map_atomic_or(space, key, value, cond) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_114cond_map_atomic_or(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cond_map_atomic_or", 0); + + /* "_hyperdex_client.pyx":1602 + * + * def cond_map_atomic_or(self, bytes space, key, dict cond, dict value): + * async = self.async_map_atomic_or(space, key, value, cond) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_map_atomic_or); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __Pyx_INCREF(((PyObject *)__pyx_v_cond)); + PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_cond)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_cond)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1603 + * def cond_map_atomic_or(self, bytes space, key, dict cond, dict value): + * async = self.async_map_atomic_or(space, key, value, cond) + * return async.wait() # <<<<<<<<<<<<<< + * + * def map_atomic_xor(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.cond_map_atomic_or", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_117map_atomic_xor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_117map_atomic_xor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_atomic_xor (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("map_atomic_xor", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("map_atomic_xor", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_atomic_xor") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("map_atomic_xor", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.map_atomic_xor", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_116map_atomic_xor(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1605 + * return async.wait() + * + * def map_atomic_xor(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * async = self.async_map_atomic_xor(space, key, value) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_116map_atomic_xor(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_atomic_xor", 0); + + /* "_hyperdex_client.pyx":1606 + * + * def map_atomic_xor(self, bytes space, key, dict value): + * async = self.async_map_atomic_xor(space, key, value) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_150); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1607 + * def map_atomic_xor(self, bytes space, key, dict value): + * async = self.async_map_atomic_xor(space, key, value) + * return async.wait() # <<<<<<<<<<<<<< + * + * def cond_map_atomic_xor(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.map_atomic_xor", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_119cond_map_atomic_xor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_119cond_map_atomic_xor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cond_map_atomic_xor (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_map_atomic_xor", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_map_atomic_xor", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_map_atomic_xor", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cond_map_atomic_xor") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cond_map_atomic_xor", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.cond_map_atomic_xor", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_118cond_map_atomic_xor(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1609 + * return async.wait() + * + * def cond_map_atomic_xor(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * async = self.async_map_atomic_xor(space, key, value, cond) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_118cond_map_atomic_xor(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cond_map_atomic_xor", 0); + + /* "_hyperdex_client.pyx":1610 + * + * def cond_map_atomic_xor(self, bytes space, key, dict cond, dict value): + * async = self.async_map_atomic_xor(space, key, value, cond) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_150); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __Pyx_INCREF(((PyObject *)__pyx_v_cond)); + PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_cond)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_cond)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1611 + * def cond_map_atomic_xor(self, bytes space, key, dict cond, dict value): + * async = self.async_map_atomic_xor(space, key, value, cond) + * return async.wait() # <<<<<<<<<<<<<< + * + * def map_string_prepend(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.cond_map_atomic_xor", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_121map_string_prepend(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_121map_string_prepend(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_string_prepend (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("map_string_prepend", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1613; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("map_string_prepend", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1613; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_string_prepend") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1613; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("map_string_prepend", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1613; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.map_string_prepend", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_120map_string_prepend(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1613 + * return async.wait() + * + * def map_string_prepend(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * async = self.async_map_string_prepend(space, key, value) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_120map_string_prepend(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_string_prepend", 0); + + /* "_hyperdex_client.pyx":1614 + * + * def map_string_prepend(self, bytes space, key, dict value): + * async = self.async_map_string_prepend(space, key, value) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_151); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1615 + * def map_string_prepend(self, bytes space, key, dict value): + * async = self.async_map_string_prepend(space, key, value) + * return async.wait() # <<<<<<<<<<<<<< + * + * def cond_map_string_prepend(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.map_string_prepend", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_123cond_map_string_prepend(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_123cond_map_string_prepend(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cond_map_string_prepend (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_map_string_prepend", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_map_string_prepend", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_map_string_prepend", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cond_map_string_prepend") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cond_map_string_prepend", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.cond_map_string_prepend", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_122cond_map_string_prepend(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1617 + * return async.wait() + * + * def cond_map_string_prepend(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * async = self.async_map_string_prepend(space, key, value, cond) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_122cond_map_string_prepend(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cond_map_string_prepend", 0); + + /* "_hyperdex_client.pyx":1618 + * + * def cond_map_string_prepend(self, bytes space, key, dict cond, dict value): + * async = self.async_map_string_prepend(space, key, value, cond) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_151); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __Pyx_INCREF(((PyObject *)__pyx_v_cond)); + PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_cond)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_cond)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1619 + * def cond_map_string_prepend(self, bytes space, key, dict cond, dict value): + * async = self.async_map_string_prepend(space, key, value, cond) + * return async.wait() # <<<<<<<<<<<<<< + * + * def map_string_append(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.cond_map_string_prepend", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_125map_string_append(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_125map_string_append(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_string_append (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("map_string_append", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("map_string_append", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_string_append") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("map_string_append", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.map_string_append", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_124map_string_append(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1621 + * return async.wait() + * + * def map_string_append(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * async = self.async_map_string_append(space, key, value) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_124map_string_append(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_string_append", 0); + + /* "_hyperdex_client.pyx":1622 + * + * def map_string_append(self, bytes space, key, dict value): + * async = self.async_map_string_append(space, key, value) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_152); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1623 + * def map_string_append(self, bytes space, key, dict value): + * async = self.async_map_string_append(space, key, value) + * return async.wait() # <<<<<<<<<<<<<< + * + * def cond_map_string_append(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.map_string_append", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_127cond_map_string_append(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_127cond_map_string_append(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cond_map_string_append (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_map_string_append", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_map_string_append", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cond_map_string_append", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cond_map_string_append") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cond_map_string_append", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.cond_map_string_append", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_126cond_map_string_append(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1625 + * return async.wait() + * + * def cond_map_string_append(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * async = self.async_map_string_append(space, key, value, cond) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_126cond_map_string_append(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cond_map_string_append", 0); + + /* "_hyperdex_client.pyx":1626 + * + * def cond_map_string_append(self, bytes space, key, dict cond, dict value): + * async = self.async_map_string_append(space, key, value, cond) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_152); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(((PyObject *)__pyx_v_value)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_value)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_value)); + __Pyx_INCREF(((PyObject *)__pyx_v_cond)); + PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_cond)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_cond)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1627 + * def cond_map_string_append(self, bytes space, key, dict cond, dict value): + * async = self.async_map_string_append(space, key, value, cond) + * return async.wait() # <<<<<<<<<<<<<< + * + * def search_describe(self, bytes space, dict predicate, bool unsafe=False): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.cond_map_string_append", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_129search_describe(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_129search_describe(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_predicate = 0; + PyBoolObject *__pyx_v_unsafe = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("search_describe (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__predicate,&__pyx_n_s__unsafe,0}; + PyObject* values[3] = {0,0,0}; + values[2] = (PyObject *)__pyx_k_153; + 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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__predicate)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("search_describe", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__unsafe); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "search_describe") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_predicate = ((PyObject*)values[1]); + __pyx_v_unsafe = ((PyBoolObject *)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("search_describe", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.search_describe", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_predicate), (&PyDict_Type), 1, "predicate", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unsafe), __pyx_ptype_7cpython_4bool_bool, 1, "unsafe", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_128search_describe(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_predicate, __pyx_v_unsafe); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1629 + * return async.wait() + * + * def search_describe(self, bytes space, dict predicate, bool unsafe=False): # <<<<<<<<<<<<<< + * async = self.async_search_describe(space, predicate, unsafe) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_128search_describe(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_predicate, PyBoolObject *__pyx_v_unsafe) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("search_describe", 0); + + /* "_hyperdex_client.pyx":1630 + * + * def search_describe(self, bytes space, dict predicate, bool unsafe=False): + * async = self.async_search_describe(space, predicate, unsafe) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_154); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(((PyObject *)__pyx_v_predicate)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_predicate)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_predicate)); + __Pyx_INCREF(((PyObject *)__pyx_v_unsafe)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_unsafe)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_unsafe)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1631 + * def search_describe(self, bytes space, dict predicate, bool unsafe=False): + * async = self.async_search_describe(space, predicate, unsafe) + * return async.wait() # <<<<<<<<<<<<<< + * + * def group_del(self, bytes space, dict predicate): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.search_describe", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_131group_del(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_131group_del(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_predicate = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("group_del (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__predicate,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__predicate)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("group_del", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1633; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "group_del") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1633; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_predicate = ((PyObject*)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("group_del", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1633; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.group_del", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_predicate), (&PyDict_Type), 1, "predicate", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_130group_del(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_predicate); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1633 + * return async.wait() + * + * def group_del(self, bytes space, dict predicate): # <<<<<<<<<<<<<< + * async = self.async_group_del(space, predicate) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_130group_del(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_predicate) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("group_del", 0); + + /* "_hyperdex_client.pyx":1634 + * + * def group_del(self, bytes space, dict predicate): + * async = self.async_group_del(space, predicate) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_group_del); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(((PyObject *)__pyx_v_predicate)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_predicate)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_predicate)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1635 + * def group_del(self, bytes space, dict predicate): + * async = self.async_group_del(space, predicate) + * return async.wait() # <<<<<<<<<<<<<< + * + * def count(self, bytes space, dict predicate, bool unsafe=False): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.group_del", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_133count(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_133count(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_predicate = 0; + PyBoolObject *__pyx_v_unsafe = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("count (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__predicate,&__pyx_n_s__unsafe,0}; + PyObject* values[3] = {0,0,0}; + values[2] = (PyObject *)__pyx_k_155; + 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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__predicate)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("count", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__unsafe); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "count") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_predicate = ((PyObject*)values[1]); + __pyx_v_unsafe = ((PyBoolObject *)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("count", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.count", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_predicate), (&PyDict_Type), 1, "predicate", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unsafe), __pyx_ptype_7cpython_4bool_bool, 1, "unsafe", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_132count(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_predicate, __pyx_v_unsafe); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1637 + * return async.wait() + * + * def count(self, bytes space, dict predicate, bool unsafe=False): # <<<<<<<<<<<<<< + * async = self.async_count(space, predicate, unsafe) + * return async.wait() + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_132count(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_predicate, PyBoolObject *__pyx_v_unsafe) { + PyObject *__pyx_v_async = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("count", 0); + + /* "_hyperdex_client.pyx":1638 + * + * def count(self, bytes space, dict predicate, bool unsafe=False): + * async = self.async_count(space, predicate, unsafe) # <<<<<<<<<<<<<< + * return async.wait() + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__async_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(((PyObject *)__pyx_v_predicate)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_predicate)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_predicate)); + __Pyx_INCREF(((PyObject *)__pyx_v_unsafe)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_unsafe)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_unsafe)); + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_async = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1639 + * def count(self, bytes space, dict predicate, bool unsafe=False): + * async = self.async_count(space, predicate, unsafe) + * return async.wait() # <<<<<<<<<<<<<< + * + * def search(self, bytes space, dict predicate): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_async, __pyx_n_s__wait); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.count", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_async); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_135search(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_135search(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_predicate = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("search (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__predicate,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__predicate)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("search", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "search") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_predicate = ((PyObject*)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("search", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.search", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_predicate), (&PyDict_Type), 1, "predicate", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_134search(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_predicate); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1641 + * return async.wait() + * + * def search(self, bytes space, dict predicate): # <<<<<<<<<<<<<< + * return Search(self, space, predicate) + * + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_134search(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_predicate) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("search", 0); + + /* "_hyperdex_client.pyx":1642 + * + * def search(self, bytes space, dict predicate): + * return Search(self, space, predicate) # <<<<<<<<<<<<<< + * + * def sorted_search(self, bytes space, dict predicate, bytes sort_by, long limit, bytes compare): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(((PyObject *)__pyx_v_predicate)); + PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_predicate)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_predicate)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_Search)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.search", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_137sorted_search(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_137sorted_search(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_predicate = 0; + PyObject *__pyx_v_sort_by = 0; + long __pyx_v_limit; + PyObject *__pyx_v_compare = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sorted_search (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__predicate,&__pyx_n_s__sort_by,&__pyx_n_s__limit,&__pyx_n_s__compare,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__predicate)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sorted_search", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sort_by)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sorted_search", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__limit)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sorted_search", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__compare)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("sorted_search", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sorted_search") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_predicate = ((PyObject*)values[1]); + __pyx_v_sort_by = ((PyObject*)values[2]); + __pyx_v_limit = __Pyx_PyInt_AsLong(values[3]); if (unlikely((__pyx_v_limit == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_compare = ((PyObject*)values[4]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sorted_search", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.sorted_search", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_predicate), (&PyDict_Type), 1, "predicate", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sort_by), (&PyBytes_Type), 1, "sort_by", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_compare), (&PyBytes_Type), 1, "compare", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_136sorted_search(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_predicate, __pyx_v_sort_by, __pyx_v_limit, __pyx_v_compare); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1644 + * return Search(self, space, predicate) + * + * def sorted_search(self, bytes space, dict predicate, bytes sort_by, long limit, bytes compare): # <<<<<<<<<<<<<< + * return SortedSearch(self, space, predicate, sort_by, limit, compare) + * + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_136sorted_search(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_predicate, PyObject *__pyx_v_sort_by, long __pyx_v_limit, PyObject *__pyx_v_compare) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sorted_search", 0); + + /* "_hyperdex_client.pyx":1645 + * + * def sorted_search(self, bytes space, dict predicate, bytes sort_by, long limit, bytes compare): + * return SortedSearch(self, space, predicate, sort_by, limit, compare) # <<<<<<<<<<<<<< + * + * def async_get(self, bytes space, key): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromLong(__pyx_v_limit); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(((PyObject *)__pyx_v_predicate)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_predicate)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_predicate)); + __Pyx_INCREF(((PyObject *)__pyx_v_sort_by)); + PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_sort_by)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_sort_by)); + PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_compare)); + PyTuple_SET_ITEM(__pyx_t_2, 5, ((PyObject *)__pyx_v_compare)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_compare)); + __pyx_t_1 = 0; + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_SortedSearch)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.sorted_search", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_139async_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_139async_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_get (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_get", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1647; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_get") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1647; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_get", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1647; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_138async_get(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1647 + * return SortedSearch(self, space, predicate, sort_by, limit, compare) + * + * def async_get(self, bytes space, key): # <<<<<<<<<<<<<< + * return DeferredGet(self, space, key) + * + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_138async_get(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_get", 0); + + /* "_hyperdex_client.pyx":1648 + * + * def async_get(self, bytes space, key): + * return DeferredGet(self, space, key) # <<<<<<<<<<<<<< + * + * def async_put(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredGet)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_141async_put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_141async_put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_put (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_put", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1650; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_put", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1650; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_put") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1650; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_put", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1650; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_140async_put(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1650 + * return DeferredGet(self, space, key) + * + * def async_put(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_put, space, key, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_140async_put(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_put", 0); + + /* "_hyperdex_client.pyx":1651 + * + * def async_put(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_put, space, key, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1652 + * def async_put(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_put, space, key, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_simple_op)hyperdex_client_put), __pyx_v_space, __pyx_v_key, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1653 + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_put, space, key, value) + * return d # <<<<<<<<<<<<<< + * + * def async_put_if_not_exist(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_143async_put_if_not_exist(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_143async_put_if_not_exist(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_put_if_not_exist (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_put_if_not_exist", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_put_if_not_exist", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_put_if_not_exist") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_put_if_not_exist", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_put_if_not_exist", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_142async_put_if_not_exist(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1655 + * return d + * + * def async_put_if_not_exist(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_put_if_not_exist, space, key, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_142async_put_if_not_exist(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_put_if_not_exist", 0); + + /* "_hyperdex_client.pyx":1656 + * + * def async_put_if_not_exist(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_put_if_not_exist, space, key, value) + * d.setcmp() + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1656; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1656; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1657 + * def async_put_if_not_exist(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_put_if_not_exist, space, key, value) # <<<<<<<<<<<<<< + * d.setcmp() + * return d + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_simple_op)hyperdex_client_put_if_not_exist), __pyx_v_space, __pyx_v_key, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1658 + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_put_if_not_exist, space, key, value) + * d.setcmp() # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredFromAttrs *)__pyx_v_d->__pyx_vtab)->setcmp(__pyx_v_d); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1659 + * d.call( hyperdex_client_put_if_not_exist, space, key, value) + * d.setcmp() + * return d # <<<<<<<<<<<<<< + * + * def async_cond_put(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_put_if_not_exist", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_145async_cond_put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_145async_cond_put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_cond_put (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_put", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1661; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_put", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1661; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_put", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1661; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_cond_put") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1661; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_cond_put", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1661; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_cond_put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_144async_cond_put(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1661 + * return d + * + * def async_cond_put(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_put, space, key, cond, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_144async_cond_put(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_cond_put", 0); + + /* "_hyperdex_client.pyx":1662 + * + * def async_cond_put(self, bytes space, key, dict cond, dict value): + * d = DeferredCondFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_cond_put, space, key, cond, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredCondFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1663 + * def async_cond_put(self, bytes space, key, dict cond, dict value): + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_put, space, key, cond, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_cond_op)hyperdex_client_cond_put), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1664 + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_put, space, key, cond, value) + * return d # <<<<<<<<<<<<<< + * + * def async_delete(self, bytes space, key): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_cond_put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_147async_delete(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_147async_delete(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_delete (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_delete", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_delete") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_delete", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_delete", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_146async_delete(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1666 + * return d + * + * def async_delete(self, bytes space, key): # <<<<<<<<<<<<<< + * return DeferredDelete(self, space, key) + * + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_146async_delete(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_delete", 0); + + /* "_hyperdex_client.pyx":1667 + * + * def async_delete(self, bytes space, key): + * return DeferredDelete(self, space, key) # <<<<<<<<<<<<<< + * + * def async_cond_delete(self, bytes space, key, cond): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1667; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredDelete)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1667; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_delete", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_149async_cond_delete(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_149async_cond_delete(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_cond_delete (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_delete", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1669; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_delete", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1669; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_cond_delete") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1669; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_cond_delete", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1669; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_cond_delete", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1669; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_148async_cond_delete(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1669 + * return DeferredDelete(self, space, key) + * + * def async_cond_delete(self, bytes space, key, cond): # <<<<<<<<<<<<<< + * return DeferredCondDelete(self, space, key, cond) + * + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_148async_cond_delete(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_cond_delete", 0); + + /* "_hyperdex_client.pyx":1670 + * + * def async_cond_delete(self, bytes space, key, cond): + * return DeferredCondDelete(self, space, key, cond) # <<<<<<<<<<<<<< + * + * def async_atomic_add(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __Pyx_INCREF(__pyx_v_cond); + PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_cond); + __Pyx_GIVEREF(__pyx_v_cond); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredCondDelete)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_cond_delete", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_151async_atomic_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_151async_atomic_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_atomic_add (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_atomic_add", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_atomic_add", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_atomic_add") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_atomic_add", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_atomic_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_150async_atomic_add(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1672 + * return DeferredCondDelete(self, space, key, cond) + * + * def async_atomic_add(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_atomic_add, space, key, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_150async_atomic_add(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_atomic_add", 0); + + /* "_hyperdex_client.pyx":1673 + * + * def async_atomic_add(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_atomic_add, space, key, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1674 + * def async_atomic_add(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_atomic_add, space, key, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_simple_op)hyperdex_client_atomic_add), __pyx_v_space, __pyx_v_key, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1675 + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_atomic_add, space, key, value) + * return d # <<<<<<<<<<<<<< + * + * def async_cond_atomic_add(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_atomic_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_153async_cond_atomic_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_153async_cond_atomic_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_cond_atomic_add (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_atomic_add", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_atomic_add", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_atomic_add", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_cond_atomic_add") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_cond_atomic_add", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_cond_atomic_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_152async_cond_atomic_add(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1677 + * return d + * + * def async_cond_atomic_add(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_atomic_add, space, key, cond, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_152async_cond_atomic_add(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_cond_atomic_add", 0); + + /* "_hyperdex_client.pyx":1678 + * + * def async_cond_atomic_add(self, bytes space, key, dict cond, dict value): + * d = DeferredCondFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_cond_atomic_add, space, key, cond, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredCondFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1679 + * def async_cond_atomic_add(self, bytes space, key, dict cond, dict value): + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_atomic_add, space, key, cond, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_cond_op)hyperdex_client_cond_atomic_add), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1680 + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_atomic_add, space, key, cond, value) + * return d # <<<<<<<<<<<<<< + * + * def async_atomic_sub(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_cond_atomic_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_155async_atomic_sub(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_155async_atomic_sub(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_atomic_sub (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_atomic_sub", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_atomic_sub", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_atomic_sub") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_atomic_sub", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_atomic_sub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_154async_atomic_sub(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1682 + * return d + * + * def async_atomic_sub(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_atomic_sub, space, key, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_154async_atomic_sub(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_atomic_sub", 0); + + /* "_hyperdex_client.pyx":1683 + * + * def async_atomic_sub(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_atomic_sub, space, key, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1684 + * def async_atomic_sub(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_atomic_sub, space, key, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_simple_op)hyperdex_client_atomic_sub), __pyx_v_space, __pyx_v_key, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1685 + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_atomic_sub, space, key, value) + * return d # <<<<<<<<<<<<<< + * + * def async_cond_atomic_sub(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_atomic_sub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_157async_cond_atomic_sub(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_157async_cond_atomic_sub(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_cond_atomic_sub (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_atomic_sub", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_atomic_sub", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_atomic_sub", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_cond_atomic_sub") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_cond_atomic_sub", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_cond_atomic_sub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_156async_cond_atomic_sub(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1687 + * return d + * + * def async_cond_atomic_sub(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_atomic_sub, space, key, cond, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_156async_cond_atomic_sub(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_cond_atomic_sub", 0); + + /* "_hyperdex_client.pyx":1688 + * + * def async_cond_atomic_sub(self, bytes space, key, dict cond, dict value): + * d = DeferredCondFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_cond_atomic_sub, space, key, cond, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredCondFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1689 + * def async_cond_atomic_sub(self, bytes space, key, dict cond, dict value): + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_atomic_sub, space, key, cond, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_cond_op)hyperdex_client_cond_atomic_sub), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1690 + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_atomic_sub, space, key, cond, value) + * return d # <<<<<<<<<<<<<< + * + * def async_atomic_mul(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_cond_atomic_sub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_159async_atomic_mul(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_159async_atomic_mul(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_atomic_mul (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_atomic_mul", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_atomic_mul", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_atomic_mul") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_atomic_mul", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_atomic_mul", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_158async_atomic_mul(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1692 + * return d + * + * def async_atomic_mul(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_atomic_mul, space, key, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_158async_atomic_mul(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_atomic_mul", 0); + + /* "_hyperdex_client.pyx":1693 + * + * def async_atomic_mul(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_atomic_mul, space, key, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1694 + * def async_atomic_mul(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_atomic_mul, space, key, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_simple_op)hyperdex_client_atomic_mul), __pyx_v_space, __pyx_v_key, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1695 + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_atomic_mul, space, key, value) + * return d # <<<<<<<<<<<<<< + * + * def async_cond_atomic_mul(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_atomic_mul", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_161async_cond_atomic_mul(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_161async_cond_atomic_mul(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_cond_atomic_mul (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_atomic_mul", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_atomic_mul", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_atomic_mul", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_cond_atomic_mul") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_cond_atomic_mul", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_cond_atomic_mul", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_160async_cond_atomic_mul(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1697 + * return d + * + * def async_cond_atomic_mul(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_atomic_mul, space, key, cond, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_160async_cond_atomic_mul(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_cond_atomic_mul", 0); + + /* "_hyperdex_client.pyx":1698 + * + * def async_cond_atomic_mul(self, bytes space, key, dict cond, dict value): + * d = DeferredCondFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_cond_atomic_mul, space, key, cond, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredCondFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1699 + * def async_cond_atomic_mul(self, bytes space, key, dict cond, dict value): + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_atomic_mul, space, key, cond, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_cond_op)hyperdex_client_cond_atomic_mul), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1700 + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_atomic_mul, space, key, cond, value) + * return d # <<<<<<<<<<<<<< + * + * def async_atomic_div(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_cond_atomic_mul", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_163async_atomic_div(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_163async_atomic_div(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_atomic_div (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_atomic_div", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_atomic_div", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_atomic_div") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_atomic_div", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_atomic_div", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_162async_atomic_div(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1702 + * return d + * + * def async_atomic_div(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_atomic_div, space, key, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_162async_atomic_div(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_atomic_div", 0); + + /* "_hyperdex_client.pyx":1703 + * + * def async_atomic_div(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_atomic_div, space, key, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1704 + * def async_atomic_div(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_atomic_div, space, key, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_simple_op)hyperdex_client_atomic_div), __pyx_v_space, __pyx_v_key, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1705 + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_atomic_div, space, key, value) + * return d # <<<<<<<<<<<<<< + * + * def async_cond_atomic_div(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_atomic_div", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_165async_cond_atomic_div(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_165async_cond_atomic_div(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_cond_atomic_div (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_atomic_div", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_atomic_div", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_atomic_div", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_cond_atomic_div") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_cond_atomic_div", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_cond_atomic_div", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_164async_cond_atomic_div(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1707 + * return d + * + * def async_cond_atomic_div(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_atomic_div, space, key, cond, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_164async_cond_atomic_div(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_cond_atomic_div", 0); + + /* "_hyperdex_client.pyx":1708 + * + * def async_cond_atomic_div(self, bytes space, key, dict cond, dict value): + * d = DeferredCondFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_cond_atomic_div, space, key, cond, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredCondFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1709 + * def async_cond_atomic_div(self, bytes space, key, dict cond, dict value): + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_atomic_div, space, key, cond, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_cond_op)hyperdex_client_cond_atomic_div), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1710 + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_atomic_div, space, key, cond, value) + * return d # <<<<<<<<<<<<<< + * + * def async_atomic_mod(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_cond_atomic_div", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_167async_atomic_mod(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_167async_atomic_mod(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_atomic_mod (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_atomic_mod", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_atomic_mod", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_atomic_mod") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_atomic_mod", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_atomic_mod", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_166async_atomic_mod(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1712 + * return d + * + * def async_atomic_mod(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_atomic_mod, space, key, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_166async_atomic_mod(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_atomic_mod", 0); + + /* "_hyperdex_client.pyx":1713 + * + * def async_atomic_mod(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_atomic_mod, space, key, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1714 + * def async_atomic_mod(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_atomic_mod, space, key, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_simple_op)hyperdex_client_atomic_mod), __pyx_v_space, __pyx_v_key, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1715 + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_atomic_mod, space, key, value) + * return d # <<<<<<<<<<<<<< + * + * def async_cond_atomic_mod(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_atomic_mod", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_169async_cond_atomic_mod(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_169async_cond_atomic_mod(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_cond_atomic_mod (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_atomic_mod", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_atomic_mod", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_atomic_mod", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_cond_atomic_mod") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_cond_atomic_mod", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_cond_atomic_mod", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_168async_cond_atomic_mod(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1717 + * return d + * + * def async_cond_atomic_mod(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_atomic_mod, space, key, cond, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_168async_cond_atomic_mod(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_cond_atomic_mod", 0); + + /* "_hyperdex_client.pyx":1718 + * + * def async_cond_atomic_mod(self, bytes space, key, dict cond, dict value): + * d = DeferredCondFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_cond_atomic_mod, space, key, cond, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredCondFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1719 + * def async_cond_atomic_mod(self, bytes space, key, dict cond, dict value): + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_atomic_mod, space, key, cond, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_cond_op)hyperdex_client_cond_atomic_mod), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1720 + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_atomic_mod, space, key, cond, value) + * return d # <<<<<<<<<<<<<< + * + * def async_atomic_and(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_cond_atomic_mod", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_171async_atomic_and(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_171async_atomic_and(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_atomic_and (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_atomic_and", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1722; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_atomic_and", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1722; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_atomic_and") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1722; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_atomic_and", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1722; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_atomic_and", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_170async_atomic_and(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1722 + * return d + * + * def async_atomic_and(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_atomic_and, space, key, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_170async_atomic_and(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_atomic_and", 0); + + /* "_hyperdex_client.pyx":1723 + * + * def async_atomic_and(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_atomic_and, space, key, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1724 + * def async_atomic_and(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_atomic_and, space, key, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_simple_op)hyperdex_client_atomic_and), __pyx_v_space, __pyx_v_key, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1725 + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_atomic_and, space, key, value) + * return d # <<<<<<<<<<<<<< + * + * def async_cond_atomic_and(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_atomic_and", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_173async_cond_atomic_and(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_173async_cond_atomic_and(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_cond_atomic_and (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_atomic_and", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_atomic_and", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_atomic_and", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_cond_atomic_and") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_cond_atomic_and", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_cond_atomic_and", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_172async_cond_atomic_and(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1727 + * return d + * + * def async_cond_atomic_and(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_atomic_and, space, key, cond, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_172async_cond_atomic_and(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_cond_atomic_and", 0); + + /* "_hyperdex_client.pyx":1728 + * + * def async_cond_atomic_and(self, bytes space, key, dict cond, dict value): + * d = DeferredCondFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_cond_atomic_and, space, key, cond, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredCondFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1729 + * def async_cond_atomic_and(self, bytes space, key, dict cond, dict value): + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_atomic_and, space, key, cond, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_cond_op)hyperdex_client_cond_atomic_and), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1730 + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_atomic_and, space, key, cond, value) + * return d # <<<<<<<<<<<<<< + * + * def async_atomic_or(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_cond_atomic_and", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_175async_atomic_or(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_175async_atomic_or(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_atomic_or (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_atomic_or", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_atomic_or", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_atomic_or") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_atomic_or", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_atomic_or", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_174async_atomic_or(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1732 + * return d + * + * def async_atomic_or(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_atomic_or, space, key, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_174async_atomic_or(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_atomic_or", 0); + + /* "_hyperdex_client.pyx":1733 + * + * def async_atomic_or(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_atomic_or, space, key, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1734 + * def async_atomic_or(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_atomic_or, space, key, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_simple_op)hyperdex_client_atomic_or), __pyx_v_space, __pyx_v_key, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1735 + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_atomic_or, space, key, value) + * return d # <<<<<<<<<<<<<< + * + * def async_cond_atomic_or(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_atomic_or", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_177async_cond_atomic_or(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_177async_cond_atomic_or(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_cond_atomic_or (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_atomic_or", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_atomic_or", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_atomic_or", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_cond_atomic_or") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_cond_atomic_or", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_cond_atomic_or", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_176async_cond_atomic_or(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1737 + * return d + * + * def async_cond_atomic_or(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_atomic_or, space, key, cond, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_176async_cond_atomic_or(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_cond_atomic_or", 0); + + /* "_hyperdex_client.pyx":1738 + * + * def async_cond_atomic_or(self, bytes space, key, dict cond, dict value): + * d = DeferredCondFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_cond_atomic_or, space, key, cond, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredCondFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1739 + * def async_cond_atomic_or(self, bytes space, key, dict cond, dict value): + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_atomic_or, space, key, cond, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_cond_op)hyperdex_client_cond_atomic_or), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1740 + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_atomic_or, space, key, cond, value) + * return d # <<<<<<<<<<<<<< + * + * def async_atomic_xor(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_cond_atomic_or", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_179async_atomic_xor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_179async_atomic_xor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_atomic_xor (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_atomic_xor", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1742; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_atomic_xor", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1742; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_atomic_xor") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1742; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_atomic_xor", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1742; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_atomic_xor", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_178async_atomic_xor(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1742 + * return d + * + * def async_atomic_xor(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_atomic_xor, space, key, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_178async_atomic_xor(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_atomic_xor", 0); + + /* "_hyperdex_client.pyx":1743 + * + * def async_atomic_xor(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_atomic_xor, space, key, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1744 + * def async_atomic_xor(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_atomic_xor, space, key, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_simple_op)hyperdex_client_atomic_xor), __pyx_v_space, __pyx_v_key, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1745 + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_atomic_xor, space, key, value) + * return d # <<<<<<<<<<<<<< + * + * def async_cond_atomic_xor(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_atomic_xor", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_181async_cond_atomic_xor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_181async_cond_atomic_xor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_cond_atomic_xor (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_atomic_xor", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_atomic_xor", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_atomic_xor", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_cond_atomic_xor") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_cond_atomic_xor", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_cond_atomic_xor", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_180async_cond_atomic_xor(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1747 + * return d + * + * def async_cond_atomic_xor(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_atomic_xor, space, key, cond, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_180async_cond_atomic_xor(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_cond_atomic_xor", 0); + + /* "_hyperdex_client.pyx":1748 + * + * def async_cond_atomic_xor(self, bytes space, key, dict cond, dict value): + * d = DeferredCondFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_cond_atomic_xor, space, key, cond, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredCondFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1749 + * def async_cond_atomic_xor(self, bytes space, key, dict cond, dict value): + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_atomic_xor, space, key, cond, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_cond_op)hyperdex_client_cond_atomic_xor), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1750 + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_atomic_xor, space, key, cond, value) + * return d # <<<<<<<<<<<<<< + * + * def async_string_prepend(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_cond_atomic_xor", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_183async_string_prepend(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_183async_string_prepend(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_string_prepend (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_string_prepend", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_string_prepend", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_string_prepend") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_string_prepend", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_string_prepend", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_182async_string_prepend(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1752 + * return d + * + * def async_string_prepend(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_string_prepend, space, key, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_182async_string_prepend(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_string_prepend", 0); + + /* "_hyperdex_client.pyx":1753 + * + * def async_string_prepend(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_string_prepend, space, key, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1754 + * def async_string_prepend(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_string_prepend, space, key, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_simple_op)hyperdex_client_string_prepend), __pyx_v_space, __pyx_v_key, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1755 + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_string_prepend, space, key, value) + * return d # <<<<<<<<<<<<<< + * + * def async_cond_string_prepend(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_string_prepend", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_185async_cond_string_prepend(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_185async_cond_string_prepend(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_cond_string_prepend (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_string_prepend", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1757; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_string_prepend", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1757; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_string_prepend", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1757; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_cond_string_prepend") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1757; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_cond_string_prepend", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1757; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_cond_string_prepend", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_184async_cond_string_prepend(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1757 + * return d + * + * def async_cond_string_prepend(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_string_prepend, space, key, cond, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_184async_cond_string_prepend(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_cond_string_prepend", 0); + + /* "_hyperdex_client.pyx":1758 + * + * def async_cond_string_prepend(self, bytes space, key, dict cond, dict value): + * d = DeferredCondFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_cond_string_prepend, space, key, cond, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredCondFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1759 + * def async_cond_string_prepend(self, bytes space, key, dict cond, dict value): + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_string_prepend, space, key, cond, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_cond_op)hyperdex_client_cond_string_prepend), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1760 + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_string_prepend, space, key, cond, value) + * return d # <<<<<<<<<<<<<< + * + * def async_string_append(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_cond_string_prepend", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_187async_string_append(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_187async_string_append(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_string_append (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_string_append", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_string_append", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_string_append") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_string_append", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_string_append", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_186async_string_append(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1762 + * return d + * + * def async_string_append(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_string_append, space, key, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_186async_string_append(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_string_append", 0); + + /* "_hyperdex_client.pyx":1763 + * + * def async_string_append(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_string_append, space, key, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1764 + * def async_string_append(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_string_append, space, key, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_simple_op)hyperdex_client_string_append), __pyx_v_space, __pyx_v_key, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1765 + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_string_append, space, key, value) + * return d # <<<<<<<<<<<<<< + * + * def async_cond_string_append(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_string_append", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_189async_cond_string_append(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_189async_cond_string_append(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_cond_string_append (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_string_append", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_string_append", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_string_append", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_cond_string_append") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_cond_string_append", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_cond_string_append", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_188async_cond_string_append(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1767 + * return d + * + * def async_cond_string_append(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_string_append, space, key, cond, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_188async_cond_string_append(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_cond_string_append", 0); + + /* "_hyperdex_client.pyx":1768 + * + * def async_cond_string_append(self, bytes space, key, dict cond, dict value): + * d = DeferredCondFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_cond_string_append, space, key, cond, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredCondFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1769 + * def async_cond_string_append(self, bytes space, key, dict cond, dict value): + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_string_append, space, key, cond, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_cond_op)hyperdex_client_cond_string_append), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1770 + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_string_append, space, key, cond, value) + * return d # <<<<<<<<<<<<<< + * + * def async_list_lpush(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_cond_string_append", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_191async_list_lpush(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_191async_list_lpush(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_list_lpush (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_list_lpush", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_list_lpush", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_list_lpush") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_list_lpush", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_list_lpush", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_190async_list_lpush(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1772 + * return d + * + * def async_list_lpush(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_list_lpush, space, key, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_190async_list_lpush(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_list_lpush", 0); + + /* "_hyperdex_client.pyx":1773 + * + * def async_list_lpush(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_list_lpush, space, key, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1774 + * def async_list_lpush(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_list_lpush, space, key, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_simple_op)hyperdex_client_list_lpush), __pyx_v_space, __pyx_v_key, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1775 + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_list_lpush, space, key, value) + * return d # <<<<<<<<<<<<<< + * + * def async_cond_list_lpush(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_list_lpush", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_193async_cond_list_lpush(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_193async_cond_list_lpush(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_cond_list_lpush (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_list_lpush", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1777; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_list_lpush", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1777; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_list_lpush", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1777; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_cond_list_lpush") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1777; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_cond_list_lpush", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1777; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_cond_list_lpush", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_192async_cond_list_lpush(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1777 + * return d + * + * def async_cond_list_lpush(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_list_lpush, space, key, cond, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_192async_cond_list_lpush(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_cond_list_lpush", 0); + + /* "_hyperdex_client.pyx":1778 + * + * def async_cond_list_lpush(self, bytes space, key, dict cond, dict value): + * d = DeferredCondFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_cond_list_lpush, space, key, cond, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredCondFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1779 + * def async_cond_list_lpush(self, bytes space, key, dict cond, dict value): + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_list_lpush, space, key, cond, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_cond_op)hyperdex_client_cond_list_lpush), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1780 + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_list_lpush, space, key, cond, value) + * return d # <<<<<<<<<<<<<< + * + * def async_list_rpush(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_cond_list_lpush", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_195async_list_rpush(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_195async_list_rpush(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_list_rpush (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_list_rpush", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_list_rpush", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_list_rpush") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_list_rpush", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_list_rpush", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_194async_list_rpush(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1782 + * return d + * + * def async_list_rpush(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_list_rpush, space, key, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_194async_list_rpush(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_list_rpush", 0); + + /* "_hyperdex_client.pyx":1783 + * + * def async_list_rpush(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_list_rpush, space, key, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1784 + * def async_list_rpush(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_list_rpush, space, key, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_simple_op)hyperdex_client_list_rpush), __pyx_v_space, __pyx_v_key, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1785 + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_list_rpush, space, key, value) + * return d # <<<<<<<<<<<<<< + * + * def async_cond_list_rpush(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_list_rpush", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_197async_cond_list_rpush(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_197async_cond_list_rpush(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_cond_list_rpush (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_list_rpush", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_list_rpush", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_list_rpush", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_cond_list_rpush") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_cond_list_rpush", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_cond_list_rpush", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_196async_cond_list_rpush(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1787 + * return d + * + * def async_cond_list_rpush(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_list_rpush, space, key, cond, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_196async_cond_list_rpush(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_cond_list_rpush", 0); + + /* "_hyperdex_client.pyx":1788 + * + * def async_cond_list_rpush(self, bytes space, key, dict cond, dict value): + * d = DeferredCondFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_cond_list_rpush, space, key, cond, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredCondFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1789 + * def async_cond_list_rpush(self, bytes space, key, dict cond, dict value): + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_list_rpush, space, key, cond, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_cond_op)hyperdex_client_cond_list_rpush), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1790 + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_list_rpush, space, key, cond, value) + * return d # <<<<<<<<<<<<<< + * + * def async_set_add(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_cond_list_rpush", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_199async_set_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_199async_set_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_set_add (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_set_add", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1792; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_set_add", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1792; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_set_add") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1792; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_set_add", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1792; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_set_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1792; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1792; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_198async_set_add(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1792 + * return d + * + * def async_set_add(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_set_add, space, key, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_198async_set_add(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_set_add", 0); + + /* "_hyperdex_client.pyx":1793 + * + * def async_set_add(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_set_add, space, key, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1794 + * def async_set_add(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_set_add, space, key, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_simple_op)hyperdex_client_set_add), __pyx_v_space, __pyx_v_key, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1795 + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_set_add, space, key, value) + * return d # <<<<<<<<<<<<<< + * + * def async_cond_set_add(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_set_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_201async_cond_set_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_201async_cond_set_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_cond_set_add (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_set_add", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_set_add", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_set_add", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_cond_set_add") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_cond_set_add", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_cond_set_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_200async_cond_set_add(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1797 + * return d + * + * def async_cond_set_add(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_set_add, space, key, cond, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_200async_cond_set_add(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_cond_set_add", 0); + + /* "_hyperdex_client.pyx":1798 + * + * def async_cond_set_add(self, bytes space, key, dict cond, dict value): + * d = DeferredCondFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_cond_set_add, space, key, cond, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredCondFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1799 + * def async_cond_set_add(self, bytes space, key, dict cond, dict value): + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_set_add, space, key, cond, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_cond_op)hyperdex_client_cond_set_add), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1800 + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_set_add, space, key, cond, value) + * return d # <<<<<<<<<<<<<< + * + * def async_set_remove(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_cond_set_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_203async_set_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_203async_set_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_set_remove (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_set_remove", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_set_remove", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_set_remove") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_set_remove", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_set_remove", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_202async_set_remove(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1802 + * return d + * + * def async_set_remove(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_set_remove, space, key, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_202async_set_remove(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_set_remove", 0); + + /* "_hyperdex_client.pyx":1803 + * + * def async_set_remove(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_set_remove, space, key, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1804 + * def async_set_remove(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_set_remove, space, key, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_simple_op)hyperdex_client_set_remove), __pyx_v_space, __pyx_v_key, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1805 + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_set_remove, space, key, value) + * return d # <<<<<<<<<<<<<< + * + * def async_cond_set_remove(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_set_remove", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_205async_cond_set_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_205async_cond_set_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_cond_set_remove (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_set_remove", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_set_remove", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_set_remove", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_cond_set_remove") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_cond_set_remove", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_cond_set_remove", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_204async_cond_set_remove(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1807 + * return d + * + * def async_cond_set_remove(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_set_remove, space, key, cond, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_204async_cond_set_remove(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_cond_set_remove", 0); + + /* "_hyperdex_client.pyx":1808 + * + * def async_cond_set_remove(self, bytes space, key, dict cond, dict value): + * d = DeferredCondFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_cond_set_remove, space, key, cond, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredCondFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1809 + * def async_cond_set_remove(self, bytes space, key, dict cond, dict value): + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_set_remove, space, key, cond, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_cond_op)hyperdex_client_cond_set_remove), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1810 + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_set_remove, space, key, cond, value) + * return d # <<<<<<<<<<<<<< + * + * def async_set_intersect(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_cond_set_remove", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_207async_set_intersect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_207async_set_intersect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_set_intersect (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_set_intersect", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_set_intersect", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_set_intersect") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_set_intersect", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_set_intersect", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_206async_set_intersect(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1812 + * return d + * + * def async_set_intersect(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_set_intersect, space, key, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_206async_set_intersect(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_set_intersect", 0); + + /* "_hyperdex_client.pyx":1813 + * + * def async_set_intersect(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_set_intersect, space, key, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1814 + * def async_set_intersect(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_set_intersect, space, key, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_simple_op)hyperdex_client_set_intersect), __pyx_v_space, __pyx_v_key, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1815 + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_set_intersect, space, key, value) + * return d # <<<<<<<<<<<<<< + * + * def async_cond_set_intersect(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_set_intersect", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_209async_cond_set_intersect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_209async_cond_set_intersect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_cond_set_intersect (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_set_intersect", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_set_intersect", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_set_intersect", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_cond_set_intersect") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_cond_set_intersect", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_cond_set_intersect", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_208async_cond_set_intersect(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1817 + * return d + * + * def async_cond_set_intersect(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_set_intersect, space, key, cond, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_208async_cond_set_intersect(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_cond_set_intersect", 0); + + /* "_hyperdex_client.pyx":1818 + * + * def async_cond_set_intersect(self, bytes space, key, dict cond, dict value): + * d = DeferredCondFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_cond_set_intersect, space, key, cond, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredCondFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1819 + * def async_cond_set_intersect(self, bytes space, key, dict cond, dict value): + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_set_intersect, space, key, cond, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_cond_op)hyperdex_client_cond_set_intersect), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1820 + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_set_intersect, space, key, cond, value) + * return d # <<<<<<<<<<<<<< + * + * def async_set_union(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_cond_set_intersect", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_211async_set_union(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_211async_set_union(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_set_union (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_set_union", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_set_union", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_set_union") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_set_union", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_set_union", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_210async_set_union(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1822 + * return d + * + * def async_set_union(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_set_union, space, key, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_210async_set_union(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_set_union", 0); + + /* "_hyperdex_client.pyx":1823 + * + * def async_set_union(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_set_union, space, key, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1824 + * def async_set_union(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_set_union, space, key, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_simple_op)hyperdex_client_set_union), __pyx_v_space, __pyx_v_key, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1825 + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_set_union, space, key, value) + * return d # <<<<<<<<<<<<<< + * + * def async_cond_set_union(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_set_union", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_213async_cond_set_union(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_213async_cond_set_union(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_cond_set_union (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_set_union", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1827; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_set_union", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1827; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_set_union", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1827; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_cond_set_union") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1827; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_cond_set_union", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1827; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_cond_set_union", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_212async_cond_set_union(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1827 + * return d + * + * def async_cond_set_union(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_set_union, space, key, cond, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_212async_cond_set_union(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_cond_set_union", 0); + + /* "_hyperdex_client.pyx":1828 + * + * def async_cond_set_union(self, bytes space, key, dict cond, dict value): + * d = DeferredCondFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_cond_set_union, space, key, cond, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredCondFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1829 + * def async_cond_set_union(self, bytes space, key, dict cond, dict value): + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_set_union, space, key, cond, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_cond_op)hyperdex_client_cond_set_union), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1830 + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_set_union, space, key, cond, value) + * return d # <<<<<<<<<<<<<< + * + * def async_map_add(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_cond_set_union", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_215async_map_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_215async_map_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_map_add (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_map_add", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1832; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_map_add", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1832; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_map_add") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1832; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_map_add", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1832; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_map_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_214async_map_add(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1832 + * return d + * + * def async_map_add(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * d = DeferredMapOp(self) + * d.call( hyperdex_client_map_add, space, key, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_214async_map_add(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredMapOp *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_map_add", 0); + + /* "_hyperdex_client.pyx":1833 + * + * def async_map_add(self, bytes space, key, dict value): + * d = DeferredMapOp(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_map_add, space, key, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredMapOp)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredMapOp *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1834 + * def async_map_add(self, bytes space, key, dict value): + * d = DeferredMapOp(self) + * d.call( hyperdex_client_map_add, space, key, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredMapOp *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_map_op)hyperdex_client_map_add), __pyx_v_space, __pyx_v_key, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1835 + * d = DeferredMapOp(self) + * d.call( hyperdex_client_map_add, space, key, value) + * return d # <<<<<<<<<<<<<< + * + * def async_cond_map_add(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_map_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_217async_cond_map_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_217async_cond_map_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_cond_map_add (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_map_add", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1837; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_map_add", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1837; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_map_add", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1837; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_cond_map_add") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1837; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_cond_map_add", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1837; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_cond_map_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_216async_cond_map_add(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1837 + * return d + * + * def async_cond_map_add(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * d = DeferredCondMapOp(self) + * d.call( hyperdex_client_cond_map_add, space, key, cond, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_216async_cond_map_add(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredCondMapOp *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_cond_map_add", 0); + + /* "_hyperdex_client.pyx":1838 + * + * def async_cond_map_add(self, bytes space, key, dict cond, dict value): + * d = DeferredCondMapOp(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_cond_map_add, space, key, cond, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredCondMapOp)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredCondMapOp *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1839 + * def async_cond_map_add(self, bytes space, key, dict cond, dict value): + * d = DeferredCondMapOp(self) + * d.call( hyperdex_client_cond_map_add, space, key, cond, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondMapOp *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_cond_map_op)hyperdex_client_cond_map_add), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1840 + * d = DeferredCondMapOp(self) + * d.call( hyperdex_client_cond_map_add, space, key, cond, value) + * return d # <<<<<<<<<<<<<< + * + * def async_map_remove(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_cond_map_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_219async_map_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_219async_map_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_map_remove (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_map_remove", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_map_remove", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_map_remove") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_map_remove", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_map_remove", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_218async_map_remove(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1842 + * return d + * + * def async_map_remove(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_map_remove, space, key, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_218async_map_remove(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_map_remove", 0); + + /* "_hyperdex_client.pyx":1843 + * + * def async_map_remove(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_map_remove, space, key, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1844 + * def async_map_remove(self, bytes space, key, dict value): + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_map_remove, space, key, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_simple_op)hyperdex_client_map_remove), __pyx_v_space, __pyx_v_key, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1845 + * d = DeferredFromAttrs(self) + * d.call( hyperdex_client_map_remove, space, key, value) + * return d # <<<<<<<<<<<<<< + * + * def async_cond_map_remove(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_map_remove", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_221async_cond_map_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_221async_cond_map_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_cond_map_remove (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_map_remove", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_map_remove", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_map_remove", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_cond_map_remove") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_cond_map_remove", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_cond_map_remove", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_220async_cond_map_remove(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1847 + * return d + * + * def async_cond_map_remove(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_map_remove, space, key, cond, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_220async_cond_map_remove(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_cond_map_remove", 0); + + /* "_hyperdex_client.pyx":1848 + * + * def async_cond_map_remove(self, bytes space, key, dict cond, dict value): + * d = DeferredCondFromAttrs(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_cond_map_remove, space, key, cond, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredCondFromAttrs)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1849 + * def async_cond_map_remove(self, bytes space, key, dict cond, dict value): + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_map_remove, space, key, cond, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondFromAttrs *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_cond_op)hyperdex_client_cond_map_remove), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1850 + * d = DeferredCondFromAttrs(self) + * d.call( hyperdex_client_cond_map_remove, space, key, cond, value) + * return d # <<<<<<<<<<<<<< + * + * def async_map_atomic_add(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_cond_map_remove", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_223async_map_atomic_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_223async_map_atomic_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_map_atomic_add (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_map_atomic_add", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1852; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_map_atomic_add", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1852; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_map_atomic_add") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1852; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_map_atomic_add", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1852; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_map_atomic_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_222async_map_atomic_add(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1852 + * return d + * + * def async_map_atomic_add(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * d = DeferredMapOp(self) + * d.call( hyperdex_client_map_atomic_add, space, key, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_222async_map_atomic_add(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredMapOp *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_map_atomic_add", 0); + + /* "_hyperdex_client.pyx":1853 + * + * def async_map_atomic_add(self, bytes space, key, dict value): + * d = DeferredMapOp(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_map_atomic_add, space, key, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredMapOp)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredMapOp *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1854 + * def async_map_atomic_add(self, bytes space, key, dict value): + * d = DeferredMapOp(self) + * d.call( hyperdex_client_map_atomic_add, space, key, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredMapOp *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_map_op)hyperdex_client_map_atomic_add), __pyx_v_space, __pyx_v_key, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1854; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1855 + * d = DeferredMapOp(self) + * d.call( hyperdex_client_map_atomic_add, space, key, value) + * return d # <<<<<<<<<<<<<< + * + * def async_cond_map_atomic_add(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_map_atomic_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_225async_cond_map_atomic_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_225async_cond_map_atomic_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_cond_map_atomic_add (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_map_atomic_add", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1857; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_map_atomic_add", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1857; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_map_atomic_add", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1857; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_cond_map_atomic_add") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1857; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_cond_map_atomic_add", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1857; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_cond_map_atomic_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1857; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1857; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1857; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_224async_cond_map_atomic_add(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1857 + * return d + * + * def async_cond_map_atomic_add(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * d = DeferredCondMapOp(self) + * d.call( hyperdex_client_cond_map_atomic_add, space, key, cond, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_224async_cond_map_atomic_add(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredCondMapOp *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_cond_map_atomic_add", 0); + + /* "_hyperdex_client.pyx":1858 + * + * def async_cond_map_atomic_add(self, bytes space, key, dict cond, dict value): + * d = DeferredCondMapOp(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_cond_map_atomic_add, space, key, cond, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredCondMapOp)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredCondMapOp *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1859 + * def async_cond_map_atomic_add(self, bytes space, key, dict cond, dict value): + * d = DeferredCondMapOp(self) + * d.call( hyperdex_client_cond_map_atomic_add, space, key, cond, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondMapOp *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_cond_map_op)hyperdex_client_cond_map_atomic_add), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1860 + * d = DeferredCondMapOp(self) + * d.call( hyperdex_client_cond_map_atomic_add, space, key, cond, value) + * return d # <<<<<<<<<<<<<< + * + * def async_map_atomic_sub(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_cond_map_atomic_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_227async_map_atomic_sub(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_227async_map_atomic_sub(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_map_atomic_sub (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_map_atomic_sub", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1862; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_map_atomic_sub", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1862; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_map_atomic_sub") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1862; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_map_atomic_sub", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1862; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_map_atomic_sub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_226async_map_atomic_sub(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1862 + * return d + * + * def async_map_atomic_sub(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * d = DeferredMapOp(self) + * d.call( hyperdex_client_map_atomic_sub, space, key, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_226async_map_atomic_sub(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredMapOp *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_map_atomic_sub", 0); + + /* "_hyperdex_client.pyx":1863 + * + * def async_map_atomic_sub(self, bytes space, key, dict value): + * d = DeferredMapOp(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_map_atomic_sub, space, key, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1863; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredMapOp)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1863; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredMapOp *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1864 + * def async_map_atomic_sub(self, bytes space, key, dict value): + * d = DeferredMapOp(self) + * d.call( hyperdex_client_map_atomic_sub, space, key, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredMapOp *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_map_op)hyperdex_client_map_atomic_sub), __pyx_v_space, __pyx_v_key, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1865 + * d = DeferredMapOp(self) + * d.call( hyperdex_client_map_atomic_sub, space, key, value) + * return d # <<<<<<<<<<<<<< + * + * def async_cond_map_atomic_sub(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_map_atomic_sub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_229async_cond_map_atomic_sub(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_229async_cond_map_atomic_sub(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_cond_map_atomic_sub (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_map_atomic_sub", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1867; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_map_atomic_sub", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1867; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_map_atomic_sub", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1867; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_cond_map_atomic_sub") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1867; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_cond_map_atomic_sub", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1867; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_cond_map_atomic_sub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_228async_cond_map_atomic_sub(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1867 + * return d + * + * def async_cond_map_atomic_sub(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * d = DeferredCondMapOp(self) + * d.call( hyperdex_client_cond_map_atomic_sub, space, key, cond, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_228async_cond_map_atomic_sub(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredCondMapOp *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_cond_map_atomic_sub", 0); + + /* "_hyperdex_client.pyx":1868 + * + * def async_cond_map_atomic_sub(self, bytes space, key, dict cond, dict value): + * d = DeferredCondMapOp(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_cond_map_atomic_sub, space, key, cond, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredCondMapOp)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredCondMapOp *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1869 + * def async_cond_map_atomic_sub(self, bytes space, key, dict cond, dict value): + * d = DeferredCondMapOp(self) + * d.call( hyperdex_client_cond_map_atomic_sub, space, key, cond, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondMapOp *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_cond_map_op)hyperdex_client_cond_map_atomic_sub), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1869; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1870 + * d = DeferredCondMapOp(self) + * d.call( hyperdex_client_cond_map_atomic_sub, space, key, cond, value) + * return d # <<<<<<<<<<<<<< + * + * def async_map_atomic_mul(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_cond_map_atomic_sub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_231async_map_atomic_mul(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_231async_map_atomic_mul(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_map_atomic_mul (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_map_atomic_mul", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1872; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_map_atomic_mul", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1872; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_map_atomic_mul") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1872; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_map_atomic_mul", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1872; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_map_atomic_mul", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_230async_map_atomic_mul(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1872 + * return d + * + * def async_map_atomic_mul(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * d = DeferredMapOp(self) + * d.call( hyperdex_client_map_atomic_mul, space, key, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_230async_map_atomic_mul(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredMapOp *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_map_atomic_mul", 0); + + /* "_hyperdex_client.pyx":1873 + * + * def async_map_atomic_mul(self, bytes space, key, dict value): + * d = DeferredMapOp(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_map_atomic_mul, space, key, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredMapOp)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredMapOp *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1874 + * def async_map_atomic_mul(self, bytes space, key, dict value): + * d = DeferredMapOp(self) + * d.call( hyperdex_client_map_atomic_mul, space, key, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredMapOp *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_map_op)hyperdex_client_map_atomic_mul), __pyx_v_space, __pyx_v_key, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1875 + * d = DeferredMapOp(self) + * d.call( hyperdex_client_map_atomic_mul, space, key, value) + * return d # <<<<<<<<<<<<<< + * + * def async_cond_map_atomic_mul(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_map_atomic_mul", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_233async_cond_map_atomic_mul(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_233async_cond_map_atomic_mul(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_cond_map_atomic_mul (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_map_atomic_mul", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1877; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_map_atomic_mul", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1877; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_map_atomic_mul", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1877; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_cond_map_atomic_mul") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1877; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_cond_map_atomic_mul", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1877; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_cond_map_atomic_mul", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_232async_cond_map_atomic_mul(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1877 + * return d + * + * def async_cond_map_atomic_mul(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * d = DeferredCondMapOp(self) + * d.call( hyperdex_client_cond_map_atomic_mul, space, key, cond, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_232async_cond_map_atomic_mul(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredCondMapOp *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_cond_map_atomic_mul", 0); + + /* "_hyperdex_client.pyx":1878 + * + * def async_cond_map_atomic_mul(self, bytes space, key, dict cond, dict value): + * d = DeferredCondMapOp(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_cond_map_atomic_mul, space, key, cond, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredCondMapOp)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredCondMapOp *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1879 + * def async_cond_map_atomic_mul(self, bytes space, key, dict cond, dict value): + * d = DeferredCondMapOp(self) + * d.call( hyperdex_client_cond_map_atomic_mul, space, key, cond, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondMapOp *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_cond_map_op)hyperdex_client_cond_map_atomic_mul), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1880 + * d = DeferredCondMapOp(self) + * d.call( hyperdex_client_cond_map_atomic_mul, space, key, cond, value) + * return d # <<<<<<<<<<<<<< + * + * def async_map_atomic_div(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_cond_map_atomic_mul", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_235async_map_atomic_div(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_235async_map_atomic_div(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_map_atomic_div (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_map_atomic_div", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_map_atomic_div", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_map_atomic_div") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_map_atomic_div", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_map_atomic_div", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_234async_map_atomic_div(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1882 + * return d + * + * def async_map_atomic_div(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * d = DeferredMapOp(self) + * d.call( hyperdex_client_map_atomic_div, space, key, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_234async_map_atomic_div(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredMapOp *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_map_atomic_div", 0); + + /* "_hyperdex_client.pyx":1883 + * + * def async_map_atomic_div(self, bytes space, key, dict value): + * d = DeferredMapOp(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_map_atomic_div, space, key, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredMapOp)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredMapOp *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1884 + * def async_map_atomic_div(self, bytes space, key, dict value): + * d = DeferredMapOp(self) + * d.call( hyperdex_client_map_atomic_div, space, key, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredMapOp *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_map_op)hyperdex_client_map_atomic_div), __pyx_v_space, __pyx_v_key, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1885 + * d = DeferredMapOp(self) + * d.call( hyperdex_client_map_atomic_div, space, key, value) + * return d # <<<<<<<<<<<<<< + * + * def async_cond_map_atomic_div(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_map_atomic_div", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_237async_cond_map_atomic_div(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_237async_cond_map_atomic_div(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_cond_map_atomic_div (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_map_atomic_div", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_map_atomic_div", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_map_atomic_div", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_cond_map_atomic_div") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_cond_map_atomic_div", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_cond_map_atomic_div", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_236async_cond_map_atomic_div(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1887 + * return d + * + * def async_cond_map_atomic_div(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * d = DeferredCondMapOp(self) + * d.call( hyperdex_client_cond_map_atomic_div, space, key, cond, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_236async_cond_map_atomic_div(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredCondMapOp *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_cond_map_atomic_div", 0); + + /* "_hyperdex_client.pyx":1888 + * + * def async_cond_map_atomic_div(self, bytes space, key, dict cond, dict value): + * d = DeferredCondMapOp(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_cond_map_atomic_div, space, key, cond, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredCondMapOp)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredCondMapOp *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1889 + * def async_cond_map_atomic_div(self, bytes space, key, dict cond, dict value): + * d = DeferredCondMapOp(self) + * d.call( hyperdex_client_cond_map_atomic_div, space, key, cond, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondMapOp *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_cond_map_op)hyperdex_client_cond_map_atomic_div), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1890 + * d = DeferredCondMapOp(self) + * d.call( hyperdex_client_cond_map_atomic_div, space, key, cond, value) + * return d # <<<<<<<<<<<<<< + * + * def async_map_atomic_mod(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_cond_map_atomic_div", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_239async_map_atomic_mod(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_239async_map_atomic_mod(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_map_atomic_mod (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_map_atomic_mod", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1892; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_map_atomic_mod", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1892; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_map_atomic_mod") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1892; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_map_atomic_mod", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1892; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_map_atomic_mod", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_238async_map_atomic_mod(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1892 + * return d + * + * def async_map_atomic_mod(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * d = DeferredMapOp(self) + * d.call( hyperdex_client_map_atomic_mod, space, key, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_238async_map_atomic_mod(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredMapOp *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_map_atomic_mod", 0); + + /* "_hyperdex_client.pyx":1893 + * + * def async_map_atomic_mod(self, bytes space, key, dict value): + * d = DeferredMapOp(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_map_atomic_mod, space, key, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredMapOp)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredMapOp *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1894 + * def async_map_atomic_mod(self, bytes space, key, dict value): + * d = DeferredMapOp(self) + * d.call( hyperdex_client_map_atomic_mod, space, key, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredMapOp *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_map_op)hyperdex_client_map_atomic_mod), __pyx_v_space, __pyx_v_key, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1895 + * d = DeferredMapOp(self) + * d.call( hyperdex_client_map_atomic_mod, space, key, value) + * return d # <<<<<<<<<<<<<< + * + * def async_cond_map_atomic_mod(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_map_atomic_mod", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_241async_cond_map_atomic_mod(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_241async_cond_map_atomic_mod(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_cond_map_atomic_mod (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_map_atomic_mod", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_map_atomic_mod", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_map_atomic_mod", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_cond_map_atomic_mod") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_cond_map_atomic_mod", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_cond_map_atomic_mod", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_240async_cond_map_atomic_mod(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1897 + * return d + * + * def async_cond_map_atomic_mod(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * d = DeferredCondMapOp(self) + * d.call( hyperdex_client_cond_map_atomic_mod, space, key, cond, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_240async_cond_map_atomic_mod(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredCondMapOp *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_cond_map_atomic_mod", 0); + + /* "_hyperdex_client.pyx":1898 + * + * def async_cond_map_atomic_mod(self, bytes space, key, dict cond, dict value): + * d = DeferredCondMapOp(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_cond_map_atomic_mod, space, key, cond, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredCondMapOp)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredCondMapOp *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1899 + * def async_cond_map_atomic_mod(self, bytes space, key, dict cond, dict value): + * d = DeferredCondMapOp(self) + * d.call( hyperdex_client_cond_map_atomic_mod, space, key, cond, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondMapOp *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_cond_map_op)hyperdex_client_cond_map_atomic_mod), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1900 + * d = DeferredCondMapOp(self) + * d.call( hyperdex_client_cond_map_atomic_mod, space, key, cond, value) + * return d # <<<<<<<<<<<<<< + * + * def async_map_atomic_and(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_cond_map_atomic_mod", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_243async_map_atomic_and(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_243async_map_atomic_and(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_map_atomic_and (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_map_atomic_and", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_map_atomic_and", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_map_atomic_and") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_map_atomic_and", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_map_atomic_and", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_242async_map_atomic_and(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1902 + * return d + * + * def async_map_atomic_and(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * d = DeferredMapOp(self) + * d.call( hyperdex_client_map_atomic_and, space, key, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_242async_map_atomic_and(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredMapOp *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_map_atomic_and", 0); + + /* "_hyperdex_client.pyx":1903 + * + * def async_map_atomic_and(self, bytes space, key, dict value): + * d = DeferredMapOp(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_map_atomic_and, space, key, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredMapOp)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredMapOp *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1904 + * def async_map_atomic_and(self, bytes space, key, dict value): + * d = DeferredMapOp(self) + * d.call( hyperdex_client_map_atomic_and, space, key, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredMapOp *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_map_op)hyperdex_client_map_atomic_and), __pyx_v_space, __pyx_v_key, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1905 + * d = DeferredMapOp(self) + * d.call( hyperdex_client_map_atomic_and, space, key, value) + * return d # <<<<<<<<<<<<<< + * + * def async_cond_map_atomic_and(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_map_atomic_and", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_245async_cond_map_atomic_and(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_245async_cond_map_atomic_and(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_cond_map_atomic_and (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_map_atomic_and", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_map_atomic_and", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_map_atomic_and", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_cond_map_atomic_and") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_cond_map_atomic_and", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_cond_map_atomic_and", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_244async_cond_map_atomic_and(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1907 + * return d + * + * def async_cond_map_atomic_and(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * d = DeferredCondMapOp(self) + * d.call( hyperdex_client_cond_map_atomic_and, space, key, cond, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_244async_cond_map_atomic_and(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredCondMapOp *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_cond_map_atomic_and", 0); + + /* "_hyperdex_client.pyx":1908 + * + * def async_cond_map_atomic_and(self, bytes space, key, dict cond, dict value): + * d = DeferredCondMapOp(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_cond_map_atomic_and, space, key, cond, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredCondMapOp)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredCondMapOp *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1909 + * def async_cond_map_atomic_and(self, bytes space, key, dict cond, dict value): + * d = DeferredCondMapOp(self) + * d.call( hyperdex_client_cond_map_atomic_and, space, key, cond, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondMapOp *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_cond_map_op)hyperdex_client_cond_map_atomic_and), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1910 + * d = DeferredCondMapOp(self) + * d.call( hyperdex_client_cond_map_atomic_and, space, key, cond, value) + * return d # <<<<<<<<<<<<<< + * + * def async_map_atomic_or(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_cond_map_atomic_and", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_247async_map_atomic_or(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_247async_map_atomic_or(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_map_atomic_or (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_map_atomic_or", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_map_atomic_or", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_map_atomic_or") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_map_atomic_or", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_map_atomic_or", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_246async_map_atomic_or(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1912 + * return d + * + * def async_map_atomic_or(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * d = DeferredMapOp(self) + * d.call( hyperdex_client_map_atomic_or, space, key, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_246async_map_atomic_or(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredMapOp *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_map_atomic_or", 0); + + /* "_hyperdex_client.pyx":1913 + * + * def async_map_atomic_or(self, bytes space, key, dict value): + * d = DeferredMapOp(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_map_atomic_or, space, key, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredMapOp)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredMapOp *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1914 + * def async_map_atomic_or(self, bytes space, key, dict value): + * d = DeferredMapOp(self) + * d.call( hyperdex_client_map_atomic_or, space, key, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredMapOp *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_map_op)hyperdex_client_map_atomic_or), __pyx_v_space, __pyx_v_key, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1915 + * d = DeferredMapOp(self) + * d.call( hyperdex_client_map_atomic_or, space, key, value) + * return d # <<<<<<<<<<<<<< + * + * def async_cond_map_atomic_or(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_map_atomic_or", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_249async_cond_map_atomic_or(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_249async_cond_map_atomic_or(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_cond_map_atomic_or (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_map_atomic_or", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_map_atomic_or", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_map_atomic_or", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_cond_map_atomic_or") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_cond_map_atomic_or", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_cond_map_atomic_or", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_248async_cond_map_atomic_or(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1917 + * return d + * + * def async_cond_map_atomic_or(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * d = DeferredCondMapOp(self) + * d.call( hyperdex_client_cond_map_atomic_or, space, key, cond, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_248async_cond_map_atomic_or(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredCondMapOp *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_cond_map_atomic_or", 0); + + /* "_hyperdex_client.pyx":1918 + * + * def async_cond_map_atomic_or(self, bytes space, key, dict cond, dict value): + * d = DeferredCondMapOp(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_cond_map_atomic_or, space, key, cond, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredCondMapOp)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredCondMapOp *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1919 + * def async_cond_map_atomic_or(self, bytes space, key, dict cond, dict value): + * d = DeferredCondMapOp(self) + * d.call( hyperdex_client_cond_map_atomic_or, space, key, cond, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondMapOp *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_cond_map_op)hyperdex_client_cond_map_atomic_or), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1920 + * d = DeferredCondMapOp(self) + * d.call( hyperdex_client_cond_map_atomic_or, space, key, cond, value) + * return d # <<<<<<<<<<<<<< + * + * def async_map_atomic_xor(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_cond_map_atomic_or", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_251async_map_atomic_xor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_251async_map_atomic_xor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_map_atomic_xor (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_map_atomic_xor", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_map_atomic_xor", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_map_atomic_xor") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_map_atomic_xor", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_map_atomic_xor", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_250async_map_atomic_xor(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1922 + * return d + * + * def async_map_atomic_xor(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * d = DeferredMapOp(self) + * d.call( hyperdex_client_map_atomic_xor, space, key, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_250async_map_atomic_xor(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredMapOp *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_map_atomic_xor", 0); + + /* "_hyperdex_client.pyx":1923 + * + * def async_map_atomic_xor(self, bytes space, key, dict value): + * d = DeferredMapOp(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_map_atomic_xor, space, key, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredMapOp)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredMapOp *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1924 + * def async_map_atomic_xor(self, bytes space, key, dict value): + * d = DeferredMapOp(self) + * d.call( hyperdex_client_map_atomic_xor, space, key, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredMapOp *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_map_op)hyperdex_client_map_atomic_xor), __pyx_v_space, __pyx_v_key, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1925 + * d = DeferredMapOp(self) + * d.call( hyperdex_client_map_atomic_xor, space, key, value) + * return d # <<<<<<<<<<<<<< + * + * def async_cond_map_atomic_xor(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_map_atomic_xor", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_253async_cond_map_atomic_xor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_253async_cond_map_atomic_xor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_cond_map_atomic_xor (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_map_atomic_xor", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_map_atomic_xor", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_map_atomic_xor", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_cond_map_atomic_xor") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_cond_map_atomic_xor", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_cond_map_atomic_xor", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_252async_cond_map_atomic_xor(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1927 + * return d + * + * def async_cond_map_atomic_xor(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * d = DeferredCondMapOp(self) + * d.call( hyperdex_client_cond_map_atomic_xor, space, key, cond, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_252async_cond_map_atomic_xor(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredCondMapOp *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_cond_map_atomic_xor", 0); + + /* "_hyperdex_client.pyx":1928 + * + * def async_cond_map_atomic_xor(self, bytes space, key, dict cond, dict value): + * d = DeferredCondMapOp(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_cond_map_atomic_xor, space, key, cond, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredCondMapOp)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredCondMapOp *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1929 + * def async_cond_map_atomic_xor(self, bytes space, key, dict cond, dict value): + * d = DeferredCondMapOp(self) + * d.call( hyperdex_client_cond_map_atomic_xor, space, key, cond, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondMapOp *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_cond_map_op)hyperdex_client_cond_map_atomic_xor), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1930 + * d = DeferredCondMapOp(self) + * d.call( hyperdex_client_cond_map_atomic_xor, space, key, cond, value) + * return d # <<<<<<<<<<<<<< + * + * def async_map_string_prepend(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_cond_map_atomic_xor", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_255async_map_string_prepend(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_255async_map_string_prepend(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_map_string_prepend (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_map_string_prepend", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1932; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_map_string_prepend", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1932; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_map_string_prepend") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1932; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_map_string_prepend", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1932; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_map_string_prepend", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_254async_map_string_prepend(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1932 + * return d + * + * def async_map_string_prepend(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * d = DeferredMapOp(self) + * d.call( hyperdex_client_map_string_prepend, space, key, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_254async_map_string_prepend(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredMapOp *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_map_string_prepend", 0); + + /* "_hyperdex_client.pyx":1933 + * + * def async_map_string_prepend(self, bytes space, key, dict value): + * d = DeferredMapOp(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_map_string_prepend, space, key, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredMapOp)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredMapOp *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1934 + * def async_map_string_prepend(self, bytes space, key, dict value): + * d = DeferredMapOp(self) + * d.call( hyperdex_client_map_string_prepend, space, key, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredMapOp *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_map_op)hyperdex_client_map_string_prepend), __pyx_v_space, __pyx_v_key, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1935 + * d = DeferredMapOp(self) + * d.call( hyperdex_client_map_string_prepend, space, key, value) + * return d # <<<<<<<<<<<<<< + * + * def async_cond_map_string_prepend(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_map_string_prepend", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_257async_cond_map_string_prepend(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_257async_cond_map_string_prepend(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_cond_map_string_prepend (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_map_string_prepend", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_map_string_prepend", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_map_string_prepend", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_cond_map_string_prepend") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_cond_map_string_prepend", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_cond_map_string_prepend", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_256async_cond_map_string_prepend(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1937 + * return d + * + * def async_cond_map_string_prepend(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * d = DeferredCondMapOp(self) + * d.call( hyperdex_client_cond_map_string_prepend, space, key, cond, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_256async_cond_map_string_prepend(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredCondMapOp *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_cond_map_string_prepend", 0); + + /* "_hyperdex_client.pyx":1938 + * + * def async_cond_map_string_prepend(self, bytes space, key, dict cond, dict value): + * d = DeferredCondMapOp(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_cond_map_string_prepend, space, key, cond, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredCondMapOp)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredCondMapOp *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1939 + * def async_cond_map_string_prepend(self, bytes space, key, dict cond, dict value): + * d = DeferredCondMapOp(self) + * d.call( hyperdex_client_cond_map_string_prepend, space, key, cond, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondMapOp *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_cond_map_op)hyperdex_client_cond_map_string_prepend), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1940 + * d = DeferredCondMapOp(self) + * d.call( hyperdex_client_cond_map_string_prepend, space, key, cond, value) + * return d # <<<<<<<<<<<<<< + * + * def async_map_string_append(self, bytes space, key, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_cond_map_string_prepend", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_259async_map_string_append(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_259async_map_string_append(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_map_string_append (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_map_string_append", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_map_string_append", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_map_string_append") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_value = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_map_string_append", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_map_string_append", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_258async_map_string_append(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1942 + * return d + * + * def async_map_string_append(self, bytes space, key, dict value): # <<<<<<<<<<<<<< + * d = DeferredMapOp(self) + * d.call( hyperdex_client_map_string_append, space, key, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_258async_map_string_append(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredMapOp *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_map_string_append", 0); + + /* "_hyperdex_client.pyx":1943 + * + * def async_map_string_append(self, bytes space, key, dict value): + * d = DeferredMapOp(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_map_string_append, space, key, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredMapOp)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredMapOp *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1944 + * def async_map_string_append(self, bytes space, key, dict value): + * d = DeferredMapOp(self) + * d.call( hyperdex_client_map_string_append, space, key, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredMapOp *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_map_op)hyperdex_client_map_string_append), __pyx_v_space, __pyx_v_key, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1945 + * d = DeferredMapOp(self) + * d.call( hyperdex_client_map_string_append, space, key, value) + * return d # <<<<<<<<<<<<<< + * + * def async_cond_map_string_append(self, bytes space, key, dict cond, dict value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_map_string_append", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_261async_cond_map_string_append(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_261async_cond_map_string_append(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_cond = 0; + PyObject *__pyx_v_value = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_cond_map_string_append (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__key,&__pyx_n_s__cond,&__pyx_n_s__value,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_map_string_append", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cond)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_map_string_append", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_cond_map_string_append", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_cond_map_string_append") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_key = values[1]; + __pyx_v_cond = ((PyObject*)values[2]); + __pyx_v_value = ((PyObject*)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_cond_map_string_append", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_cond_map_string_append", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cond), (&PyDict_Type), 1, "cond", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyDict_Type), 1, "value", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_260async_cond_map_string_append(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1947 + * return d + * + * def async_cond_map_string_append(self, bytes space, key, dict cond, dict value): # <<<<<<<<<<<<<< + * d = DeferredCondMapOp(self) + * d.call( hyperdex_client_cond_map_string_append, space, key, cond, value) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_260async_cond_map_string_append(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_key, PyObject *__pyx_v_cond, PyObject *__pyx_v_value) { + struct __pyx_obj_16_hyperdex_client_DeferredCondMapOp *__pyx_v_d = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_cond_map_string_append", 0); + + /* "_hyperdex_client.pyx":1948 + * + * def async_cond_map_string_append(self, bytes space, key, dict cond, dict value): + * d = DeferredCondMapOp(self) # <<<<<<<<<<<<<< + * d.call( hyperdex_client_cond_map_string_append, space, key, cond, value) + * return d + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredCondMapOp)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_v_d = ((struct __pyx_obj_16_hyperdex_client_DeferredCondMapOp *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1949 + * def async_cond_map_string_append(self, bytes space, key, dict cond, dict value): + * d = DeferredCondMapOp(self) + * d.call( hyperdex_client_cond_map_string_append, space, key, cond, value) # <<<<<<<<<<<<<< + * return d + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondMapOp *)__pyx_v_d->__pyx_vtab)->call(__pyx_v_d, ((__pyx_t_16_hyperdex_client_hyperdex_client_cond_map_op)hyperdex_client_cond_map_string_append), __pyx_v_space, __pyx_v_key, __pyx_v_cond, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":1950 + * d = DeferredCondMapOp(self) + * d.call( hyperdex_client_cond_map_string_append, space, key, cond, value) + * return d # <<<<<<<<<<<<<< + * + * def async_search_describe(self, bytes space, dict predicate, bool unsafe=False): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_d)); + __pyx_r = ((PyObject *)__pyx_v_d); + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_cond_map_string_append", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_263async_search_describe(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_263async_search_describe(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_predicate = 0; + PyBoolObject *__pyx_v_unsafe = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_search_describe (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__predicate,&__pyx_n_s__unsafe,0}; + PyObject* values[3] = {0,0,0}; + values[2] = (PyObject *)__pyx_k_156; + 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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__predicate)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_search_describe", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__unsafe); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_search_describe") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_predicate = ((PyObject*)values[1]); + __pyx_v_unsafe = ((PyBoolObject *)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_search_describe", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_search_describe", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_predicate), (&PyDict_Type), 1, "predicate", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unsafe), __pyx_ptype_7cpython_4bool_bool, 1, "unsafe", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_262async_search_describe(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_predicate, __pyx_v_unsafe); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1952 + * return d + * + * def async_search_describe(self, bytes space, dict predicate, bool unsafe=False): # <<<<<<<<<<<<<< + * return DeferredSearchDescribe(self, space, predicate, unsafe) + * + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_262async_search_describe(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_predicate, PyBoolObject *__pyx_v_unsafe) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_search_describe", 0); + + /* "_hyperdex_client.pyx":1953 + * + * def async_search_describe(self, bytes space, dict predicate, bool unsafe=False): + * return DeferredSearchDescribe(self, space, predicate, unsafe) # <<<<<<<<<<<<<< + * + * def async_group_del(self, bytes space, dict predicate): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(((PyObject *)__pyx_v_predicate)); + PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_predicate)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_predicate)); + __Pyx_INCREF(((PyObject *)__pyx_v_unsafe)); + PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_unsafe)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_unsafe)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredSearchDescribe)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_search_describe", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_265async_group_del(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_265async_group_del(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_predicate = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_group_del (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__predicate,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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__predicate)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_group_del", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_group_del") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_predicate = ((PyObject*)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_group_del", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_group_del", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_predicate), (&PyDict_Type), 1, "predicate", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_264async_group_del(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_predicate); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1955 + * return DeferredSearchDescribe(self, space, predicate, unsafe) + * + * def async_group_del(self, bytes space, dict predicate): # <<<<<<<<<<<<<< + * return DeferredGroupDel(self, space, predicate) + * + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_264async_group_del(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_predicate) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_group_del", 0); + + /* "_hyperdex_client.pyx":1956 + * + * def async_group_del(self, bytes space, dict predicate): + * return DeferredGroupDel(self, space, predicate) # <<<<<<<<<<<<<< + * + * def async_count(self, bytes space, dict predicate, bool unsafe=False): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(((PyObject *)__pyx_v_predicate)); + PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_predicate)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_predicate)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredGroupDel)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_group_del", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_267async_count(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_267async_count(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_space = 0; + PyObject *__pyx_v_predicate = 0; + PyBoolObject *__pyx_v_unsafe = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_count (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__space,&__pyx_n_s__predicate,&__pyx_n_s__unsafe,0}; + PyObject* values[3] = {0,0,0}; + values[2] = (PyObject *)__pyx_k_157; + 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__space)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__predicate)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("async_count", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__unsafe); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_count") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __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_space = ((PyObject*)values[0]); + __pyx_v_predicate = ((PyObject*)values[1]); + __pyx_v_unsafe = ((PyBoolObject *)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_count", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("_hyperdex_client.Client.async_count", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_space), (&PyBytes_Type), 1, "space", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_predicate), (&PyDict_Type), 1, "predicate", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unsafe), __pyx_ptype_7cpython_4bool_bool, 1, "unsafe", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_266async_count(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self), __pyx_v_space, __pyx_v_predicate, __pyx_v_unsafe); + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1958 + * return DeferredGroupDel(self, space, predicate) + * + * def async_count(self, bytes space, dict predicate, bool unsafe=False): # <<<<<<<<<<<<<< + * return DeferredCount(self, space, predicate, unsafe) + * + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_266async_count(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self, PyObject *__pyx_v_space, PyObject *__pyx_v_predicate, PyBoolObject *__pyx_v_unsafe) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("async_count", 0); + + /* "_hyperdex_client.pyx":1959 + * + * def async_count(self, bytes space, dict predicate, bool unsafe=False): + * return DeferredCount(self, space, predicate, unsafe) # <<<<<<<<<<<<<< + * + * def loop(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_INCREF(((PyObject *)__pyx_v_space)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_space)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_space)); + __Pyx_INCREF(((PyObject *)__pyx_v_predicate)); + PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_predicate)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_predicate)); + __Pyx_INCREF(((PyObject *)__pyx_v_unsafe)); + PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_unsafe)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_unsafe)); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_16_hyperdex_client_DeferredCount)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + __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("_hyperdex_client.Client.async_count", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_269loop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_16_hyperdex_client_6Client_269loop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("loop (wrapper)", 0); + __pyx_r = __pyx_pf_16_hyperdex_client_6Client_268loop(((struct __pyx_obj_16_hyperdex_client_Client *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_hyperdex_client.pyx":1961 + * return DeferredCount(self, space, predicate, unsafe) + * + * def loop(self): # <<<<<<<<<<<<<< + * cdef hyperdex_client_returncode rc + * ret = hyperdex_client_loop(self._client, -1, &rc) + */ + +static PyObject *__pyx_pf_16_hyperdex_client_6Client_268loop(struct __pyx_obj_16_hyperdex_client_Client *__pyx_v_self) { + enum hyperdex_client_returncode __pyx_v_rc; + int64_t __pyx_v_ret; + PyObject *__pyx_v_op = 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; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("loop", 0); + + /* "_hyperdex_client.pyx":1963 + * def loop(self): + * cdef hyperdex_client_returncode rc + * ret = hyperdex_client_loop(self._client, -1, &rc) # <<<<<<<<<<<<<< + * if ret < 0: + * raise HyperClientException(rc) + */ + __pyx_v_ret = hyperdex_client_loop(__pyx_v_self->_client, -1, (&__pyx_v_rc)); + + /* "_hyperdex_client.pyx":1964 + * cdef hyperdex_client_returncode rc + * ret = hyperdex_client_loop(self._client, -1, &rc) + * if ret < 0: # <<<<<<<<<<<<<< + * raise HyperClientException(rc) + * else: + */ + __pyx_t_1 = (__pyx_v_ret < 0); + if (__pyx_t_1) { + + /* "_hyperdex_client.pyx":1965 + * ret = hyperdex_client_loop(self._client, -1, &rc) + * if ret < 0: + * raise HyperClientException(rc) # <<<<<<<<<<<<<< + * else: + * assert ret in self._ops + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_122); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyInt_FromLong(__pyx_v_rc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__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_filename = __pyx_f[0]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L3; + } + /*else*/ { + + /* "_hyperdex_client.pyx":1967 + * raise HyperClientException(rc) + * else: + * assert ret in self._ops # <<<<<<<<<<<<<< + * op = self._ops[ret] + * # We cannot refer to self._ops[ret] after this call as + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + __pyx_t_3 = __Pyx_PyInt_to_py_int64_t(__pyx_v_ret); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(((PyObject *)__pyx_v_self->_ops) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_1 = (__Pyx_PyDict_Contains(__pyx_t_3, ((PyObject *)__pyx_v_self->_ops), Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) { + PyErr_SetNone(PyExc_AssertionError); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #endif + + /* "_hyperdex_client.pyx":1968 + * else: + * assert ret in self._ops + * op = self._ops[ret] # <<<<<<<<<<<<<< + * # We cannot refer to self._ops[ret] after this call as + * # _callback() may remove ret from self._ops. + */ + if (unlikely(((PyObject *)__pyx_v_self->_ops) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->_ops), __pyx_v_ret, sizeof(int64_t), __Pyx_PyInt_to_py_int64_t, 0, 1, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_op = __pyx_t_3; + __pyx_t_3 = 0; + + /* "_hyperdex_client.pyx":1971 + * # We cannot refer to self._ops[ret] after this call as + * # _callback() may remove ret from self._ops. + * op._callback() # <<<<<<<<<<<<<< + * return op + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_op, __pyx_n_s___callback); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "_hyperdex_client.pyx":1972 + * # _callback() may remove ret from self._ops. + * op._callback() + * return op # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_op); + __pyx_r = __pyx_v_op; + goto __pyx_L0; + } + __pyx_L3:; + + __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("_hyperdex_client.Client.loop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_op); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cpython/datetime.pxd":104 + * # Datetime C API initialization function. + * # You have to call it before any usage of DateTime CAPI functions. + * cdef inline void import_datetime(): # <<<<<<<<<<<<<< + * PyDateTime_IMPORT + * + */ + +static CYTHON_INLINE void __pyx_f_7cpython_8datetime_import_datetime(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("import_datetime", 0); + + /* "cpython/datetime.pxd":105 + * # You have to call it before any usage of DateTime CAPI functions. + * cdef inline void import_datetime(): + * PyDateTime_IMPORT # <<<<<<<<<<<<<< + * + * # Create date object using DateTime CAPI factory function. + */ + PyDateTime_IMPORT; + + __Pyx_RefNannyFinishContext(); +} + +/* "cpython/datetime.pxd":109 + * # Create date object using DateTime CAPI factory function. + * # Note, there are no range checks for any of the arguments. + * cdef inline object date_new(int year, int month, int day): # <<<<<<<<<<<<<< + * return PyDateTimeAPI.Date_FromDate(year, month, day, PyDateTimeAPI.DateType) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_date_new(int __pyx_v_year, int __pyx_v_month, int __pyx_v_day) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("date_new", 0); + + /* "cpython/datetime.pxd":110 + * # Note, there are no range checks for any of the arguments. + * cdef inline object date_new(int year, int month, int day): + * return PyDateTimeAPI.Date_FromDate(year, month, day, PyDateTimeAPI.DateType) # <<<<<<<<<<<<<< + * + * # Create time object using DateTime CAPI factory function + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyDateTimeAPI->Date_FromDate(__pyx_v_year, __pyx_v_month, __pyx_v_day, PyDateTimeAPI->DateType); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cpython.datetime.date_new", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cpython/datetime.pxd":114 + * # Create time object using DateTime CAPI factory function + * # Note, there are no range checks for any of the arguments. + * cdef inline object time_new(int hour, int minute, int second, int microsecond, object tz): # <<<<<<<<<<<<<< + * return PyDateTimeAPI.Time_FromTime(hour, minute, second, microsecond, tz, PyDateTimeAPI.TimeType) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_time_new(int __pyx_v_hour, int __pyx_v_minute, int __pyx_v_second, int __pyx_v_microsecond, PyObject *__pyx_v_tz) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("time_new", 0); + + /* "cpython/datetime.pxd":115 + * # Note, there are no range checks for any of the arguments. + * cdef inline object time_new(int hour, int minute, int second, int microsecond, object tz): + * return PyDateTimeAPI.Time_FromTime(hour, minute, second, microsecond, tz, PyDateTimeAPI.TimeType) # <<<<<<<<<<<<<< + * + * # Create datetime object using DateTime CAPI factory function. + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyDateTimeAPI->Time_FromTime(__pyx_v_hour, __pyx_v_minute, __pyx_v_second, __pyx_v_microsecond, __pyx_v_tz, PyDateTimeAPI->TimeType); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cpython.datetime.time_new", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cpython/datetime.pxd":119 + * # Create datetime object using DateTime CAPI factory function. + * # Note, there are no range checks for any of the arguments. + * cdef inline object datetime_new(int year, int month, int day, int hour, int minute, int second, int microsecond, object tz): # <<<<<<<<<<<<<< + * return PyDateTimeAPI.DateTime_FromDateAndTime(year, month, day, hour, minute, second, microsecond, tz, PyDateTimeAPI.DateTimeType) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_datetime_new(int __pyx_v_year, int __pyx_v_month, int __pyx_v_day, int __pyx_v_hour, int __pyx_v_minute, int __pyx_v_second, int __pyx_v_microsecond, PyObject *__pyx_v_tz) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("datetime_new", 0); + + /* "cpython/datetime.pxd":120 + * # Note, there are no range checks for any of the arguments. + * cdef inline object datetime_new(int year, int month, int day, int hour, int minute, int second, int microsecond, object tz): + * return PyDateTimeAPI.DateTime_FromDateAndTime(year, month, day, hour, minute, second, microsecond, tz, PyDateTimeAPI.DateTimeType) # <<<<<<<<<<<<<< + * + * # Create timedelta object using DateTime CAPI factory function. + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyDateTimeAPI->DateTime_FromDateAndTime(__pyx_v_year, __pyx_v_month, __pyx_v_day, __pyx_v_hour, __pyx_v_minute, __pyx_v_second, __pyx_v_microsecond, __pyx_v_tz, PyDateTimeAPI->DateTimeType); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cpython.datetime.datetime_new", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cpython/datetime.pxd":124 + * # Create timedelta object using DateTime CAPI factory function. + * # Note, there are no range checks for any of the arguments. + * cdef inline object timedelta_new(int days, int seconds, int useconds): # <<<<<<<<<<<<<< + * return PyDateTimeAPI.Delta_FromDelta(days, seconds, useconds, 1, PyDateTimeAPI.DeltaType) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_timedelta_new(int __pyx_v_days, int __pyx_v_seconds, int __pyx_v_useconds) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("timedelta_new", 0); + + /* "cpython/datetime.pxd":125 + * # Note, there are no range checks for any of the arguments. + * cdef inline object timedelta_new(int days, int seconds, int useconds): + * return PyDateTimeAPI.Delta_FromDelta(days, seconds, useconds, 1, PyDateTimeAPI.DeltaType) # <<<<<<<<<<<<<< + * + * # More recognizable getters for date/time/datetime/timedelta. + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyDateTimeAPI->Delta_FromDelta(__pyx_v_days, __pyx_v_seconds, __pyx_v_useconds, 1, PyDateTimeAPI->DeltaType); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cpython.datetime.timedelta_new", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cpython/datetime.pxd":133 + * + * # Get tzinfo of time + * cdef inline object time_tzinfo(object o): # <<<<<<<<<<<<<< + * if (o).hastzinfo: + * return (o).tzinfo + */ + +static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_time_tzinfo(PyObject *__pyx_v_o) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("time_tzinfo", 0); + + /* "cpython/datetime.pxd":134 + * # Get tzinfo of time + * cdef inline object time_tzinfo(object o): + * if (o).hastzinfo: # <<<<<<<<<<<<<< + * return (o).tzinfo + * else: + */ + if (((PyDateTime_Time *)__pyx_v_o)->hastzinfo) { + + /* "cpython/datetime.pxd":135 + * cdef inline object time_tzinfo(object o): + * if (o).hastzinfo: + * return (o).tzinfo # <<<<<<<<<<<<<< + * else: + * return None + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)((PyDateTime_Time *)__pyx_v_o)->tzinfo)); + __pyx_r = ((PyObject *)((PyDateTime_Time *)__pyx_v_o)->tzinfo); + goto __pyx_L0; + goto __pyx_L3; + } + /*else*/ { + + /* "cpython/datetime.pxd":137 + * return (o).tzinfo + * else: + * return None # <<<<<<<<<<<<<< + * + * # Get tzinfo of datetime + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + __pyx_L3:; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cpython/datetime.pxd":140 + * + * # Get tzinfo of datetime + * cdef inline object datetime_tzinfo(object o): # <<<<<<<<<<<<<< + * if (o).hastzinfo: + * return (o).tzinfo + */ + +static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_datetime_tzinfo(PyObject *__pyx_v_o) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("datetime_tzinfo", 0); + + /* "cpython/datetime.pxd":141 + * # Get tzinfo of datetime + * cdef inline object datetime_tzinfo(object o): + * if (o).hastzinfo: # <<<<<<<<<<<<<< + * return (o).tzinfo + * else: + */ + if (((PyDateTime_DateTime *)__pyx_v_o)->hastzinfo) { + + /* "cpython/datetime.pxd":142 + * cdef inline object datetime_tzinfo(object o): + * if (o).hastzinfo: + * return (o).tzinfo # <<<<<<<<<<<<<< + * else: + * return None + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)((PyDateTime_DateTime *)__pyx_v_o)->tzinfo)); + __pyx_r = ((PyObject *)((PyDateTime_DateTime *)__pyx_v_o)->tzinfo); + goto __pyx_L0; + goto __pyx_L3; + } + /*else*/ { + + /* "cpython/datetime.pxd":144 + * return (o).tzinfo + * else: + * return None # <<<<<<<<<<<<<< + * + * # Get year of date + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + __pyx_L3:; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cpython/datetime.pxd":147 + * + * # Get year of date + * cdef inline int date_year(object o): # <<<<<<<<<<<<<< + * return PyDateTime_GET_YEAR(o) + * + */ + +static CYTHON_INLINE int __pyx_f_7cpython_8datetime_date_year(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("date_year", 0); + + /* "cpython/datetime.pxd":148 + * # Get year of date + * cdef inline int date_year(object o): + * return PyDateTime_GET_YEAR(o) # <<<<<<<<<<<<<< + * + * # Get month of date + */ + __pyx_r = PyDateTime_GET_YEAR(__pyx_v_o); + goto __pyx_L0; + + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cpython/datetime.pxd":151 + * + * # Get month of date + * cdef inline int date_month(object o): # <<<<<<<<<<<<<< + * return PyDateTime_GET_MONTH(o) + * + */ + +static CYTHON_INLINE int __pyx_f_7cpython_8datetime_date_month(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("date_month", 0); + + /* "cpython/datetime.pxd":152 + * # Get month of date + * cdef inline int date_month(object o): + * return PyDateTime_GET_MONTH(o) # <<<<<<<<<<<<<< + * + * # Get day of date + */ + __pyx_r = PyDateTime_GET_MONTH(__pyx_v_o); + goto __pyx_L0; + + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cpython/datetime.pxd":155 + * + * # Get day of date + * cdef inline int date_day(object o): # <<<<<<<<<<<<<< + * return PyDateTime_GET_DAY(o) + * + */ + +static CYTHON_INLINE int __pyx_f_7cpython_8datetime_date_day(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("date_day", 0); + + /* "cpython/datetime.pxd":156 + * # Get day of date + * cdef inline int date_day(object o): + * return PyDateTime_GET_DAY(o) # <<<<<<<<<<<<<< + * + * # Get year of datetime + */ + __pyx_r = PyDateTime_GET_DAY(__pyx_v_o); + goto __pyx_L0; + + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cpython/datetime.pxd":159 + * + * # Get year of datetime + * cdef inline int datetime_year(object o): # <<<<<<<<<<<<<< + * return PyDateTime_GET_YEAR(o) + * + */ + +static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_year(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("datetime_year", 0); + + /* "cpython/datetime.pxd":160 + * # Get year of datetime + * cdef inline int datetime_year(object o): + * return PyDateTime_GET_YEAR(o) # <<<<<<<<<<<<<< + * + * # Get month of datetime + */ + __pyx_r = PyDateTime_GET_YEAR(__pyx_v_o); + goto __pyx_L0; + + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cpython/datetime.pxd":163 + * + * # Get month of datetime + * cdef inline int datetime_month(object o): # <<<<<<<<<<<<<< + * return PyDateTime_GET_MONTH(o) + * + */ + +static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_month(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("datetime_month", 0); + + /* "cpython/datetime.pxd":164 + * # Get month of datetime + * cdef inline int datetime_month(object o): + * return PyDateTime_GET_MONTH(o) # <<<<<<<<<<<<<< + * + * # Get day of datetime + */ + __pyx_r = PyDateTime_GET_MONTH(__pyx_v_o); + goto __pyx_L0; + + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cpython/datetime.pxd":167 + * + * # Get day of datetime + * cdef inline int datetime_day(object o): # <<<<<<<<<<<<<< + * return PyDateTime_GET_DAY(o) + * + */ + +static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_day(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("datetime_day", 0); + + /* "cpython/datetime.pxd":168 + * # Get day of datetime + * cdef inline int datetime_day(object o): + * return PyDateTime_GET_DAY(o) # <<<<<<<<<<<<<< + * + * # Get hour of time + */ + __pyx_r = PyDateTime_GET_DAY(__pyx_v_o); + goto __pyx_L0; + + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cpython/datetime.pxd":171 + * + * # Get hour of time + * cdef inline int time_hour(object o): # <<<<<<<<<<<<<< + * return PyDateTime_TIME_GET_HOUR(o) + * + */ + +static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_hour(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("time_hour", 0); + + /* "cpython/datetime.pxd":172 + * # Get hour of time + * cdef inline int time_hour(object o): + * return PyDateTime_TIME_GET_HOUR(o) # <<<<<<<<<<<<<< + * + * # Get minute of time + */ + __pyx_r = PyDateTime_TIME_GET_HOUR(__pyx_v_o); + goto __pyx_L0; + + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cpython/datetime.pxd":175 + * + * # Get minute of time + * cdef inline int time_minute(object o): # <<<<<<<<<<<<<< + * return PyDateTime_TIME_GET_MINUTE(o) + * + */ + +static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_minute(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("time_minute", 0); + + /* "cpython/datetime.pxd":176 + * # Get minute of time + * cdef inline int time_minute(object o): + * return PyDateTime_TIME_GET_MINUTE(o) # <<<<<<<<<<<<<< + * + * # Get second of time + */ + __pyx_r = PyDateTime_TIME_GET_MINUTE(__pyx_v_o); + goto __pyx_L0; + + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cpython/datetime.pxd":179 + * + * # Get second of time + * cdef inline int time_second(object o): # <<<<<<<<<<<<<< + * return PyDateTime_TIME_GET_SECOND(o) + * + */ + +static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_second(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("time_second", 0); + + /* "cpython/datetime.pxd":180 + * # Get second of time + * cdef inline int time_second(object o): + * return PyDateTime_TIME_GET_SECOND(o) # <<<<<<<<<<<<<< + * + * # Get microsecond of time + */ + __pyx_r = PyDateTime_TIME_GET_SECOND(__pyx_v_o); + goto __pyx_L0; + + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cpython/datetime.pxd":183 + * + * # Get microsecond of time + * cdef inline int time_microsecond(object o): # <<<<<<<<<<<<<< + * return PyDateTime_TIME_GET_MICROSECOND(o) + * + */ + +static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_microsecond(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("time_microsecond", 0); + + /* "cpython/datetime.pxd":184 + * # Get microsecond of time + * cdef inline int time_microsecond(object o): + * return PyDateTime_TIME_GET_MICROSECOND(o) # <<<<<<<<<<<<<< + * + * # Get hour of datetime + */ + __pyx_r = PyDateTime_TIME_GET_MICROSECOND(__pyx_v_o); + goto __pyx_L0; + + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cpython/datetime.pxd":187 + * + * # Get hour of datetime + * cdef inline int datetime_hour(object o): # <<<<<<<<<<<<<< + * return PyDateTime_DATE_GET_HOUR(o) + * + */ + +static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_hour(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("datetime_hour", 0); + + /* "cpython/datetime.pxd":188 + * # Get hour of datetime + * cdef inline int datetime_hour(object o): + * return PyDateTime_DATE_GET_HOUR(o) # <<<<<<<<<<<<<< + * + * # Get minute of datetime + */ + __pyx_r = PyDateTime_DATE_GET_HOUR(__pyx_v_o); + goto __pyx_L0; + + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cpython/datetime.pxd":191 + * + * # Get minute of datetime + * cdef inline int datetime_minute(object o): # <<<<<<<<<<<<<< + * return PyDateTime_DATE_GET_MINUTE(o) + * + */ + +static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_minute(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("datetime_minute", 0); + + /* "cpython/datetime.pxd":192 + * # Get minute of datetime + * cdef inline int datetime_minute(object o): + * return PyDateTime_DATE_GET_MINUTE(o) # <<<<<<<<<<<<<< + * + * # Get second of datetime + */ + __pyx_r = PyDateTime_DATE_GET_MINUTE(__pyx_v_o); + goto __pyx_L0; + + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cpython/datetime.pxd":195 + * + * # Get second of datetime + * cdef inline int datetime_second(object o): # <<<<<<<<<<<<<< + * return PyDateTime_DATE_GET_SECOND(o) + * + */ + +static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_second(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("datetime_second", 0); + + /* "cpython/datetime.pxd":196 + * # Get second of datetime + * cdef inline int datetime_second(object o): + * return PyDateTime_DATE_GET_SECOND(o) # <<<<<<<<<<<<<< + * + * # Get microsecond of datetime + */ + __pyx_r = PyDateTime_DATE_GET_SECOND(__pyx_v_o); + goto __pyx_L0; + + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cpython/datetime.pxd":199 + * + * # Get microsecond of datetime + * cdef inline int datetime_microsecond(object o): # <<<<<<<<<<<<<< + * return PyDateTime_DATE_GET_MICROSECOND(o) + * + */ + +static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_microsecond(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("datetime_microsecond", 0); + + /* "cpython/datetime.pxd":200 + * # Get microsecond of datetime + * cdef inline int datetime_microsecond(object o): + * return PyDateTime_DATE_GET_MICROSECOND(o) # <<<<<<<<<<<<<< + * + * # Get days of timedelta + */ + __pyx_r = PyDateTime_DATE_GET_MICROSECOND(__pyx_v_o); + goto __pyx_L0; + + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cpython/datetime.pxd":203 + * + * # Get days of timedelta + * cdef inline int timedelta_days(object o): # <<<<<<<<<<<<<< + * return (o).days + * + */ + +static CYTHON_INLINE int __pyx_f_7cpython_8datetime_timedelta_days(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("timedelta_days", 0); + + /* "cpython/datetime.pxd":204 + * # Get days of timedelta + * cdef inline int timedelta_days(object o): + * return (o).days # <<<<<<<<<<<<<< + * + * # Get seconds of timedelta + */ + __pyx_r = ((PyDateTime_Delta *)__pyx_v_o)->days; + goto __pyx_L0; + + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cpython/datetime.pxd":207 + * + * # Get seconds of timedelta + * cdef inline int timedelta_seconds(object o): # <<<<<<<<<<<<<< + * return (o).seconds + * + */ + +static CYTHON_INLINE int __pyx_f_7cpython_8datetime_timedelta_seconds(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("timedelta_seconds", 0); + + /* "cpython/datetime.pxd":208 + * # Get seconds of timedelta + * cdef inline int timedelta_seconds(object o): + * return (o).seconds # <<<<<<<<<<<<<< + * + * # Get microseconds of timedelta + */ + __pyx_r = ((PyDateTime_Delta *)__pyx_v_o)->seconds; + goto __pyx_L0; + + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cpython/datetime.pxd":211 + * + * # Get microseconds of timedelta + * cdef inline int timedelta_microseconds(object o): # <<<<<<<<<<<<<< + * return (o).microseconds + */ + +static CYTHON_INLINE int __pyx_f_7cpython_8datetime_timedelta_microseconds(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("timedelta_microseconds", 0); + + /* "cpython/datetime.pxd":212 + * # Get microseconds of timedelta + * cdef inline int timedelta_microseconds(object o): + * return (o).microseconds # <<<<<<<<<<<<<< + */ + __pyx_r = ((PyDateTime_Delta *)__pyx_v_o)->microseconds; + goto __pyx_L0; + + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_tp_new_16_hyperdex_client_Deferred(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_16_hyperdex_client_Deferred *p; + PyObject *o; + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_16_hyperdex_client_Deferred *)o); + p->_client = ((struct __pyx_obj_16_hyperdex_client_Client *)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_16_hyperdex_client_8Deferred_1__cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_16_hyperdex_client_Deferred(PyObject *o) { + struct __pyx_obj_16_hyperdex_client_Deferred *p = (struct __pyx_obj_16_hyperdex_client_Deferred *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->_client); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_16_hyperdex_client_Deferred(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_16_hyperdex_client_Deferred *p = (struct __pyx_obj_16_hyperdex_client_Deferred *)o; + if (p->_client) { + e = (*v)(((PyObject*)p->_client), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_16_hyperdex_client_Deferred(PyObject *o) { + struct __pyx_obj_16_hyperdex_client_Deferred *p = (struct __pyx_obj_16_hyperdex_client_Deferred *)o; + PyObject* tmp; + tmp = ((PyObject*)p->_client); + p->_client = ((struct __pyx_obj_16_hyperdex_client_Client *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_16_hyperdex_client_Deferred[] = { + {__Pyx_NAMESTR("_callback"), (PyCFunction)__pyx_pw_16_hyperdex_client_8Deferred_3_callback, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("wait"), (PyCFunction)__pyx_pw_16_hyperdex_client_8Deferred_5wait, METH_NOARGS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_Deferred = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + 0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + #if PY_VERSION_HEX >= 0x02050000 + 0, /*nb_index*/ + #endif +}; + +static PySequenceMethods __pyx_tp_as_sequence_Deferred = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_Deferred = { + 0, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_Deferred = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_getbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_releasebuffer*/ + #endif +}; + +static PyTypeObject __pyx_type_16_hyperdex_client_Deferred = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("_hyperdex_client.Deferred"), /*tp_name*/ + sizeof(struct __pyx_obj_16_hyperdex_client_Deferred), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_16_hyperdex_client_Deferred, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + &__pyx_tp_as_number_Deferred, /*tp_as_number*/ + &__pyx_tp_as_sequence_Deferred, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_Deferred, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_Deferred, /*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*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_16_hyperdex_client_Deferred, /*tp_traverse*/ + __pyx_tp_clear_16_hyperdex_client_Deferred, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_16_hyperdex_client_Deferred, /*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_16_hyperdex_client_Deferred, /*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*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif +}; + +static PyObject *__pyx_tp_new_16_hyperdex_client_DeferredGet(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_16_hyperdex_client_DeferredGet *p; + PyObject *o = __pyx_tp_new_16_hyperdex_client_Deferred(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_16_hyperdex_client_DeferredGet *)o); + p->_space = ((PyObject*)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_16_hyperdex_client_11DeferredGet_1__cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_16_hyperdex_client_DeferredGet(PyObject *o) { + struct __pyx_obj_16_hyperdex_client_DeferredGet *p = (struct __pyx_obj_16_hyperdex_client_DeferredGet *)o; + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_16_hyperdex_client_11DeferredGet_3__dealloc__(o); + if (PyErr_Occurred()) PyErr_WriteUnraisable(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->_space); + PyObject_GC_Track(o); + __pyx_tp_dealloc_16_hyperdex_client_Deferred(o); +} + +static int __pyx_tp_traverse_16_hyperdex_client_DeferredGet(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_16_hyperdex_client_DeferredGet *p = (struct __pyx_obj_16_hyperdex_client_DeferredGet *)o; + e = __pyx_tp_traverse_16_hyperdex_client_Deferred(o, v, a); if (e) return e; + if (p->_space) { + e = (*v)(p->_space, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_16_hyperdex_client_DeferredGet(PyObject *o) { + struct __pyx_obj_16_hyperdex_client_DeferredGet *p = (struct __pyx_obj_16_hyperdex_client_DeferredGet *)o; + PyObject* tmp; + __pyx_tp_clear_16_hyperdex_client_Deferred(o); + tmp = ((PyObject*)p->_space); + p->_space = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_16_hyperdex_client_DeferredGet[] = { + {__Pyx_NAMESTR("wait"), (PyCFunction)__pyx_pw_16_hyperdex_client_11DeferredGet_5wait, METH_NOARGS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_DeferredGet = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + 0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + #if PY_VERSION_HEX >= 0x02050000 + 0, /*nb_index*/ + #endif +}; + +static PySequenceMethods __pyx_tp_as_sequence_DeferredGet = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_DeferredGet = { + 0, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_DeferredGet = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_getbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_releasebuffer*/ + #endif +}; + +static PyTypeObject __pyx_type_16_hyperdex_client_DeferredGet = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("_hyperdex_client.DeferredGet"), /*tp_name*/ + sizeof(struct __pyx_obj_16_hyperdex_client_DeferredGet), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_16_hyperdex_client_DeferredGet, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + &__pyx_tp_as_number_DeferredGet, /*tp_as_number*/ + &__pyx_tp_as_sequence_DeferredGet, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_DeferredGet, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_DeferredGet, /*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*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_16_hyperdex_client_DeferredGet, /*tp_traverse*/ + __pyx_tp_clear_16_hyperdex_client_DeferredGet, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_16_hyperdex_client_DeferredGet, /*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_16_hyperdex_client_DeferredGet, /*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*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif +}; +static struct __pyx_vtabstruct_16_hyperdex_client_DeferredFromAttrs __pyx_vtable_16_hyperdex_client_DeferredFromAttrs; + +static PyObject *__pyx_tp_new_16_hyperdex_client_DeferredFromAttrs(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *p; + PyObject *o = __pyx_tp_new_16_hyperdex_client_Deferred(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *)o); + p->__pyx_vtab = __pyx_vtabptr_16_hyperdex_client_DeferredFromAttrs; + if (unlikely(__pyx_pw_16_hyperdex_client_17DeferredFromAttrs_1__cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static PyMethodDef __pyx_methods_16_hyperdex_client_DeferredFromAttrs[] = { + {__Pyx_NAMESTR("wait"), (PyCFunction)__pyx_pw_16_hyperdex_client_17DeferredFromAttrs_3wait, METH_NOARGS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_DeferredFromAttrs = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + 0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + #if PY_VERSION_HEX >= 0x02050000 + 0, /*nb_index*/ + #endif +}; + +static PySequenceMethods __pyx_tp_as_sequence_DeferredFromAttrs = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_DeferredFromAttrs = { + 0, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_DeferredFromAttrs = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_getbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_releasebuffer*/ + #endif +}; + +static PyTypeObject __pyx_type_16_hyperdex_client_DeferredFromAttrs = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("_hyperdex_client.DeferredFromAttrs"), /*tp_name*/ + sizeof(struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_16_hyperdex_client_Deferred, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + &__pyx_tp_as_number_DeferredFromAttrs, /*tp_as_number*/ + &__pyx_tp_as_sequence_DeferredFromAttrs, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_DeferredFromAttrs, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_DeferredFromAttrs, /*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*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_16_hyperdex_client_Deferred, /*tp_traverse*/ + __pyx_tp_clear_16_hyperdex_client_Deferred, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_16_hyperdex_client_DeferredFromAttrs, /*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_16_hyperdex_client_DeferredFromAttrs, /*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*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif +}; +static struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondFromAttrs __pyx_vtable_16_hyperdex_client_DeferredCondFromAttrs; + +static PyObject *__pyx_tp_new_16_hyperdex_client_DeferredCondFromAttrs(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *p; + PyObject *o = __pyx_tp_new_16_hyperdex_client_Deferred(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *)o); + p->__pyx_vtab = __pyx_vtabptr_16_hyperdex_client_DeferredCondFromAttrs; + if (unlikely(__pyx_pw_16_hyperdex_client_21DeferredCondFromAttrs_1__cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static PyMethodDef __pyx_methods_16_hyperdex_client_DeferredCondFromAttrs[] = { + {__Pyx_NAMESTR("wait"), (PyCFunction)__pyx_pw_16_hyperdex_client_21DeferredCondFromAttrs_3wait, METH_NOARGS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_DeferredCondFromAttrs = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + 0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + #if PY_VERSION_HEX >= 0x02050000 + 0, /*nb_index*/ + #endif +}; + +static PySequenceMethods __pyx_tp_as_sequence_DeferredCondFromAttrs = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_DeferredCondFromAttrs = { + 0, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_DeferredCondFromAttrs = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_getbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_releasebuffer*/ + #endif +}; + +static PyTypeObject __pyx_type_16_hyperdex_client_DeferredCondFromAttrs = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("_hyperdex_client.DeferredCondFromAttrs"), /*tp_name*/ + sizeof(struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_16_hyperdex_client_Deferred, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + &__pyx_tp_as_number_DeferredCondFromAttrs, /*tp_as_number*/ + &__pyx_tp_as_sequence_DeferredCondFromAttrs, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_DeferredCondFromAttrs, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_DeferredCondFromAttrs, /*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*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_16_hyperdex_client_Deferred, /*tp_traverse*/ + __pyx_tp_clear_16_hyperdex_client_Deferred, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_16_hyperdex_client_DeferredCondFromAttrs, /*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_16_hyperdex_client_DeferredCondFromAttrs, /*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*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif +}; + +static PyObject *__pyx_tp_new_16_hyperdex_client_DeferredDelete(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_16_hyperdex_client_Deferred(t, a, k); + if (unlikely(!o)) return 0; + if (unlikely(__pyx_pw_16_hyperdex_client_14DeferredDelete_1__cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static PyMethodDef __pyx_methods_16_hyperdex_client_DeferredDelete[] = { + {__Pyx_NAMESTR("wait"), (PyCFunction)__pyx_pw_16_hyperdex_client_14DeferredDelete_3wait, METH_NOARGS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_DeferredDelete = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + 0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + #if PY_VERSION_HEX >= 0x02050000 + 0, /*nb_index*/ + #endif +}; + +static PySequenceMethods __pyx_tp_as_sequence_DeferredDelete = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_DeferredDelete = { + 0, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_DeferredDelete = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_getbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_releasebuffer*/ + #endif +}; + +static PyTypeObject __pyx_type_16_hyperdex_client_DeferredDelete = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("_hyperdex_client.DeferredDelete"), /*tp_name*/ + sizeof(struct __pyx_obj_16_hyperdex_client_DeferredDelete), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_16_hyperdex_client_Deferred, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + &__pyx_tp_as_number_DeferredDelete, /*tp_as_number*/ + &__pyx_tp_as_sequence_DeferredDelete, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_DeferredDelete, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_DeferredDelete, /*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*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_16_hyperdex_client_Deferred, /*tp_traverse*/ + __pyx_tp_clear_16_hyperdex_client_Deferred, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_16_hyperdex_client_DeferredDelete, /*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_16_hyperdex_client_DeferredDelete, /*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*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif +}; + +static PyObject *__pyx_tp_new_16_hyperdex_client_DeferredCondDelete(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_16_hyperdex_client_Deferred(t, a, k); + if (unlikely(!o)) return 0; + if (unlikely(__pyx_pw_16_hyperdex_client_18DeferredCondDelete_1__cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static PyMethodDef __pyx_methods_16_hyperdex_client_DeferredCondDelete[] = { + {__Pyx_NAMESTR("wait"), (PyCFunction)__pyx_pw_16_hyperdex_client_18DeferredCondDelete_3wait, METH_NOARGS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_DeferredCondDelete = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + 0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + #if PY_VERSION_HEX >= 0x02050000 + 0, /*nb_index*/ + #endif +}; + +static PySequenceMethods __pyx_tp_as_sequence_DeferredCondDelete = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_DeferredCondDelete = { + 0, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_DeferredCondDelete = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_getbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_releasebuffer*/ + #endif +}; + +static PyTypeObject __pyx_type_16_hyperdex_client_DeferredCondDelete = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("_hyperdex_client.DeferredCondDelete"), /*tp_name*/ + sizeof(struct __pyx_obj_16_hyperdex_client_DeferredCondDelete), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_16_hyperdex_client_Deferred, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + &__pyx_tp_as_number_DeferredCondDelete, /*tp_as_number*/ + &__pyx_tp_as_sequence_DeferredCondDelete, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_DeferredCondDelete, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_DeferredCondDelete, /*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*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_16_hyperdex_client_Deferred, /*tp_traverse*/ + __pyx_tp_clear_16_hyperdex_client_Deferred, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_16_hyperdex_client_DeferredCondDelete, /*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_16_hyperdex_client_DeferredCondDelete, /*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*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif +}; +static struct __pyx_vtabstruct_16_hyperdex_client_DeferredMapOp __pyx_vtable_16_hyperdex_client_DeferredMapOp; + +static PyObject *__pyx_tp_new_16_hyperdex_client_DeferredMapOp(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_16_hyperdex_client_DeferredMapOp *p; + PyObject *o = __pyx_tp_new_16_hyperdex_client_Deferred(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_16_hyperdex_client_DeferredMapOp *)o); + p->__pyx_vtab = __pyx_vtabptr_16_hyperdex_client_DeferredMapOp; + if (unlikely(__pyx_pw_16_hyperdex_client_13DeferredMapOp_1__cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static PyMethodDef __pyx_methods_16_hyperdex_client_DeferredMapOp[] = { + {__Pyx_NAMESTR("wait"), (PyCFunction)__pyx_pw_16_hyperdex_client_13DeferredMapOp_3wait, METH_NOARGS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_DeferredMapOp = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + 0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + #if PY_VERSION_HEX >= 0x02050000 + 0, /*nb_index*/ + #endif +}; + +static PySequenceMethods __pyx_tp_as_sequence_DeferredMapOp = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_DeferredMapOp = { + 0, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_DeferredMapOp = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_getbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_releasebuffer*/ + #endif +}; + +static PyTypeObject __pyx_type_16_hyperdex_client_DeferredMapOp = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("_hyperdex_client.DeferredMapOp"), /*tp_name*/ + sizeof(struct __pyx_obj_16_hyperdex_client_DeferredMapOp), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_16_hyperdex_client_Deferred, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + &__pyx_tp_as_number_DeferredMapOp, /*tp_as_number*/ + &__pyx_tp_as_sequence_DeferredMapOp, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_DeferredMapOp, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_DeferredMapOp, /*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*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_16_hyperdex_client_Deferred, /*tp_traverse*/ + __pyx_tp_clear_16_hyperdex_client_Deferred, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_16_hyperdex_client_DeferredMapOp, /*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_16_hyperdex_client_DeferredMapOp, /*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*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif +}; +static struct __pyx_vtabstruct_16_hyperdex_client_DeferredCondMapOp __pyx_vtable_16_hyperdex_client_DeferredCondMapOp; + +static PyObject *__pyx_tp_new_16_hyperdex_client_DeferredCondMapOp(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_16_hyperdex_client_DeferredCondMapOp *p; + PyObject *o = __pyx_tp_new_16_hyperdex_client_Deferred(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_16_hyperdex_client_DeferredCondMapOp *)o); + p->__pyx_vtab = __pyx_vtabptr_16_hyperdex_client_DeferredCondMapOp; + if (unlikely(__pyx_pw_16_hyperdex_client_17DeferredCondMapOp_1__cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static PyMethodDef __pyx_methods_16_hyperdex_client_DeferredCondMapOp[] = { + {__Pyx_NAMESTR("wait"), (PyCFunction)__pyx_pw_16_hyperdex_client_17DeferredCondMapOp_3wait, METH_NOARGS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_DeferredCondMapOp = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + 0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + #if PY_VERSION_HEX >= 0x02050000 + 0, /*nb_index*/ + #endif +}; + +static PySequenceMethods __pyx_tp_as_sequence_DeferredCondMapOp = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_DeferredCondMapOp = { + 0, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_DeferredCondMapOp = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_getbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_releasebuffer*/ + #endif +}; + +static PyTypeObject __pyx_type_16_hyperdex_client_DeferredCondMapOp = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("_hyperdex_client.DeferredCondMapOp"), /*tp_name*/ + sizeof(struct __pyx_obj_16_hyperdex_client_DeferredCondMapOp), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_16_hyperdex_client_Deferred, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + &__pyx_tp_as_number_DeferredCondMapOp, /*tp_as_number*/ + &__pyx_tp_as_sequence_DeferredCondMapOp, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_DeferredCondMapOp, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_DeferredCondMapOp, /*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*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_16_hyperdex_client_Deferred, /*tp_traverse*/ + __pyx_tp_clear_16_hyperdex_client_Deferred, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_16_hyperdex_client_DeferredCondMapOp, /*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_16_hyperdex_client_DeferredCondMapOp, /*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*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif +}; + +static PyObject *__pyx_tp_new_16_hyperdex_client_DeferredGroupDel(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_16_hyperdex_client_Deferred(t, a, k); + if (unlikely(!o)) return 0; + if (unlikely(__pyx_pw_16_hyperdex_client_16DeferredGroupDel_1__cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static PyMethodDef __pyx_methods_16_hyperdex_client_DeferredGroupDel[] = { + {__Pyx_NAMESTR("wait"), (PyCFunction)__pyx_pw_16_hyperdex_client_16DeferredGroupDel_3wait, METH_NOARGS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_DeferredGroupDel = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + 0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + #if PY_VERSION_HEX >= 0x02050000 + 0, /*nb_index*/ + #endif +}; + +static PySequenceMethods __pyx_tp_as_sequence_DeferredGroupDel = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_DeferredGroupDel = { + 0, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_DeferredGroupDel = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_getbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_releasebuffer*/ + #endif +}; + +static PyTypeObject __pyx_type_16_hyperdex_client_DeferredGroupDel = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("_hyperdex_client.DeferredGroupDel"), /*tp_name*/ + sizeof(struct __pyx_obj_16_hyperdex_client_DeferredGroupDel), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_16_hyperdex_client_Deferred, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + &__pyx_tp_as_number_DeferredGroupDel, /*tp_as_number*/ + &__pyx_tp_as_sequence_DeferredGroupDel, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_DeferredGroupDel, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_DeferredGroupDel, /*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*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_16_hyperdex_client_Deferred, /*tp_traverse*/ + __pyx_tp_clear_16_hyperdex_client_Deferred, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_16_hyperdex_client_DeferredGroupDel, /*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_16_hyperdex_client_DeferredGroupDel, /*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*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif +}; + +static PyObject *__pyx_tp_new_16_hyperdex_client_DeferredSearchDescribe(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_16_hyperdex_client_Deferred(t, a, k); + if (unlikely(!o)) return 0; + if (unlikely(__pyx_pw_16_hyperdex_client_22DeferredSearchDescribe_1__cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static PyMethodDef __pyx_methods_16_hyperdex_client_DeferredSearchDescribe[] = { + {__Pyx_NAMESTR("wait"), (PyCFunction)__pyx_pw_16_hyperdex_client_22DeferredSearchDescribe_3wait, METH_NOARGS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_DeferredSearchDescribe = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + 0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + #if PY_VERSION_HEX >= 0x02050000 + 0, /*nb_index*/ + #endif +}; + +static PySequenceMethods __pyx_tp_as_sequence_DeferredSearchDescribe = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_DeferredSearchDescribe = { + 0, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_DeferredSearchDescribe = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_getbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_releasebuffer*/ + #endif +}; + +static PyTypeObject __pyx_type_16_hyperdex_client_DeferredSearchDescribe = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("_hyperdex_client.DeferredSearchDescribe"), /*tp_name*/ + sizeof(struct __pyx_obj_16_hyperdex_client_DeferredSearchDescribe), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_16_hyperdex_client_Deferred, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + &__pyx_tp_as_number_DeferredSearchDescribe, /*tp_as_number*/ + &__pyx_tp_as_sequence_DeferredSearchDescribe, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_DeferredSearchDescribe, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_DeferredSearchDescribe, /*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*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_16_hyperdex_client_Deferred, /*tp_traverse*/ + __pyx_tp_clear_16_hyperdex_client_Deferred, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_16_hyperdex_client_DeferredSearchDescribe, /*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_16_hyperdex_client_DeferredSearchDescribe, /*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*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif +}; + +static PyObject *__pyx_tp_new_16_hyperdex_client_DeferredCount(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_16_hyperdex_client_Deferred(t, a, k); + if (unlikely(!o)) return 0; + if (unlikely(__pyx_pw_16_hyperdex_client_13DeferredCount_1__cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static PyMethodDef __pyx_methods_16_hyperdex_client_DeferredCount[] = { + {__Pyx_NAMESTR("wait"), (PyCFunction)__pyx_pw_16_hyperdex_client_13DeferredCount_3wait, METH_NOARGS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_DeferredCount = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + 0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + #if PY_VERSION_HEX >= 0x02050000 + 0, /*nb_index*/ + #endif +}; + +static PySequenceMethods __pyx_tp_as_sequence_DeferredCount = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_DeferredCount = { + 0, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_DeferredCount = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_getbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_releasebuffer*/ + #endif +}; + +static PyTypeObject __pyx_type_16_hyperdex_client_DeferredCount = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("_hyperdex_client.DeferredCount"), /*tp_name*/ + sizeof(struct __pyx_obj_16_hyperdex_client_DeferredCount), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_16_hyperdex_client_Deferred, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + &__pyx_tp_as_number_DeferredCount, /*tp_as_number*/ + &__pyx_tp_as_sequence_DeferredCount, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_DeferredCount, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_DeferredCount, /*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*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_16_hyperdex_client_Deferred, /*tp_traverse*/ + __pyx_tp_clear_16_hyperdex_client_Deferred, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_16_hyperdex_client_DeferredCount, /*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_16_hyperdex_client_DeferredCount, /*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*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif +}; + +static PyObject *__pyx_tp_new_16_hyperdex_client_SearchBase(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_16_hyperdex_client_SearchBase *p; + PyObject *o; + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_16_hyperdex_client_SearchBase *)o); + p->_client = ((struct __pyx_obj_16_hyperdex_client_Client *)Py_None); Py_INCREF(Py_None); + p->_backlogged = ((PyObject*)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_16_hyperdex_client_10SearchBase_1__cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_16_hyperdex_client_SearchBase(PyObject *o) { + struct __pyx_obj_16_hyperdex_client_SearchBase *p = (struct __pyx_obj_16_hyperdex_client_SearchBase *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->_client); + Py_CLEAR(p->_backlogged); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_16_hyperdex_client_SearchBase(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_16_hyperdex_client_SearchBase *p = (struct __pyx_obj_16_hyperdex_client_SearchBase *)o; + if (p->_client) { + e = (*v)(((PyObject*)p->_client), a); if (e) return e; + } + if (p->_backlogged) { + e = (*v)(p->_backlogged, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_16_hyperdex_client_SearchBase(PyObject *o) { + struct __pyx_obj_16_hyperdex_client_SearchBase *p = (struct __pyx_obj_16_hyperdex_client_SearchBase *)o; + PyObject* tmp; + tmp = ((PyObject*)p->_client); + p->_client = ((struct __pyx_obj_16_hyperdex_client_Client *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_backlogged); + p->_backlogged = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_16_hyperdex_client_SearchBase[] = { + {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_16_hyperdex_client_10SearchBase_5__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("_callback"), (PyCFunction)__pyx_pw_16_hyperdex_client_10SearchBase_7_callback, METH_NOARGS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_SearchBase = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + 0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + #if PY_VERSION_HEX >= 0x02050000 + 0, /*nb_index*/ + #endif +}; + +static PySequenceMethods __pyx_tp_as_sequence_SearchBase = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_SearchBase = { + 0, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_SearchBase = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_getbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_releasebuffer*/ + #endif +}; + +static PyTypeObject __pyx_type_16_hyperdex_client_SearchBase = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("_hyperdex_client.SearchBase"), /*tp_name*/ + sizeof(struct __pyx_obj_16_hyperdex_client_SearchBase), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_16_hyperdex_client_SearchBase, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + &__pyx_tp_as_number_SearchBase, /*tp_as_number*/ + &__pyx_tp_as_sequence_SearchBase, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_SearchBase, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_SearchBase, /*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*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_16_hyperdex_client_SearchBase, /*tp_traverse*/ + __pyx_tp_clear_16_hyperdex_client_SearchBase, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + __pyx_pw_16_hyperdex_client_10SearchBase_3__iter__, /*tp_iter*/ + __pyx_pw_16_hyperdex_client_10SearchBase_5__next__, /*tp_iternext*/ + __pyx_methods_16_hyperdex_client_SearchBase, /*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_16_hyperdex_client_SearchBase, /*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*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif +}; + +static PyObject *__pyx_tp_new_16_hyperdex_client_Search(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_16_hyperdex_client_SearchBase(t, a, k); + if (unlikely(!o)) return 0; + if (unlikely(__pyx_pw_16_hyperdex_client_6Search_1__cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static PyMethodDef __pyx_methods_16_hyperdex_client_Search[] = { + {0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_Search = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + 0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + #if PY_VERSION_HEX >= 0x02050000 + 0, /*nb_index*/ + #endif +}; + +static PySequenceMethods __pyx_tp_as_sequence_Search = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_Search = { + 0, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_Search = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_getbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_releasebuffer*/ + #endif +}; + +static PyTypeObject __pyx_type_16_hyperdex_client_Search = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("_hyperdex_client.Search"), /*tp_name*/ + sizeof(struct __pyx_obj_16_hyperdex_client_Search), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_16_hyperdex_client_SearchBase, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + &__pyx_tp_as_number_Search, /*tp_as_number*/ + &__pyx_tp_as_sequence_Search, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_Search, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_Search, /*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*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_16_hyperdex_client_SearchBase, /*tp_traverse*/ + __pyx_tp_clear_16_hyperdex_client_SearchBase, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_16_hyperdex_client_10SearchBase_3__iter__, /*tp_iter*/ + #else + 0, /*tp_iter*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_16_hyperdex_client_10SearchBase_5__next__, /*tp_iternext*/ + #else + 0, /*tp_iternext*/ + #endif + __pyx_methods_16_hyperdex_client_Search, /*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_16_hyperdex_client_Search, /*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*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif +}; + +static PyObject *__pyx_tp_new_16_hyperdex_client_SortedSearch(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_16_hyperdex_client_SearchBase(t, a, k); + if (unlikely(!o)) return 0; + if (unlikely(__pyx_pw_16_hyperdex_client_12SortedSearch_1__cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static PyMethodDef __pyx_methods_16_hyperdex_client_SortedSearch[] = { + {0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_SortedSearch = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + 0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + #if PY_VERSION_HEX >= 0x02050000 + 0, /*nb_index*/ + #endif +}; + +static PySequenceMethods __pyx_tp_as_sequence_SortedSearch = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_SortedSearch = { + 0, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_SortedSearch = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_getbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_releasebuffer*/ + #endif +}; + +static PyTypeObject __pyx_type_16_hyperdex_client_SortedSearch = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("_hyperdex_client.SortedSearch"), /*tp_name*/ + sizeof(struct __pyx_obj_16_hyperdex_client_SortedSearch), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_16_hyperdex_client_SearchBase, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + &__pyx_tp_as_number_SortedSearch, /*tp_as_number*/ + &__pyx_tp_as_sequence_SortedSearch, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_SortedSearch, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_SortedSearch, /*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*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_16_hyperdex_client_SearchBase, /*tp_traverse*/ + __pyx_tp_clear_16_hyperdex_client_SearchBase, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_16_hyperdex_client_10SearchBase_3__iter__, /*tp_iter*/ + #else + 0, /*tp_iter*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_16_hyperdex_client_10SearchBase_5__next__, /*tp_iternext*/ + #else + 0, /*tp_iternext*/ + #endif + __pyx_methods_16_hyperdex_client_SortedSearch, /*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_16_hyperdex_client_SortedSearch, /*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*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif +}; + +static PyObject *__pyx_tp_new_16_hyperdex_client_Predicate(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_16_hyperdex_client_Predicate *p; + PyObject *o; + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_16_hyperdex_client_Predicate *)o); + p->_raw_check = ((PyObject*)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_16_hyperdex_client_Predicate(PyObject *o) { + struct __pyx_obj_16_hyperdex_client_Predicate *p = (struct __pyx_obj_16_hyperdex_client_Predicate *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->_raw_check); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_16_hyperdex_client_Predicate(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_16_hyperdex_client_Predicate *p = (struct __pyx_obj_16_hyperdex_client_Predicate *)o; + if (p->_raw_check) { + e = (*v)(p->_raw_check, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_16_hyperdex_client_Predicate(PyObject *o) { + struct __pyx_obj_16_hyperdex_client_Predicate *p = (struct __pyx_obj_16_hyperdex_client_Predicate *)o; + PyObject* tmp; + tmp = ((PyObject*)p->_raw_check); + p->_raw_check = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_16_hyperdex_client_Predicate[] = { + {__Pyx_NAMESTR("_raw"), (PyCFunction)__pyx_pw_16_hyperdex_client_9Predicate_3_raw, METH_O, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_Predicate = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + 0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + #if PY_VERSION_HEX >= 0x02050000 + 0, /*nb_index*/ + #endif +}; + +static PySequenceMethods __pyx_tp_as_sequence_Predicate = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_Predicate = { + 0, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_Predicate = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_getbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_releasebuffer*/ + #endif +}; + +static PyTypeObject __pyx_type_16_hyperdex_client_Predicate = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("_hyperdex_client.Predicate"), /*tp_name*/ + sizeof(struct __pyx_obj_16_hyperdex_client_Predicate), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_16_hyperdex_client_Predicate, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + &__pyx_tp_as_number_Predicate, /*tp_as_number*/ + &__pyx_tp_as_sequence_Predicate, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_Predicate, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_Predicate, /*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*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_16_hyperdex_client_Predicate, /*tp_traverse*/ + __pyx_tp_clear_16_hyperdex_client_Predicate, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_16_hyperdex_client_Predicate, /*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*/ + __pyx_pw_16_hyperdex_client_9Predicate_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_16_hyperdex_client_Predicate, /*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*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif +}; + +static PyObject *__pyx_tp_new_16_hyperdex_client_Range(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_16_hyperdex_client_Predicate(t, a, k); + if (unlikely(!o)) return 0; + return o; +} + +static PyMethodDef __pyx_methods_16_hyperdex_client_Range[] = { + {0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_Range = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + 0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + #if PY_VERSION_HEX >= 0x02050000 + 0, /*nb_index*/ + #endif +}; + +static PySequenceMethods __pyx_tp_as_sequence_Range = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_Range = { + 0, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_Range = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_getbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_releasebuffer*/ + #endif +}; + +static PyTypeObject __pyx_type_16_hyperdex_client_Range = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("_hyperdex_client.Range"), /*tp_name*/ + sizeof(struct __pyx_obj_16_hyperdex_client_Range), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_16_hyperdex_client_Predicate, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + &__pyx_tp_as_number_Range, /*tp_as_number*/ + &__pyx_tp_as_sequence_Range, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_Range, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_Range, /*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*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_16_hyperdex_client_Predicate, /*tp_traverse*/ + __pyx_tp_clear_16_hyperdex_client_Predicate, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_16_hyperdex_client_Range, /*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*/ + __pyx_pw_16_hyperdex_client_5Range_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_16_hyperdex_client_Range, /*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*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif +}; + +static PyObject *__pyx_tp_new_16_hyperdex_client_Contains(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_16_hyperdex_client_Predicate(t, a, k); + if (unlikely(!o)) return 0; + return o; +} + +static PyMethodDef __pyx_methods_16_hyperdex_client_Contains[] = { + {0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_Contains = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + 0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + #if PY_VERSION_HEX >= 0x02050000 + 0, /*nb_index*/ + #endif +}; + +static PySequenceMethods __pyx_tp_as_sequence_Contains = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_Contains = { + 0, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_Contains = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_getbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_releasebuffer*/ + #endif +}; + +static PyTypeObject __pyx_type_16_hyperdex_client_Contains = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("_hyperdex_client.Contains"), /*tp_name*/ + sizeof(struct __pyx_obj_16_hyperdex_client_Contains), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_16_hyperdex_client_Predicate, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + &__pyx_tp_as_number_Contains, /*tp_as_number*/ + &__pyx_tp_as_sequence_Contains, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_Contains, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_Contains, /*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*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_16_hyperdex_client_Predicate, /*tp_traverse*/ + __pyx_tp_clear_16_hyperdex_client_Predicate, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_16_hyperdex_client_Contains, /*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*/ + __pyx_pw_16_hyperdex_client_8Contains_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_16_hyperdex_client_Contains, /*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*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif +}; + +static PyObject *__pyx_tp_new_16_hyperdex_client_LessEqual(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_16_hyperdex_client_Predicate(t, a, k); + if (unlikely(!o)) return 0; + return o; +} + +static PyMethodDef __pyx_methods_16_hyperdex_client_LessEqual[] = { + {0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_LessEqual = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + 0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + #if PY_VERSION_HEX >= 0x02050000 + 0, /*nb_index*/ + #endif +}; + +static PySequenceMethods __pyx_tp_as_sequence_LessEqual = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_LessEqual = { + 0, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_LessEqual = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_getbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_releasebuffer*/ + #endif +}; + +static PyTypeObject __pyx_type_16_hyperdex_client_LessEqual = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("_hyperdex_client.LessEqual"), /*tp_name*/ + sizeof(struct __pyx_obj_16_hyperdex_client_LessEqual), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_16_hyperdex_client_Predicate, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + &__pyx_tp_as_number_LessEqual, /*tp_as_number*/ + &__pyx_tp_as_sequence_LessEqual, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_LessEqual, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_LessEqual, /*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*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_16_hyperdex_client_Predicate, /*tp_traverse*/ + __pyx_tp_clear_16_hyperdex_client_Predicate, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_16_hyperdex_client_LessEqual, /*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*/ + __pyx_pw_16_hyperdex_client_9LessEqual_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_16_hyperdex_client_LessEqual, /*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*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif +}; + +static PyObject *__pyx_tp_new_16_hyperdex_client_GreaterEqual(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_16_hyperdex_client_Predicate(t, a, k); + if (unlikely(!o)) return 0; + return o; +} + +static PyMethodDef __pyx_methods_16_hyperdex_client_GreaterEqual[] = { + {0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_GreaterEqual = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + 0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + #if PY_VERSION_HEX >= 0x02050000 + 0, /*nb_index*/ + #endif +}; + +static PySequenceMethods __pyx_tp_as_sequence_GreaterEqual = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_GreaterEqual = { + 0, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_GreaterEqual = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_getbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_releasebuffer*/ + #endif +}; + +static PyTypeObject __pyx_type_16_hyperdex_client_GreaterEqual = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("_hyperdex_client.GreaterEqual"), /*tp_name*/ + sizeof(struct __pyx_obj_16_hyperdex_client_GreaterEqual), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_16_hyperdex_client_Predicate, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + &__pyx_tp_as_number_GreaterEqual, /*tp_as_number*/ + &__pyx_tp_as_sequence_GreaterEqual, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_GreaterEqual, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_GreaterEqual, /*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*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_16_hyperdex_client_Predicate, /*tp_traverse*/ + __pyx_tp_clear_16_hyperdex_client_Predicate, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_16_hyperdex_client_GreaterEqual, /*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*/ + __pyx_pw_16_hyperdex_client_12GreaterEqual_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_16_hyperdex_client_GreaterEqual, /*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*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif +}; + +static PyObject *__pyx_tp_new_16_hyperdex_client_Regex(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_16_hyperdex_client_Predicate(t, a, k); + if (unlikely(!o)) return 0; + return o; +} + +static PyMethodDef __pyx_methods_16_hyperdex_client_Regex[] = { + {0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_Regex = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + 0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + #if PY_VERSION_HEX >= 0x02050000 + 0, /*nb_index*/ + #endif +}; + +static PySequenceMethods __pyx_tp_as_sequence_Regex = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_Regex = { + 0, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_Regex = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_getbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_releasebuffer*/ + #endif +}; + +static PyTypeObject __pyx_type_16_hyperdex_client_Regex = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("_hyperdex_client.Regex"), /*tp_name*/ + sizeof(struct __pyx_obj_16_hyperdex_client_Regex), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_16_hyperdex_client_Predicate, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + &__pyx_tp_as_number_Regex, /*tp_as_number*/ + &__pyx_tp_as_sequence_Regex, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_Regex, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_Regex, /*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*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_16_hyperdex_client_Predicate, /*tp_traverse*/ + __pyx_tp_clear_16_hyperdex_client_Predicate, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_16_hyperdex_client_Regex, /*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*/ + __pyx_pw_16_hyperdex_client_5Regex_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_16_hyperdex_client_Regex, /*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*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif +}; + +static PyObject *__pyx_tp_new_16_hyperdex_client_LengthEquals(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_16_hyperdex_client_Predicate(t, a, k); + if (unlikely(!o)) return 0; + return o; +} + +static PyMethodDef __pyx_methods_16_hyperdex_client_LengthEquals[] = { + {0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_LengthEquals = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + 0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + #if PY_VERSION_HEX >= 0x02050000 + 0, /*nb_index*/ + #endif +}; + +static PySequenceMethods __pyx_tp_as_sequence_LengthEquals = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_LengthEquals = { + 0, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_LengthEquals = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_getbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_releasebuffer*/ + #endif +}; + +static PyTypeObject __pyx_type_16_hyperdex_client_LengthEquals = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("_hyperdex_client.LengthEquals"), /*tp_name*/ + sizeof(struct __pyx_obj_16_hyperdex_client_LengthEquals), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_16_hyperdex_client_Predicate, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + &__pyx_tp_as_number_LengthEquals, /*tp_as_number*/ + &__pyx_tp_as_sequence_LengthEquals, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_LengthEquals, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_LengthEquals, /*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*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_16_hyperdex_client_Predicate, /*tp_traverse*/ + __pyx_tp_clear_16_hyperdex_client_Predicate, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_16_hyperdex_client_LengthEquals, /*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*/ + __pyx_pw_16_hyperdex_client_12LengthEquals_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_16_hyperdex_client_LengthEquals, /*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*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif +}; + +static PyObject *__pyx_tp_new_16_hyperdex_client_LengthLessEqual(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_16_hyperdex_client_Predicate(t, a, k); + if (unlikely(!o)) return 0; + return o; +} + +static PyMethodDef __pyx_methods_16_hyperdex_client_LengthLessEqual[] = { + {0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_LengthLessEqual = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + 0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + #if PY_VERSION_HEX >= 0x02050000 + 0, /*nb_index*/ + #endif +}; + +static PySequenceMethods __pyx_tp_as_sequence_LengthLessEqual = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_LengthLessEqual = { + 0, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_LengthLessEqual = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_getbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_releasebuffer*/ + #endif +}; + +static PyTypeObject __pyx_type_16_hyperdex_client_LengthLessEqual = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("_hyperdex_client.LengthLessEqual"), /*tp_name*/ + sizeof(struct __pyx_obj_16_hyperdex_client_LengthLessEqual), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_16_hyperdex_client_Predicate, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + &__pyx_tp_as_number_LengthLessEqual, /*tp_as_number*/ + &__pyx_tp_as_sequence_LengthLessEqual, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_LengthLessEqual, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_LengthLessEqual, /*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*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_16_hyperdex_client_Predicate, /*tp_traverse*/ + __pyx_tp_clear_16_hyperdex_client_Predicate, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_16_hyperdex_client_LengthLessEqual, /*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*/ + __pyx_pw_16_hyperdex_client_15LengthLessEqual_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_16_hyperdex_client_LengthLessEqual, /*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*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif +}; + +static PyObject *__pyx_tp_new_16_hyperdex_client_LengthGreaterEqual(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_16_hyperdex_client_Predicate(t, a, k); + if (unlikely(!o)) return 0; + return o; +} + +static PyMethodDef __pyx_methods_16_hyperdex_client_LengthGreaterEqual[] = { + {0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_LengthGreaterEqual = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + 0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + #if PY_VERSION_HEX >= 0x02050000 + 0, /*nb_index*/ + #endif +}; + +static PySequenceMethods __pyx_tp_as_sequence_LengthGreaterEqual = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_LengthGreaterEqual = { + 0, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_LengthGreaterEqual = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_getbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_releasebuffer*/ + #endif +}; + +static PyTypeObject __pyx_type_16_hyperdex_client_LengthGreaterEqual = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("_hyperdex_client.LengthGreaterEqual"), /*tp_name*/ + sizeof(struct __pyx_obj_16_hyperdex_client_LengthGreaterEqual), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_16_hyperdex_client_Predicate, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + &__pyx_tp_as_number_LengthGreaterEqual, /*tp_as_number*/ + &__pyx_tp_as_sequence_LengthGreaterEqual, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_LengthGreaterEqual, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_LengthGreaterEqual, /*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*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_16_hyperdex_client_Predicate, /*tp_traverse*/ + __pyx_tp_clear_16_hyperdex_client_Predicate, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_16_hyperdex_client_LengthGreaterEqual, /*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*/ + __pyx_pw_16_hyperdex_client_18LengthGreaterEqual_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_16_hyperdex_client_LengthGreaterEqual, /*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*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif +}; + +static PyObject *__pyx_tp_new_16_hyperdex_client_Client(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_16_hyperdex_client_Client *p; + PyObject *o; + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_16_hyperdex_client_Client *)o); + p->_ops = ((PyObject*)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_16_hyperdex_client_6Client_1__cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_16_hyperdex_client_Client(PyObject *o) { + struct __pyx_obj_16_hyperdex_client_Client *p = (struct __pyx_obj_16_hyperdex_client_Client *)o; + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_16_hyperdex_client_6Client_3__dealloc__(o); + if (PyErr_Occurred()) PyErr_WriteUnraisable(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->_ops); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_16_hyperdex_client_Client(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_16_hyperdex_client_Client *p = (struct __pyx_obj_16_hyperdex_client_Client *)o; + if (p->_ops) { + e = (*v)(p->_ops, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_16_hyperdex_client_Client(PyObject *o) { + struct __pyx_obj_16_hyperdex_client_Client *p = (struct __pyx_obj_16_hyperdex_client_Client *)o; + PyObject* tmp; + tmp = ((PyObject*)p->_ops); + p->_ops = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_16_hyperdex_client_Client[] = { + {__Pyx_NAMESTR("get"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_5get, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("put"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_7put, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("cond_put"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_9cond_put, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("put_if_not_exist"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_11put_if_not_exist, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("delete"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_13delete, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("cond_delete"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_15cond_delete, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("atomic_add"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_17atomic_add, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("cond_atomic_add"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_19cond_atomic_add, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("atomic_sub"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_21atomic_sub, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("cond_atomic_sub"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_23cond_atomic_sub, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("atomic_mul"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_25atomic_mul, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("cond_atomic_mul"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_27cond_atomic_mul, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("atomic_div"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_29atomic_div, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("cond_atomic_div"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_31cond_atomic_div, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("atomic_mod"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_33atomic_mod, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("cond_atomic_mod"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_35cond_atomic_mod, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("atomic_and"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_37atomic_and, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("cond_atomic_and"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_39cond_atomic_and, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("atomic_or"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_41atomic_or, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("cond_atomic_or"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_43cond_atomic_or, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("atomic_xor"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_45atomic_xor, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("cond_atomic_xor"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_47cond_atomic_xor, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("string_prepend"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_49string_prepend, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("cond_string_prepend"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_51cond_string_prepend, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("string_append"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_53string_append, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("cond_string_append"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_55cond_string_append, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("list_lpush"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_57list_lpush, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("cond_list_lpush"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_59cond_list_lpush, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("list_rpush"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_61list_rpush, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("cond_list_rpush"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_63cond_list_rpush, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("set_add"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_65set_add, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("cond_set_add"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_67cond_set_add, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("set_remove"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_69set_remove, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("cond_set_remove"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_71cond_set_remove, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("set_intersect"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_73set_intersect, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("cond_set_intersect"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_75cond_set_intersect, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("set_union"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_77set_union, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("cond_set_union"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_79cond_set_union, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("map_add"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_81map_add, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("cond_map_add"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_83cond_map_add, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("map_remove"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_85map_remove, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("cond_map_remove"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_87cond_map_remove, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("map_atomic_add"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_89map_atomic_add, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("cond_map_atomic_add"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_91cond_map_atomic_add, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("map_atomic_sub"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_93map_atomic_sub, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("cond_map_atomic_sub"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_95cond_map_atomic_sub, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("map_atomic_mul"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_97map_atomic_mul, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("cond_map_atomic_mul"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_99cond_map_atomic_mul, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("map_atomic_div"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_101map_atomic_div, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("cond_map_atomic_div"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_103cond_map_atomic_div, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("map_atomic_mod"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_105map_atomic_mod, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("cond_map_atomic_mod"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_107cond_map_atomic_mod, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("map_atomic_and"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_109map_atomic_and, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("cond_map_atomic_and"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_111cond_map_atomic_and, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("map_atomic_or"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_113map_atomic_or, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("cond_map_atomic_or"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_115cond_map_atomic_or, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("map_atomic_xor"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_117map_atomic_xor, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("cond_map_atomic_xor"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_119cond_map_atomic_xor, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("map_string_prepend"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_121map_string_prepend, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("cond_map_string_prepend"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_123cond_map_string_prepend, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("map_string_append"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_125map_string_append, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("cond_map_string_append"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_127cond_map_string_append, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("search_describe"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_129search_describe, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("group_del"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_131group_del, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("count"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_133count, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("search"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_135search, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sorted_search"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_137sorted_search, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_get"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_139async_get, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_put"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_141async_put, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_put_if_not_exist"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_143async_put_if_not_exist, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_cond_put"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_145async_cond_put, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_delete"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_147async_delete, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_cond_delete"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_149async_cond_delete, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_atomic_add"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_151async_atomic_add, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_cond_atomic_add"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_153async_cond_atomic_add, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_atomic_sub"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_155async_atomic_sub, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_cond_atomic_sub"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_157async_cond_atomic_sub, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_atomic_mul"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_159async_atomic_mul, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_cond_atomic_mul"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_161async_cond_atomic_mul, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_atomic_div"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_163async_atomic_div, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_cond_atomic_div"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_165async_cond_atomic_div, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_atomic_mod"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_167async_atomic_mod, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_cond_atomic_mod"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_169async_cond_atomic_mod, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_atomic_and"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_171async_atomic_and, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_cond_atomic_and"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_173async_cond_atomic_and, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_atomic_or"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_175async_atomic_or, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_cond_atomic_or"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_177async_cond_atomic_or, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_atomic_xor"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_179async_atomic_xor, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_cond_atomic_xor"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_181async_cond_atomic_xor, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_string_prepend"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_183async_string_prepend, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_cond_string_prepend"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_185async_cond_string_prepend, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_string_append"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_187async_string_append, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_cond_string_append"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_189async_cond_string_append, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_list_lpush"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_191async_list_lpush, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_cond_list_lpush"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_193async_cond_list_lpush, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_list_rpush"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_195async_list_rpush, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_cond_list_rpush"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_197async_cond_list_rpush, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_set_add"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_199async_set_add, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_cond_set_add"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_201async_cond_set_add, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_set_remove"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_203async_set_remove, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_cond_set_remove"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_205async_cond_set_remove, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_set_intersect"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_207async_set_intersect, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_cond_set_intersect"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_209async_cond_set_intersect, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_set_union"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_211async_set_union, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_cond_set_union"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_213async_cond_set_union, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_map_add"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_215async_map_add, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_cond_map_add"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_217async_cond_map_add, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_map_remove"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_219async_map_remove, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_cond_map_remove"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_221async_cond_map_remove, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_map_atomic_add"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_223async_map_atomic_add, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_cond_map_atomic_add"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_225async_cond_map_atomic_add, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_map_atomic_sub"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_227async_map_atomic_sub, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_cond_map_atomic_sub"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_229async_cond_map_atomic_sub, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_map_atomic_mul"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_231async_map_atomic_mul, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_cond_map_atomic_mul"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_233async_cond_map_atomic_mul, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_map_atomic_div"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_235async_map_atomic_div, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_cond_map_atomic_div"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_237async_cond_map_atomic_div, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_map_atomic_mod"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_239async_map_atomic_mod, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_cond_map_atomic_mod"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_241async_cond_map_atomic_mod, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_map_atomic_and"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_243async_map_atomic_and, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_cond_map_atomic_and"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_245async_cond_map_atomic_and, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_map_atomic_or"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_247async_map_atomic_or, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_cond_map_atomic_or"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_249async_cond_map_atomic_or, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_map_atomic_xor"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_251async_map_atomic_xor, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_cond_map_atomic_xor"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_253async_cond_map_atomic_xor, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_map_string_prepend"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_255async_map_string_prepend, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_cond_map_string_prepend"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_257async_cond_map_string_prepend, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_map_string_append"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_259async_map_string_append, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_cond_map_string_append"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_261async_cond_map_string_append, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_search_describe"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_263async_search_describe, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_group_del"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_265async_group_del, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("async_count"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_267async_count, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("loop"), (PyCFunction)__pyx_pw_16_hyperdex_client_6Client_269loop, METH_NOARGS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_Client = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + 0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + #if PY_VERSION_HEX >= 0x02050000 + 0, /*nb_index*/ + #endif +}; + +static PySequenceMethods __pyx_tp_as_sequence_Client = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_Client = { + 0, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_Client = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_getbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_releasebuffer*/ + #endif +}; + +static PyTypeObject __pyx_type_16_hyperdex_client_Client = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("_hyperdex_client.Client"), /*tp_name*/ + sizeof(struct __pyx_obj_16_hyperdex_client_Client), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_16_hyperdex_client_Client, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + &__pyx_tp_as_number_Client, /*tp_as_number*/ + &__pyx_tp_as_sequence_Client, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_Client, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_Client, /*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*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_16_hyperdex_client_Client, /*tp_traverse*/ + __pyx_tp_clear_16_hyperdex_client_Client, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_16_hyperdex_client_Client, /*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_16_hyperdex_client_Client, /*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*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #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 + __Pyx_NAMESTR("_hyperdex_client"), + 0, /* 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_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0}, + {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0}, + {&__pyx_kp_s_101, __pyx_k_101, sizeof(__pyx_k_101), 0, 0, 1, 0}, + {&__pyx_kp_s_103, __pyx_k_103, sizeof(__pyx_k_103), 0, 0, 1, 0}, + {&__pyx_kp_s_105, __pyx_k_105, sizeof(__pyx_k_105), 0, 0, 1, 0}, + {&__pyx_kp_s_107, __pyx_k_107, sizeof(__pyx_k_107), 0, 0, 1, 0}, + {&__pyx_kp_s_109, __pyx_k_109, sizeof(__pyx_k_109), 0, 0, 1, 0}, + {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0}, + {&__pyx_kp_s_111, __pyx_k_111, sizeof(__pyx_k_111), 0, 0, 1, 0}, + {&__pyx_kp_s_114, __pyx_k_114, sizeof(__pyx_k_114), 0, 0, 1, 0}, + {&__pyx_kp_s_116, __pyx_k_116, sizeof(__pyx_k_116), 0, 0, 1, 0}, + {&__pyx_kp_s_118, __pyx_k_118, sizeof(__pyx_k_118), 0, 0, 1, 0}, + {&__pyx_kp_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 0}, + {&__pyx_kp_s_120, __pyx_k_120, sizeof(__pyx_k_120), 0, 0, 1, 0}, + {&__pyx_n_s_122, __pyx_k_122, sizeof(__pyx_k_122), 0, 0, 1, 1}, + {&__pyx_kp_s_123, __pyx_k_123, sizeof(__pyx_k_123), 0, 0, 1, 0}, + {&__pyx_kp_s_125, __pyx_k_125, sizeof(__pyx_k_125), 0, 0, 1, 0}, + {&__pyx_kp_s_127, __pyx_k_127, sizeof(__pyx_k_127), 0, 0, 1, 0}, + {&__pyx_kp_s_129, __pyx_k_129, sizeof(__pyx_k_129), 0, 0, 1, 0}, + {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0}, + {&__pyx_kp_s_131, __pyx_k_131, sizeof(__pyx_k_131), 0, 0, 1, 0}, + {&__pyx_kp_s_133, __pyx_k_133, sizeof(__pyx_k_133), 0, 0, 1, 0}, + {&__pyx_kp_s_135, __pyx_k_135, sizeof(__pyx_k_135), 0, 0, 1, 0}, + {&__pyx_kp_s_137, __pyx_k_137, sizeof(__pyx_k_137), 0, 0, 1, 0}, + {&__pyx_kp_s_139, __pyx_k_139, sizeof(__pyx_k_139), 0, 0, 1, 0}, + {&__pyx_kp_s_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 0, 1, 0}, + {&__pyx_n_s_141, __pyx_k_141, sizeof(__pyx_k_141), 0, 0, 1, 1}, + {&__pyx_n_s_142, __pyx_k_142, sizeof(__pyx_k_142), 0, 0, 1, 1}, + {&__pyx_n_s_143, __pyx_k_143, sizeof(__pyx_k_143), 0, 0, 1, 1}, + {&__pyx_n_s_144, __pyx_k_144, sizeof(__pyx_k_144), 0, 0, 1, 1}, + {&__pyx_n_s_145, __pyx_k_145, sizeof(__pyx_k_145), 0, 0, 1, 1}, + {&__pyx_n_s_146, __pyx_k_146, sizeof(__pyx_k_146), 0, 0, 1, 1}, + {&__pyx_n_s_147, __pyx_k_147, sizeof(__pyx_k_147), 0, 0, 1, 1}, + {&__pyx_n_s_148, __pyx_k_148, sizeof(__pyx_k_148), 0, 0, 1, 1}, + {&__pyx_n_s_149, __pyx_k_149, sizeof(__pyx_k_149), 0, 0, 1, 1}, + {&__pyx_kp_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 0}, + {&__pyx_n_s_150, __pyx_k_150, sizeof(__pyx_k_150), 0, 0, 1, 1}, + {&__pyx_n_s_151, __pyx_k_151, sizeof(__pyx_k_151), 0, 0, 1, 1}, + {&__pyx_n_s_152, __pyx_k_152, sizeof(__pyx_k_152), 0, 0, 1, 1}, + {&__pyx_n_s_154, __pyx_k_154, sizeof(__pyx_k_154), 0, 0, 1, 1}, + {&__pyx_kp_s_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 0, 1, 0}, + {&__pyx_kp_s_160, __pyx_k_160, sizeof(__pyx_k_160), 0, 0, 1, 0}, + {&__pyx_n_s_162, __pyx_k_162, sizeof(__pyx_k_162), 0, 0, 1, 1}, + {&__pyx_n_s_165, __pyx_k_165, sizeof(__pyx_k_165), 0, 0, 1, 1}, + {&__pyx_n_s_168, __pyx_k_168, sizeof(__pyx_k_168), 0, 0, 1, 1}, + {&__pyx_kp_s_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 0, 1, 0}, + {&__pyx_n_s_171, __pyx_k_171, sizeof(__pyx_k_171), 0, 0, 1, 1}, + {&__pyx_n_s_174, __pyx_k_174, sizeof(__pyx_k_174), 0, 0, 1, 1}, + {&__pyx_n_s_177, __pyx_k_177, sizeof(__pyx_k_177), 0, 0, 1, 1}, + {&__pyx_kp_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0}, + {&__pyx_n_s_180, __pyx_k_180, sizeof(__pyx_k_180), 0, 0, 1, 1}, + {&__pyx_kp_s_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 1, 0}, + {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0}, + {&__pyx_kp_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 0}, + {&__pyx_kp_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 0}, + {&__pyx_n_s_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 1, 1}, + {&__pyx_n_s_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 0, 1, 1}, + {&__pyx_n_s_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 0, 1, 1}, + {&__pyx_n_s_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 0, 1, 1}, + {&__pyx_n_s_26, __pyx_k_26, sizeof(__pyx_k_26), 0, 0, 1, 1}, + {&__pyx_n_s_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 0, 1, 1}, + {&__pyx_n_s_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 0, 1, 1}, + {&__pyx_n_s_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 0, 1, 1}, + {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0}, + {&__pyx_n_s_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 0, 1, 1}, + {&__pyx_n_s_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 0, 1, 1}, + {&__pyx_n_s_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 0, 1, 1}, + {&__pyx_n_s_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 0, 1, 1}, + {&__pyx_n_s_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 0, 1, 1}, + {&__pyx_n_s_35, __pyx_k_35, sizeof(__pyx_k_35), 0, 0, 1, 1}, + {&__pyx_n_s_36, __pyx_k_36, sizeof(__pyx_k_36), 0, 0, 1, 1}, + {&__pyx_n_s_37, __pyx_k_37, sizeof(__pyx_k_37), 0, 0, 1, 1}, + {&__pyx_n_s_38, __pyx_k_38, sizeof(__pyx_k_38), 0, 0, 1, 1}, + {&__pyx_n_s_39, __pyx_k_39, sizeof(__pyx_k_39), 0, 0, 1, 1}, + {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0}, + {&__pyx_n_s_40, __pyx_k_40, sizeof(__pyx_k_40), 0, 0, 1, 1}, + {&__pyx_n_s_41, __pyx_k_41, sizeof(__pyx_k_41), 0, 0, 1, 1}, + {&__pyx_n_s_42, __pyx_k_42, sizeof(__pyx_k_42), 0, 0, 1, 1}, + {&__pyx_n_s_43, __pyx_k_43, sizeof(__pyx_k_43), 0, 0, 1, 1}, + {&__pyx_n_s_44, __pyx_k_44, sizeof(__pyx_k_44), 0, 0, 1, 1}, + {&__pyx_kp_s_45, __pyx_k_45, sizeof(__pyx_k_45), 0, 0, 1, 0}, + {&__pyx_kp_b_46, __pyx_k_46, sizeof(__pyx_k_46), 0, 0, 0, 0}, + {&__pyx_kp_s_47, __pyx_k_47, sizeof(__pyx_k_47), 0, 0, 1, 0}, + {&__pyx_kp_s_48, __pyx_k_48, sizeof(__pyx_k_48), 0, 0, 1, 0}, + {&__pyx_kp_s_49, __pyx_k_49, sizeof(__pyx_k_49), 0, 0, 1, 0}, + {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0}, + {&__pyx_kp_s_50, __pyx_k_50, sizeof(__pyx_k_50), 0, 0, 1, 0}, + {&__pyx_kp_s_52, __pyx_k_52, sizeof(__pyx_k_52), 0, 0, 1, 0}, + {&__pyx_kp_s_55, __pyx_k_55, sizeof(__pyx_k_55), 0, 0, 1, 0}, + {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0}, + {&__pyx_kp_s_60, __pyx_k_60, sizeof(__pyx_k_60), 0, 0, 1, 0}, + {&__pyx_kp_s_62, __pyx_k_62, sizeof(__pyx_k_62), 0, 0, 1, 0}, + {&__pyx_kp_s_66, __pyx_k_66, sizeof(__pyx_k_66), 0, 0, 1, 0}, + {&__pyx_kp_s_68, __pyx_k_68, sizeof(__pyx_k_68), 0, 0, 1, 0}, + {&__pyx_kp_s_69, __pyx_k_69, sizeof(__pyx_k_69), 0, 0, 1, 0}, + {&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0}, + {&__pyx_kp_s_71, __pyx_k_71, sizeof(__pyx_k_71), 0, 0, 1, 0}, + {&__pyx_kp_s_73, __pyx_k_73, sizeof(__pyx_k_73), 0, 0, 1, 0}, + {&__pyx_kp_s_75, __pyx_k_75, sizeof(__pyx_k_75), 0, 0, 1, 0}, + {&__pyx_kp_s_77, __pyx_k_77, sizeof(__pyx_k_77), 0, 0, 1, 0}, + {&__pyx_kp_s_79, __pyx_k_79, sizeof(__pyx_k_79), 0, 0, 1, 0}, + {&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0}, + {&__pyx_kp_s_81, __pyx_k_81, sizeof(__pyx_k_81), 0, 0, 1, 0}, + {&__pyx_kp_s_83, __pyx_k_83, sizeof(__pyx_k_83), 0, 0, 1, 0}, + {&__pyx_kp_s_85, __pyx_k_85, sizeof(__pyx_k_85), 0, 0, 1, 0}, + {&__pyx_kp_s_88, __pyx_k_88, sizeof(__pyx_k_88), 0, 0, 1, 0}, + {&__pyx_kp_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 0}, + {&__pyx_kp_s_90, __pyx_k_90, sizeof(__pyx_k_90), 0, 0, 1, 0}, + {&__pyx_kp_s_93, __pyx_k_93, sizeof(__pyx_k_93), 0, 0, 1, 0}, + {&__pyx_kp_s_95, __pyx_k_95, sizeof(__pyx_k_95), 0, 0, 1, 0}, + {&__pyx_kp_s_97, __pyx_k_97, sizeof(__pyx_k_97), 0, 0, 1, 0}, + {&__pyx_kp_s_99, __pyx_k_99, sizeof(__pyx_k_99), 0, 0, 1, 0}, + {&__pyx_n_s__AttributeError, __pyx_k__AttributeError, sizeof(__pyx_k__AttributeError), 0, 0, 1, 1}, + {&__pyx_n_s__BUG, __pyx_k__BUG, sizeof(__pyx_k__BUG), 0, 0, 1, 1}, + {&__pyx_n_s__Exception, __pyx_k__Exception, sizeof(__pyx_k__Exception), 0, 0, 1, 1}, + {&__pyx_n_s__MemoryError, __pyx_k__MemoryError, sizeof(__pyx_k__MemoryError), 0, 0, 1, 1}, + {&__pyx_n_s__Reconfiguration, __pyx_k__Reconfiguration, sizeof(__pyx_k__Reconfiguration), 0, 0, 1, 1}, + {&__pyx_n_s__StopIteration, __pyx_k__StopIteration, sizeof(__pyx_k__StopIteration), 0, 0, 1, 1}, + {&__pyx_n_s__Success, __pyx_k__Success, sizeof(__pyx_k__Success), 0, 0, 1, 1}, + {&__pyx_n_s__Timeout, __pyx_k__Timeout, sizeof(__pyx_k__Timeout), 0, 0, 1, 1}, + {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1}, + {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1}, + {&__pyx_n_s____class__, __pyx_k____class__, sizeof(__pyx_k____class__), 0, 0, 1, 1}, + {&__pyx_n_s____eq__, __pyx_k____eq__, sizeof(__pyx_k____eq__), 0, 0, 1, 1}, + {&__pyx_n_s____import__, __pyx_k____import__, sizeof(__pyx_k____import__), 0, 0, 1, 1}, + {&__pyx_n_s____init__, __pyx_k____init__, sizeof(__pyx_k____init__), 0, 0, 1, 1}, + {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1}, + {&__pyx_n_s____metaclass__, __pyx_k____metaclass__, sizeof(__pyx_k____metaclass__), 0, 0, 1, 1}, + {&__pyx_n_s____module__, __pyx_k____module__, sizeof(__pyx_k____module__), 0, 0, 1, 1}, + {&__pyx_n_s____ne__, __pyx_k____ne__, sizeof(__pyx_k____ne__), 0, 0, 1, 1}, + {&__pyx_n_s____qualname__, __pyx_k____qualname__, sizeof(__pyx_k____qualname__), 0, 0, 1, 1}, + {&__pyx_n_s____repr__, __pyx_k____repr__, sizeof(__pyx_k____repr__), 0, 0, 1, 1}, + {&__pyx_n_s____sort_key, __pyx_k____sort_key, sizeof(__pyx_k____sort_key), 0, 0, 1, 1}, + {&__pyx_n_s____str__, __pyx_k____str__, sizeof(__pyx_k____str__), 0, 0, 1, 1}, + {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1}, + {&__pyx_n_s___callback, __pyx_k___callback, sizeof(__pyx_k___callback), 0, 0, 1, 1}, + {&__pyx_n_s___e, __pyx_k___e, sizeof(__pyx_k___e), 0, 0, 1, 1}, + {&__pyx_n_s___hyperdex_client, __pyx_k___hyperdex_client, sizeof(__pyx_k___hyperdex_client), 0, 0, 1, 1}, + {&__pyx_n_s___raw, __pyx_k___raw, sizeof(__pyx_k___raw), 0, 0, 1, 1}, + {&__pyx_n_s___s, __pyx_k___s, sizeof(__pyx_k___s), 0, 0, 1, 1}, + {&__pyx_n_s___status, __pyx_k___status, sizeof(__pyx_k___status), 0, 0, 1, 1}, + {&__pyx_n_s__address, __pyx_k__address, sizeof(__pyx_k__address), 0, 0, 1, 1}, + {&__pyx_n_s__all, __pyx_k__all, sizeof(__pyx_k__all), 0, 0, 1, 1}, + {&__pyx_n_s__append, __pyx_k__append, sizeof(__pyx_k__append), 0, 0, 1, 1}, + {&__pyx_n_s__async_atomic_add, __pyx_k__async_atomic_add, sizeof(__pyx_k__async_atomic_add), 0, 0, 1, 1}, + {&__pyx_n_s__async_atomic_and, __pyx_k__async_atomic_and, sizeof(__pyx_k__async_atomic_and), 0, 0, 1, 1}, + {&__pyx_n_s__async_atomic_div, __pyx_k__async_atomic_div, sizeof(__pyx_k__async_atomic_div), 0, 0, 1, 1}, + {&__pyx_n_s__async_atomic_mod, __pyx_k__async_atomic_mod, sizeof(__pyx_k__async_atomic_mod), 0, 0, 1, 1}, + {&__pyx_n_s__async_atomic_mul, __pyx_k__async_atomic_mul, sizeof(__pyx_k__async_atomic_mul), 0, 0, 1, 1}, + {&__pyx_n_s__async_atomic_or, __pyx_k__async_atomic_or, sizeof(__pyx_k__async_atomic_or), 0, 0, 1, 1}, + {&__pyx_n_s__async_atomic_sub, __pyx_k__async_atomic_sub, sizeof(__pyx_k__async_atomic_sub), 0, 0, 1, 1}, + {&__pyx_n_s__async_atomic_xor, __pyx_k__async_atomic_xor, sizeof(__pyx_k__async_atomic_xor), 0, 0, 1, 1}, + {&__pyx_n_s__async_cond_map_add, __pyx_k__async_cond_map_add, sizeof(__pyx_k__async_cond_map_add), 0, 0, 1, 1}, + {&__pyx_n_s__async_cond_put, __pyx_k__async_cond_put, sizeof(__pyx_k__async_cond_put), 0, 0, 1, 1}, + {&__pyx_n_s__async_count, __pyx_k__async_count, sizeof(__pyx_k__async_count), 0, 0, 1, 1}, + {&__pyx_n_s__async_delete, __pyx_k__async_delete, sizeof(__pyx_k__async_delete), 0, 0, 1, 1}, + {&__pyx_n_s__async_get, __pyx_k__async_get, sizeof(__pyx_k__async_get), 0, 0, 1, 1}, + {&__pyx_n_s__async_group_del, __pyx_k__async_group_del, sizeof(__pyx_k__async_group_del), 0, 0, 1, 1}, + {&__pyx_n_s__async_list_lpush, __pyx_k__async_list_lpush, sizeof(__pyx_k__async_list_lpush), 0, 0, 1, 1}, + {&__pyx_n_s__async_list_rpush, __pyx_k__async_list_rpush, sizeof(__pyx_k__async_list_rpush), 0, 0, 1, 1}, + {&__pyx_n_s__async_map_add, __pyx_k__async_map_add, sizeof(__pyx_k__async_map_add), 0, 0, 1, 1}, + {&__pyx_n_s__async_map_atomic_or, __pyx_k__async_map_atomic_or, sizeof(__pyx_k__async_map_atomic_or), 0, 0, 1, 1}, + {&__pyx_n_s__async_map_remove, __pyx_k__async_map_remove, sizeof(__pyx_k__async_map_remove), 0, 0, 1, 1}, + {&__pyx_n_s__async_put, __pyx_k__async_put, sizeof(__pyx_k__async_put), 0, 0, 1, 1}, + {&__pyx_n_s__async_set_add, __pyx_k__async_set_add, sizeof(__pyx_k__async_set_add), 0, 0, 1, 1}, + {&__pyx_n_s__async_set_intersect, __pyx_k__async_set_intersect, sizeof(__pyx_k__async_set_intersect), 0, 0, 1, 1}, + {&__pyx_n_s__async_set_remove, __pyx_k__async_set_remove, sizeof(__pyx_k__async_set_remove), 0, 0, 1, 1}, + {&__pyx_n_s__async_set_union, __pyx_k__async_set_union, sizeof(__pyx_k__async_set_union), 0, 0, 1, 1}, + {&__pyx_n_s__async_string_append, __pyx_k__async_string_append, sizeof(__pyx_k__async_string_append), 0, 0, 1, 1}, + {&__pyx_n_s__attr, __pyx_k__attr, sizeof(__pyx_k__attr), 0, 0, 1, 1}, + {&__pyx_n_s__c, __pyx_k__c, sizeof(__pyx_k__c), 0, 0, 1, 1}, + {&__pyx_n_s__client, __pyx_k__client, sizeof(__pyx_k__client), 0, 0, 1, 1}, + {&__pyx_n_s__collections, __pyx_k__collections, sizeof(__pyx_k__collections), 0, 0, 1, 1}, + {&__pyx_n_s__compare, __pyx_k__compare, sizeof(__pyx_k__compare), 0, 0, 1, 1}, + {&__pyx_n_s__cond, __pyx_k__cond, sizeof(__pyx_k__cond), 0, 0, 1, 1}, + {&__pyx_n_s__condition, __pyx_k__condition, sizeof(__pyx_k__condition), 0, 0, 1, 1}, + {&__pyx_n_s__elem, __pyx_k__elem, sizeof(__pyx_k__elem), 0, 0, 1, 1}, + {&__pyx_n_s__enumerate, __pyx_k__enumerate, sizeof(__pyx_k__enumerate), 0, 0, 1, 1}, + {&__pyx_n_s__format, __pyx_k__format, sizeof(__pyx_k__format), 0, 0, 1, 1}, + {&__pyx_n_s__get, __pyx_k__get, sizeof(__pyx_k__get), 0, 0, 1, 1}, + {&__pyx_n_s__items, __pyx_k__items, sizeof(__pyx_k__items), 0, 0, 1, 1}, + {&__pyx_n_s__iteritems, __pyx_k__iteritems, sizeof(__pyx_k__iteritems), 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__length, __pyx_k__length, sizeof(__pyx_k__length), 0, 0, 1, 1}, + {&__pyx_n_s__limit, __pyx_k__limit, sizeof(__pyx_k__limit), 0, 0, 1, 1}, + {&__pyx_n_s__loop, __pyx_k__loop, sizeof(__pyx_k__loop), 0, 0, 1, 1}, + {&__pyx_n_s__lower, __pyx_k__lower, sizeof(__pyx_k__lower), 0, 0, 1, 1}, + {&__pyx_n_s__max, __pyx_k__max, sizeof(__pyx_k__max), 0, 0, 1, 1}, + {&__pyx_n_s__maximize, __pyx_k__maximize, sizeof(__pyx_k__maximize), 0, 0, 1, 1}, + {&__pyx_n_s__min, __pyx_k__min, sizeof(__pyx_k__min), 0, 0, 1, 1}, + {&__pyx_n_s__minimize, __pyx_k__minimize, sizeof(__pyx_k__minimize), 0, 0, 1, 1}, + {&__pyx_n_s__obj, __pyx_k__obj, sizeof(__pyx_k__obj), 0, 0, 1, 1}, + {&__pyx_n_s__ord, __pyx_k__ord, sizeof(__pyx_k__ord), 0, 0, 1, 1}, + {&__pyx_n_s__other, __pyx_k__other, sizeof(__pyx_k__other), 0, 0, 1, 1}, + {&__pyx_n_s__pack, __pyx_k__pack, sizeof(__pyx_k__pack), 0, 0, 1, 1}, + {&__pyx_n_s__pop, __pyx_k__pop, sizeof(__pyx_k__pop), 0, 0, 1, 1}, + {&__pyx_n_s__port, __pyx_k__port, sizeof(__pyx_k__port), 0, 0, 1, 1}, + {&__pyx_n_s__predicate, __pyx_k__predicate, sizeof(__pyx_k__predicate), 0, 0, 1, 1}, + {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1}, + {&__pyx_n_s__raw, __pyx_k__raw, sizeof(__pyx_k__raw), 0, 0, 1, 1}, + {&__pyx_n_s__regex, __pyx_k__regex, sizeof(__pyx_k__regex), 0, 0, 1, 1}, + {&__pyx_n_s__self, __pyx_k__self, sizeof(__pyx_k__self), 0, 0, 1, 1}, + {&__pyx_n_s__sort_by, __pyx_k__sort_by, sizeof(__pyx_k__sort_by), 0, 0, 1, 1}, + {&__pyx_n_s__sorted, __pyx_k__sorted, sizeof(__pyx_k__sorted), 0, 0, 1, 1}, + {&__pyx_n_s__space, __pyx_k__space, sizeof(__pyx_k__space), 0, 0, 1, 1}, + {&__pyx_n_s__status, __pyx_k__status, sizeof(__pyx_k__status), 0, 0, 1, 1}, + {&__pyx_n_s__strip, __pyx_k__strip, sizeof(__pyx_k__strip), 0, 0, 1, 1}, + {&__pyx_n_s__struct, __pyx_k__struct, sizeof(__pyx_k__struct), 0, 0, 1, 1}, + {&__pyx_n_s__sum, __pyx_k__sum, sizeof(__pyx_k__sum), 0, 0, 1, 1}, + {&__pyx_n_s__symbol, __pyx_k__symbol, sizeof(__pyx_k__symbol), 0, 0, 1, 1}, + {&__pyx_n_s__type, __pyx_k__type, sizeof(__pyx_k__type), 0, 0, 1, 1}, + {&__pyx_n_s__unpack, __pyx_k__unpack, sizeof(__pyx_k__unpack), 0, 0, 1, 1}, + {&__pyx_n_s__unsafe, __pyx_k__unsafe, sizeof(__pyx_k__unsafe), 0, 0, 1, 1}, + {&__pyx_n_s__upper, __pyx_k__upper, sizeof(__pyx_k__upper), 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__wait, __pyx_k__wait, sizeof(__pyx_k__wait), 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_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ord = __Pyx_GetBuiltinName(__pyx_n_s__ord); if (!__pyx_builtin_ord) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_all = __Pyx_GetBuiltinName(__pyx_n_s__all); if (!__pyx_builtin_all) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_sorted = __Pyx_GetBuiltinName(__pyx_n_s__sorted); if (!__pyx_builtin_sorted) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s__MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s__enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s__sum); if (!__pyx_builtin_sum) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s__StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s__AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "_hyperdex_client.pyx":335 + * datatype = HYPERDATATYPE_LIST_FLOAT + * else: + * raise TypeError("Cannot store heterogeneous lists") # <<<<<<<<<<<<<< + * elif isinstance(v, set): + * keytype = HYPERDATATYPE_SET_GENERIC + */ + __pyx_k_tuple_51 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_50)); if (unlikely(!__pyx_k_tuple_51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_k_tuple_51); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_51)); + + /* "_hyperdex_client.pyx":339 + * keytype = HYPERDATATYPE_SET_GENERIC + * if len(set([x.__class__ for x in v])) > 1: + * raise TypeError("Cannot store heterogeneous sets") # <<<<<<<<<<<<<< + * for x in sorted(v, key=__sort_key): + * if isinstance(x, bytes): + */ + __pyx_k_tuple_53 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_52)); if (unlikely(!__pyx_k_tuple_53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_k_tuple_53); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_53)); + + /* "_hyperdex_client.pyx":351 + * innerxbacking = struct.pack(' 1: + * raise TypeError("Cannot store heterogeneous maps") # <<<<<<<<<<<<<< + * if len(set([x.__class__ for x in v.values()])) > 1: + * raise TypeError("Cannot store heterogeneous maps") + */ + __pyx_k_tuple_56 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_55)); if (unlikely(!__pyx_k_tuple_56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_k_tuple_56); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_56)); + + /* "_hyperdex_client.pyx":366 + * raise TypeError("Cannot store heterogeneous maps") + * if len(set([x.__class__ for x in v.values()])) > 1: + * raise TypeError("Cannot store heterogeneous maps") # <<<<<<<<<<<<<< + * for x, y in sorted(v.items(), key=__sort_key): + * if isinstance(x, bytes): + */ + __pyx_k_tuple_57 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_55)); if (unlikely(!__pyx_k_tuple_57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_k_tuple_57); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_57)); + + /* "_hyperdex_client.pyx":378 + * innerxbacking = struct.pack(' 8: + * s = s[:8] # <<<<<<<<<<<<<< + * elif i < 8: + * s += (8 - i) * '\x00' + */ + __pyx_k_slice_65 = PySlice_New(Py_None, __pyx_int_8, Py_None); if (unlikely(!__pyx_k_slice_65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_k_slice_65); + __Pyx_GIVEREF(__pyx_k_slice_65); + + /* "_hyperdex_client.pyx":499 + * i = len(s) + * if i > 8: + * s = s[:8] # <<<<<<<<<<<<<< + * elif i < 8: + * s += (8 - i) * '\x00' + */ + __pyx_k_slice_67 = PySlice_New(Py_None, __pyx_int_8, Py_None); if (unlikely(!__pyx_k_slice_67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_k_slice_67); + __Pyx_GIVEREF(__pyx_k_slice_67); + + /* "_hyperdex_client.pyx":510 + * sz = struct.unpack('= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "_hyperdex_client")) { + if (unlikely(PyDict_SetItemString(modules, "_hyperdex_client", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main__hyperdex_client) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + if (PyType_Ready(&__pyx_type_16_hyperdex_client_Deferred) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Deferred", (PyObject *)&__pyx_type_16_hyperdex_client_Deferred) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_16_hyperdex_client_Deferred = &__pyx_type_16_hyperdex_client_Deferred; + __pyx_type_16_hyperdex_client_DeferredGet.tp_base = __pyx_ptype_16_hyperdex_client_Deferred; + if (PyType_Ready(&__pyx_type_16_hyperdex_client_DeferredGet) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "DeferredGet", (PyObject *)&__pyx_type_16_hyperdex_client_DeferredGet) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_16_hyperdex_client_DeferredGet = &__pyx_type_16_hyperdex_client_DeferredGet; + __pyx_vtabptr_16_hyperdex_client_DeferredFromAttrs = &__pyx_vtable_16_hyperdex_client_DeferredFromAttrs; + __pyx_vtable_16_hyperdex_client_DeferredFromAttrs.setcmp = (PyObject *(*)(struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *))__pyx_f_16_hyperdex_client_17DeferredFromAttrs_setcmp; + __pyx_vtable_16_hyperdex_client_DeferredFromAttrs.call = (PyObject *(*)(struct __pyx_obj_16_hyperdex_client_DeferredFromAttrs *, __pyx_t_16_hyperdex_client_hyperdex_client_simple_op, PyObject *, PyObject *, PyObject *))__pyx_f_16_hyperdex_client_17DeferredFromAttrs_call; + __pyx_type_16_hyperdex_client_DeferredFromAttrs.tp_base = __pyx_ptype_16_hyperdex_client_Deferred; + if (PyType_Ready(&__pyx_type_16_hyperdex_client_DeferredFromAttrs) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_16_hyperdex_client_DeferredFromAttrs.tp_dict, __pyx_vtabptr_16_hyperdex_client_DeferredFromAttrs) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "DeferredFromAttrs", (PyObject *)&__pyx_type_16_hyperdex_client_DeferredFromAttrs) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_16_hyperdex_client_DeferredFromAttrs = &__pyx_type_16_hyperdex_client_DeferredFromAttrs; + __pyx_vtabptr_16_hyperdex_client_DeferredCondFromAttrs = &__pyx_vtable_16_hyperdex_client_DeferredCondFromAttrs; + __pyx_vtable_16_hyperdex_client_DeferredCondFromAttrs.call = (PyObject *(*)(struct __pyx_obj_16_hyperdex_client_DeferredCondFromAttrs *, __pyx_t_16_hyperdex_client_hyperdex_client_cond_op, PyObject *, PyObject *, PyObject *, PyObject *))__pyx_f_16_hyperdex_client_21DeferredCondFromAttrs_call; + __pyx_type_16_hyperdex_client_DeferredCondFromAttrs.tp_base = __pyx_ptype_16_hyperdex_client_Deferred; + if (PyType_Ready(&__pyx_type_16_hyperdex_client_DeferredCondFromAttrs) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_16_hyperdex_client_DeferredCondFromAttrs.tp_dict, __pyx_vtabptr_16_hyperdex_client_DeferredCondFromAttrs) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "DeferredCondFromAttrs", (PyObject *)&__pyx_type_16_hyperdex_client_DeferredCondFromAttrs) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_16_hyperdex_client_DeferredCondFromAttrs = &__pyx_type_16_hyperdex_client_DeferredCondFromAttrs; + __pyx_type_16_hyperdex_client_DeferredDelete.tp_base = __pyx_ptype_16_hyperdex_client_Deferred; + if (PyType_Ready(&__pyx_type_16_hyperdex_client_DeferredDelete) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "DeferredDelete", (PyObject *)&__pyx_type_16_hyperdex_client_DeferredDelete) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_16_hyperdex_client_DeferredDelete = &__pyx_type_16_hyperdex_client_DeferredDelete; + __pyx_type_16_hyperdex_client_DeferredCondDelete.tp_base = __pyx_ptype_16_hyperdex_client_Deferred; + if (PyType_Ready(&__pyx_type_16_hyperdex_client_DeferredCondDelete) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "DeferredCondDelete", (PyObject *)&__pyx_type_16_hyperdex_client_DeferredCondDelete) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_16_hyperdex_client_DeferredCondDelete = &__pyx_type_16_hyperdex_client_DeferredCondDelete; + __pyx_vtabptr_16_hyperdex_client_DeferredMapOp = &__pyx_vtable_16_hyperdex_client_DeferredMapOp; + __pyx_vtable_16_hyperdex_client_DeferredMapOp.call = (PyObject *(*)(struct __pyx_obj_16_hyperdex_client_DeferredMapOp *, __pyx_t_16_hyperdex_client_hyperdex_client_map_op, PyObject *, PyObject *, PyObject *))__pyx_f_16_hyperdex_client_13DeferredMapOp_call; + __pyx_type_16_hyperdex_client_DeferredMapOp.tp_base = __pyx_ptype_16_hyperdex_client_Deferred; + if (PyType_Ready(&__pyx_type_16_hyperdex_client_DeferredMapOp) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_16_hyperdex_client_DeferredMapOp.tp_dict, __pyx_vtabptr_16_hyperdex_client_DeferredMapOp) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "DeferredMapOp", (PyObject *)&__pyx_type_16_hyperdex_client_DeferredMapOp) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_16_hyperdex_client_DeferredMapOp = &__pyx_type_16_hyperdex_client_DeferredMapOp; + __pyx_vtabptr_16_hyperdex_client_DeferredCondMapOp = &__pyx_vtable_16_hyperdex_client_DeferredCondMapOp; + __pyx_vtable_16_hyperdex_client_DeferredCondMapOp.call = (PyObject *(*)(struct __pyx_obj_16_hyperdex_client_DeferredCondMapOp *, __pyx_t_16_hyperdex_client_hyperdex_client_cond_map_op, PyObject *, PyObject *, PyObject *, PyObject *))__pyx_f_16_hyperdex_client_17DeferredCondMapOp_call; + __pyx_type_16_hyperdex_client_DeferredCondMapOp.tp_base = __pyx_ptype_16_hyperdex_client_Deferred; + if (PyType_Ready(&__pyx_type_16_hyperdex_client_DeferredCondMapOp) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_16_hyperdex_client_DeferredCondMapOp.tp_dict, __pyx_vtabptr_16_hyperdex_client_DeferredCondMapOp) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "DeferredCondMapOp", (PyObject *)&__pyx_type_16_hyperdex_client_DeferredCondMapOp) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_16_hyperdex_client_DeferredCondMapOp = &__pyx_type_16_hyperdex_client_DeferredCondMapOp; + __pyx_type_16_hyperdex_client_DeferredGroupDel.tp_base = __pyx_ptype_16_hyperdex_client_Deferred; + if (PyType_Ready(&__pyx_type_16_hyperdex_client_DeferredGroupDel) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "DeferredGroupDel", (PyObject *)&__pyx_type_16_hyperdex_client_DeferredGroupDel) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_16_hyperdex_client_DeferredGroupDel = &__pyx_type_16_hyperdex_client_DeferredGroupDel; + __pyx_type_16_hyperdex_client_DeferredSearchDescribe.tp_base = __pyx_ptype_16_hyperdex_client_Deferred; + if (PyType_Ready(&__pyx_type_16_hyperdex_client_DeferredSearchDescribe) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "DeferredSearchDescribe", (PyObject *)&__pyx_type_16_hyperdex_client_DeferredSearchDescribe) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_16_hyperdex_client_DeferredSearchDescribe = &__pyx_type_16_hyperdex_client_DeferredSearchDescribe; + __pyx_type_16_hyperdex_client_DeferredCount.tp_base = __pyx_ptype_16_hyperdex_client_Deferred; + if (PyType_Ready(&__pyx_type_16_hyperdex_client_DeferredCount) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "DeferredCount", (PyObject *)&__pyx_type_16_hyperdex_client_DeferredCount) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_16_hyperdex_client_DeferredCount = &__pyx_type_16_hyperdex_client_DeferredCount; + if (PyType_Ready(&__pyx_type_16_hyperdex_client_SearchBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "SearchBase", (PyObject *)&__pyx_type_16_hyperdex_client_SearchBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_16_hyperdex_client_SearchBase = &__pyx_type_16_hyperdex_client_SearchBase; + __pyx_type_16_hyperdex_client_Search.tp_base = __pyx_ptype_16_hyperdex_client_SearchBase; + if (PyType_Ready(&__pyx_type_16_hyperdex_client_Search) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Search", (PyObject *)&__pyx_type_16_hyperdex_client_Search) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_16_hyperdex_client_Search = &__pyx_type_16_hyperdex_client_Search; + __pyx_type_16_hyperdex_client_SortedSearch.tp_base = __pyx_ptype_16_hyperdex_client_SearchBase; + if (PyType_Ready(&__pyx_type_16_hyperdex_client_SortedSearch) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "SortedSearch", (PyObject *)&__pyx_type_16_hyperdex_client_SortedSearch) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_16_hyperdex_client_SortedSearch = &__pyx_type_16_hyperdex_client_SortedSearch; + if (PyType_Ready(&__pyx_type_16_hyperdex_client_Predicate) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Predicate", (PyObject *)&__pyx_type_16_hyperdex_client_Predicate) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_16_hyperdex_client_Predicate = &__pyx_type_16_hyperdex_client_Predicate; + __pyx_type_16_hyperdex_client_Range.tp_base = __pyx_ptype_16_hyperdex_client_Predicate; + if (PyType_Ready(&__pyx_type_16_hyperdex_client_Range) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Range", (PyObject *)&__pyx_type_16_hyperdex_client_Range) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_16_hyperdex_client_Range = &__pyx_type_16_hyperdex_client_Range; + __pyx_type_16_hyperdex_client_Contains.tp_base = __pyx_ptype_16_hyperdex_client_Predicate; + if (PyType_Ready(&__pyx_type_16_hyperdex_client_Contains) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Contains", (PyObject *)&__pyx_type_16_hyperdex_client_Contains) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_16_hyperdex_client_Contains = &__pyx_type_16_hyperdex_client_Contains; + __pyx_type_16_hyperdex_client_LessEqual.tp_base = __pyx_ptype_16_hyperdex_client_Predicate; + if (PyType_Ready(&__pyx_type_16_hyperdex_client_LessEqual) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "LessEqual", (PyObject *)&__pyx_type_16_hyperdex_client_LessEqual) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_16_hyperdex_client_LessEqual = &__pyx_type_16_hyperdex_client_LessEqual; + __pyx_type_16_hyperdex_client_GreaterEqual.tp_base = __pyx_ptype_16_hyperdex_client_Predicate; + if (PyType_Ready(&__pyx_type_16_hyperdex_client_GreaterEqual) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "GreaterEqual", (PyObject *)&__pyx_type_16_hyperdex_client_GreaterEqual) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_16_hyperdex_client_GreaterEqual = &__pyx_type_16_hyperdex_client_GreaterEqual; + __pyx_type_16_hyperdex_client_Regex.tp_base = __pyx_ptype_16_hyperdex_client_Predicate; + if (PyType_Ready(&__pyx_type_16_hyperdex_client_Regex) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Regex", (PyObject *)&__pyx_type_16_hyperdex_client_Regex) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_16_hyperdex_client_Regex = &__pyx_type_16_hyperdex_client_Regex; + __pyx_type_16_hyperdex_client_LengthEquals.tp_base = __pyx_ptype_16_hyperdex_client_Predicate; + if (PyType_Ready(&__pyx_type_16_hyperdex_client_LengthEquals) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "LengthEquals", (PyObject *)&__pyx_type_16_hyperdex_client_LengthEquals) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_16_hyperdex_client_LengthEquals = &__pyx_type_16_hyperdex_client_LengthEquals; + __pyx_type_16_hyperdex_client_LengthLessEqual.tp_base = __pyx_ptype_16_hyperdex_client_Predicate; + if (PyType_Ready(&__pyx_type_16_hyperdex_client_LengthLessEqual) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "LengthLessEqual", (PyObject *)&__pyx_type_16_hyperdex_client_LengthLessEqual) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_16_hyperdex_client_LengthLessEqual = &__pyx_type_16_hyperdex_client_LengthLessEqual; + __pyx_type_16_hyperdex_client_LengthGreaterEqual.tp_base = __pyx_ptype_16_hyperdex_client_Predicate; + if (PyType_Ready(&__pyx_type_16_hyperdex_client_LengthGreaterEqual) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "LengthGreaterEqual", (PyObject *)&__pyx_type_16_hyperdex_client_LengthGreaterEqual) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_16_hyperdex_client_LengthGreaterEqual = &__pyx_type_16_hyperdex_client_LengthGreaterEqual; + if (PyType_Ready(&__pyx_type_16_hyperdex_client_Client) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Client", (PyObject *)&__pyx_type_16_hyperdex_client_Client) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_16_hyperdex_client_Client = &__pyx_type_16_hyperdex_client_Client; + /*--- 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_filename = __pyx_f[2]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[3]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[4]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_8datetime_date = __Pyx_ImportType("datetime", "date", sizeof(PyDateTime_Date), 0); if (unlikely(!__pyx_ptype_7cpython_8datetime_date)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_8datetime_time = __Pyx_ImportType("datetime", "time", sizeof(PyDateTime_Time), 0); if (unlikely(!__pyx_ptype_7cpython_8datetime_time)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_8datetime_datetime = __Pyx_ImportType("datetime", "datetime", sizeof(PyDateTime_DateTime), 0); if (unlikely(!__pyx_ptype_7cpython_8datetime_datetime)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_8datetime_timedelta = __Pyx_ImportType("datetime", "timedelta", sizeof(PyDateTime_Delta), 0); if (unlikely(!__pyx_ptype_7cpython_8datetime_timedelta)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_8datetime_tzinfo = __Pyx_ImportType("datetime", "tzinfo", sizeof(PyDateTime_TZInfo), 0); if (unlikely(!__pyx_ptype_7cpython_8datetime_tzinfo)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "_hyperdex_client.pyx":219 + * ctypedef int64_t (*hyperdex_client_cond_map_op)(hyperdex_client*, char*, char*, size_t, hyperdex_client_attribute_check* condattrs, size_t condattrs_sz, hyperdex_client_map_attribute*, size_t, hyperdex_client_returncode*) + * + * import collections # <<<<<<<<<<<<<< + * import struct + * + */ + __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__collections), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s__collections, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":220 + * + * import collections + * import struct # <<<<<<<<<<<<<< + * + * class HyperClientException(Exception): + */ + __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__struct), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s__struct, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":222 + * import struct + * + * class HyperClientException(Exception): # <<<<<<<<<<<<<< + * + * def __init__(self, status, attr=None): + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + + /* "_hyperdex_client.pyx":224 + * class HyperClientException(Exception): + * + * def __init__(self, status, attr=None): # <<<<<<<<<<<<<< + * self._status = status + * self._s = {HYPERDEX_CLIENT_SUCCESS: 'Success' + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16_hyperdex_client_20HyperClientException_1__init__, 0, __pyx_n_s_162, NULL, __pyx_n_s___hyperdex_client, ((PyObject *)__pyx_k_codeobj_159)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, ((PyObject *)__pyx_k_tuple_161)); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s____init__, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":275 + * }.get(status, 'BUG') + * + * def status(self): # <<<<<<<<<<<<<< + * return self._status + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16_hyperdex_client_20HyperClientException_3status, 0, __pyx_n_s_165, NULL, __pyx_n_s___hyperdex_client, ((PyObject *)__pyx_k_codeobj_164)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s__status, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":278 + * return self._status + * + * def symbol(self): # <<<<<<<<<<<<<< + * return self._e + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16_hyperdex_client_20HyperClientException_5symbol, 0, __pyx_n_s_168, NULL, __pyx_n_s___hyperdex_client, ((PyObject *)__pyx_k_codeobj_167)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s__symbol, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":281 + * return self._e + * + * def __str__(self): # <<<<<<<<<<<<<< + * return 'HyperClient(%s, %s)' % (self._e, self._s) + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16_hyperdex_client_20HyperClientException_7__str__, 0, __pyx_n_s_171, NULL, __pyx_n_s___hyperdex_client, ((PyObject *)__pyx_k_codeobj_170)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s____str__, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":284 + * return 'HyperClient(%s, %s)' % (self._e, self._s) + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return str(self) + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16_hyperdex_client_20HyperClientException_9__repr__, 0, __pyx_n_s_174, NULL, __pyx_n_s___hyperdex_client, ((PyObject *)__pyx_k_codeobj_173)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s____repr__, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":287 + * return str(self) + * + * def __eq__(self, other): # <<<<<<<<<<<<<< + * if self.__class__ != other.__class__: + * return False + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16_hyperdex_client_20HyperClientException_11__eq__, 0, __pyx_n_s_177, NULL, __pyx_n_s___hyperdex_client, ((PyObject *)__pyx_k_codeobj_176)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s____eq__, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":292 + * return self._status == other._status + * + * def __ne__(self, other): # <<<<<<<<<<<<<< + * return not (self == other) + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_16_hyperdex_client_20HyperClientException_13__ne__, 0, __pyx_n_s_180, NULL, __pyx_n_s___hyperdex_client, ((PyObject *)__pyx_k_codeobj_179)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s____ne__, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "_hyperdex_client.pyx":222 + * import struct + * + * class HyperClientException(Exception): # <<<<<<<<<<<<<< + * + * def __init__(self, status, attr=None): + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_builtin_Exception); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_Exception); + __Pyx_GIVEREF(__pyx_builtin_Exception); + __pyx_t_3 = __Pyx_CreateClass(((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_1), __pyx_n_s_122, __pyx_n_s_122, __pyx_n_s___hyperdex_client); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_122, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":296 + * + * + * def __sort_key(obj): # <<<<<<<<<<<<<< + * if isinstance(obj, bytes): + * return tuple([ord(c) for c in obj]) + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_16_hyperdex_client_1__sort_key, NULL, __pyx_n_s___hyperdex_client); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s____sort_key, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":1629 + * return async.wait() + * + * def search_describe(self, bytes space, dict predicate, bool unsafe=False): # <<<<<<<<<<<<<< + * async = self.async_search_describe(space, predicate, unsafe) + * return async.wait() + */ + __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7cpython_4bool_bool)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_153 = ((PyBoolObject *)__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":1637 + * return async.wait() + * + * def count(self, bytes space, dict predicate, bool unsafe=False): # <<<<<<<<<<<<<< + * async = self.async_count(space, predicate, unsafe) + * return async.wait() + */ + __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7cpython_4bool_bool)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_155 = ((PyBoolObject *)__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":1952 + * return d + * + * def async_search_describe(self, bytes space, dict predicate, bool unsafe=False): # <<<<<<<<<<<<<< + * return DeferredSearchDescribe(self, space, predicate, unsafe) + * + */ + __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7cpython_4bool_bool)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_156 = ((PyBoolObject *)__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":1958 + * return DeferredGroupDel(self, space, predicate) + * + * def async_count(self, bytes space, dict predicate, bool unsafe=False): # <<<<<<<<<<<<<< + * return DeferredCount(self, space, predicate, unsafe) + * + */ + __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7cpython_4bool_bool)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_157 = ((PyBoolObject *)__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "_hyperdex_client.pyx":1 + * # Copyright (c) 2011, Cornell University # <<<<<<<<<<<<<< + * # All rights reserved. + * # + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + if (PyDict_SetItem(__pyx_d, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + + /* "cpython/datetime.pxd":211 + * + * # Get microseconds of timedelta + * cdef inline int timedelta_microseconds(object o): # <<<<<<<<<<<<<< + * return (o).microseconds + */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + if (__pyx_m) { + __Pyx_AddTraceback("init _hyperdex_client", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init _hyperdex_client"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#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 /* CYTHON_REFNANNY */ + +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 '%s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +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, + "%s() takes %s %" CYTHON_FORMAT_SSIZE_T "d positional argument%s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +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 +} + +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, + "%s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%s() got an unexpected keyword argument '%s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) { + PyObject* value; +#if PY_MAJOR_VERSION >= 3 + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (unlikely(PyErr_Occurred())) + return NULL; + value = default_value; + } + Py_INCREF(value); +#else + if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) { + value = PyDict_GetItem(d, key); + if (unlikely(!value)) { + value = default_value; + } + Py_INCREF(value); + } else { + if (default_value == Py_None) + default_value = NULL; + value = PyObject_CallMethodObjArgs( + d, __pyx_n_s__get, key, default_value, NULL); + } +#endif + return value; +} + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + 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); +#else + PyErr_Restore(type, value, tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(type, value, tb); +#endif +} + +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + 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 PY_VERSION_HEX < 0x02050000 + if (PyClass_Check(type)) { + #else + if (PyType_Check(type)) { + #endif +#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; + #if PY_VERSION_HEX < 0x02050000 + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } else { + type = 0; + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } + #else + 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; + } + #endif + } + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else /* Python 3+ */ +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 *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 = PyEval_CallObject(type, args); + 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) { + 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); + } + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +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); +} + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%s to unpack", + index, (index == 1) ? "" : "s"); +} + +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 +} + +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; +} + +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( + PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, + PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, + int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) { +#if CYTHON_COMPILING_IN_CPYTHON + PyMappingMethods* mp; +#if PY_MAJOR_VERSION < 3 + PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; + if (likely(ms && ms->sq_slice)) { + if (!has_cstart) { + if (_py_start && (*_py_start != Py_None)) { + cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); + if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstart = 0; + } + if (!has_cstop) { + if (_py_stop && (*_py_stop != Py_None)) { + cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); + if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstop = PY_SSIZE_T_MAX; + } + if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { + Py_ssize_t l = ms->sq_length(obj); + if (likely(l >= 0)) { + if (cstop < 0) { + cstop += l; + if (cstop < 0) cstop = 0; + } + if (cstart < 0) { + cstart += l; + if (cstart < 0) cstart = 0; + } + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + goto bad; + } + } + return ms->sq_slice(obj, cstart, cstop); + } +#endif + mp = Py_TYPE(obj)->tp_as_mapping; + if (likely(mp && mp->mp_subscript)) +#endif + { + PyObject* result; + PyObject *py_slice, *py_start, *py_stop; + if (_py_slice) { + py_slice = *_py_slice; + } else { + PyObject* owned_start = NULL; + PyObject* owned_stop = NULL; + if (_py_start) { + py_start = *_py_start; + } else { + if (has_cstart) { + owned_start = py_start = PyInt_FromSsize_t(cstart); + if (unlikely(!py_start)) goto bad; + } else + py_start = Py_None; + } + if (_py_stop) { + py_stop = *_py_stop; + } else { + if (has_cstop) { + owned_stop = py_stop = PyInt_FromSsize_t(cstop); + if (unlikely(!py_stop)) { + Py_XDECREF(owned_start); + goto bad; + } + } else + py_stop = Py_None; + } + py_slice = PySlice_New(py_start, py_stop, Py_None); + Py_XDECREF(owned_start); + Py_XDECREF(owned_stop); + if (unlikely(!py_slice)) goto bad; + } +#if CYTHON_COMPILING_IN_CPYTHON + result = mp->mp_subscript(obj, py_slice); +#else + result = PyObject_GetItem(obj, py_slice); +#endif + if (!_py_slice) { + Py_DECREF(py_slice); + } + return result; + } + PyErr_Format(PyExc_TypeError, + "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name); +bad: + return NULL; +} + +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, + int wraparound, 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, + int wraparound, 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, int wraparound, 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)) + PyErr_Clear(); + else + return NULL; + } + } + 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)); +} + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { + if (t == Py_None) { + __Pyx_RaiseNoneNotIterableError(); + } else if (PyTuple_GET_SIZE(t) < index) { + __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); + } else { + __Pyx_RaiseTooManyValuesError(index); + } +} + +static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, + int is_tuple, int has_known_size, int decref_tuple) { + Py_ssize_t index; + PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; + if (!is_tuple && unlikely(!PyTuple_Check(tuple))) { + iternextfunc iternext; + iter = PyObject_GetIter(tuple); + if (unlikely(!iter)) goto bad; + if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } + iternext = Py_TYPE(iter)->tp_iternext; + value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } + value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } + if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; + Py_DECREF(iter); + } else { + if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) { + __Pyx_UnpackTupleError(tuple, 2); + goto bad; + } +#if CYTHON_COMPILING_IN_PYPY + value1 = PySequence_ITEM(tuple, 0); + if (unlikely(!value1)) goto bad; + value2 = PySequence_ITEM(tuple, 1); + if (unlikely(!value2)) goto bad; +#else + value1 = PyTuple_GET_ITEM(tuple, 0); + value2 = PyTuple_GET_ITEM(tuple, 1); + Py_INCREF(value1); + Py_INCREF(value2); +#endif + if (decref_tuple) { Py_DECREF(tuple); } + } + *pvalue1 = value1; + *pvalue2 = value2; + return 0; +unpacking_failed: + if (!has_known_size && __Pyx_IterFinish() == 0) + __Pyx_RaiseNeedMoreValuesError(index); +bad: + Py_XDECREF(iter); + Py_XDECREF(value1); + Py_XDECREF(value2); + if (decref_tuple) { Py_XDECREF(tuple); } + return -1; +} + +static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, + Py_ssize_t* p_orig_length, int* p_source_is_dict) { + is_dict = is_dict || likely(PyDict_CheckExact(iterable)); + *p_source_is_dict = is_dict; +#if !CYTHON_COMPILING_IN_PYPY + if (is_dict) { + *p_orig_length = PyDict_Size(iterable); + Py_INCREF(iterable); + return iterable; + } +#endif + *p_orig_length = 0; + if (method_name) { + PyObject* iter; + iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); + if (!iterable) + return NULL; +#if !CYTHON_COMPILING_IN_PYPY + if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) + return iterable; +#endif + iter = PyObject_GetIter(iterable); + Py_DECREF(iterable); + return iter; + } + return PyObject_GetIter(iterable); +} +static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* iter_obj, Py_ssize_t orig_length, Py_ssize_t* ppos, + PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { + PyObject* next_item; +#if !CYTHON_COMPILING_IN_PYPY + if (source_is_dict) { + PyObject *key, *value; + if (unlikely(orig_length != PyDict_Size(iter_obj))) { + PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); + return -1; + } + if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { + return 0; + } + if (pitem) { + PyObject* tuple = PyTuple_New(2); + if (unlikely(!tuple)) { + return -1; + } + Py_INCREF(key); + Py_INCREF(value); + PyTuple_SET_ITEM(tuple, 0, key); + PyTuple_SET_ITEM(tuple, 1, value); + *pitem = tuple; + } else { + if (pkey) { + Py_INCREF(key); + *pkey = key; + } + if (pvalue) { + Py_INCREF(value); + *pvalue = value; + } + } + return 1; + } else if (PyTuple_CheckExact(iter_obj)) { + Py_ssize_t pos = *ppos; + if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; + *ppos = pos + 1; + next_item = PyTuple_GET_ITEM(iter_obj, pos); + Py_INCREF(next_item); + } else if (PyList_CheckExact(iter_obj)) { + Py_ssize_t pos = *ppos; + if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; + *ppos = pos + 1; + next_item = PyList_GET_ITEM(iter_obj, pos); + Py_INCREF(next_item); + } else +#endif + { + next_item = PyIter_Next(iter_obj); + if (unlikely(!next_item)) { + return __Pyx_IterFinish(); + } + } + if (pitem) { + *pitem = next_item; + } else if (pkey && pvalue) { + if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) + return -1; + } else if (pkey) { + *pkey = next_item; + } else { + *pvalue = next_item; + } + return 1; +} + +static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact) +{ + if (!type) { + PyErr_Format(PyExc_SystemError, "Missing type object"); + return 0; + } + if (none_allowed && obj == Py_None) return 1; + else if (exact) { + if (Py_TYPE(obj) == type) return 1; + } + else { + if (PyObject_TypeCheck(obj, type)) return 1; + } + PyErr_Format(PyExc_TypeError, + "Argument '%s' has incorrect type (expected %s, got %s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; +} + +static CYTHON_INLINE int __Pyx_DelItem_Generic(PyObject *o, PyObject *j) { + int r; + if (!j) return -1; + r = PyObject_DelItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE int __Pyx_DelItemInt_Fast(PyObject *o, Py_ssize_t i, + CYTHON_UNUSED int is_list, int wraparound) { +#if CYTHON_COMPILING_IN_PYPY + if (is_list || PySequence_Check(o)) { + return PySequence_DelItem(o, i); + } +#else + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_ass_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)) + PyErr_Clear(); + else + return -1; + } + } + return m->sq_ass_item(o, i, (PyObject *)NULL); + } +#endif + return __Pyx_DelItem_Generic(o, PyInt_FromSsize_t(i)); +} + +static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { + int r; + if (!j) return -1; + r = PyObject_SetItem(o, j, v); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, + int is_list, int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o)); + if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) { + PyObject* old = PyList_GET_ITEM(o, n); + Py_INCREF(v); + PyList_SET_ITEM(o, n, v); + Py_DECREF(old); + return 1; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_ass_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)) + PyErr_Clear(); + else + return -1; + } + } + return m->sq_ass_item(o, i, v); + } + } +#else +#if CYTHON_COMPILING_IN_PYPY + if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) { +#else + if (is_list || PySequence_Check(o)) { +#endif + return PySequence_SetItem(o, i, v); + } +#endif + return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v); +} + +#if PY_MAJOR_VERSION >= 3 +static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) { + return PyObject_CallMethodObjArgs(d, __pyx_n_s__items, NULL); +} +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) { + if (likely(PyList_CheckExact(L))) { + if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return NULL; + Py_INCREF(Py_None); + return Py_None; /* this is just to have an accurate signature */ + } else { + return __Pyx_PyObject_CallMethod1(L, __pyx_n_s__append, x); + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyObject_Pop(PyObject* L) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02040000 + if (likely(PyList_CheckExact(L)) + && likely(PyList_GET_SIZE(L) > (((PyListObject*)L)->allocated >> 1))) { + Py_SIZE(L) -= 1; + return PyList_GET_ITEM(L, PyList_GET_SIZE(L)); + } +#if PY_VERSION_HEX >= 0x02050000 + else if (Py_TYPE(L) == (&PySet_Type)) { + return PySet_Pop(L); + } +#endif +#endif + return __Pyx_PyObject_CallMethod0(L, __pyx_n_s__pop); +} + +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)) { + if (PyBytes_GET_SIZE(s1) != PyBytes_GET_SIZE(s2)) { + return (equals == Py_NE); + } else if (PyBytes_GET_SIZE(s1) == 1) { + if (equals == Py_EQ) + return (PyBytes_AS_STRING(s1)[0] == PyBytes_AS_STRING(s2)[0]); + else + return (PyBytes_AS_STRING(s1)[0] != PyBytes_AS_STRING(s2)[0]); + } else { + int result = memcmp(PyBytes_AS_STRING(s1), PyBytes_AS_STRING(s2), (size_t)PyBytes_GET_SIZE(s1)); + 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 +} + +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; /* Mark as deleted */ + 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(CYTHON_UNUSED __pyx_CyFunctionObject *op) +{ + PyObject* dict = PyModule_GetDict(__pyx_m); + Py_XINCREF(dict); + return dict; +} +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) { + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + 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); + Py_DECREF(res); + return 0; +} +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} +}; +#ifndef PY_WRITE_RESTRICTED /* < Py2.5 */ +#define PY_WRITE_RESTRICTED WRITE_RESTRICTED +#endif +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[] = { + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + op->func_weakreflist = 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; + 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_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]); + PyMem_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + if (m->func_weakreflist != 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_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 PyMethod_New(func, + type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return 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 = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + Py_ssize_t size; + switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) { + 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 (size == 0) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%zd 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 (size == 1) + return (*meth)(self, PyTuple_GET_ITEM(arg, 0)); + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%zd 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) + __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/ + sizeof(__pyx_CyFunctionObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ +#if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ +#else + 0, /*reserved*/ +#endif + (reprfunc) __Pyx_CyFunction_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __Pyx_CyFunction_Call, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/ + 0, /*tp_doc*/ + (traverseproc) __Pyx_CyFunction_traverse, /*tp_traverse*/ + (inquiry) __Pyx_CyFunction_clear, /*tp_clear*/ + 0, /*tp_richcompare*/ + offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_CyFunction_methods, /*tp_methods*/ + __pyx_CyFunction_members, /*tp_members*/ + __pyx_CyFunction_getsets, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + __Pyx_CyFunction_descr_get, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*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*/ +#if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ +#endif +}; +static int __Pyx_CyFunction_init(void) { +#if !CYTHON_COMPILING_IN_PYPY + __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; +#endif + if (PyType_Ready(&__pyx_CyFunctionType_type) < 0) + return -1; + __pyx_CyFunctionType = &__pyx_CyFunctionType_type; + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyMem_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); +} + +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_Format(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; +} + +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_VERSION_HEX >= 0x02050000 + { + #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; /* try absolute import on failure */ + } + #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 + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases) { + PyObject *metaclass; +#if PY_MAJOR_VERSION < 3 + if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) { + PyObject *base = PyTuple_GET_ITEM(bases, 0); + metaclass = __Pyx_PyObject_GetAttrStr(base, __pyx_n_s____class__); + if (!metaclass) { + PyErr_Clear(); + metaclass = (PyObject*) Py_TYPE(base); + } + } else { + metaclass = (PyObject *) &PyClass_Type; + } +#else + if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) { + PyObject *base = PyTuple_GET_ITEM(bases, 0); + metaclass = (PyObject*) Py_TYPE(base); + } else { + metaclass = (PyObject *) &PyType_Type; + } +#endif + Py_INCREF(metaclass); + return metaclass; +} + +static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, + PyObject *qualname, PyObject *modname) { + PyObject *result; + PyObject *metaclass; + if (PyDict_SetItem(dict, __pyx_n_s____module__, modname) < 0) + return NULL; + if (PyDict_SetItem(dict, __pyx_n_s____qualname__, qualname) < 0) + return NULL; + metaclass = PyDict_GetItem(dict, __pyx_n_s____metaclass__); + if (metaclass) { + Py_INCREF(metaclass); + } else { + metaclass = __Pyx_FindPy2Metaclass(bases); + } + result = PyObject_CallFunctionObjArgs(metaclass, name, bases, dict, NULL); + Py_DECREF(metaclass); + return result; +} + +static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_int64_t(int64_t val) { + const int64_t neg_one = (int64_t)-1, const_zero = (int64_t)0; + const int is_unsigned = const_zero < neg_one; + if ((sizeof(int64_t) == sizeof(char)) || + (sizeof(int64_t) == sizeof(short))) { + return PyInt_FromLong((long)val); + } else if ((sizeof(int64_t) == sizeof(int)) || + (sizeof(int64_t) == sizeof(long))) { + if (is_unsigned) + return PyLong_FromUnsignedLong((unsigned long)val); + else + return PyInt_FromLong((long)val); + } else if (sizeof(int64_t) == sizeof(PY_LONG_LONG)) { + if (is_unsigned) + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val); + else + return PyLong_FromLongLong((PY_LONG_LONG)val); + } else { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + return _PyLong_FromByteArray(bytes, sizeof(int64_t), + little, !is_unsigned); + } +} + +static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_uint64_t(uint64_t val) { + const uint64_t neg_one = (uint64_t)-1, const_zero = (uint64_t)0; + const int is_unsigned = const_zero < neg_one; + if ((sizeof(uint64_t) == sizeof(char)) || + (sizeof(uint64_t) == sizeof(short))) { + return PyInt_FromLong((long)val); + } else if ((sizeof(uint64_t) == sizeof(int)) || + (sizeof(uint64_t) == sizeof(long))) { + if (is_unsigned) + return PyLong_FromUnsignedLong((unsigned long)val); + else + return PyInt_FromLong((long)val); + } else if (sizeof(uint64_t) == sizeof(PY_LONG_LONG)) { + if (is_unsigned) + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val); + else + return PyLong_FromLongLong((PY_LONG_LONG)val); + } else { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + return _PyLong_FromByteArray(bytes, sizeof(uint64_t), + little, !is_unsigned); + } +} + +static CYTHON_INLINE uint16_t __Pyx_PyInt_from_py_uint16_t(PyObject* x) { + const uint16_t neg_one = (uint16_t)-1, const_zero = (uint16_t)0; + const int is_unsigned = const_zero < neg_one; + if (sizeof(uint16_t) == sizeof(char)) { + if (is_unsigned) + return (uint16_t)__Pyx_PyInt_AsUnsignedChar(x); + else + return (uint16_t)__Pyx_PyInt_AsSignedChar(x); + } else if (sizeof(uint16_t) == sizeof(short)) { + if (is_unsigned) + return (uint16_t)__Pyx_PyInt_AsUnsignedShort(x); + else + return (uint16_t)__Pyx_PyInt_AsSignedShort(x); + } else if (sizeof(uint16_t) == sizeof(int)) { + if (is_unsigned) + return (uint16_t)__Pyx_PyInt_AsUnsignedInt(x); + else + return (uint16_t)__Pyx_PyInt_AsSignedInt(x); + } else if (sizeof(uint16_t) == sizeof(long)) { + if (is_unsigned) + return (uint16_t)__Pyx_PyInt_AsUnsignedLong(x); + else + return (uint16_t)__Pyx_PyInt_AsSignedLong(x); + } else if (sizeof(uint16_t) == sizeof(PY_LONG_LONG)) { + if (is_unsigned) + return (uint16_t)__Pyx_PyInt_AsUnsignedLongLong(x); + else + return (uint16_t)__Pyx_PyInt_AsSignedLongLong(x); + } else { + #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); + #else + uint16_t val; + PyObject *v = __Pyx_PyNumber_Int(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 (uint16_t)-1; + } +} + +static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { + const unsigned char neg_one = (unsigned char)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (sizeof(unsigned char) < sizeof(long)) { + long val = __Pyx_PyInt_AsLong(x); + if (unlikely(val != (long)(unsigned char)val)) { + if (!unlikely(val == -1 && PyErr_Occurred())) { + PyErr_SetString(PyExc_OverflowError, + (is_unsigned && unlikely(val < 0)) ? + "can't convert negative value to unsigned char" : + "value too large to convert to unsigned char"); + } + return (unsigned char)-1; + } + return (unsigned char)val; + } + return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x); +} + +static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) { + const unsigned short neg_one = (unsigned short)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (sizeof(unsigned short) < sizeof(long)) { + long val = __Pyx_PyInt_AsLong(x); + if (unlikely(val != (long)(unsigned short)val)) { + if (!unlikely(val == -1 && PyErr_Occurred())) { + PyErr_SetString(PyExc_OverflowError, + (is_unsigned && unlikely(val < 0)) ? + "can't convert negative value to unsigned short" : + "value too large to convert to unsigned short"); + } + return (unsigned short)-1; + } + return (unsigned short)val; + } + return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x); +} + +static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) { + const unsigned int neg_one = (unsigned int)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (sizeof(unsigned int) < sizeof(long)) { + long val = __Pyx_PyInt_AsLong(x); + if (unlikely(val != (long)(unsigned int)val)) { + if (!unlikely(val == -1 && PyErr_Occurred())) { + PyErr_SetString(PyExc_OverflowError, + (is_unsigned && unlikely(val < 0)) ? + "can't convert negative value to unsigned int" : + "value too large to convert to unsigned int"); + } + return (unsigned int)-1; + } + return (unsigned int)val; + } + return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x); +} + +static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) { + const char neg_one = (char)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (sizeof(char) < sizeof(long)) { + long val = __Pyx_PyInt_AsLong(x); + if (unlikely(val != (long)(char)val)) { + if (!unlikely(val == -1 && PyErr_Occurred())) { + PyErr_SetString(PyExc_OverflowError, + (is_unsigned && unlikely(val < 0)) ? + "can't convert negative value to char" : + "value too large to convert to char"); + } + return (char)-1; + } + return (char)val; + } + return (char)__Pyx_PyInt_AsLong(x); +} + +static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) { + const short neg_one = (short)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (sizeof(short) < sizeof(long)) { + long val = __Pyx_PyInt_AsLong(x); + if (unlikely(val != (long)(short)val)) { + if (!unlikely(val == -1 && PyErr_Occurred())) { + PyErr_SetString(PyExc_OverflowError, + (is_unsigned && unlikely(val < 0)) ? + "can't convert negative value to short" : + "value too large to convert to short"); + } + return (short)-1; + } + return (short)val; + } + return (short)__Pyx_PyInt_AsLong(x); +} + +static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) { + const int neg_one = (int)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (sizeof(int) < sizeof(long)) { + long val = __Pyx_PyInt_AsLong(x); + if (unlikely(val != (long)(int)val)) { + if (!unlikely(val == -1 && PyErr_Occurred())) { + PyErr_SetString(PyExc_OverflowError, + (is_unsigned && unlikely(val < 0)) ? + "can't convert negative value to int" : + "value too large to convert to int"); + } + return (int)-1; + } + return (int)val; + } + return (int)__Pyx_PyInt_AsLong(x); +} + +static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) { + const signed char neg_one = (signed char)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (sizeof(signed char) < sizeof(long)) { + long val = __Pyx_PyInt_AsLong(x); + if (unlikely(val != (long)(signed char)val)) { + if (!unlikely(val == -1 && PyErr_Occurred())) { + PyErr_SetString(PyExc_OverflowError, + (is_unsigned && unlikely(val < 0)) ? + "can't convert negative value to signed char" : + "value too large to convert to signed char"); + } + return (signed char)-1; + } + return (signed char)val; + } + return (signed char)__Pyx_PyInt_AsSignedLong(x); +} + +static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) { + const signed short neg_one = (signed short)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (sizeof(signed short) < sizeof(long)) { + long val = __Pyx_PyInt_AsLong(x); + if (unlikely(val != (long)(signed short)val)) { + if (!unlikely(val == -1 && PyErr_Occurred())) { + PyErr_SetString(PyExc_OverflowError, + (is_unsigned && unlikely(val < 0)) ? + "can't convert negative value to signed short" : + "value too large to convert to signed short"); + } + return (signed short)-1; + } + return (signed short)val; + } + return (signed short)__Pyx_PyInt_AsSignedLong(x); +} + +static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { + const signed int neg_one = (signed int)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (sizeof(signed int) < sizeof(long)) { + long val = __Pyx_PyInt_AsLong(x); + if (unlikely(val != (long)(signed int)val)) { + if (!unlikely(val == -1 && PyErr_Occurred())) { + PyErr_SetString(PyExc_OverflowError, + (is_unsigned && unlikely(val < 0)) ? + "can't convert negative value to signed int" : + "value too large to convert to signed int"); + } + return (signed int)-1; + } + return (signed int)val; + } + return (signed int)__Pyx_PyInt_AsSignedLong(x); +} + +static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) { + const int neg_one = (int)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (sizeof(int) < sizeof(long)) { + long val = __Pyx_PyInt_AsLong(x); + if (unlikely(val != (long)(int)val)) { + if (!unlikely(val == -1 && PyErr_Occurred())) { + PyErr_SetString(PyExc_OverflowError, + (is_unsigned && unlikely(val < 0)) ? + "can't convert negative value to int" : + "value too large to convert to int"); + } + return (int)-1; + } + return (int)val; + } + return (int)__Pyx_PyInt_AsLong(x); +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 +#if CYTHON_USE_PYLONG_INTERNALS +#include "longintrepr.h" +#endif +#endif +static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { + const unsigned long neg_one = (unsigned long)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to unsigned long"); + return (unsigned long)-1; + } + return (unsigned long)val; + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 +#if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(unsigned long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (unsigned long) ((PyLongObject*)x)->ob_digit[0]; + } + } +#endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to unsigned long"); + return (unsigned long)-1; + } + return (unsigned long)PyLong_AsUnsignedLong(x); + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 +#if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(unsigned long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(unsigned long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(unsigned long) ((PyLongObject*)x)->ob_digit[0]; + } + } +#endif +#endif + return (unsigned long)PyLong_AsLong(x); + } + } else { + unsigned long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (unsigned long)-1; + val = __Pyx_PyInt_AsUnsignedLong(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 +#if CYTHON_USE_PYLONG_INTERNALS +#include "longintrepr.h" +#endif +#endif +static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) { + const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to unsigned PY_LONG_LONG"); + return (unsigned PY_LONG_LONG)-1; + } + return (unsigned PY_LONG_LONG)val; + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 +#if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(unsigned PY_LONG_LONG)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; + } + } +#endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to unsigned PY_LONG_LONG"); + return (unsigned PY_LONG_LONG)-1; + } + return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x); + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 +#if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(unsigned PY_LONG_LONG)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; + } + } +#endif +#endif + return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x); + } + } else { + unsigned PY_LONG_LONG val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (unsigned PY_LONG_LONG)-1; + val = __Pyx_PyInt_AsUnsignedLongLong(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 +#if CYTHON_USE_PYLONG_INTERNALS +#include "longintrepr.h" +#endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) { + const long neg_one = (long)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long)-1; + } + return (long)val; + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 +#if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } +#endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long)-1; + } + return (long)PyLong_AsUnsignedLong(x); + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 +#if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } +#endif +#endif + return (long)PyLong_AsLong(x); + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long)-1; + val = __Pyx_PyInt_AsLong(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 +#if CYTHON_USE_PYLONG_INTERNALS +#include "longintrepr.h" +#endif +#endif +static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { + const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to PY_LONG_LONG"); + return (PY_LONG_LONG)-1; + } + return (PY_LONG_LONG)val; + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 +#if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(PY_LONG_LONG)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; + } + } +#endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to PY_LONG_LONG"); + return (PY_LONG_LONG)-1; + } + return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x); + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 +#if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(PY_LONG_LONG)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; + } + } +#endif +#endif + return (PY_LONG_LONG)PyLong_AsLongLong(x); + } + } else { + PY_LONG_LONG val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (PY_LONG_LONG)-1; + val = __Pyx_PyInt_AsLongLong(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 +#if CYTHON_USE_PYLONG_INTERNALS +#include "longintrepr.h" +#endif +#endif +static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { + const signed long neg_one = (signed long)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to signed long"); + return (signed long)-1; + } + return (signed long)val; + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 +#if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(signed long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (signed long) ((PyLongObject*)x)->ob_digit[0]; + } + } +#endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to signed long"); + return (signed long)-1; + } + return (signed long)PyLong_AsUnsignedLong(x); + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 +#if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(signed long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(signed long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(signed long) ((PyLongObject*)x)->ob_digit[0]; + } + } +#endif +#endif + return (signed long)PyLong_AsLong(x); + } + } else { + signed long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (signed long)-1; + val = __Pyx_PyInt_AsSignedLong(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 +#if CYTHON_USE_PYLONG_INTERNALS +#include "longintrepr.h" +#endif +#endif +static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) { + const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to signed PY_LONG_LONG"); + return (signed PY_LONG_LONG)-1; + } + return (signed PY_LONG_LONG)val; + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 +#if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(signed PY_LONG_LONG)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; + } + } +#endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to signed PY_LONG_LONG"); + return (signed PY_LONG_LONG)-1; + } + return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x); + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 +#if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(signed PY_LONG_LONG)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; + } + } +#endif +#endif + return (signed PY_LONG_LONG)PyLong_AsLongLong(x); + } + } else { + signed PY_LONG_LONG val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (signed PY_LONG_LONG)-1; + val = __Pyx_PyInt_AsSignedLongLong(tmp); + Py_DECREF(tmp); + return val; + } +} + +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); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItemString(dict, "__pyx_vtable__", ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +#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 + +#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, + "%s.%s 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", + module_name, class_name); + #if PY_VERSION_HEX < 0x02050000 + if (PyErr_Warn(NULL, warning) < 0) goto bad; + #else + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + #endif + } + else if ((size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%s.%s has the wrong size, try recompiling", + module_name, class_name); + goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(py_module); + Py_XDECREF(result); + return NULL; +} +#endif + +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) / 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, 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); +} + +#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, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __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, /*int firstlineno,*/ + __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; + PyObject *py_globals = 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_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*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); +} + +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 /* Python 3+ has unicode identifiers */ + 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(char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, 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 __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 /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_DATA_SIZE(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (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_Int(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 Py_INCREF(x), 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, + "__%s__ returned non-%s (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 = 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) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} +static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) { + unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x); + if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) { + if ((val != (unsigned PY_LONG_LONG)-1) || !PyErr_Occurred()) + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to size_t"); + return (size_t)-1; + } + return (size_t)val; +} + + +#endif /* Py_PYTHON_H */ diff --git a/coordinator/transitions.cc b/coordinator/transitions.cc index 64fff0323..6771ad203 100644 --- a/coordinator/transitions.cc +++ b/coordinator/transitions.cc @@ -210,8 +210,8 @@ hyperdex_coordinator_migrate_data(struct replicant_state_machine_context* ctx, space_from.data()[space_from.size() - 1] != '\0' || space_to.data()[space_to.size() - 1] != '\0') { - fprintf(log, "received malformed \"migrate_data\" message\n"); \ - return generate_response(ctx, hyperdex::COORD_MALFORMED); \ + fprintf(log, "received malformed \"migrate_data\" message\n"); + return generate_response(ctx, hyperdex::COORD_MALFORMED); } c->new_migration(ctx, diff --git a/hyper.diff b/hyper.diff new file mode 100644 index 000000000..a4c88e743 --- /dev/null +++ b/hyper.diff @@ -0,0 +1,1203 @@ +diff --git a/.gitignore b/.gitignore +index c8a9772..597718e 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -61,6 +61,7 @@ + /hyperdex-initiate-transfer + /hyperdex-kill + /hyperdex-list-spaces ++/hyperdex-migrate-data + /hyperdex-perf-counters + /hyperdex-raw-backup + /hyperdex-rm-space +@@ -89,4 +90,3 @@ + /test/search-stress-test + /test/simple-consistency-stress-test + /ylwrap +-hyperdex-migrate-data +diff --git a/admin/admin.cc b/admin/admin.cc +index 886dbd2..7eb4044 100644 +--- a/admin/admin.cc ++++ b/admin/admin.cc +@@ -205,22 +205,20 @@ admin :: migrate_data(const char* space_from, const char* space_to, + int64_t id = m_next_admin_id; + ++m_next_admin_id; + e::intrusive_ptr op = new coord_rpc_generic(id, status, "migrate"); +- uint64_t space_from_sz = strlen(space_from); +- uint64_t space_to_sz = strlen(space_to); ++ uint32_t space_from_sz = strlen(space_from) + 1; ++ uint32_t space_to_sz = strlen(space_to) + 1; + + // Pack +- size_t total_sz = sizeof(uint64_t) * 2 + space_from_sz + space_to_sz; +- char buf[total_sz]; +- char* pos = buf; +- e::pack64be(space_from_sz, pos); +- pos += sizeof(uint64_t); ++ size_t total_sz = sizeof(uint32_t) * 2 + space_from_sz + space_to_sz; ++ std::vector buf(total_sz); ++ char* pos = &buf[0]; ++ pos = e::pack64be(space_from_sz, pos); + memcpy(pos, space_from, space_from_sz); + pos += space_from_sz; +- e::pack64be(space_to_sz, pos); +- pos += sizeof(uint64_t); ++ pos = e::pack64be(space_to_sz, pos); + memcpy(pos, space_to, space_to_sz); + +- int64_t cid = m_coord.rpc("migrate", buf, total_sz, ++ int64_t cid = m_coord.rpc("migrate", &buf[0], total_sz, + &op->repl_status, &op->repl_output, &op->repl_output_sz); + + if (cid >= 0) +diff --git a/bindings/__init__.py b/bindings/__init__.py +index a52901f..1d022b5 100644 +--- a/bindings/__init__.py ++++ b/bindings/__init__.py +@@ -70,6 +70,10 @@ class SpaceDescription(object): + args = (('const char*', 'description'),) + class SpaceList(object): + args = (('const char*', 'spaces'),) ++class SpaceFrom(object): ++ args = (('const char*', 'space_from'),) ++class SpaceTo(object): ++ args = (('const char*', 'space_to'),) + class Token(object): + args = (('uint64_t', 'token'),) + class Address(object): +@@ -167,6 +171,7 @@ Admin = [ + Method('add_space', AsyncCall, (SpaceDescription,), (AdminStatus,)), + Method('rm_space', AsyncCall, (SpaceName,), (AdminStatus,)), + Method('list_spaces', AsyncCall, (), (AdminStatus, SpaceList)), ++ Method('migrate_data', AsyncCall, (SpaceFrom, SpaceTo), (AdminStatus,)), + Method('server_register', AsyncCall, (Token, Address), (AdminStatus,)), + Method('server_online', AsyncCall, (Token,), (AdminStatus,)), + Method('server_offline', AsyncCall, (Token,), (AdminStatus,)), +diff --git a/common/network_msgtype.cc b/common/network_msgtype.cc +index 65d53cb..88b0dcb 100644 +--- a/common/network_msgtype.cc ++++ b/common/network_msgtype.cc +@@ -55,6 +55,8 @@ hyperdex :: operator << (std::ostream& lhs, const network_msgtype& rhs) + STRINGIFY(CHAIN_SUBSPACE); + STRINGIFY(CHAIN_ACK); + STRINGIFY(CHAIN_GC); ++ STRINGIFY(REQ_MIGRATION); ++ STRINGIFY(RESP_MIGRATION); + STRINGIFY(XFER_OP); + STRINGIFY(XFER_ACK); + STRINGIFY(XFER_HS); +diff --git a/common/network_msgtype.h b/common/network_msgtype.h +index 0fa1a10..26c80c0 100755 +--- a/common/network_msgtype.h ++++ b/common/network_msgtype.h +@@ -50,9 +50,6 @@ enum network_msgtype + RESP_SEARCH_ITEM = 35, + RESP_SEARCH_DONE = 36, + +- REQ_MIGRATION = 37, +- RESP_MIGRATION = 38, +- + REQ_SORTED_SEARCH = 40, + RESP_SORTED_SEARCH = 41, + +@@ -70,6 +67,9 @@ enum network_msgtype + CHAIN_ACK = 66, + CHAIN_GC = 67, + ++ REQ_MIGRATION = 78, ++ RESP_MIGRATION = 79, ++ + XFER_OP = 80, + XFER_ACK = 81, + XFER_HS = 82, // handshake syn +diff --git a/coordinator/transitions.cc b/coordinator/transitions.cc +index 269abd9..64fff03 100644 +--- a/coordinator/transitions.cc ++++ b/coordinator/transitions.cc +@@ -200,27 +200,23 @@ hyperdex_coordinator_migrate_data(struct replicant_state_machine_context* ctx, + PROTECT_UNINITIALIZED; + FILE* log = replicant_state_machine_log_stream(ctx); + coordinator* c = static_cast(obj); ++ e::slice space_from; ++ e::slice space_to; ++ e::unpacker up(data, data_sz); ++ up = up >> space_from >> space_to; ++ CHECK_UNPACK(migrate_data); ++ ++ if (space_from.empty() || space_to.empty() || ++ space_from.data()[space_from.size() - 1] != '\0' || ++ space_to.data()[space_to.size() - 1] != '\0') ++ { ++ fprintf(log, "received malformed \"migrate_data\" message\n"); \ ++ return generate_response(ctx, hyperdex::COORD_MALFORMED); \ ++ } + +- char* pos = const_cast(data); +- +- uint64_t space_from_sz; +- e::unpacker up_one(pos, sizeof(uint64_t)); +- up_one >> space_from_sz; +- pos += sizeof(uint64_t); +- char space_from[space_from_sz + 1]; +- memcpy(space_from, pos, space_from_sz); +- pos += space_from_sz; +- space_from[space_from_sz] = '\0'; +- +- uint64_t space_to_sz; +- e::unpacker up_two(pos, sizeof(uint64_t)); +- up_two >> space_to_sz; +- pos += sizeof(uint64_t); +- char space_to[space_to_sz + 1]; +- memcpy(space_to, pos, space_to_sz); +- space_to[space_to_sz] = '\0'; +- +- c->new_migration(ctx, space_from, space_to); ++ c->new_migration(ctx, ++ reinterpret_cast(space_from.data()), ++ reinterpret_cast(space_to.data())); + } + + void +diff --git a/doc/api/c.admin.tex b/doc/api/c.admin.tex +index b65be72..277df66 100644 +--- a/doc/api/c.admin.tex ++++ b/doc/api/c.admin.tex +@@ -222,6 +222,37 @@ int64_t hyperdex_admin_list_spaces(struct hyperdex_admin* admin, + \input{\topdir/api/fragments/c/admin/out_asynccall_spacelist} + \end{itemize} + ++%%%%%%%%%%%%%%%%%%%% migrate_data %%%%%%%%%%%%%%%%%%%% ++\pagebreak ++\subsubsection{\code{migrate\_data}} ++\label{api:c:migrate_data} ++\index{migrate\_data!C API} ++\input{\topdir/api/desc/migrate_data} ++ ++\paragraph{Definition:} ++\begin{ccode} ++int64_t hyperdex_admin_migrate_data(struct hyperdex_admin* admin, ++ const char* space_from, ++ const char* space_to, ++ enum hyperdex_admin_returncode* status); ++\end{ccode} ++ ++\paragraph{Parameters:} ++\begin{itemize}[noitemsep] ++\item \code{struct hyperdex\_admin* admin}\\ ++\input{\topdir/api/fragments/c/admin/in_asynccall_structadmin} ++\item \code{const char* space\_from}\\ ++\input{\topdir/api/fragments/c/admin/in_asynccall_spacefrom} ++\item \code{const char* space\_to}\\ ++\input{\topdir/api/fragments/c/admin/in_asynccall_spaceto} ++\end{itemize} ++ ++\paragraph{Returns:} ++\begin{itemize}[noitemsep] ++\item \code{enum hyperdex\_admin\_returncode* status}\\ ++\input{\topdir/api/fragments/c/admin/out_asynccall_adminstatus} ++\end{itemize} ++ + %%%%%%%%%%%%%%%%%%%% server_register %%%%%%%%%%%%%%%%%%%% + \pagebreak + \subsubsection{\code{server\_register}} +diff --git a/hyperdex-migrate b/hyperdex-migrate +deleted file mode 100755 +index 97402e3..0000000 +--- a/hyperdex-migrate ++++ /dev/null +@@ -1,228 +0,0 @@ +-#! /bin/bash +- +-# hyperdex-migrate - temporary wrapper script for .libs/hyperdex-migrate +-# Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1.3ubuntu1 +-# +-# The hyperdex-migrate program cannot be directly executed until all the libtool +-# libraries that it depends on are installed. +-# +-# This wrapper script should never be moved out of the build directory. +-# If it is, it will not operate correctly. +- +-# Sed substitution that helps us do robust quoting. It backslashifies +-# metacharacters that are still active within double-quoted strings. +-sed_quote_subst='s/\([`"$\\]\)/\\\1/g' +- +-# Be Bourne compatible +-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +- emulate sh +- NULLCMD=: +- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which +- # is contrary to our usage. Disable this feature. +- alias -g '${1+"$@"}'='"$@"' +- setopt NO_GLOB_SUBST +-else +- case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +-fi +-BIN_SH=xpg4; export BIN_SH # for Tru64 +-DUALCASE=1; export DUALCASE # for MKS sh +- +-# The HP-UX ksh and POSIX shell print the target directory to stdout +-# if CDPATH is set. +-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH +- +-relink_command="(cd /media/Work_Study/CS/workspace/HyperDex/HyperDex; { test -z \"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset COMPILER_PATH || { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z \"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; { test -z \"\${LD_LIBRARY_PATH+set}\" || unset LD_LIBRARY_PATH || { LD_LIBRARY_PATH=; export LD_LIBRARY_PATH; }; }; PATH=/home/derek/.rvm/gems/ruby-2.0.0-p0/bin:/home/derek/.rvm/gems/ruby-2.0.0-p0@global/bin:/home/derek/.rvm/rubies/ruby-2.0.0-p0/bin:/home/derek/.rvm/bin:/usr/lib/mipsel-linux/bin:/usr/local/heroku/bin:/home/derek/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/go/bin:/home/derek/go/bin:/home/derek/Dropbox/CS/workspace/go:/usr/lib/scala/bin:/usr/lib/akka/bin:/media/Work_Study/CS/workspace/Play:/home/derek/.cabal/bin:/usr/lib/vertx/bin:/usr/lib/jvm/jdk1.7.0/bin:/home/derek/Dropbox/CS/workspace/go/bin; export PATH; g++ -fvisibility=hidden -fvisibility-inlines-hidden -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -g -O2 -o \$progdir/\$file tools/migrate.o ./.libs/libhyperdex-admin.so /usr/lib/x86_64-linux-gnu/libpopt.so -Wl,-rpath -Wl,/media/Work_Study/CS/workspace/HyperDex/HyperDex/.libs)" +- +-# This environment variable determines our operation mode. +-if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then +- # install mode needs the following variables: +- generated_by_libtool_version='2.4.2' +- notinst_deplibs=' libhyperdex-admin.la' +-else +- # When we are sourced in execute mode, $file and $ECHO are already set. +- if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then +- file="$0" +- +-# A function that is used when there is no print builtin or printf. +-func_fallback_echo () +-{ +- eval 'cat <<_LTECHO_EOF +-$1 +-_LTECHO_EOF' +-} +- ECHO="printf %s\\n" +- fi +- +-# Very basic option parsing. These options are (a) specific to +-# the libtool wrapper, (b) are identical between the wrapper +-# /script/ and the wrapper /executable/ which is used only on +-# windows platforms, and (c) all begin with the string --lt- +-# (application programs are unlikely to have options which match +-# this pattern). +-# +-# There are only two supported options: --lt-debug and +-# --lt-dump-script. There is, deliberately, no --lt-help. +-# +-# The first argument to this parsing function should be the +-# script's ./libtool value, followed by no. +-lt_option_debug= +-func_parse_lt_options () +-{ +- lt_script_arg0=$0 +- shift +- for lt_opt +- do +- case "$lt_opt" in +- --lt-debug) lt_option_debug=1 ;; +- --lt-dump-script) +- lt_dump_D=`$ECHO "X$lt_script_arg0" | /bin/sed -e 's/^X//' -e 's%/[^/]*$%%'` +- test "X$lt_dump_D" = "X$lt_script_arg0" && lt_dump_D=. +- lt_dump_F=`$ECHO "X$lt_script_arg0" | /bin/sed -e 's/^X//' -e 's%^.*/%%'` +- cat "$lt_dump_D/$lt_dump_F" +- exit 0 +- ;; +- --lt-*) +- $ECHO "Unrecognized --lt- option: '$lt_opt'" 1>&2 +- exit 1 +- ;; +- esac +- done +- +- # Print the debug banner immediately: +- if test -n "$lt_option_debug"; then +- echo "hyperdex-migrate:hyperdex-migrate:${LINENO}: libtool wrapper (GNU libtool) 2.4.2 Debian-2.4.2-1.3ubuntu1" 1>&2 +- fi +-} +- +-# Used when --lt-debug. Prints its arguments to stdout +-# (redirection is the responsibility of the caller) +-func_lt_dump_args () +-{ +- lt_dump_args_N=1; +- for lt_arg +- do +- $ECHO "hyperdex-migrate:hyperdex-migrate:${LINENO}: newargv[$lt_dump_args_N]: $lt_arg" +- lt_dump_args_N=`expr $lt_dump_args_N + 1` +- done +-} +- +-# Core function for launching the target application +-func_exec_program_core () +-{ +- +- if test -n "$lt_option_debug"; then +- $ECHO "hyperdex-migrate:hyperdex-migrate:${LINENO}: newargv[0]: $progdir/$program" 1>&2 +- func_lt_dump_args ${1+"$@"} 1>&2 +- fi +- exec "$progdir/$program" ${1+"$@"} +- +- $ECHO "$0: cannot exec $program $*" 1>&2 +- exit 1 +-} +- +-# A function to encapsulate launching the target application +-# Strips options in the --lt-* namespace from $@ and +-# launches target application with the remaining arguments. +-func_exec_program () +-{ +- case " $* " in +- *\ --lt-*) +- for lt_wr_arg +- do +- case $lt_wr_arg in +- --lt-*) ;; +- *) set x "$@" "$lt_wr_arg"; shift;; +- esac +- shift +- done ;; +- esac +- func_exec_program_core ${1+"$@"} +-} +- +- # Parse options +- func_parse_lt_options "$0" ${1+"$@"} +- +- # Find the directory that this script lives in. +- thisdir=`$ECHO "$file" | /bin/sed 's%/[^/]*$%%'` +- test "x$thisdir" = "x$file" && thisdir=. +- +- # Follow symbolic links until we get to the real thisdir. +- file=`ls -ld "$file" | /bin/sed -n 's/.*-> //p'` +- while test -n "$file"; do +- destdir=`$ECHO "$file" | /bin/sed 's%/[^/]*$%%'` +- +- # If there was a directory component, then change thisdir. +- if test "x$destdir" != "x$file"; then +- case "$destdir" in +- [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;; +- *) thisdir="$thisdir/$destdir" ;; +- esac +- fi +- +- file=`$ECHO "$file" | /bin/sed 's%^.*/%%'` +- file=`ls -ld "$thisdir/$file" | /bin/sed -n 's/.*-> //p'` +- done +- +- # Usually 'no', except on cygwin/mingw when embedded into +- # the cwrapper. +- WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no +- if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then +- # special case for '.' +- if test "$thisdir" = "."; then +- thisdir=`pwd` +- fi +- # remove .libs from thisdir +- case "$thisdir" in +- *[\\/].libs ) thisdir=`$ECHO "$thisdir" | /bin/sed 's%[\\/][^\\/]*$%%'` ;; +- .libs ) thisdir=. ;; +- esac +- fi +- +- # Try to get the absolute directory name. +- absdir=`cd "$thisdir" && pwd` +- test -n "$absdir" && thisdir="$absdir" +- +- program=lt-'hyperdex-migrate' +- progdir="$thisdir/.libs" +- +- if test ! -f "$progdir/$program" || +- { file=`ls -1dt "$progdir/$program" "$progdir/../$program" 2>/dev/null | /bin/sed 1q`; \ +- test "X$file" != "X$progdir/$program"; }; then +- +- file="$$-$program" +- +- if test ! -d "$progdir"; then +- mkdir "$progdir" +- else +- rm -f "$progdir/$file" +- fi +- +- # relink executable if necessary +- if test -n "$relink_command"; then +- if relink_command_output=`eval $relink_command 2>&1`; then : +- else +- printf %s\n "$relink_command_output" >&2 +- rm -f "$progdir/$file" +- exit 1 +- fi +- fi +- +- mv -f "$progdir/$file" "$progdir/$program" 2>/dev/null || +- { rm -f "$progdir/$program"; +- mv -f "$progdir/$file" "$progdir/$program"; } +- rm -f "$progdir/$file" +- fi +- +- if test -f "$progdir/$program"; then +- if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then +- # Run the actual program with our arguments. +- func_exec_program ${1+"$@"} +- fi +- else +- # The program doesn't exist. +- $ECHO "$0: error: \`$progdir/$program' does not exist" 1>&2 +- $ECHO "This script is just a wrapper for $program." 1>&2 +- $ECHO "See the libtool documentation for more information." 1>&2 +- exit 1 +- fi +-fi +diff --git a/m4/.gitignore b/m4/.gitignore +new file mode 100644 +index 0000000..e69de29 +diff --git a/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4 +new file mode 100644 +index 0000000..c3a8d69 +--- /dev/null ++++ b/m4/ax_check_compile_flag.m4 +@@ -0,0 +1,72 @@ ++# =========================================================================== ++# http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html ++# =========================================================================== ++# ++# SYNOPSIS ++# ++# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS]) ++# ++# DESCRIPTION ++# ++# Check whether the given FLAG works with the current language's compiler ++# or gives an error. (Warnings, however, are ignored) ++# ++# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on ++# success/failure. ++# ++# If EXTRA-FLAGS is defined, it is added to the current language's default ++# flags (e.g. CFLAGS) when the check is done. The check is thus made with ++# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to ++# force the compiler to issue an error when a bad flag is given. ++# ++# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this ++# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. ++# ++# LICENSE ++# ++# Copyright (c) 2008 Guido U. Draheim ++# Copyright (c) 2011 Maarten Bosmans ++# ++# This program is free software: you can redistribute it and/or modify it ++# under the terms of the GNU General Public License as published by the ++# Free Software Foundation, either version 3 of the License, or (at your ++# option) any later version. ++# ++# This program is distributed in the hope that it will be useful, but ++# WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General ++# Public License for more details. ++# ++# You should have received a copy of the GNU General Public License along ++# with this program. If not, see . ++# ++# As a special exception, the respective Autoconf Macro's copyright owner ++# gives unlimited permission to copy, distribute and modify the configure ++# scripts that are the output of Autoconf when processing the Macro. You ++# need not follow the terms of the GNU General Public License when using ++# or distributing such scripts, even though portions of the text of the ++# Macro appear in them. The GNU General Public License (GPL) does govern ++# all other use of the material that constitutes the Autoconf Macro. ++# ++# This special exception to the GPL applies to versions of the Autoconf ++# Macro released by the Autoconf Archive. When you make and distribute a ++# modified version of the Autoconf Macro, you may extend this special ++# exception to the GPL to apply to your modified version as well. ++ ++#serial 2 ++ ++AC_DEFUN([AX_CHECK_COMPILE_FLAG], ++[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX ++AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl ++AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ ++ ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS ++ _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" ++ AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], ++ [AS_VAR_SET(CACHEVAR,[yes])], ++ [AS_VAR_SET(CACHEVAR,[no])]) ++ _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) ++AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes], ++ [m4_default([$2], :)], ++ [m4_default([$3], :)]) ++AS_VAR_POPDEF([CACHEVAR])dnl ++])dnl AX_CHECK_COMPILE_FLAGS +diff --git a/m4/ax_check_link_flag.m4 b/m4/ax_check_link_flag.m4 +new file mode 100644 +index 0000000..e2d0d36 +--- /dev/null ++++ b/m4/ax_check_link_flag.m4 +@@ -0,0 +1,71 @@ ++# =========================================================================== ++# http://www.gnu.org/software/autoconf-archive/ax_check_link_flag.html ++# =========================================================================== ++# ++# SYNOPSIS ++# ++# AX_CHECK_LINK_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS]) ++# ++# DESCRIPTION ++# ++# Check whether the given FLAG works with the linker or gives an error. ++# (Warnings, however, are ignored) ++# ++# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on ++# success/failure. ++# ++# If EXTRA-FLAGS is defined, it is added to the linker's default flags ++# when the check is done. The check is thus made with the flags: "LDFLAGS ++# EXTRA-FLAGS FLAG". This can for example be used to force the linker to ++# issue an error when a bad flag is given. ++# ++# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this ++# macro in sync with AX_CHECK_{PREPROC,COMPILE}_FLAG. ++# ++# LICENSE ++# ++# Copyright (c) 2008 Guido U. Draheim ++# Copyright (c) 2011 Maarten Bosmans ++# ++# This program is free software: you can redistribute it and/or modify it ++# under the terms of the GNU General Public License as published by the ++# Free Software Foundation, either version 3 of the License, or (at your ++# option) any later version. ++# ++# This program is distributed in the hope that it will be useful, but ++# WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General ++# Public License for more details. ++# ++# You should have received a copy of the GNU General Public License along ++# with this program. If not, see . ++# ++# As a special exception, the respective Autoconf Macro's copyright owner ++# gives unlimited permission to copy, distribute and modify the configure ++# scripts that are the output of Autoconf when processing the Macro. You ++# need not follow the terms of the GNU General Public License when using ++# or distributing such scripts, even though portions of the text of the ++# Macro appear in them. The GNU General Public License (GPL) does govern ++# all other use of the material that constitutes the Autoconf Macro. ++# ++# This special exception to the GPL applies to versions of the Autoconf ++# Macro released by the Autoconf Archive. When you make and distribute a ++# modified version of the Autoconf Macro, you may extend this special ++# exception to the GPL to apply to your modified version as well. ++ ++#serial 2 ++ ++AC_DEFUN([AX_CHECK_LINK_FLAG], ++[AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_ldflags_$4_$1])dnl ++AC_CACHE_CHECK([whether the linker accepts $1], CACHEVAR, [ ++ ax_check_save_flags=$LDFLAGS ++ LDFLAGS="$LDFLAGS $4 $1" ++ AC_LINK_IFELSE([AC_LANG_PROGRAM()], ++ [AS_VAR_SET(CACHEVAR,[yes])], ++ [AS_VAR_SET(CACHEVAR,[no])]) ++ LDFLAGS=$ax_check_save_flags]) ++AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes], ++ [m4_default([$2], :)], ++ [m4_default([$3], :)]) ++AS_VAR_POPDEF([CACHEVAR])dnl ++])dnl AX_CHECK_LINK_FLAGS +diff --git a/m4/ax_check_preproc_flag.m4 b/m4/ax_check_preproc_flag.m4 +new file mode 100644 +index 0000000..b1cfef6 +--- /dev/null ++++ b/m4/ax_check_preproc_flag.m4 +@@ -0,0 +1,72 @@ ++# =========================================================================== ++# http://www.gnu.org/software/autoconf-archive/ax_check_preproc_flag.html ++# =========================================================================== ++# ++# SYNOPSIS ++# ++# AX_CHECK_PREPROC_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS]) ++# ++# DESCRIPTION ++# ++# Check whether the given FLAG works with the current language's ++# preprocessor or gives an error. (Warnings, however, are ignored) ++# ++# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on ++# success/failure. ++# ++# If EXTRA-FLAGS is defined, it is added to the preprocessor's default ++# flags when the check is done. The check is thus made with the flags: ++# "CPPFLAGS EXTRA-FLAGS FLAG". This can for example be used to force the ++# preprocessor to issue an error when a bad flag is given. ++# ++# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this ++# macro in sync with AX_CHECK_{COMPILE,LINK}_FLAG. ++# ++# LICENSE ++# ++# Copyright (c) 2008 Guido U. Draheim ++# Copyright (c) 2011 Maarten Bosmans ++# ++# This program is free software: you can redistribute it and/or modify it ++# under the terms of the GNU General Public License as published by the ++# Free Software Foundation, either version 3 of the License, or (at your ++# option) any later version. ++# ++# This program is distributed in the hope that it will be useful, but ++# WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General ++# Public License for more details. ++# ++# You should have received a copy of the GNU General Public License along ++# with this program. If not, see . ++# ++# As a special exception, the respective Autoconf Macro's copyright owner ++# gives unlimited permission to copy, distribute and modify the configure ++# scripts that are the output of Autoconf when processing the Macro. You ++# need not follow the terms of the GNU General Public License when using ++# or distributing such scripts, even though portions of the text of the ++# Macro appear in them. The GNU General Public License (GPL) does govern ++# all other use of the material that constitutes the Autoconf Macro. ++# ++# This special exception to the GPL applies to versions of the Autoconf ++# Macro released by the Autoconf Archive. When you make and distribute a ++# modified version of the Autoconf Macro, you may extend this special ++# exception to the GPL to apply to your modified version as well. ++ ++#serial 2 ++ ++AC_DEFUN([AX_CHECK_PREPROC_FLAG], ++[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX ++AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]cppflags_$4_$1])dnl ++AC_CACHE_CHECK([whether _AC_LANG preprocessor accepts $1], CACHEVAR, [ ++ ax_check_save_flags=$CPPFLAGS ++ CPPFLAGS="$CPPFLAGS $4 $1" ++ AC_PREPROC_IFELSE([AC_LANG_PROGRAM()], ++ [AS_VAR_SET(CACHEVAR,[yes])], ++ [AS_VAR_SET(CACHEVAR,[no])]) ++ CPPFLAGS=$ax_check_save_flags]) ++AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes], ++ [m4_default([$2], :)], ++ [m4_default([$3], :)]) ++AS_VAR_POPDEF([CACHEVAR])dnl ++])dnl AX_CHECK_PREPROC_FLAGS +diff --git a/m4/ax_python_devel.m4 b/m4/ax_python_devel.m4 +new file mode 100644 +index 0000000..cf2163c +--- /dev/null ++++ b/m4/ax_python_devel.m4 +@@ -0,0 +1,324 @@ ++# =========================================================================== ++# http://www.gnu.org/software/autoconf-archive/ax_python_devel.html ++# =========================================================================== ++# ++# SYNOPSIS ++# ++# AX_PYTHON_DEVEL([version]) ++# ++# DESCRIPTION ++# ++# Note: Defines as a precious variable "PYTHON_VERSION". Don't override it ++# in your configure.ac. ++# ++# This macro checks for Python and tries to get the include path to ++# 'Python.h'. It provides the $(PYTHON_CPPFLAGS) and $(PYTHON_LDFLAGS) ++# output variables. It also exports $(PYTHON_EXTRA_LIBS) and ++# $(PYTHON_EXTRA_LDFLAGS) for embedding Python in your code. ++# ++# You can search for some particular version of Python by passing a ++# parameter to this macro, for example ">= '2.3.1'", or "== '2.4'". Please ++# note that you *have* to pass also an operator along with the version to ++# match, and pay special attention to the single quotes surrounding the ++# version number. Don't use "PYTHON_VERSION" for this: that environment ++# variable is declared as precious and thus reserved for the end-user. ++# ++# This macro should work for all versions of Python >= 2.1.0. As an end ++# user, you can disable the check for the python version by setting the ++# PYTHON_NOVERSIONCHECK environment variable to something else than the ++# empty string. ++# ++# If you need to use this macro for an older Python version, please ++# contact the authors. We're always open for feedback. ++# ++# LICENSE ++# ++# Copyright (c) 2009 Sebastian Huber ++# Copyright (c) 2009 Alan W. Irwin ++# Copyright (c) 2009 Rafael Laboissiere ++# Copyright (c) 2009 Andrew Collier ++# Copyright (c) 2009 Matteo Settenvini ++# Copyright (c) 2009 Horst Knorr ++# Copyright (c) 2013 Daniel Mullner ++# ++# This program is free software: you can redistribute it and/or modify it ++# under the terms of the GNU General Public License as published by the ++# Free Software Foundation, either version 3 of the License, or (at your ++# option) any later version. ++# ++# This program is distributed in the hope that it will be useful, but ++# WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General ++# Public License for more details. ++# ++# You should have received a copy of the GNU General Public License along ++# with this program. If not, see . ++# ++# As a special exception, the respective Autoconf Macro's copyright owner ++# gives unlimited permission to copy, distribute and modify the configure ++# scripts that are the output of Autoconf when processing the Macro. You ++# need not follow the terms of the GNU General Public License when using ++# or distributing such scripts, even though portions of the text of the ++# Macro appear in them. The GNU General Public License (GPL) does govern ++# all other use of the material that constitutes the Autoconf Macro. ++# ++# This special exception to the GPL applies to versions of the Autoconf ++# Macro released by the Autoconf Archive. When you make and distribute a ++# modified version of the Autoconf Macro, you may extend this special ++# exception to the GPL to apply to your modified version as well. ++ ++#serial 16 ++ ++AU_ALIAS([AC_PYTHON_DEVEL], [AX_PYTHON_DEVEL]) ++AC_DEFUN([AX_PYTHON_DEVEL],[ ++ # ++ # Allow the use of a (user set) custom python version ++ # ++ AC_ARG_VAR([PYTHON_VERSION],[The installed Python ++ version to use, for example '2.3'. This string ++ will be appended to the Python interpreter ++ canonical name.]) ++ ++ AC_PATH_PROG([PYTHON],[python[$PYTHON_VERSION]]) ++ if test -z "$PYTHON"; then ++ AC_MSG_ERROR([Cannot find python$PYTHON_VERSION in your system path]) ++ PYTHON_VERSION="" ++ fi ++ ++ # ++ # Check for a version of Python >= 2.1.0 ++ # ++ AC_MSG_CHECKING([for a version of Python >= '2.1.0']) ++ ac_supports_python_ver=`$PYTHON -c "import sys; \ ++ ver = sys.version.split ()[[0]]; \ ++ print (ver >= '2.1.0')"` ++ if test "$ac_supports_python_ver" != "True"; then ++ if test -z "$PYTHON_NOVERSIONCHECK"; then ++ AC_MSG_RESULT([no]) ++ AC_MSG_FAILURE([ ++This version of the AC@&t@_PYTHON_DEVEL macro ++doesn't work properly with versions of Python before ++2.1.0. You may need to re-run configure, setting the ++variables PYTHON_CPPFLAGS, PYTHON_LDFLAGS, PYTHON_SITE_PKG, ++PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand. ++Moreover, to disable this check, set PYTHON_NOVERSIONCHECK ++to something else than an empty string. ++]) ++ else ++ AC_MSG_RESULT([skip at user request]) ++ fi ++ else ++ AC_MSG_RESULT([yes]) ++ fi ++ ++ # ++ # if the macro parameter ``version'' is set, honour it ++ # ++ if test -n "$1"; then ++ AC_MSG_CHECKING([for a version of Python $1]) ++ ac_supports_python_ver=`$PYTHON -c "import sys; \ ++ ver = sys.version.split ()[[0]]; \ ++ print (ver $1)"` ++ if test "$ac_supports_python_ver" = "True"; then ++ AC_MSG_RESULT([yes]) ++ else ++ AC_MSG_RESULT([no]) ++ AC_MSG_ERROR([this package requires Python $1. ++If you have it installed, but it isn't the default Python ++interpreter in your system path, please pass the PYTHON_VERSION ++variable to configure. See ``configure --help'' for reference. ++]) ++ PYTHON_VERSION="" ++ fi ++ fi ++ ++ # ++ # Check if you have distutils, else fail ++ # ++ AC_MSG_CHECKING([for the distutils Python package]) ++ ac_distutils_result=`$PYTHON -c "import distutils" 2>&1` ++ if test -z "$ac_distutils_result"; then ++ AC_MSG_RESULT([yes]) ++ else ++ AC_MSG_RESULT([no]) ++ AC_MSG_ERROR([cannot import Python module "distutils". ++Please check your Python installation. The error was: ++$ac_distutils_result]) ++ PYTHON_VERSION="" ++ fi ++ ++ # ++ # Check for Python include path ++ # ++ AC_MSG_CHECKING([for Python include path]) ++ if test -z "$PYTHON_CPPFLAGS"; then ++ python_path=`$PYTHON -c "import distutils.sysconfig; \ ++ print (distutils.sysconfig.get_python_inc ());"` ++ plat_python_path=`$PYTHON -c "import distutils.sysconfig; \ ++ print (distutils.sysconfig.get_python_inc (plat_specific=1));"` ++ if test -n "${python_path}"; then ++ if test "${plat_python_path}" != "${python_path}"; then ++ python_path="-I$python_path -I$plat_python_path" ++ else ++ python_path="-I$python_path" ++ fi ++ fi ++ PYTHON_CPPFLAGS=$python_path ++ fi ++ AC_MSG_RESULT([$PYTHON_CPPFLAGS]) ++ AC_SUBST([PYTHON_CPPFLAGS]) ++ ++ # ++ # Check for Python library path ++ # ++ AC_MSG_CHECKING([for Python library path]) ++ if test -z "$PYTHON_LDFLAGS"; then ++ # (makes two attempts to ensure we've got a version number ++ # from the interpreter) ++ ac_python_version=`cat<]], ++ [[Py_Initialize();]]) ++ ],[pythonexists=yes],[pythonexists=no]) ++ AC_LANG_POP([C]) ++ # turn back to default flags ++ CPPFLAGS="$ac_save_CPPFLAGS" ++ LIBS="$ac_save_LIBS" ++ ++ AC_MSG_RESULT([$pythonexists]) ++ ++ if test ! "x$pythonexists" = "xyes"; then ++ AC_MSG_FAILURE([ ++ Could not link test program to Python. Maybe the main Python library has been ++ installed in some non-standard library path. If so, pass it to configure, ++ via the LDFLAGS environment variable. ++ Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib" ++ ============================================================================ ++ ERROR! ++ You probably have to install the development version of the Python package ++ for your distribution. The exact name of this package varies among them. ++ ============================================================================ ++ ]) ++ PYTHON_VERSION="" ++ fi ++ ++ # ++ # all done! ++ # ++]) +diff --git a/test-driver b/test-driver +deleted file mode 100755 +index 32bf39e..0000000 +--- a/test-driver ++++ /dev/null +@@ -1,127 +0,0 @@ +-#! /bin/sh +-# test-driver - basic testsuite driver script. +- +-scriptversion=2012-06-27.10; # UTC +- +-# Copyright (C) 2011-2013 Free Software Foundation, Inc. +-# +-# This program is free software; you can redistribute it and/or modify +-# it under the terms of the GNU General Public License as published by +-# the Free Software Foundation; either version 2, or (at your option) +-# any later version. +-# +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# along with this program. If not, see . +- +-# As a special exception to the GNU General Public License, if you +-# distribute this file as part of a program that contains a +-# configuration script generated by Autoconf, you may include it under +-# the same distribution terms that you use for the rest of that program. +- +-# This file is maintained in Automake, please report +-# bugs to or send patches to +-# . +- +-# Make unconditional expansion of undefined variables an error. This +-# helps a lot in preventing typo-related bugs. +-set -u +- +-usage_error () +-{ +- echo "$0: $*" >&2 +- print_usage >&2 +- exit 2 +-} +- +-print_usage () +-{ +- cat <$log_file 2>&1 +-estatus=$? +-if test $enable_hard_errors = no && test $estatus -eq 99; then +- estatus=1 +-fi +- +-case $estatus:$expect_failure in +- 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; +- 0:*) col=$grn res=PASS recheck=no gcopy=no;; +- 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; +- 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; +- *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; +- *:*) col=$red res=FAIL recheck=yes gcopy=yes;; +-esac +- +-# Report outcome to console. +-echo "${col}${res}${std}: $test_name" +- +-# Register the test result, and other relevant metadata. +-echo ":test-result: $res" > $trs_file +-echo ":global-test-result: $res" >> $trs_file +-echo ":recheck: $recheck" >> $trs_file +-echo ":copy-in-global-log: $gcopy" >> $trs_file +- +-# Local Variables: +-# mode: shell-script +-# sh-indentation: 2 +-# eval: (add-hook 'write-file-hooks 'time-stamp) +-# time-stamp-start: "scriptversion=" +-# time-stamp-format: "%:y-%02m-%02d.%02H" +-# time-stamp-time-zone: "UTC" +-# time-stamp-end: "; # UTC" +-# End: +diff --git a/test/migration-test.cc b/test/migration-test.cc +index ffe109c..bfbaa34 100644 +--- a/test/migration-test.cc ++++ b/test/migration-test.cc +@@ -295,8 +295,10 @@ test0() + FAIL("migration failure: " << status); + } + +- std::cout << "Sleeping for 20 seconds for the migration to complete...\n"; +- usleep(20 * 1000 * 1000); ++ std::cout << "Sleeping for 5 seconds for the migration to complete...\n"; ++ std::cout << "This could fail if your disk is too slow (i.e. if you are using a HDD).\n"; ++ std::cout << "In this case, you could modify the test file to wait for longer.\n"; ++ usleep(5 * 1000 * 1000); + + read_and_verify_data(_space_to_name, num_objects); + +diff --git a/tools/migrate-data.cc b/tools/migrate-data.cc +index 9d247d3..50ef8cf 100644 +--- a/tools/migrate-data.cc ++++ b/tools/migrate-data.cc +@@ -1,4 +1,4 @@ +-// Copyright (c) 2012, Cornell University ++// Copyright (c) 2014, Cornell University + // All rights reserved. + // + // Redistribution and use in source and binary forms, with or without +@@ -9,7 +9,7 @@ + // * Redistributions in binary form must reproduce the above copyright + // notice, this list of conditions and the following disclaimer in the + // documentation and/or other materials provided with the distribution. +-// * Neither the name of Replicant nor the names of its contributors may be ++// * Neither the name of HyperDex nor the names of its contributors may be + // used to endorse or promote products derived from this software without + // specific prior written permission. + // +@@ -53,16 +53,15 @@ main(int argc, const char* argv[]) + return EXIT_FAILURE; + } + +- try ++ if (ap.args_sz() != 2) + { +- if (ap.args_sz() != 2) { +- std::cerr << "invalid arguments: expecting exactly two space names\n" << std::endl; +- ap.usage(); +- return EXIT_FAILURE; +- } +- +- ++ std::cerr << "invalid arguments: expecting exactly two space names\n" << std::endl; ++ ap.usage(); ++ return EXIT_FAILURE; ++ } + ++ try ++ { + hyperdex::Admin h(conn.host(), conn.port()); + hyperdex_admin_returncode rrc; + +@@ -91,7 +90,6 @@ main(int argc, const char* argv[]) + return EXIT_FAILURE; + } + +- std::cout << "migration in process..." << std::endl; + return EXIT_SUCCESS; + } + catch (std::exception& e) diff --git a/hyperdex.diff b/hyperdex.diff new file mode 100644 index 000000000..a545c6892 --- /dev/null +++ b/hyperdex.diff @@ -0,0 +1,4089 @@ +diff --git a/.gitignore b/.gitignore +index f4f91fc..b470804 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -86,3 +86,4 @@ + /test/replication-stress-test + /test/search-stress-test + /ylwrap ++hyperdex-migrate-data +diff --git a/Makefile.am b/Makefile.am +index 4316db0..2b0663d 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -139,6 +139,7 @@ noinst_HEADERS += common/schema.h + noinst_HEADERS += common/serialization.h + noinst_HEADERS += common/server.h + noinst_HEADERS += common/transfer.h ++noinst_HEADERS += common/migration.h + noinst_HEADERS += tools/common.h + + check_PROGRAMS += common/test/ordered_encoding +@@ -201,6 +202,9 @@ noinst_HEADERS += daemon/state_transfer_manager.h + noinst_HEADERS += daemon/state_transfer_manager_pending.h + noinst_HEADERS += daemon/state_transfer_manager_transfer_in_state.h + noinst_HEADERS += daemon/state_transfer_manager_transfer_out_state.h ++noinst_HEADERS += daemon/migration_manager.h ++noinst_HEADERS += daemon/migration_manager_pending.h ++noinst_HEADERS += daemon/migration_out_state.h + + EXTRA_DIST += man/hyperdex-daemon.1.md + EXTRA_DIST += man/hyperdex-daemon.1.h2m +@@ -232,6 +236,7 @@ hyperdex_daemon_SOURCES += common/schema.cc + hyperdex_daemon_SOURCES += common/serialization.cc + hyperdex_daemon_SOURCES += common/server.cc + hyperdex_daemon_SOURCES += common/transfer.cc ++hyperdex_daemon_SOURCES += common/migration.cc + hyperdex_daemon_SOURCES += cityhash/city.cc + hyperdex_daemon_SOURCES += daemon/communication.cc + hyperdex_daemon_SOURCES += daemon/coordinator_link_wrapper.cc +@@ -260,6 +265,9 @@ hyperdex_daemon_SOURCES += daemon/state_transfer_manager.cc + hyperdex_daemon_SOURCES += daemon/state_transfer_manager_pending.cc + hyperdex_daemon_SOURCES += daemon/state_transfer_manager_transfer_in_state.cc + hyperdex_daemon_SOURCES += daemon/state_transfer_manager_transfer_out_state.cc ++hyperdex_daemon_SOURCES += daemon/migration_manager.cc ++hyperdex_daemon_SOURCES += daemon/migration_manager_pending.cc ++hyperdex_daemon_SOURCES += daemon/migration_out_state.cc + hyperdex_daemon_CXXFLAGS = $(AM_CXXFLAGS) $(CXXFLAGS) + hyperdex_daemon_LDADD = + hyperdex_daemon_LDADD += $(E_LIBS) +@@ -308,6 +316,7 @@ libhyperdex_coordinator_la_SOURCES += common/schema.cc + libhyperdex_coordinator_la_SOURCES += common/serialization.cc + libhyperdex_coordinator_la_SOURCES += common/server.cc + libhyperdex_coordinator_la_SOURCES += common/transfer.cc ++libhyperdex_coordinator_la_SOURCES += common/migration.cc + libhyperdex_coordinator_la_SOURCES += coordinator/coordinator.cc + libhyperdex_coordinator_la_SOURCES += coordinator/replica_sets.cc + libhyperdex_coordinator_la_SOURCES += coordinator/server_barrier.cc +@@ -387,6 +396,7 @@ libhyperdex_client_la_SOURCES += common/schema.cc + libhyperdex_client_la_SOURCES += common/server.cc + libhyperdex_client_la_SOURCES += common/serialization.cc + libhyperdex_client_la_SOURCES += common/transfer.cc ++libhyperdex_client_la_SOURCES += common/migration.cc + libhyperdex_client_la_SOURCES += cityhash/city.cc + libhyperdex_client_la_SOURCES += client/c.cc + libhyperdex_client_la_SOURCES += client/client.cc +@@ -472,6 +482,7 @@ libhyperdex_admin_la_SOURCES += common/schema.cc + libhyperdex_admin_la_SOURCES += common/serialization.cc + libhyperdex_admin_la_SOURCES += common/server.cc + libhyperdex_admin_la_SOURCES += common/transfer.cc ++libhyperdex_admin_la_SOURCES += common/migration.cc + libhyperdex_admin_la_SOURCES += cityhash/city.cc + libhyperdex_admin_la_SOURCES += admin/admin.cc + libhyperdex_admin_la_SOURCES += admin/backup_state_machine.cc +@@ -983,6 +994,7 @@ hyperdexexec_PROGRAMS += hyperdex-wait-until-stable + hyperdexexec_PROGRAMS += hyperdex-backup + hyperdexexec_PROGRAMS += hyperdex-backup-manager + hyperdexexec_PROGRAMS += hyperdex-raw-backup ++hyperdexexec_PROGRAMS += hyperdex-migrate-data + dist_man_MANS += man/hyperdex-add-space.1 + dist_man_MANS += man/hyperdex-rm-space.1 + dist_man_MANS += man/hyperdex-list-spaces.1 +@@ -1000,6 +1012,7 @@ dist_man_MANS += man/hyperdex-wait-until-stable.1 + dist_man_MANS += man/hyperdex-backup.1 + dist_man_MANS += man/hyperdex-backup-manager.1 + dist_man_MANS += man/hyperdex-raw-backup.1 ++dist_man_MANS += man/hyperdex-migrate-data.1 + endif + + # hyperdex +@@ -1167,6 +1180,15 @@ man/hyperdex-raw-backup.1: man/hyperdex-raw-backup.1.h2m tools/raw-backup.cc + @$(MAKE) --silent $(AM_MAKEFLAGS) hyperdex-raw-backup$(EXEEXT) + $(help2man_verbose)help2man $(HELP2MAN_FLAGS) --section 1 --output $@ --include $< ${abs_top_builddir}/hyperdex-raw-backup$(EXEEXT) + ++# hyperdex-migrate-data ++EXTRA_DIST += man/hyperdex-migrate-data.1.md ++EXTRA_DIST += man/hyperdex-migrate-data.1.h2m ++hyperdex_migrate_data_SOURCES = tools/migrate-data.cc ++hyperdex_migrate_data_LDADD = libhyperdex-admin.la -lpopt ++man/hyperdex-migrate-data.1: man/hyperdex-migrate-data.1.h2m tools/migrate-data.cc ++ @$(MAKE) --silent $(AM_MAKEFLAGS) hyperdex-migrate-data$(EXEEXT) ++ $(help2man_verbose)help2man $(HELP2MAN_FLAGS) --section 1 --output $@ --include $< ${abs_top_builddir}/hyperdex-migrate-data$(EXEEXT) ++ + ################################################################################ + ################################# Documentation ################################ + ################################################################################ +diff --git a/admin/admin.cc b/admin/admin.cc +index f8eda92..886dbd2 100644 +--- a/admin/admin.cc ++++ b/admin/admin.cc +@@ -193,6 +193,48 @@ admin :: fault_tolerance(const char* space, uint64_t ft, + } + } + ++int64_t ++admin :: migrate_data(const char* space_from, const char* space_to, ++ enum hyperdex_admin_returncode* status) ++{ ++ if (!maintain_coord_connection(status)) ++ { ++ return -1; ++ } ++ ++ int64_t id = m_next_admin_id; ++ ++m_next_admin_id; ++ e::intrusive_ptr op = new coord_rpc_generic(id, status, "migrate"); ++ uint64_t space_from_sz = strlen(space_from); ++ uint64_t space_to_sz = strlen(space_to); ++ ++ // Pack ++ size_t total_sz = sizeof(uint64_t) * 2 + space_from_sz + space_to_sz; ++ char buf[total_sz]; ++ char* pos = buf; ++ e::pack64be(space_from_sz, pos); ++ pos += sizeof(uint64_t); ++ memcpy(pos, space_from, space_from_sz); ++ pos += space_from_sz; ++ e::pack64be(space_to_sz, pos); ++ pos += sizeof(uint64_t); ++ memcpy(pos, space_to, space_to_sz); ++ ++ int64_t cid = m_coord.rpc("migrate", buf, total_sz, ++ &op->repl_status, &op->repl_output, &op->repl_output_sz); ++ ++ if (cid >= 0) ++ { ++ m_coord_ops[cid] = op; ++ return op->admin_visible_id(); ++ } ++ else ++ { ++ interpret_rpc_request_failure(op->repl_status, status); ++ return -1; ++ } ++} ++ + int + admin :: validate_space(const char* description, + hyperdex_admin_returncode* status) +diff --git a/admin/admin.h b/admin/admin.h +index b76e64b..b1b53f5 100644 +--- a/admin/admin.h ++++ b/admin/admin.h +@@ -72,6 +72,8 @@ class admin + enum hyperdex_admin_returncode* status); + int64_t list_spaces(enum hyperdex_admin_returncode* status, + const char** spaces); ++ int64_t migrate_data(const char* space_from, const char* space_to, ++ enum hyperdex_admin_returncode* status); + // manage servers + int64_t server_register(uint64_t token, const char* address, + enum hyperdex_admin_returncode* status); +diff --git a/admin/c.cc b/admin/c.cc +index d301621..ffc792f 100644 +--- a/admin/c.cc ++++ b/admin/c.cc +@@ -174,6 +174,18 @@ hyperdex_admin_list_spaces(struct hyperdex_admin* _adm, + } + + HYPERDEX_API int64_t ++hyperdex_admin_migrate_data(struct hyperdex_admin* _adm, ++ const char* space_from, ++ const char* space_to, ++ enum hyperdex_admin_returncode* status) ++{ ++ C_WRAP_EXCEPT( ++ hyperdex::admin* adm = reinterpret_cast(_adm); ++ return adm->migrate_data(space_from, space_to, status); ++ ); ++} ++ ++HYPERDEX_API int64_t + hyperdex_admin_server_register(struct hyperdex_admin* _adm, + uint64_t token, const char* address, + hyperdex_admin_returncode* status) +diff --git a/common/configuration.cc b/common/configuration.cc +index 4574c8c..d92e321 100644 +--- a/common/configuration.cc ++++ b/common/configuration.cc +@@ -45,6 +45,7 @@ using hyperdex::schema; + using hyperdex::server; + using hyperdex::server_id; + using hyperdex::subspace; ++using hyperdex::space_id; + using hyperdex::subspace_id; + using hyperdex::virtual_server_id; + +@@ -66,6 +67,7 @@ configuration :: configuration() + , m_point_leaders_by_virtual() + , m_spaces() + , m_transfers() ++ , m_migrations() + { + refill_cache(); + } +@@ -88,6 +90,7 @@ configuration :: configuration(const configuration& other) + , m_point_leaders_by_virtual(other.m_point_leaders_by_virtual) + , m_spaces(other.m_spaces) + , m_transfers(other.m_transfers) ++ , m_migrations(other.m_migrations) + { + refill_cache(); + } +@@ -282,6 +285,21 @@ configuration :: get_virtual(const region_id& ri, const server_id& si) const + return virtual_server_id(); + } + ++space_id ++configuration :: space_of(const region_id& ri) const ++{ ++ subspace_id ssid = subspace_of(ri); ++ for (size_t s = 0; s < m_spaces.size(); ++s) ++ { ++ for (size_t ss = 0; ss < m_spaces[s].subspaces.size(); ++ss) ++ { ++ if (m_spaces[s].subspaces[ss].id == ssid) { ++ return m_spaces[s].id; ++ } ++ } ++ } ++} ++ + subspace_id + configuration :: subspace_of(const region_id& ri) const + { +@@ -455,6 +473,39 @@ configuration :: point_leader(const char* sname, const e::slice& key) const + } + + virtual_server_id ++configuration :: point_leader(const space_id& sid, const e::slice& key) const ++{ ++ for (size_t s = 0; s < m_spaces.size(); ++s) ++ { ++ if (sid != m_spaces[s].id) ++ { ++ continue; ++ } ++ ++ uint64_t h; ++ hash(m_spaces[s].sc, key, &h); ++ ++ for (size_t pl = 0; pl < m_spaces[s].subspaces[0].regions.size(); ++pl) ++ { ++ if (m_spaces[s].subspaces[0].regions[pl].lower_coord[0] <= h && ++ h <= m_spaces[s].subspaces[0].regions[pl].upper_coord[0]) ++ { ++ if (m_spaces[s].subspaces[0].regions[pl].replicas.empty()) ++ { ++ return virtual_server_id(); ++ } ++ ++ return m_spaces[s].subspaces[0].regions[pl].replicas[0].vsi; ++ } ++ } ++ ++ abort(); ++ } ++ ++ return virtual_server_id(); ++} ++ ++virtual_server_id + configuration :: point_leader(const region_id& rid, const e::slice& key) const + { + for (size_t s = 0; s < m_spaces.size(); ++s) +@@ -614,6 +665,13 @@ configuration :: transfers_out_regions(const server_id& si, std::vector* migrations) const ++{ ++ for (size_t m = 0; m < m_migrations.size(); ++m) { ++ migrations->push_back(m_migrations[m]); ++ } ++} ++ + void + configuration :: lookup_region(const subspace_id& ssid, + const std::vector& hashes, +@@ -876,6 +934,11 @@ configuration :: dump() const + out << m_transfers[i] << std::endl; + } + ++ for (size_t i = 0; i < m_migrations.size(); ++i) ++ { ++ out << m_migrations[i] << std::endl; ++ } ++ + return out.str(); + } + +@@ -917,6 +980,7 @@ configuration :: operator = (const configuration& rhs) + m_point_leaders_by_virtual = rhs.m_point_leaders_by_virtual; + m_spaces = rhs.m_spaces; + m_transfers = rhs.m_transfers; ++ m_migrations = rhs.m_migrations; + refill_cache(); + return *this; + } +@@ -1022,9 +1086,11 @@ hyperdex :: operator >> (e::unpacker up, configuration& c) + uint64_t num_servers; + uint64_t num_spaces; + uint64_t num_transfers; ++ uint64_t num_migrations; + up = up >> c.m_cluster >> c.m_version >> c.m_flags + >> num_servers >> num_spaces +- >> num_transfers; ++ >> num_transfers >> num_migrations; ++ + c.m_servers.clear(); + c.m_servers.reserve(num_servers); + +@@ -1055,6 +1121,16 @@ hyperdex :: operator >> (e::unpacker up, configuration& c) + c.m_transfers.push_back(xfer); + } + ++ c.m_migrations.clear(); ++ c.m_migrations.reserve(num_migrations); ++ ++ for (size_t i = 0; !up.error() && i < num_migrations; ++i) ++ { ++ migration m; ++ up = up >> m; ++ c.m_migrations.push_back(m); ++ } ++ + c.refill_cache(); + return up; + } +diff --git a/common/configuration.h b/common/configuration.h +index ce82480..7f16fff 100755 +--- a/common/configuration.h ++++ b/common/configuration.h +@@ -47,6 +47,7 @@ + #include "common/schema.h" + #include "common/server.h" + #include "common/transfer.h" ++#include "common/migration.h" + + BEGIN_HYPERDEX_NAMESPACE + +@@ -78,6 +79,7 @@ class configuration + const schema* get_schema(const region_id& ri) const; + const subspace* get_subspace(const region_id& ri) const; + virtual_server_id get_virtual(const region_id& ri, const server_id& si) const; ++ space_id space_of(const region_id& ri) const; + subspace_id subspace_of(const region_id& ri) const; + subspace_id subspace_prev(const subspace_id& ss) const; + subspace_id subspace_next(const subspace_id& ss) const; +@@ -88,6 +90,7 @@ class configuration + void key_regions(const server_id& s, std::vector* servers) const; + bool is_point_leader(const virtual_server_id& e) const; + virtual_server_id point_leader(const char* space, const e::slice& key) const; ++ virtual_server_id point_leader(const space_id& sid, const e::slice& key) const; + // point leader for this key in the same space as ri + virtual_server_id point_leader(const region_id& ri, const e::slice& key) const; + // lhs and rhs are in adjacent subspaces such that lhs sends CHAIN_PUT +@@ -109,6 +112,10 @@ class configuration + void transfers_in_regions(const server_id& s, std::vector* transfers) const; + void transfers_out_regions(const server_id& s, std::vector* transfers) const; + ++ // migrations ++ public: ++ void migrations_out(const server_id& s, std::vector* migrations) const; ++ + // hashing functions + public: + void lookup_region(const subspace_id& subspace, +@@ -155,6 +162,7 @@ class configuration + std::vector m_point_leaders_by_virtual; + std::vector m_spaces; + std::vector m_transfers; ++ std::vector m_migrations; + }; + + e::buffer::packer +diff --git a/common/datatype_int64.cc b/common/datatype_int64.cc +index f87e230..974817e 100644 +--- a/common/datatype_int64.cc ++++ b/common/datatype_int64.cc +@@ -92,8 +92,10 @@ datatype_int64 :: apply(const e::slice& old_value, + for (size_t i = 0; i < funcs_sz; ++i) + { + const funcall* func = funcs + i; +- int64_t arg; +- e::unpack64le(func->arg1.data(), &arg); ++ int64_t arg = 0; ++ if (func->arg1.size() == sizeof(int64_t)) { ++ e::unpack64le(func->arg1.data(), &arg); ++ } + + switch (func->name) + { +diff --git a/common/ids.cc b/common/ids.cc +index ff8bee8..57286c6 100644 +--- a/common/ids.cc ++++ b/common/ids.cc +@@ -56,6 +56,7 @@ CREATE_ID(server) + CREATE_ID(space) + CREATE_ID(subspace) + CREATE_ID(transfer) ++CREATE_ID(migration) + CREATE_ID(virtual_server) + + END_HYPERDEX_NAMESPACE +diff --git a/common/ids.h b/common/ids.h +index 826a720..5d0ad98 100644 +--- a/common/ids.h ++++ b/common/ids.h +@@ -86,6 +86,7 @@ CREATE_ID(server) + CREATE_ID(space) + CREATE_ID(subspace) + CREATE_ID(transfer) ++CREATE_ID(migration) + CREATE_ID(virtual_server) + + END_HYPERDEX_NAMESPACE +diff --git a/common/migration.cc b/common/migration.cc +new file mode 100644 +index 0000000..8e3ae70 +--- /dev/null ++++ b/common/migration.cc +@@ -0,0 +1,129 @@ ++// Copyright (c) 2012, Cornell University ++// All rights reserved. ++// ++// Redistribution and use in source and binary forms, with or without ++// modification, are permitted provided that the following conditions are met: ++// ++// * Redistributions of source code must retain the above copyright notice, ++// this list of conditions and the following disclaimer. ++// * Redistributions in binary form must reproduce the above copyright ++// notice, this list of conditions and the following disclaimer in the ++// documentation and/or other materials provided with the distribution. ++// * Neither the name of HyperDex nor the names of its contributors may be ++// used to endorse or promote products derived from this software without ++// specific prior written permission. ++// ++// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ++// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE ++// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR ++// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ++// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ++// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN ++// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ++// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ++// POSSIBILITY OF SUCH DAMAGE. ++ ++// HyperDex ++#include "common/migration.h" ++ ++using hyperdex::migration; ++ ++migration :: migration() ++ : id() ++ , space_from() ++ , space_to() ++ , outstanding_regions() ++{ ++} ++ ++migration :: ~migration() throw () ++{ ++} ++ ++migration& ++migration :: operator = (const migration& rhs) ++{ ++ id = rhs.id; ++ space_from = rhs.space_from; ++ space_to = rhs.space_to; ++ outstanding_regions = rhs.outstanding_regions; ++} ++ ++bool migration :: operator < (const migration& rhs) const ++{ ++ if (id < rhs.id) { return true; } ++ else if (id > rhs.id) { return false; } ++ ++ if (space_from < rhs.space_from) { return true; } ++ else if (space_from > rhs.space_from) { return false; } ++ ++ if (space_to < rhs.space_to) { return true; } ++ else if (space_to > rhs.space_to) { return false; } ++ ++ return false; ++} ++ ++migration :: migration(migration_id _id, ++ space_id _space_from, ++ space_id _space_to) ++ : id(id) ++ , space_from(_space_from) ++ , space_to(_space_to) ++{ ++} ++ ++std::ostream& ++hyperdex :: operator << (std::ostream& lhs, const migration& rhs) ++{ ++ return lhs << "migration(id=" << rhs.id ++ << ", space_from=" << rhs.space_from ++ << ", space_to=" << rhs.space_to; ++} ++ ++e::buffer::packer ++hyperdex :: operator << (e::buffer::packer pa, const migration& m) ++{ ++ size_t num_outstanding_regions = m.outstanding_regions.size(); ++ pa = pa << m.id.get() << m.space_from.get() << m.space_to.get() << num_outstanding_regions; ++ for (size_t i = 0; i < num_outstanding_regions; ++i) ++ { ++ pa = pa << m.outstanding_regions[i]; ++ } ++ ++ return pa; ++} ++ ++e::unpacker ++hyperdex :: operator >> (e::unpacker up, migration& m) ++{ ++ uint64_t mid, space_from_id, space_to_id; ++ size_t num_outstanding_regions; ++ up >> mid >> space_from_id >> space_to_id >> num_outstanding_regions; ++ m.id = migration_id(mid); ++ m.space_from = space_id(space_from_id); ++ m.space_to = space_id(space_to_id); ++ m.outstanding_regions.resize(num_outstanding_regions); ++ for (size_t i = 0; !up.error() && i < num_outstanding_regions; ++i) ++ { ++ up = up >> m.outstanding_regions[i]; ++ } ++ return up; ++} ++ ++size_t ++hyperdex :: pack_size(const migration& m) ++{ ++ size_t sz = sizeof(uint64_t) // migration id ++ + sizeof(uint64_t) // space_from ++ + sizeof(uint64_t) // space_to ++ + sizeof(size_t); // num_outstanding_regions ++ ++ for (size_t i = 0; i < m.outstanding_regions.size(); ++i) ++ { ++ sz += pack_size(m.outstanding_regions[i]); ++ } ++ ++ return sz; ++} +diff --git a/common/migration.h b/common/migration.h +new file mode 100644 +index 0000000..b0c877b +--- /dev/null ++++ b/common/migration.h +@@ -0,0 +1,74 @@ ++// Copyright (c) 2012, Cornell University ++// All rights reserved. ++// ++// Redistribution and use in source and binary forms, with or without ++// modification, are permitted provided that the following conditions are met: ++// ++// * Redistributions of source code must retain the above copyright notice, ++// this list of conditions and the following disclaimer. ++// * Redistributions in binary form must reproduce the above copyright ++// notice, this list of conditions and the following disclaimer in the ++// documentation and/or other materials provided with the distribution. ++// * Neither the name of HyperDex nor the names of its contributors may be ++// used to endorse or promote products derived from this software without ++// specific prior written permission. ++// ++// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ++// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE ++// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR ++// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ++// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ++// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN ++// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ++// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ++// POSSIBILITY OF SUCH DAMAGE. ++ ++#ifndef hyperdex_common_migration_h_ ++#define hyperdex_common_migration_h_ ++ ++// HyperDex ++#include "namespace.h" ++#include "common/ids.h" ++ ++BEGIN_HYPERDEX_NAMESPACE ++ ++class migration ++{ ++ public: ++ migration(); ++ migration(migration_id id, ++ space_id space_from, ++ space_id space_to); ++ ~migration() throw (); ++ ++ public: ++ migration& operator = (const migration&); ++ bool operator < (const migration&) const; ++ ++ public: ++ migration_id id; ++ space_id space_from; ++ space_id space_to; ++ // This is only used at the coordinator to keep track ++ // of which regions have not been migrated. ++ std::vector outstanding_regions; ++}; ++ ++std::ostream& ++operator << (std::ostream& lhs, const migration& rhs); ++ ++e::buffer::packer ++operator << (e::buffer::packer, const migration& t); ++ ++e::unpacker ++operator >> (e::unpacker, migration& t); ++ ++size_t ++pack_size(const migration&); ++ ++ ++END_HYPERDEX_NAMESPACE ++ ++#endif // hyperdex_common_migration_h_ +\ No newline at end of file +diff --git a/common/network_msgtype.h b/common/network_msgtype.h +index b7bbe77..0fa1a10 100755 +--- a/common/network_msgtype.h ++++ b/common/network_msgtype.h +@@ -50,6 +50,9 @@ enum network_msgtype + RESP_SEARCH_ITEM = 35, + RESP_SEARCH_DONE = 36, + ++ REQ_MIGRATION = 37, ++ RESP_MIGRATION = 38, ++ + REQ_SORTED_SEARCH = 40, + RESP_SORTED_SEARCH = 41, + +diff --git a/coordinator/coordinator.cc b/coordinator/coordinator.cc +index 7037483..5eaf119 100644 +--- a/coordinator/coordinator.cc ++++ b/coordinator/coordinator.cc +@@ -49,6 +49,7 @@ using hyperdex::region; + using hyperdex::region_intent; + using hyperdex::server; + using hyperdex::transfer; ++using hyperdex::migration; + + // ASSUME: I'm assuming only one server ever changes state at a time for a + // given transition. If you violate this assumption, fixup +@@ -760,6 +761,33 @@ coordinator :: transfer_complete(replicant_state_machine_context* ctx, + } + + void ++coordinator :: migration_complete(replicant_state_machine_context* ctx, ++ uint64_t version, ++ const migration_id& mid, ++ const region_id& rid) ++{ ++ for (size_t m = 0; m < m_migrations.size(); m++) ++ { ++ if (m_migrations[m].id == mid) ++ { ++ for (size_t r = 0; r < m_migrations[m].outstanding_regions.size(); r++) ++ { ++ if (m_migrations[m].outstanding_regions[r] == rid) ++ { ++ m_migrations[m].outstanding_regions.erase(m_migrations[m].outstanding_regions.begin() + r); ++ if (m_migrations[m].outstanding_regions.size() == 0) { ++ del_migration(m_migrations[m].id); ++ } ++ // TODO: do I need to call converge_intent? ++ generate_next_configuration(ctx); // TODO: is this an expensive operation? ++ return generate_response(ctx, COORD_SUCCESS); ++ } ++ } ++ } ++ } ++} ++ ++void + coordinator :: config_get(replicant_state_machine_context* ctx) + { + assert(m_cluster != 0 && m_version != 0); +@@ -1638,6 +1666,75 @@ coordinator :: del_transfer(const transfer_id& xid) + } + + void ++coordinator :: new_migration(replicant_state_machine_context* ctx, ++ const char* space_from, ++ const char* space_to) ++{ ++ FILE* log = replicant_state_machine_log_stream(ctx); ++ ++ // Make sure the spaces exist ++ space_map_t::iterator it; ++ it = m_spaces.find(std::string(space_from)); ++ if (it == m_spaces.end()) ++ { ++ fprintf(log, "could not migrate from space \"%s\" because it doesn't exist\n", space_from); ++ return generate_response(ctx, COORD_NOT_FOUND); ++ } ++ ++ space_id space_from_id = it->second->id; ++ ++ it = m_spaces.find(std::string(space_to)); ++ if (it == m_spaces.end()) ++ { ++ fprintf(log, "could not migrate to space \"%s\" because it doesn't exist\n", space_to); ++ return generate_response(ctx, COORD_NOT_FOUND); ++ } ++ ++ space_id space_to_id = it->second->id; ++ ++ migration mgt(migration_id(m_counter++), space_from_id, space_to_id); ++ ++ space_ptr s = m_spaces[std::string(space_from)]; ++ regions_in_space(s, &mgt.outstanding_regions); ++ ++ m_migrations.push_back(mgt); ++ ++ generate_next_configuration(ctx); ++} ++ ++migration* ++coordinator :: get_migration(migration_id mid) ++{ ++ for (size_t i = 0; i < m_migrations.size(); ++i) ++ { ++ ++ if (m_migrations[i].id == mid) ++ { ++ return &m_migrations[i]; ++ } ++ } ++ ++ return NULL; ++} ++ ++void ++coordinator :: del_migration(migration_id mid) ++{ ++ for (size_t i = 0; i < m_migrations.size(); ++i) ++ { ++ if (m_migrations[i].id == mid) ++ { ++ for (size_t j = i + 1; j < m_migrations.size(); ++j) ++ { ++ m_migrations[j - 1] = m_migrations[j]; ++ } ++ m_migrations.pop_back(); ++ break; ++ } ++ } ++} ++ ++void + coordinator :: check_ack_condition(replicant_state_machine_context* ctx) + { + if (m_config_ack_through < m_config_ack_barrier.min_version()) +@@ -1712,12 +1809,18 @@ coordinator :: generate_cached_configuration(replicant_state_machine_context*) + sz += pack_size(m_transfers[i]); + } + ++ for (size_t i = 0; i < m_migrations.size(); ++i) ++ { ++ sz += pack_size(m_migrations[i]); ++ } ++ + std::auto_ptr new_config(e::buffer::create(sz)); + e::buffer::packer pa = new_config->pack_at(0); + pa = pa << m_cluster << m_version << m_flags + << uint64_t(m_servers.size()) + << uint64_t(m_spaces.size()) +- << uint64_t(m_transfers.size()); ++ << uint64_t(m_transfers.size()) ++ << uint64_t(m_migrations.size()); + + for (size_t i = 0; i < m_servers.size(); ++i) + { +@@ -1735,6 +1838,11 @@ coordinator :: generate_cached_configuration(replicant_state_machine_context*) + pa = pa << m_transfers[i]; + } + ++ for (size_t i = 0; i < m_migrations.size(); ++i) ++ { ++ pa = pa << m_migrations[i]; ++ } ++ + m_latest_config = new_config; + } + +diff --git a/coordinator/coordinator.h b/coordinator/coordinator.h +index 56efbec..6b636e3 100644 +--- a/coordinator/coordinator.h ++++ b/coordinator/coordinator.h +@@ -44,6 +44,7 @@ + #include "common/ids.h" + #include "common/server.h" + #include "common/transfer.h" ++#include "common/migration.h" + #include "coordinator/offline_server.h" + #include "coordinator/region_intent.h" + #include "coordinator/replica_sets.h" +@@ -103,6 +104,16 @@ class coordinator + uint64_t version, + const transfer_id& xid); + ++ // migrations management ++ public: ++ void migration_complete(replicant_state_machine_context* ctx, ++ uint64_t version, ++ const migration_id& mid, ++ const region_id& rid); ++ void new_migration(replicant_state_machine_context* ctx, ++ const char* space_from, ++ const char* space_to); ++ + // config management + public: + void config_get(replicant_state_machine_context* ctx); +@@ -173,6 +184,9 @@ class coordinator + transfer* get_transfer(const region_id& rid); + transfer* get_transfer(const transfer_id& xid); + void del_transfer(const transfer_id& xid); ++ // migrations ++ migration* get_migration(migration_id mid); ++ void del_migration(migration_id mid); + // configuration + void check_ack_condition(replicant_state_machine_context* ctx); + void check_stable_condition(replicant_state_machine_context* ctx); +@@ -203,6 +217,8 @@ class coordinator + std::vector m_offline; + // transfers + std::vector m_transfers; ++ // migrations ++ std::vector m_migrations; + // barriers + uint64_t m_config_ack_through; + server_barrier m_config_ack_barrier; +diff --git a/coordinator/symtable.c b/coordinator/symtable.c +index 4e55c32..3e21019 100644 +--- a/coordinator/symtable.c ++++ b/coordinator/symtable.c +@@ -56,10 +56,12 @@ struct replicant_state_machine HYPERDEX_API rsm = { + {"space_rm", hyperdex_coordinator_space_rm}, + {"transfer_go_live", hyperdex_coordinator_transfer_go_live}, + {"transfer_complete", hyperdex_coordinator_transfer_complete}, ++ {"migration_complete", hyperdex_coordinator_migration_complete}, + {"checkpoint_stable", hyperdex_coordinator_checkpoint_stable}, + {"alarm", hyperdex_coordinator_alarm}, + {"read_only", hyperdex_coordinator_read_only}, + {"fault_tolerance", hyperdex_coordinator_fault_tolerance}, ++ {"migrate", hyperdex_coordinator_migrate_data}, + {"debug_dump", hyperdex_coordinator_debug_dump}, + {"init", hyperdex_coordinator_init}, + {NULL, NULL}} +diff --git a/coordinator/transitions.cc b/coordinator/transitions.cc +index 34b4530..2c967ab 100644 +--- a/coordinator/transitions.cc ++++ b/coordinator/transitions.cc +@@ -194,6 +194,36 @@ hyperdex_coordinator_fault_tolerance(struct replicant_state_machine_context* ctx + } + + void ++hyperdex_coordinator_migrate_data(struct replicant_state_machine_context* ctx, ++ void *obj, const char* data, size_t data_sz) ++{ ++ PROTECT_UNINITIALIZED; ++ FILE* log = replicant_state_machine_log_stream(ctx); ++ coordinator* c = static_cast(obj); ++ ++ char* pos = const_cast(data); ++ ++ uint64_t space_from_sz; ++ e::unpacker up_one(pos, sizeof(uint64_t)); ++ up_one >> space_from_sz; ++ pos += sizeof(uint64_t); ++ char space_from[space_from_sz + 1]; ++ memcpy(space_from, pos, space_from_sz); ++ pos += space_from_sz; ++ space_from[space_from_sz] = '\0'; ++ ++ uint64_t space_to_sz; ++ e::unpacker up_two(pos, sizeof(uint64_t)); ++ up_two >> space_to_sz; ++ pos += sizeof(uint64_t); ++ char space_to[space_to_sz + 1]; ++ memcpy(space_to, pos, space_to_sz); ++ space_to[space_to_sz] = '\0'; ++ ++ c->new_migration(ctx, space_from, space_to); ++} ++ ++void + hyperdex_coordinator_config_get(struct replicant_state_machine_context* ctx, + void* obj, const char*, size_t) + { +@@ -418,6 +448,22 @@ hyperdex_coordinator_transfer_complete(struct replicant_state_machine_context* c + } + + void ++hyperdex_coordinator_migration_complete(struct replicant_state_machine_context* ctx, ++ void* obj, const char* data, size_t data_sz) ++{ ++ PROTECT_UNINITIALIZED; ++ FILE* log = replicant_state_machine_log_stream(ctx); ++ coordinator* c = static_cast(obj); ++ migration_id mid; ++ region_id rid; ++ uint64_t version; ++ e::unpacker up(data, data_sz); ++ up = up >> mid >> rid >> version; ++ CHECK_UNPACK(migration_complete); ++ c->migration_complete(ctx, version, mid, rid); ++} ++ ++void + hyperdex_coordinator_checkpoint_stable(struct replicant_state_machine_context* ctx, + void* obj, const char* data, size_t data_sz) + { +diff --git a/coordinator/transitions.h b/coordinator/transitions.h +index dfb6060..a722a97 100644 +--- a/coordinator/transitions.h ++++ b/coordinator/transitions.h +@@ -59,6 +59,7 @@ TRANSITION(init); + + TRANSITION(read_only); + TRANSITION(fault_tolerance); ++TRANSITION(migrate_data); + + TRANSITION(config_get); + TRANSITION(config_ack); +@@ -79,6 +80,8 @@ TRANSITION(space_rm); + TRANSITION(transfer_go_live); + TRANSITION(transfer_complete); + ++TRANSITION(migration_complete); ++ + TRANSITION(checkpoint_stable); + + TRANSITION(alarm); +diff --git a/daemon/coordinator_link_wrapper.cc b/daemon/coordinator_link_wrapper.cc +index 618ea47..ef5f10a 100644 +--- a/daemon/coordinator_link_wrapper.cc ++++ b/daemon/coordinator_link_wrapper.cc +@@ -369,12 +369,27 @@ coordinator_link_wrapper :: transfer_complete(const transfer_id& id) + e::pack64be(id.get(), buf); + e::pack64be(version, buf + sizeof(uint64_t)); + e::intrusive_ptr rpc = new coord_rpc(); +- rpc->msg << "transver complete id=" << id; ++ rpc->msg << "transfer complete id=" << id; + make_rpc("transfer_complete", buf, 2 * sizeof(uint64_t), rpc); + LOG(INFO) << "requesting that " << id << " complete"; + } + + void ++coordinator_link_wrapper :: migration_complete(const migration_id& mid, ++ const region_id& rid) ++{ ++ uint64_t version = m_daemon->m_config.version(); ++ char buf[3 * sizeof(uint64_t)]; ++ e::pack64be(mid.get(), buf); ++ e::pack64be(rid.get(), buf + sizeof(uint64_t)); ++ e::pack64be(version, buf + 2 * sizeof(uint64_t)); ++ e::intrusive_ptr rpc = new coord_rpc(); ++ rpc->msg << "migration complete id=" << mid << " " << rid; ++ make_rpc("migration_complete", buf, 3 * sizeof(uint64_t), rpc); ++ // LOG(INFO) << "requesting that " << mid << " " << rid << " complete"; ++} ++ ++void + coordinator_link_wrapper :: report_tcp_disconnect(const server_id& id) + { + uint64_t version = m_daemon->m_config.version(); +diff --git a/daemon/coordinator_link_wrapper.h b/daemon/coordinator_link_wrapper.h +index 2fdb1c9..b2fe243 100644 +--- a/daemon/coordinator_link_wrapper.h ++++ b/daemon/coordinator_link_wrapper.h +@@ -69,6 +69,8 @@ class coordinator_link_wrapper + public: + void transfer_go_live(const transfer_id& id); + void transfer_complete(const transfer_id& id); ++ void migration_complete(const migration_id& mid, ++ const region_id& rid); + void report_tcp_disconnect(const server_id& id); + void config_ack(uint64_t version); + void config_stable(uint64_t version); +diff --git a/daemon/daemon.cc b/daemon/daemon.cc +index 695a111..1902055 100644 +--- a/daemon/daemon.cc ++++ b/daemon/daemon.cc +@@ -105,10 +105,12 @@ daemon :: daemon() + , m_comm(this) + , m_repl(this) + , m_stm(this) ++ , m_mm(this) + , m_sm(this) + , m_config() + , m_perf_req_get() + , m_perf_req_atomic() ++ , m_perf_req_migration() + , m_perf_req_search_start() + , m_perf_req_search_next() + , m_perf_req_search_stop() +@@ -128,6 +130,7 @@ daemon :: daemon() + , m_perf_xfer_ack() + , m_perf_backup() + , m_perf_perf_counters() ++ , m_perf_resp_migration() + , m_block_stat_path() + , m_stat_collector(std::tr1::bind(&daemon::collect_stats, this)) + , m_protect_stats() +@@ -324,6 +327,7 @@ daemon :: run(bool daemonize, + m_comm.setup(bind_to, threads); + m_repl.setup(); + m_stm.setup(); ++ m_mm.setup(); + m_sm.setup(); + + for (size_t i = 0; i < threads; ++i) +@@ -429,6 +433,7 @@ daemon :: run(bool daemonize, + << "; pausing all activity while we reconfigure"; + m_sm.pause(); + m_stm.pause(); ++ m_mm.pause(); + m_repl.pause(); + m_data.pause(); + m_comm.pause(); +@@ -436,12 +441,14 @@ daemon :: run(bool daemonize, + m_data.reconfigure(old_config, new_config, m_us); + m_repl.reconfigure(old_config, new_config, m_us); + m_stm.reconfigure(old_config, new_config, m_us); ++ m_mm.reconfigure(old_config, new_config, m_us); + m_sm.reconfigure(old_config, new_config, m_us); + m_config = new_config; + m_comm.unpause(); + m_data.unpause(); + m_repl.unpause(); + m_stm.unpause(); ++ m_mm.unpause(); + m_sm.unpause(); + LOG(INFO) << "reconfiguration complete; resuming normal operation"; + +@@ -479,6 +486,7 @@ daemon :: run(bool daemonize, + + m_sm.teardown(); + m_stm.teardown(); ++ m_mm.teardown(); + m_repl.teardown(); + m_comm.teardown(); + m_data.teardown(); +@@ -546,6 +554,14 @@ daemon :: loop(size_t thread) + process_req_atomic(from, vfrom, vto, msg, up); + m_perf_req_atomic.tap(); + break; ++ case REQ_MIGRATION: ++ process_req_migration(from, vfrom, vto, msg, up); ++ m_perf_req_migration.tap(); ++ break; ++ case RESP_MIGRATION: ++ process_resp_migration(from, vfrom, vto, msg, up); ++ m_perf_resp_migration.tap(); ++ break; + case REQ_SEARCH_START: + process_req_search_start(from, vfrom, vto, msg, up); + m_perf_req_search_start.tap(); +@@ -617,6 +633,7 @@ daemon :: loop(size_t thread) + case BACKUP: + process_backup(from, vfrom, vto, msg, up); + m_perf_backup.tap(); ++ break; + case PERF_COUNTERS: + process_perf_counters(from, vfrom, vto, msg, up); + m_perf_perf_counters.tap(); +@@ -715,6 +732,45 @@ daemon :: process_req_atomic(server_id from, + m_repl.client_atomic(from, vto, nonce, erase, fail_if_not_found, fail_if_found, key, checks, funcs); + } + ++void daemon :: process_req_migration(server_id from, ++ virtual_server_id vfrom, ++ virtual_server_id vto, ++ std::auto_ptr msg, ++ e::unpacker up) ++{ ++ uint8_t flags; ++ e::slice key; ++ std::vector checks; ++ std::vector funcs; ++ region_id rid; ++ uint64_t seq_no; ++ up = up >> key >> flags >> checks >> funcs >> rid >> seq_no; ++ ++ if (up.error()) ++ { ++ LOG(WARNING) << "unpack of REQ_MIGRATION failed; here's some hex: " << msg->hex(); ++ return; ++ } ++ ++ bool erase = !(flags & 128); ++ bool fail_if_not_found = flags & 1; ++ bool fail_if_found = flags & 2; ++ m_repl.request_atomic(from, vto, 0, erase, fail_if_not_found, fail_if_found, key, checks, funcs, true, rid, seq_no); ++} ++ ++void daemon :: process_resp_migration(server_id from, ++ virtual_server_id vfrom, ++ virtual_server_id vto, ++ std::auto_ptr msg, ++ e::unpacker up) ++{ ++ region_id rid; ++ uint64_t seq_no; ++ uint16_t result; ++ up = up >> rid >> seq_no >> result; ++ m_mm.migration_ack(from, vto, rid, seq_no, result); ++} ++ + void + daemon :: process_req_search_start(server_id from, + virtual_server_id, +diff --git a/daemon/daemon.h b/daemon/daemon.h +index a5dcfae..0e63c6f 100644 +--- a/daemon/daemon.h ++++ b/daemon/daemon.h +@@ -51,6 +51,7 @@ + #include "daemon/replication_manager.h" + #include "daemon/search_manager.h" + #include "daemon/state_transfer_manager.h" ++#include "daemon/migration_manager.h" + + BEGIN_HYPERDEX_NAMESPACE + +@@ -74,6 +75,8 @@ class daemon + void loop(size_t thread); + void process_req_get(server_id from, virtual_server_id vfrom, virtual_server_id vto, std::auto_ptr msg, e::unpacker up); + void process_req_atomic(server_id from, virtual_server_id vfrom, virtual_server_id vto, std::auto_ptr msg, e::unpacker up); ++ void process_req_migration(server_id from, virtual_server_id vfrom, virtual_server_id vto, std::auto_ptr msg, e::unpacker up); ++ void process_resp_migration(server_id from, virtual_server_id vfrom, virtual_server_id vto, std::auto_ptr msg, e::unpacker up); + void process_req_search_start(server_id from, virtual_server_id vfrom, virtual_server_id vto, std::auto_ptr msg, e::unpacker up); + void process_req_search_next(server_id from, virtual_server_id vfrom, virtual_server_id vto, std::auto_ptr msg, e::unpacker up); + void process_req_search_stop(server_id from, virtual_server_id vfrom, virtual_server_id vto, std::auto_ptr msg, e::unpacker up); +@@ -108,6 +111,7 @@ class daemon + friend class replication_manager; + friend class search_manager; + friend class state_transfer_manager; ++ friend class migration_manager; + + private: + server_id m_us; +@@ -119,11 +123,13 @@ class daemon + communication m_comm; + replication_manager m_repl; + state_transfer_manager m_stm; ++ migration_manager m_mm; + search_manager m_sm; + configuration m_config; + // counters + performance_counter m_perf_req_get; + performance_counter m_perf_req_atomic; ++ performance_counter m_perf_req_migration; + performance_counter m_perf_req_search_start; + performance_counter m_perf_req_search_next; + performance_counter m_perf_req_search_stop; +@@ -143,6 +149,7 @@ class daemon + performance_counter m_perf_xfer_ack; + performance_counter m_perf_backup; + performance_counter m_perf_perf_counters; ++ performance_counter m_perf_resp_migration; + // iostat-like stats + std::string m_block_stat_path; + // historical data +diff --git a/daemon/datalayer_iterator.h b/daemon/datalayer_iterator.h +index 0596934..d8db075 100644 +--- a/daemon/datalayer_iterator.h ++++ b/daemon/datalayer_iterator.h +@@ -57,6 +57,7 @@ class datalayer::iterator + + protected: + friend class e::intrusive_ptr; ++ friend class std::auto_ptr; + virtual ~iterator() throw (); + void inc() { ++m_ref; } + void dec() { --m_ref; if (m_ref == 0) delete this; } +@@ -64,6 +65,7 @@ class datalayer::iterator + + private: + leveldb_snapshot_ptr m_snap; ++ + }; + + class datalayer::replay_iterator +diff --git a/daemon/migration_manager.cc b/daemon/migration_manager.cc +new file mode 100644 +index 0000000..4a9b649 +--- /dev/null ++++ b/daemon/migration_manager.cc +@@ -0,0 +1,447 @@ ++// Copyright (c) 2012, Cornell University ++// All rights reserved. ++// ++// Redistribution and use in source and binary forms, with or without ++// modification, are permitted provided that the following conditions are met: ++// ++// * Redistributions of source code must retain the above copyright notice, ++// this list of conditions and the following disclaimer. ++// * Redistributions in binary form must reproduce the above copyright ++// notice, this list of conditions and the following disclaimer in the ++// documentation and/or other materials provided with the distribution. ++// * Neither the name of HyperDex nor the names of its contributors may be ++// used to endorse or promote products derived from this software without ++// specific prior written permission. ++// ++// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ++// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE ++// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR ++// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ++// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ++// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN ++// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ++// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ++// POSSIBILITY OF SUCH DAMAGE. ++ ++// POSIX ++#include ++ ++// STL ++#include ++ ++// Google Log ++#include ++ ++// HyperDex ++#include "common/serialization.h" ++#include "daemon/daemon.h" ++#include "daemon/datalayer_iterator.h" ++#include "daemon/migration_manager.h" ++#include "daemon/migration_manager_pending.h" ++#include "daemon/migration_out_state.h" ++#include "daemon/leveldb.h" ++ ++using hyperdex::reconfigure_returncode; ++using hyperdex::migration_manager; ++using hyperdex::migration_id; ++using hyperdex::region_id; ++ ++migration_manager :: migration_manager(daemon* d) ++ : m_daemon(d) ++ , m_migrations_out() ++ , m_kickstarter(std::tr1::bind(&migration_manager::kickstarter, this)) ++ , m_block_kickstarter() ++ , m_wakeup_kickstarter(&m_block_kickstarter) ++ , m_wakeup_reconfigurer(&m_block_kickstarter) ++ , m_need_kickstart(false) ++ , m_shutdown(true) ++ , m_need_pause(false) ++ , m_paused(false) ++{ ++} ++ ++migration_manager :: ~migration_manager() throw () ++{ ++ shutdown(); ++} ++ ++bool ++migration_manager :: setup() ++{ ++ po6::threads::mutex::hold hold(&m_block_kickstarter); ++ m_kickstarter.start(); ++ m_shutdown = false; ++ return true; ++} ++ ++void ++migration_manager :: teardown() ++{ ++ shutdown(); ++ m_migrations_out.clear(); ++} ++ ++void ++migration_manager :: pause() ++{ ++ po6::threads::mutex::hold hold(&m_block_kickstarter); ++ assert(!m_need_pause); ++ m_need_pause = true; ++} ++ ++void ++migration_manager :: unpause() ++{ ++ po6::threads::mutex::hold hold(&m_block_kickstarter); ++ assert(m_need_pause); ++ m_wakeup_kickstarter.broadcast(); ++ m_need_pause = false; ++ m_need_kickstart = true; ++} ++ ++void ++migration_manager :: reconfigure(const configuration&, ++ const configuration& new_config, ++ const server_id& sid) ++{ ++ LOG(INFO) << "reconfiguring migration_manager"; ++ { ++ po6::threads::mutex::hold hold(&m_block_kickstarter); ++ assert(m_need_pause); ++ ++ while (!m_paused) ++ { ++ m_wakeup_reconfigurer.wait(); ++ } ++ } ++ ++ std::vector migrations; ++ new_config.migrations_out(sid, &migrations); ++ std::sort(migrations.begin(), migrations.end()); ++ setup_migration_state(migrations, &m_migrations_out); ++} ++ ++void ++migration_manager :: setup_migration_state(const std::vector migrations, ++ std::vector >* migration_states) ++{ ++ std::vector > tmp; ++ // In reality, tmp probably will store way more elements than ++ // migrations, since one migration will likely correspond to ++ // many migration out states. ++ tmp.reserve(migrations.size()); ++ size_t m_idx = 0; ++ size_t ms_idx = 0; ++ ++ std::vector regions; ++ m_daemon->m_config.mapped_regions(m_daemon->m_us, ®ions); ++ ++ leveldb_snapshot_ptr snapshot_ptr = m_daemon->m_data.make_snapshot(); ++ ++ while (m_idx < migrations.size() && ms_idx < migration_states->size()) ++ { ++ if (migrations[m_idx].id == (*migration_states)[ms_idx]->mid) ++ { ++ tmp.push_back((*migration_states)[ms_idx]); ++ // TODO: commenting out the following line seems to fix the ++ // bug, but check the correctness of this method again. ++ // ++m_idx; ++ ++ms_idx; ++ } ++ else if (migrations[m_idx].id < (*migration_states)[ms_idx]->mid) ++ { ++ LOG(INFO) << "initiating migration out state " << migrations[m_idx]; ++ ++ std::vector::iterator r_iter; ++ for (r_iter = regions.begin(); r_iter != regions.end(); r_iter++) { ++ region_id rid = (*r_iter); ++ if (m_daemon->m_config.space_of(rid) == migrations[m_idx].space_from) { ++ datalayer::returncode err; ++ std::auto_ptr iter; ++ iter.reset(m_daemon->m_data.make_region_iterator(snapshot_ptr, rid, &err)); ++ if (err != datalayer::SUCCESS) { ++ LOG(ERROR) << "failed to create region iterator"; ++ continue; // TODO: should we continue? ++ } ++ e::intrusive_ptr ptr( ++ new migration_out_state(migrations[m_idx].id, ++ migrations[m_idx].space_to, ++ rid, ++ iter)); ++ tmp.push_back(ptr); ++ } ++ } ++ ++m_idx; ++ } ++ else if (migrations[m_idx].id > (*migration_states)[ms_idx]->mid) ++ { ++ LOG(INFO) << "ending migration out state " << (*migration_states)[ms_idx]->mid; ++ ++ms_idx; ++ } ++ } ++ ++ while (m_idx < migrations.size()) ++ { ++ LOG(INFO) << "initiating migration out state " << migrations[m_idx]; ++ ++ std::vector::iterator r_iter; ++ for (r_iter = regions.begin(); r_iter != regions.end(); r_iter++) { ++ region_id rid = (*r_iter); ++ if (m_daemon->m_config.space_of(rid) == migrations[m_idx].space_from) { ++ datalayer::returncode err; ++ std::auto_ptr iter; ++ iter.reset(m_daemon->m_data.make_region_iterator(snapshot_ptr, rid, &err)); ++ if (err != datalayer::SUCCESS) { ++ LOG(ERROR) << "failed to create region iterator"; ++ continue; // TODO: should we continue? ++ } ++ e::intrusive_ptr ptr( ++ new migration_out_state(migrations[m_idx].id, ++ migrations[m_idx].space_to, ++ rid, ++ iter)); ++ tmp.push_back(ptr); ++ } ++ } ++ ++m_idx; ++ } ++ ++ while (ms_idx < migration_states->size()) ++ { ++ ++ms_idx; ++ } ++ ++ tmp.swap(*migration_states); ++} ++ ++void ++migration_manager :: migrate_more_state(migration_out_state* mos) ++{ ++ assert(mos->iter.get()); ++ ++ while (mos->window.size() < mos->window_sz && mos->iter->valid()) ++ { ++ e::intrusive_ptr op(new pending()); ++ op->rid = mos->rid; ++ op->seq_no = mos->next_seq_no; ++ ++mos->next_seq_no; ++ ++ // TODO: can an object has no value? ++ if (m_daemon->m_data.get_from_iterator(mos->rid, mos->iter.get(), &op->key, &op->value, &op->version, &op->vref) != datalayer::SUCCESS) ++ { ++ LOG(ERROR) << "error unpacking value during migration"; ++ break; ++ } ++ ++ mos->window.push_back(op); ++ send_object(mos, op.get()); ++ mos->iter->next(); ++ } ++ ++ if (mos->window.empty()) { ++ m_daemon->m_coord.migration_complete(mos->mid, mos->rid); ++ } ++} ++ ++void ++migration_manager :: retransmit(migration_out_state* mos) ++{ ++ for (std::list >::iterator it = mos->window.begin(); ++ it != mos->window.end(); ++it) ++ { ++ send_object(mos, it->get()); ++ } ++} ++ ++void ++migration_manager :: send_object(migration_out_state* mos, pending* op) ++{ ++ virtual_server_id to = m_daemon->m_config.point_leader(mos->sid, op->key); ++ ++ const schema* sc = m_daemon->m_config.get_schema(op->rid); ++ if (sc == NULL) { ++ // TODO: this happens occationally. Not sure why. Possibly because the ++ // related space has been destroyed? ++ LOG(INFO) << "trying to send an object whose region no longer exists."; ++ return; ++ } ++ std::vector funcs; ++ std::vector checks; ++ funcs.reserve(op->value.size()); ++ ++ for (size_t j = 1; j <= op->value.size(); ++j) ++ { ++ hyperdatatype datatype = sc->attrs[j].type; ++ ++ funcall o; ++ o.attr = j; ++ o.name = FUNC_SET; ++ o.arg1 = op->value[j - 1]; ++ o.arg1_datatype = datatype; ++ funcs.push_back(o); ++ } ++ ++ size_t sz = HYPERDEX_HEADER_SIZE_SV ++ + pack_size(op->key) ++ + sizeof(uint8_t) ++ + pack_size(checks) ++ + pack_size(funcs) ++ + sizeof(region_id) ++ + sizeof(uint64_t); // seq_no ++ std::auto_ptr msg(e::buffer::create(sz)); ++ uint8_t flags = (0 | 0 | 128); ++ msg->pack_at(HYPERDEX_HEADER_SIZE_SV) ++ << op->key << flags << checks << funcs << mos->rid << op->seq_no; ++ m_daemon->m_comm.send(to, REQ_MIGRATION, msg); ++ // TODO: do we need this here? m_daemon->m_comm.wake_one(); ++} ++ ++void ++migration_manager :: migration_ack(const server_id& from, ++ const virtual_server_id& to, ++ region_id rid, ++ uint64_t seq_no, ++ uint16_t result) ++{ ++ migration_out_state* mos = get_mos(rid); ++ ++ if (!mos) ++ { ++ // TODO: it seems that sometimes we receive ACK for regions ++ // that have already been completely migrated. Why is that? ++ // Does that indicate a bug? ++ // LOG(INFO) << "dropping RESP_MIGRATION for " << rid << " which we don't know about."; ++ return; ++ } ++ ++ po6::threads::mutex::hold hold(&mos->mtx); ++ ++ // TODO: do we need to check if the ACK comes from the right server? ++ // The state transfer manager does that. ++ ++ std::list >::iterator it; ++ ++ for (it = mos->window.begin(); it != mos->window.end(); ++it) ++ { ++ if ((*it)->seq_no == seq_no) ++ { ++ break; ++ } ++ } ++ ++ if (it != mos->window.end()) ++ { ++ (*it)->acked = true; ++ ++ if (mos->window_sz < 1024) ++ { ++ ++mos->window_sz; ++ } ++ } ++ ++ while (!mos->window.empty() && (*mos->window.begin())->acked) ++ { ++ mos->window.pop_front(); ++ } ++ ++ migrate_more_state(mos); ++} ++ ++migration_manager::migration_out_state* ++migration_manager :: get_mos(region_id rid) ++{ ++ for (size_t i = 0; i < m_migrations_out.size(); ++i) ++ { ++ if (m_migrations_out[i]->rid == rid) ++ { ++ return m_migrations_out[i].get(); ++ } ++ } ++ ++ return NULL; ++} ++ ++void ++migration_manager :: kickstarter() ++{ ++ LOG(INFO) << "migration thread started"; ++ sigset_t ss; ++ ++ if (sigfillset(&ss) < 0) ++ { ++ PLOG(ERROR) << "sigfillset"; ++ return; ++ } ++ ++ if (pthread_sigmask(SIG_BLOCK, &ss, NULL) < 0) ++ { ++ PLOG(ERROR) << "could not block signals"; ++ return; ++ } ++ ++ while (true) ++ { ++ { ++ po6::threads::mutex::hold hold(&m_block_kickstarter); ++ ++ while ((!m_need_kickstart && !m_shutdown) || m_need_pause) ++ { ++ m_paused = true; ++ ++ if (m_need_pause) ++ { ++ m_wakeup_reconfigurer.signal(); ++ } ++ ++ m_wakeup_kickstarter.wait(); ++ m_paused = false; ++ } ++ ++ if (m_shutdown) ++ { ++ break; ++ } ++ ++ m_need_kickstart = false; ++ } ++ ++ size_t idx = 0; ++ ++ while (true) ++ { ++ po6::threads::mutex::hold hold(&m_block_kickstarter); ++ ++ if (idx >= m_migrations_out.size()) ++ { ++ break; ++ } ++ ++ po6::threads::mutex::hold hold2(&m_migrations_out[idx]->mtx); ++ retransmit(m_migrations_out[idx].get()); ++ migrate_more_state(m_migrations_out[idx].get()); ++ ++idx; ++ } ++ } ++ ++ LOG(INFO) << "migration thread shutting down"; ++} ++ ++void ++migration_manager :: shutdown() ++{ ++ bool is_shutdown; ++ ++ { ++ po6::threads::mutex::hold hold(&m_block_kickstarter); ++ m_wakeup_kickstarter.broadcast(); ++ is_shutdown = m_shutdown; ++ m_shutdown = true; ++ } ++ ++ if (!is_shutdown) ++ { ++ m_kickstarter.join(); ++ } ++} +diff --git a/daemon/migration_manager.h b/daemon/migration_manager.h +new file mode 100644 +index 0000000..f5790b9 +--- /dev/null ++++ b/daemon/migration_manager.h +@@ -0,0 +1,105 @@ ++// Copyright (c) 2012, Cornell University ++// All rights reserved. ++// ++// Redistribution and use in source and binary forms, with or without ++// modification, are permitted provided that the following conditions are met: ++// ++// * Redistributions of source code must retain the above copyright notice, ++// this list of conditions and the following disclaimer. ++// * Redistributions in binary form must reproduce the above copyright ++// notice, this list of conditions and the following disclaimer in the ++// documentation and/or other materials provided with the distribution. ++// * Neither the name of HyperDex nor the names of its contributors may be ++// used to endorse or promote products derived from this software without ++// specific prior written permission. ++// ++// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ++// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE ++// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR ++// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ++// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ++// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN ++// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ++// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ++// POSSIBILITY OF SUCH DAMAGE. ++ ++#ifndef hyperdex_daemon_migration_manager_h_ ++#define hyperdex_daemon_migration_manager_h_ ++ ++// STL ++#include ++ ++// po6 ++#include ++#include ++#include ++ ++// e ++#include ++ ++// HyperDex ++#include "namespace.h" ++#include "common/configuration.h" ++#include "daemon/reconfigure_returncode.h" ++ ++BEGIN_HYPERDEX_NAMESPACE ++class daemon; ++ ++class migration_manager ++{ ++ public: ++ migration_manager(daemon*); ++ ~migration_manager() throw (); ++ ++ public: ++ bool setup(); ++ void teardown(); ++ void pause(); ++ void unpause(); ++ void reconfigure(const configuration& old_config, ++ const configuration& new_config, ++ const server_id&); ++ ++ void migration_ack(const server_id& from, ++ const virtual_server_id& to, ++ region_id rid, ++ uint64_t seq_no, ++ uint16_t result); ++ ++ private: ++ class pending; ++ class migration_out_state; ++ ++ private: ++ void setup_migration_state(const std::vector migrations, ++ std::vector >* migration_states); ++ void migrate_more_state(migration_out_state* mos); ++ void retransmit(migration_out_state* mos); ++ void send_object(migration_out_state* mos, pending* op); ++ void kickstarter(); ++ void shutdown(); ++ ++ migration_out_state* get_mos(region_id rid); ++ ++ private: ++ migration_manager(const migration_manager&); ++ migration_manager& operator = (const migration_manager&); ++ ++ private: ++ daemon* m_daemon; ++ std::vector > m_migrations_out; ++ po6::threads::thread m_kickstarter; ++ po6::threads::mutex m_block_kickstarter; ++ po6::threads::cond m_wakeup_kickstarter; ++ po6::threads::cond m_wakeup_reconfigurer; ++ bool m_need_kickstart; ++ bool m_shutdown; ++ bool m_need_pause; ++ bool m_paused; ++}; ++ ++END_HYPERDEX_NAMESPACE ++ ++#endif // hyperdex_daemon_migration_manager_h_ +\ No newline at end of file +diff --git a/daemon/migration_manager_pending.cc b/daemon/migration_manager_pending.cc +new file mode 100644 +index 0000000..fb55773 +--- /dev/null ++++ b/daemon/migration_manager_pending.cc +@@ -0,0 +1,48 @@ ++// Copyright (c) 2012, Cornell University ++// All rights reserved. ++// ++// Redistribution and use in source and binary forms, with or without ++// modification, are permitted provided that the following conditions are met: ++// ++// * Redistributions of source code must retain the above copyright notice, ++// this list of conditions and the following disclaimer. ++// * Redistributions in binary form must reproduce the above copyright ++// notice, this list of conditions and the following disclaimer in the ++// documentation and/or other materials provided with the distribution. ++// * Neither the name of HyperDex nor the names of its contributors may be ++// used to endorse or promote products derived from this software without ++// specific prior written permission. ++// ++// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ++// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE ++// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR ++// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ++// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ++// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN ++// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ++// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ++// POSSIBILITY OF SUCH DAMAGE. ++ ++// HyperDex ++#include "daemon/migration_manager_pending.h" ++ ++using hyperdex::migration_manager; ++ ++migration_manager :: migration_manager :: pending :: pending() ++ : seq_no(0) ++ , rid(0) ++ , version(0) ++ , key() ++ , value() ++ , acked(false) ++ , msg() ++ , vref() ++ , m_ref(0) ++{ ++} ++ ++migration_manager :: migration_manager :: pending :: ~pending() throw () ++{ ++} +diff --git a/daemon/migration_manager_pending.h b/daemon/migration_manager_pending.h +new file mode 100644 +index 0000000..3539bf6 +--- /dev/null ++++ b/daemon/migration_manager_pending.h +@@ -0,0 +1,62 @@ ++// Copyright (c) 2012, Cornell University ++// All rights reserved. ++// ++// Redistribution and use in source and binary forms, with or without ++// modification, are permitted provided that the following conditions are met: ++// ++// * Redistributions of source code must retain the above copyright notice, ++// this list of conditions and the following disclaimer. ++// * Redistributions in binary form must reproduce the above copyright ++// notice, this list of conditions and the following disclaimer in the ++// documentation and/or other materials provided with the distribution. ++// * Neither the name of HyperDex nor the names of its contributors may be ++// used to endorse or promote products derived from this software without ++// specific prior written permission. ++// ++// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ++// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE ++// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR ++// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ++// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ++// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN ++// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ++// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ++// POSSIBILITY OF SUCH DAMAGE. ++ ++#ifndef hyperdex_daemon_migration_manager_pending_h_ ++#define hyperdex_daemon_migration_manager_pending_h_ ++ ++// hyperdex ++#include "daemon/datalayer.h" ++#include "daemon/migration_manager.h" ++ ++class hyperdex::migration_manager::pending ++{ ++ public: ++ pending(); ++ ~pending() throw (); ++ ++ public: ++ uint64_t seq_no; ++ region_id rid; ++ uint64_t version; ++ e::slice key; ++ std::vector value; ++ bool acked; ++ std::auto_ptr msg; ++ datalayer::reference vref; ++ ++ private: ++ friend class e::intrusive_ptr; ++ ++ private: ++ void inc() { ++m_ref; } ++ void dec() { --m_ref; if (m_ref == 0) delete this; } ++ ++ private: ++ size_t m_ref; ++}; ++ ++#endif // hyperdex_daemon_migration_manager_pending_h_ +diff --git a/daemon/migration_out_state.cc b/daemon/migration_out_state.cc +new file mode 100644 +index 0000000..f823ad6 +--- /dev/null ++++ b/daemon/migration_out_state.cc +@@ -0,0 +1,64 @@ ++// Copyright (c) 2012, Cornell University ++// All rights reserved. ++// ++// Redistribution and use in source and binary forms, with or without ++// modification, are permitted provided that the following conditions are met: ++// ++// * Redistributions of source code must retain the above copyright notice, ++// this list of conditions and the following disclaimer. ++// * Redistributions in binary form must reproduce the above copyright ++// notice, this list of conditions and the following disclaimer in the ++// documentation and/or other materials provided with the distribution. ++// * Neither the name of HyperDex nor the names of its contributors may be ++// used to endorse or promote products derived from this software without ++// specific prior written permission. ++// ++// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ++// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE ++// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR ++// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ++// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ++// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN ++// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ++// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ++// POSSIBILITY OF SUCH DAMAGE. ++ ++// HyperDex ++#include "daemon/datalayer_iterator.h" ++#include "daemon/migration_out_state.h" ++#include "daemon/migration_manager_pending.h" ++ ++using hyperdex::migration_manager; ++ ++migration_manager :: migration_out_state :: migration_out_state() ++ : mtx() ++ , next_seq_no(1) ++ , window() ++ , window_sz(1) ++ , iter() ++ , mid() ++ , sid() ++ , rid() ++ , m_ref(0) ++{ ++} ++ ++migration_manager :: migration_out_state :: migration_out_state(migration_id _mid, ++ space_id _sid, region_id _rid, std::auto_ptr _iter) ++ : mtx() ++ , next_seq_no(1) ++ , window() ++ , window_sz(1) ++ , iter(_iter) ++ , mid(_mid) ++ , sid(_sid) ++ , rid(_rid) ++ , m_ref(0) ++{ ++} ++ ++migration_manager :: migration_out_state :: ~migration_out_state() throw () ++{ ++} +diff --git a/daemon/migration_out_state.h b/daemon/migration_out_state.h +new file mode 100644 +index 0000000..4e2a1b6 +--- /dev/null ++++ b/daemon/migration_out_state.h +@@ -0,0 +1,83 @@ ++// Copyright (c) 2012, Cornell University ++// All rights reserved. ++// ++// Redistribution and use in source and binary forms, with or without ++// modification, are permitted provided that the following conditions are met: ++// ++// * Redistributions of source code must retain the above copyright notice, ++// this list of conditions and the following disclaimer. ++// * Redistributions in binary form must reproduce the above copyright ++// notice, this list of conditions and the following disclaimer in the ++// documentation and/or other materials provided with the distribution. ++// * Neither the name of HyperDex nor the names of its contributors may be ++// used to endorse or promote products derived from this software without ++// specific prior written permission. ++// ++// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ++// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE ++// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR ++// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ++// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ++// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN ++// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ++// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ++// POSSIBILITY OF SUCH DAMAGE. ++ ++#ifndef hyperdex_daemon_migration_manager_migration_out_state_h_ ++#define hyperdex_daemon_migration_manager_migration_out_state_h_ ++ ++// STL ++#include ++#include ++ ++// po6 ++#include ++ ++// e ++#include ++ ++// HyperDex ++#include "common/ids.h" ++#include "daemon/datalayer.h" ++#include "daemon/migration_manager.h" ++ ++using hyperdex::migration_manager; ++ ++class migration_manager::migration_out_state ++{ ++ public: ++ migration_out_state(); ++ migration_out_state(migration_id mid, ++ space_id sid, ++ region_id rid, ++ std::auto_ptr iter); ++ ~migration_out_state() throw (); ++ ++ public: ++ po6::threads::mutex mtx; ++ uint64_t next_seq_no; ++ migration_id mid; ++ space_id sid; ++ region_id rid; ++ std::list > window; ++ size_t window_sz; ++ std::auto_ptr iter; ++ ++ private: ++ friend class e::intrusive_ptr; ++ ++ private: ++ void inc() { __sync_add_and_fetch(&m_ref, 1); } ++ void dec() { if (__sync_sub_and_fetch(&m_ref, 1) == 0) delete this; } ++ ++ private: ++ size_t m_ref; ++ ++ private: ++ migration_out_state(const migration_out_state&); ++ migration_out_state& operator = (const migration_out_state&); ++}; ++ ++#endif // hyperdex_daemon_migration_manager_migration_out_state_h_ +diff --git a/daemon/replication_manager.cc b/daemon/replication_manager.cc +index 6fbffb4..951abce 100644 +--- a/daemon/replication_manager.cc ++++ b/daemon/replication_manager.cc +@@ -226,6 +226,16 @@ replication_manager :: debug_dump() + unpause(); + } + ++// OK, so basically, you create a new class, something called "response", which ++// contains some state that specifies 1) whether the receiver is a client or a server, ++// 2) extra state if the receiver is a server, i.e. state that identify the corresponding ++// migration state for the object in question. When receiving a req_atomic or a ++// migration_atomic, you generate such an object, then you call client_atomic with ++// this response object. Then, client_atomic saves it into the key state. Then, ++// when chain_ack is received, the point leader will look into the key state and ++// call some method on this response class, that would generate an appropriate response ++// that the point leader can send. ++ + void + replication_manager :: client_atomic(const server_id& from, + const virtual_server_id& to, +@@ -237,9 +247,31 @@ replication_manager :: client_atomic(const server_id& from, + const std::vector& checks, + const std::vector& funcs) + { ++ request_atomic(from, to, nonce, erase, fail_if_not_found, fail_if_found, ++ key, checks, funcs, false, region_id(), 0); ++} ++ ++void ++replication_manager :: request_atomic(const server_id& from, ++ const virtual_server_id& to, ++ uint64_t nonce, ++ bool erase, ++ bool fail_if_not_found, ++ bool fail_if_found, ++ const e::slice& key, ++ const std::vector& checks, ++ const std::vector& funcs, ++ bool is_migration_object, ++ region_id rid, ++ uint64_t seq_no) ++{ ++ #define respond(ret) \ ++ if (is_migration_object) { respond_for_migration(to, from, rid, seq_no, ret); } \ ++ else { respond_to_client(to, from, nonce, ret); } ++ + if (m_daemon->m_config.read_only()) + { +- respond_to_client(to, from, nonce, NET_READONLY); ++ respond(NET_READONLY) + return; + } + +@@ -253,7 +285,7 @@ replication_manager :: client_atomic(const server_id& from, + { + LOG(ERROR) << "dropping nonce=" << nonce << " from client=" << from + << " because the key, checks, or funcs don't validate"; +- respond_to_client(to, from, nonce, NET_BADDIMSPEC); ++ respond(NET_BADDIMSPEC); + return; + } + +@@ -261,7 +293,7 @@ replication_manager :: client_atomic(const server_id& from, + { + LOG(ERROR) << "dropping nonce=" << nonce << " from client=" << from + << " because it doesn't map to " << ri; +- respond_to_client(to, from, nonce, NET_NOTUS); ++ respond(NET_NOTUS); + return; + } + +@@ -271,7 +303,7 @@ replication_manager :: client_atomic(const server_id& from, + + if (!ks->check_against_latest_version(sc, erase, fail_if_not_found, fail_if_found, checks, &nrc)) + { +- respond_to_client(to, from, nonce, nrc); ++ respond(nrc); + return; + } + +@@ -285,9 +317,10 @@ replication_manager :: client_atomic(const server_id& from, + } + else + { +- if (!ks->put_from_funcs(sc, ri, seq_id, funcs, from, nonce)) ++ if (!ks->put_from_funcs(sc, ri, seq_id, funcs, from, nonce, ++ is_migration_object, rid, seq_id)) + { +- respond_to_client(to, from, nonce, NET_OVERFLOW); ++ respond(NET_OVERFLOW); + return; + } + } +@@ -530,7 +563,11 @@ replication_manager :: chain_ack(const virtual_server_id& from, + + if (op->client != server_id()) + { +- respond_to_client(to, op->client, op->nonce, NET_SUCCESS); ++ if (op->is_migration_object) { ++ respond_for_migration(to, op->client, op->rid, op->seq_no, NET_SUCCESS); ++ } else { ++ respond_to_client(to, op->client, op->nonce, NET_SUCCESS); ++ } + } + + if (is_head && m_daemon->m_config.version() == op->recv_config_version) +@@ -840,13 +877,44 @@ replication_manager :: respond_to_client(const virtual_server_id& us, + uint64_t nonce, + network_returncode ret) + { +- size_t sz = HYPERDEX_HEADER_SIZE_VC +- + sizeof(uint64_t) +- + sizeof(uint16_t); +- std::auto_ptr msg(e::buffer::create(sz)); +- uint16_t result = static_cast(ret); +- msg->pack_at(HYPERDEX_HEADER_SIZE_VC) << nonce << result; +- m_daemon->m_comm.send_client(us, client, RESP_ATOMIC, msg); ++ if (m_daemon->m_config.exists(client)) { ++ size_t sz = HYPERDEX_HEADER_SIZE_VV ++ + sizeof(uint64_t) ++ + sizeof(uint16_t); ++ std::auto_ptr msg(e::buffer::create(sz)); ++ uint16_t result = static_cast(ret); ++ msg->pack_at(HYPERDEX_HEADER_SIZE_VV) << nonce << result; ++ m_daemon->m_comm.send(us, client, RESP_ATOMIC, msg); ++ } else { ++ size_t sz = HYPERDEX_HEADER_SIZE_VC ++ + sizeof(uint64_t) ++ + sizeof(uint16_t); ++ std::auto_ptr msg(e::buffer::create(sz)); ++ uint16_t result = static_cast(ret); ++ msg->pack_at(HYPERDEX_HEADER_SIZE_VC) << nonce << result; ++ m_daemon->m_comm.send_client(us, client, RESP_ATOMIC, msg); ++ } ++} ++ ++void ++replication_manager :: respond_for_migration(const virtual_server_id& us, ++ const server_id& client, ++ region_id rid, ++ uint64_t seq_no, ++ network_returncode ret) ++{ ++ if (m_daemon->m_config.exists(client)) { ++ size_t sz = HYPERDEX_HEADER_SIZE_VV ++ + sizeof(uint64_t) ++ + sizeof(uint64_t) ++ + sizeof(uint16_t); ++ std::auto_ptr msg(e::buffer::create(sz)); ++ uint16_t result = static_cast(ret); ++ msg->pack_at(HYPERDEX_HEADER_SIZE_VV) << rid << seq_no << result; ++ m_daemon->m_comm.send(us, client, RESP_MIGRATION, msg); ++ } else { ++ LOG(ERROR) << "migration has to originate from a server"; ++ } + } + + bool +diff --git a/daemon/replication_manager.h b/daemon/replication_manager.h +index 8823dd8..922c5d0 100755 +--- a/daemon/replication_manager.h ++++ b/daemon/replication_manager.h +@@ -91,6 +91,18 @@ class replication_manager + const e::slice& key, + const std::vector& checks, + const std::vector& funcs); ++ void request_atomic(const server_id& from, ++ const virtual_server_id& to, ++ uint64_t nonce, ++ bool erase, ++ bool fail_if_not_found, ++ bool fail_if_found, ++ const e::slice& key, ++ const std::vector& checks, ++ const std::vector& funcs, ++ bool is_migration_object, ++ region_id rid, ++ uint64_t seq_no); + // These are called in response to messages from other hosts. + void chain_op(const virtual_server_id& from, + const virtual_server_id& to, +@@ -165,6 +177,11 @@ class replication_manager + const server_id& client, + uint64_t nonce, + network_returncode ret); ++ void respond_for_migration(const virtual_server_id& us, ++ const server_id& client, ++ region_id rid, ++ uint64_t seq_no, ++ network_returncode ret); + // check stability + bool is_check_needed(); + void check_is_needed(); +diff --git a/daemon/replication_manager_key_state.cc b/daemon/replication_manager_key_state.cc +index daf0f3f..eab82b8 100644 +--- a/daemon/replication_manager_key_state.cc ++++ b/daemon/replication_manager_key_state.cc +@@ -279,7 +279,10 @@ bool + replication_manager :: key_state :: put_from_funcs(const schema& sc, + const region_id& reg_id, uint64_t seq_id, + const std::vector& funcs, +- const server_id& client, uint64_t nonce) ++ const server_id& client, uint64_t nonce, ++ bool is_migration_object, ++ region_id rid, ++ uint64_t seq_no) + { + bool has_old_value = false; + uint64_t old_version = 0; +@@ -303,6 +306,10 @@ replication_manager :: key_state :: put_from_funcs(const schema& sc, + client, nonce, + 0, virtual_server_id()); + ++ op->is_migration_object = is_migration_object; ++ op->rid = rid; ++ op->seq_no = seq_no; ++ + if (funcs_passed == funcs.size()) + { + insert_deferred(old_version + 1, op); +diff --git a/daemon/replication_manager_key_state.h b/daemon/replication_manager_key_state.h +index a112c6c..b9d2f04 100644 +--- a/daemon/replication_manager_key_state.h ++++ b/daemon/replication_manager_key_state.h +@@ -73,7 +73,9 @@ class hyperdex::replication_manager::key_state + bool put_from_funcs(const schema& sc, + const region_id& reg_id, uint64_t seq_id, + const std::vector& funcs, +- const server_id& client, uint64_t nonce); ++ const server_id& client, uint64_t nonce, ++ bool is_migration_object, ++ region_id rid, uint64_t seq_no); + void insert_deferred(uint64_t version, e::intrusive_ptr op); + bool persist_to_datalayer(replication_manager* rm, const region_id& ri, + const region_id& reg_id, uint64_t seq_id, +diff --git a/daemon/replication_manager_pending.cc b/daemon/replication_manager_pending.cc +index b2bb2a9..680861e 100644 +--- a/daemon/replication_manager_pending.cc ++++ b/daemon/replication_manager_pending.cc +@@ -61,6 +61,9 @@ replication_manager :: pending :: pending(std::auto_ptr _backing, + , this_new_region() + , prev_region() + , next_region() ++ , is_migration_object() ++ , rid(region_id()) ++ , seq_no(0) + , m_ref(0) + { + } +@@ -82,4 +85,7 @@ replication_manager :: pending :: debug_dump() + LOG(INFO) << " this_old: " << this_old_region; + LOG(INFO) << " this_new: " << this_new_region; + LOG(INFO) << " next: " << next_region; ++ LOG(INFO) << " is_migration_object: " << is_migration_object; ++ LOG(INFO) << " rid: " << rid; ++ LOG(INFO) << " seq_no: " << seq_no; + } +diff --git a/daemon/replication_manager_pending.h b/daemon/replication_manager_pending.h +index 9d551bf..5350b0e 100644 +--- a/daemon/replication_manager_pending.h ++++ b/daemon/replication_manager_pending.h +@@ -72,6 +72,11 @@ class hyperdex::replication_manager::pending + region_id prev_region; + region_id next_region; + ++ // Migration-related stuff ++ bool is_migration_object; ++ region_id rid; ++ uint64_t seq_no; ++ + private: + friend class e::intrusive_ptr; + void inc() { ++m_ref; } +diff --git a/hyperdex-migrate b/hyperdex-migrate +new file mode 100755 +index 0000000..97402e3 +--- /dev/null ++++ b/hyperdex-migrate +@@ -0,0 +1,228 @@ ++#! /bin/bash ++ ++# hyperdex-migrate - temporary wrapper script for .libs/hyperdex-migrate ++# Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1.3ubuntu1 ++# ++# The hyperdex-migrate program cannot be directly executed until all the libtool ++# libraries that it depends on are installed. ++# ++# This wrapper script should never be moved out of the build directory. ++# If it is, it will not operate correctly. ++ ++# Sed substitution that helps us do robust quoting. It backslashifies ++# metacharacters that are still active within double-quoted strings. ++sed_quote_subst='s/\([`"$\\]\)/\\\1/g' ++ ++# Be Bourne compatible ++if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then ++ emulate sh ++ NULLCMD=: ++ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which ++ # is contrary to our usage. Disable this feature. ++ alias -g '${1+"$@"}'='"$@"' ++ setopt NO_GLOB_SUBST ++else ++ case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac ++fi ++BIN_SH=xpg4; export BIN_SH # for Tru64 ++DUALCASE=1; export DUALCASE # for MKS sh ++ ++# The HP-UX ksh and POSIX shell print the target directory to stdout ++# if CDPATH is set. ++(unset CDPATH) >/dev/null 2>&1 && unset CDPATH ++ ++relink_command="(cd /media/Work_Study/CS/workspace/HyperDex/HyperDex; { test -z \"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset COMPILER_PATH || { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z \"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; { test -z \"\${LD_LIBRARY_PATH+set}\" || unset LD_LIBRARY_PATH || { LD_LIBRARY_PATH=; export LD_LIBRARY_PATH; }; }; PATH=/home/derek/.rvm/gems/ruby-2.0.0-p0/bin:/home/derek/.rvm/gems/ruby-2.0.0-p0@global/bin:/home/derek/.rvm/rubies/ruby-2.0.0-p0/bin:/home/derek/.rvm/bin:/usr/lib/mipsel-linux/bin:/usr/local/heroku/bin:/home/derek/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/go/bin:/home/derek/go/bin:/home/derek/Dropbox/CS/workspace/go:/usr/lib/scala/bin:/usr/lib/akka/bin:/media/Work_Study/CS/workspace/Play:/home/derek/.cabal/bin:/usr/lib/vertx/bin:/usr/lib/jvm/jdk1.7.0/bin:/home/derek/Dropbox/CS/workspace/go/bin; export PATH; g++ -fvisibility=hidden -fvisibility-inlines-hidden -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -g -O2 -o \$progdir/\$file tools/migrate.o ./.libs/libhyperdex-admin.so /usr/lib/x86_64-linux-gnu/libpopt.so -Wl,-rpath -Wl,/media/Work_Study/CS/workspace/HyperDex/HyperDex/.libs)" ++ ++# This environment variable determines our operation mode. ++if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then ++ # install mode needs the following variables: ++ generated_by_libtool_version='2.4.2' ++ notinst_deplibs=' libhyperdex-admin.la' ++else ++ # When we are sourced in execute mode, $file and $ECHO are already set. ++ if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then ++ file="$0" ++ ++# A function that is used when there is no print builtin or printf. ++func_fallback_echo () ++{ ++ eval 'cat <<_LTECHO_EOF ++$1 ++_LTECHO_EOF' ++} ++ ECHO="printf %s\\n" ++ fi ++ ++# Very basic option parsing. These options are (a) specific to ++# the libtool wrapper, (b) are identical between the wrapper ++# /script/ and the wrapper /executable/ which is used only on ++# windows platforms, and (c) all begin with the string --lt- ++# (application programs are unlikely to have options which match ++# this pattern). ++# ++# There are only two supported options: --lt-debug and ++# --lt-dump-script. There is, deliberately, no --lt-help. ++# ++# The first argument to this parsing function should be the ++# script's ./libtool value, followed by no. ++lt_option_debug= ++func_parse_lt_options () ++{ ++ lt_script_arg0=$0 ++ shift ++ for lt_opt ++ do ++ case "$lt_opt" in ++ --lt-debug) lt_option_debug=1 ;; ++ --lt-dump-script) ++ lt_dump_D=`$ECHO "X$lt_script_arg0" | /bin/sed -e 's/^X//' -e 's%/[^/]*$%%'` ++ test "X$lt_dump_D" = "X$lt_script_arg0" && lt_dump_D=. ++ lt_dump_F=`$ECHO "X$lt_script_arg0" | /bin/sed -e 's/^X//' -e 's%^.*/%%'` ++ cat "$lt_dump_D/$lt_dump_F" ++ exit 0 ++ ;; ++ --lt-*) ++ $ECHO "Unrecognized --lt- option: '$lt_opt'" 1>&2 ++ exit 1 ++ ;; ++ esac ++ done ++ ++ # Print the debug banner immediately: ++ if test -n "$lt_option_debug"; then ++ echo "hyperdex-migrate:hyperdex-migrate:${LINENO}: libtool wrapper (GNU libtool) 2.4.2 Debian-2.4.2-1.3ubuntu1" 1>&2 ++ fi ++} ++ ++# Used when --lt-debug. Prints its arguments to stdout ++# (redirection is the responsibility of the caller) ++func_lt_dump_args () ++{ ++ lt_dump_args_N=1; ++ for lt_arg ++ do ++ $ECHO "hyperdex-migrate:hyperdex-migrate:${LINENO}: newargv[$lt_dump_args_N]: $lt_arg" ++ lt_dump_args_N=`expr $lt_dump_args_N + 1` ++ done ++} ++ ++# Core function for launching the target application ++func_exec_program_core () ++{ ++ ++ if test -n "$lt_option_debug"; then ++ $ECHO "hyperdex-migrate:hyperdex-migrate:${LINENO}: newargv[0]: $progdir/$program" 1>&2 ++ func_lt_dump_args ${1+"$@"} 1>&2 ++ fi ++ exec "$progdir/$program" ${1+"$@"} ++ ++ $ECHO "$0: cannot exec $program $*" 1>&2 ++ exit 1 ++} ++ ++# A function to encapsulate launching the target application ++# Strips options in the --lt-* namespace from $@ and ++# launches target application with the remaining arguments. ++func_exec_program () ++{ ++ case " $* " in ++ *\ --lt-*) ++ for lt_wr_arg ++ do ++ case $lt_wr_arg in ++ --lt-*) ;; ++ *) set x "$@" "$lt_wr_arg"; shift;; ++ esac ++ shift ++ done ;; ++ esac ++ func_exec_program_core ${1+"$@"} ++} ++ ++ # Parse options ++ func_parse_lt_options "$0" ${1+"$@"} ++ ++ # Find the directory that this script lives in. ++ thisdir=`$ECHO "$file" | /bin/sed 's%/[^/]*$%%'` ++ test "x$thisdir" = "x$file" && thisdir=. ++ ++ # Follow symbolic links until we get to the real thisdir. ++ file=`ls -ld "$file" | /bin/sed -n 's/.*-> //p'` ++ while test -n "$file"; do ++ destdir=`$ECHO "$file" | /bin/sed 's%/[^/]*$%%'` ++ ++ # If there was a directory component, then change thisdir. ++ if test "x$destdir" != "x$file"; then ++ case "$destdir" in ++ [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;; ++ *) thisdir="$thisdir/$destdir" ;; ++ esac ++ fi ++ ++ file=`$ECHO "$file" | /bin/sed 's%^.*/%%'` ++ file=`ls -ld "$thisdir/$file" | /bin/sed -n 's/.*-> //p'` ++ done ++ ++ # Usually 'no', except on cygwin/mingw when embedded into ++ # the cwrapper. ++ WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no ++ if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then ++ # special case for '.' ++ if test "$thisdir" = "."; then ++ thisdir=`pwd` ++ fi ++ # remove .libs from thisdir ++ case "$thisdir" in ++ *[\\/].libs ) thisdir=`$ECHO "$thisdir" | /bin/sed 's%[\\/][^\\/]*$%%'` ;; ++ .libs ) thisdir=. ;; ++ esac ++ fi ++ ++ # Try to get the absolute directory name. ++ absdir=`cd "$thisdir" && pwd` ++ test -n "$absdir" && thisdir="$absdir" ++ ++ program=lt-'hyperdex-migrate' ++ progdir="$thisdir/.libs" ++ ++ if test ! -f "$progdir/$program" || ++ { file=`ls -1dt "$progdir/$program" "$progdir/../$program" 2>/dev/null | /bin/sed 1q`; \ ++ test "X$file" != "X$progdir/$program"; }; then ++ ++ file="$$-$program" ++ ++ if test ! -d "$progdir"; then ++ mkdir "$progdir" ++ else ++ rm -f "$progdir/$file" ++ fi ++ ++ # relink executable if necessary ++ if test -n "$relink_command"; then ++ if relink_command_output=`eval $relink_command 2>&1`; then : ++ else ++ printf %s\n "$relink_command_output" >&2 ++ rm -f "$progdir/$file" ++ exit 1 ++ fi ++ fi ++ ++ mv -f "$progdir/$file" "$progdir/$program" 2>/dev/null || ++ { rm -f "$progdir/$program"; ++ mv -f "$progdir/$file" "$progdir/$program"; } ++ rm -f "$progdir/$file" ++ fi ++ ++ if test -f "$progdir/$program"; then ++ if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then ++ # Run the actual program with our arguments. ++ func_exec_program ${1+"$@"} ++ fi ++ else ++ # The program doesn't exist. ++ $ECHO "$0: error: \`$progdir/$program' does not exist" 1>&2 ++ $ECHO "This script is just a wrapper for $program." 1>&2 ++ $ECHO "See the libtool documentation for more information." 1>&2 ++ exit 1 ++ fi ++fi +diff --git a/hyperdex.cc b/hyperdex.cc +index 29866de..6ad37d6 100644 +--- a/hyperdex.cc ++++ b/hyperdex.cc +@@ -45,6 +45,7 @@ main(int argc, const char* argv[]) + cmds.push_back(e::subcommand("rm-space", "Remove an existing HyperDex space")); + cmds.push_back(e::subcommand("list-spaces", "List the names of all spaces")); + cmds.push_back(e::subcommand("validate-space", "Validate a HyperDex space description")); ++ cmds.push_back(e::subcommand("migrate-data", "Migrate data from one space to another")); + cmds.push_back(e::subcommand("server-register", "Manually register a new HyperDex server")); + cmds.push_back(e::subcommand("server-offline", "Manually take a daemon offline")); + cmds.push_back(e::subcommand("server-online", "Manually bring a daemon online")); +diff --git a/include/hyperdex/admin.h b/include/hyperdex/admin.h +index 50b2dd8..05d0b20 100644 +--- a/include/hyperdex/admin.h ++++ b/include/hyperdex/admin.h +@@ -120,6 +120,12 @@ hyperdex_admin_list_spaces(struct hyperdex_admin* admin, + const char** spaces); + + int64_t ++hyperdex_admin_migrate_data(struct hyperdex_admin* admin, ++ const char* space_from, ++ const char* space_to, ++ enum hyperdex_admin_returncode* status); ++ ++int64_t + hyperdex_admin_server_register(struct hyperdex_admin* admin, + uint64_t token, const char* address, + enum hyperdex_admin_returncode* status); +diff --git a/include/hyperdex/admin.hpp b/include/hyperdex/admin.hpp +index 9a93dca..8bb6f84 100644 +--- a/include/hyperdex/admin.hpp ++++ b/include/hyperdex/admin.hpp +@@ -73,6 +73,10 @@ class Admin + int64_t list_spaces(enum hyperdex_admin_returncode* status, + const char** spaces) + { return hyperdex_admin_list_spaces(m_adm, status, spaces); } ++ int64_t migrate_data(const char* space_from, ++ const char* space_to, ++ enum hyperdex_admin_returncode* status) ++ { return hyperdex_admin_migrate_data(m_adm, space_from, space_to, status); }; + int64_t server_register(uint64_t token, const char* address, + enum hyperdex_admin_returncode* status) + { return hyperdex_admin_server_register(m_adm, token, address, status); } +diff --git a/m4/.gitignore b/m4/.gitignore +deleted file mode 100644 +index e69de29..0000000 +diff --git a/m4/anal_warnings.m4 b/m4/anal_warnings.m4 +deleted file mode 100644 +index a5f1306..0000000 +--- a/m4/anal_warnings.m4 ++++ /dev/null +@@ -1,121 +0,0 @@ +-# Copyright (c) 2012-2013, Robert Escriva +-# All rights reserved. +-# +-# Redistribution and use in source and binary forms, with or without +-# modification, are permitted provided that the following conditions are met: +-# +-# * Redistributions of source code must retain the above copyright notice, +-# this list of conditions and the following disclaimer. +-# * Redistributions in binary form must reproduce the above copyright +-# notice, this list of conditions and the following disclaimer in the +-# documentation and/or other materials provided with the distribution. +-# * Neither the name of this project nor the names of its contributors may +-# be used to endorse or promote products derived from this software +-# without specific prior written permission. +-# +-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +-# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +-# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-# +-# This macro enables many compiler warnings for C++ that generally catch bugs in +-# code. It offers the "--enable-wanal-flags" option which defaults to "no". +- +-AC_DEFUN([ANAL_WARNINGS], +- [WANAL_CFLAGS="" +- WANAL_CXXFLAGS="" +- WANAL_CFLAGS_ONLY="" +- AC_ARG_ENABLE([wanal-flags], +- [AS_HELP_STRING([--enable-wanal-flags], [enable many warnings @<:@default: no@:>@])], +- [wanal_flags=${enableval}], [wanal_flags=no]) +- if test x"${wanal_flags}" = xyes; then +- AX_CHECK_COMPILE_FLAG([-pedantic],[WANAL_CFLAGS="${WANAL_CFLAGS} -pedantic"],,) +- AX_CHECK_COMPILE_FLAG([-Wabi],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wabi"],,) +- AX_CHECK_COMPILE_FLAG([-Waddress],[WANAL_CFLAGS="${WANAL_CFLAGS} -Waddress"],,) +- AX_CHECK_COMPILE_FLAG([-Wall],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wall"],,) +- AX_CHECK_COMPILE_FLAG([-Warray-bounds],[WANAL_CFLAGS="${WANAL_CFLAGS} -Warray-bounds"],,) +- AX_CHECK_COMPILE_FLAG([-Wc++0x-compat],[WANAL_CXXFLAGS="${WANAL_CXXFLAGS} -Wc++0x-compat"],,) +- AX_CHECK_COMPILE_FLAG([-Wcast-align],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wcast-align"],,) +- AX_CHECK_COMPILE_FLAG([-Wcast-qual],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wcast-qual"],,) +- AX_CHECK_COMPILE_FLAG([-Wchar-subscripts],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wchar-subscripts"],,) +- AX_CHECK_COMPILE_FLAG([-Wclobbered],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wclobbered"],,) +- AX_CHECK_COMPILE_FLAG([-Wcomment],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wcomment"],,) +- #AX_CHECK_COMPILE_FLAG([-Wconversion],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wconversion"],,) +- AX_CHECK_COMPILE_FLAG([-Wctor-dtor-privacy],[WANAL_CXXFLAGS="${WANAL_CXXFLAGS} -Wctor-dtor-privacy"],,) +- AX_CHECK_COMPILE_FLAG([-Wdisabled-optimization],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wdisabled-optimization"],,) +- AX_CHECK_COMPILE_FLAG([-Weffc++],[WANAL_CXXFLAGS="${WANAL_CXXFLAGS} -Weffc++"],,) +- AX_CHECK_COMPILE_FLAG([-Wempty-body],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wempty-body"],,) +- AX_CHECK_COMPILE_FLAG([-Wenum-compare],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wenum-compare"],,) +- AX_CHECK_COMPILE_FLAG([-Wextra],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wextra"],,) +- AX_CHECK_COMPILE_FLAG([-Wfloat-equal],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wfloat-equal"],,) +- AX_CHECK_COMPILE_FLAG([-Wformat=2],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wformat=2"],,) +- AX_CHECK_COMPILE_FLAG([-Wformat-nonliteral],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wformat-nonliteral"],,) +- AX_CHECK_COMPILE_FLAG([-Wformat-security],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wformat-security"],,) +- AX_CHECK_COMPILE_FLAG([-Wformat],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wformat"],,) +- AX_CHECK_COMPILE_FLAG([-Wformat-y2k],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wformat-y2k"],,) +- dnl AX_CHECK_COMPILE_FLAG([-Wframe-larger-than=8192],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wframe-larger-than=8192"],,) +- AX_CHECK_COMPILE_FLAG([-Wignored-qualifiers],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wignored-qualifiers"],,) +- AX_CHECK_COMPILE_FLAG([-Wimplicit],[WANAL_CFLAGS_ONLY="${WANAL_CFLAGS} -Wimplicit"],,) +- AX_CHECK_COMPILE_FLAG([-Winit-self],[WANAL_CFLAGS="${WANAL_CFLAGS} -Winit-self"],,) +- AX_CHECK_COMPILE_FLAG([-Winline],[WANAL_CFLAGS="${WANAL_CFLAGS} -Winline"],,) +- AX_CHECK_COMPILE_FLAG([-Wlarger-than=4096],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wlarger-than=4096"],,) +- AX_CHECK_COMPILE_FLAG([-Wlogical-op],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wlogical-op"],,) +- AX_CHECK_COMPILE_FLAG([-Wmain],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wmain"],,) +- AX_CHECK_COMPILE_FLAG([-Wmissing-braces],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wmissing-braces"],,) +- #AX_CHECK_COMPILE_FLAG([-Wmissing-declarations],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wmissing-declarations"],,) +- AX_CHECK_COMPILE_FLAG([-Wmissing-field-initializers],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wmissing-field-initializers"],,) +- AX_CHECK_COMPILE_FLAG([-Wmissing-format-attribute],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wmissing-format-attribute"],,) +- AX_CHECK_COMPILE_FLAG([-Wmissing-include-dirs],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wmissing-include-dirs"],,) +- dnl AX_CHECK_COMPILE_FLAG([-Wmissing-noreturn],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wmissing-noreturn"],,) +- AX_CHECK_COMPILE_FLAG([-Wno-long-long],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wno-long-long"],,) +- AX_CHECK_COMPILE_FLAG([-Wnon-virtual-dtor],[WANAL_CXXFLAGS="${WANAL_CXXFLAGS} -Wnon-virtual-dtor"],,) +- #AX_CHECK_COMPILE_FLAG([-Wold-style-cast],[WANAL_CXXFLAGS="${WANAL_CXXFLAGS} -Wold-style-cast"],,) +- AX_CHECK_COMPILE_FLAG([-Woverlength-strings],[WANAL_CFLAGS="${WANAL_CFLAGS} -Woverlength-strings"],,) +- AX_CHECK_COMPILE_FLAG([-Woverloaded-virtual],[WANAL_CXXFLAGS="${WANAL_CXXFLAGS} -Woverloaded-virtual"],,) +- AX_CHECK_COMPILE_FLAG([-Wpacked-bitfield-compat],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wpacked-bitfield-compat"],,) +- AX_CHECK_COMPILE_FLAG([-Wpacked],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wpacked"],,) +- #AX_CHECK_COMPILE_FLAG([-Wpadded],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wpadded"],,) +- AX_CHECK_COMPILE_FLAG([-Wparentheses],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wparentheses"],,) +- AX_CHECK_COMPILE_FLAG([-Wpointer-arith],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wpointer-arith"],,) +- AX_CHECK_COMPILE_FLAG([-Wredundant-decls],[WANAL_CXXFLAGS="${WANAL_CXXFLAGS} -Wredundant-decls"],,) +- AX_CHECK_COMPILE_FLAG([-Wreorder],[WANAL_CXXFLAGS="${WANAL_CXXFLAGS} -Wreorder"],,) +- AX_CHECK_COMPILE_FLAG([-Wreturn-type],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wreturn-type"],,) +- AX_CHECK_COMPILE_FLAG([-Wsequence-point],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wsequence-point"],,) +- AX_CHECK_COMPILE_FLAG([-Wshadow],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wshadow"],,) +- AX_CHECK_COMPILE_FLAG([-Wsign-compare],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wsign-compare"],,) +- #AX_CHECK_COMPILE_FLAG([-Wsign-conversion],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wsign-conversion"],,) +- AX_CHECK_COMPILE_FLAG([-Wsign-promo],[WANAL_CXXFLAGS="${WANAL_CXXFLAGS} -Wsign-promo"],,) +- AX_CHECK_COMPILE_FLAG([-Wstack-protector],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wstack-protector"],,) +- AX_CHECK_COMPILE_FLAG([-Wstrict-aliasing=3],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wstrict-aliasing=3"],,) +- AX_CHECK_COMPILE_FLAG([-Wstrict-aliasing],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wstrict-aliasing"],,) +- AX_CHECK_COMPILE_FLAG([-Wstrict-null-sentinel],[WANAL_CXXFLAGS="${WANAL_CXXFLAGS} -Wstrict-null-sentinel"],,) +- #AX_CHECK_COMPILE_FLAG([-Wstrict-overflow=4],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wstrict-overflow=4"],,) +- #AX_CHECK_COMPILE_FLAG([-Wstrict-overflow],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wstrict-overflow"],,) +- AX_CHECK_COMPILE_FLAG([-Wswitch-default],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wswitch-default"],,) +- AX_CHECK_COMPILE_FLAG([-Wswitch-enum],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wswitch-enum"],,) +- AX_CHECK_COMPILE_FLAG([-Wswitch],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wswitch"],,) +- AX_CHECK_COMPILE_FLAG([-Wtrigraphs],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wtrigraphs"],,) +- AX_CHECK_COMPILE_FLAG([-Wtype-limits],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wtype-limits"],,) +- AX_CHECK_COMPILE_FLAG([-Wundef],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wundef"],,) +- AX_CHECK_COMPILE_FLAG([-Wuninitialized],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wuninitialized"],,) +- AX_CHECK_COMPILE_FLAG([-Wunsafe-loop-optimizations],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wunsafe-loop-optimizations"],,) +- AX_CHECK_COMPILE_FLAG([-Wunused-function],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wunused-function"],,) +- AX_CHECK_COMPILE_FLAG([-Wunused-label],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wunused-label"],,) +- AX_CHECK_COMPILE_FLAG([-Wunused-parameter],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wunused-parameter"],,) +- AX_CHECK_COMPILE_FLAG([-Wunused-value],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wunused-value"],,) +- AX_CHECK_COMPILE_FLAG([-Wunused-variable],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wunused-variable"],,) +- AX_CHECK_COMPILE_FLAG([-Wunused],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wunused"],,) +- AX_CHECK_COMPILE_FLAG([-Wvolatile-register-var],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wvolatile-register-var"],,) +- AX_CHECK_COMPILE_FLAG([-Wwrite-strings],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wwrite-strings"],,) +- fi +- WANAL_CXXFLAGS="${WANAL_CFLAGS} ${WANAL_CXXFLAGS}" +- WANAL_CFLAGS="${WANAL_CFLAGS} ${WANAL_CFLAGS_ONLY}" +- AC_SUBST([WANAL_CFLAGS], [${WANAL_CFLAGS}]) +- AC_SUBST([WANAL_CXXFLAGS], [${WANAL_CXXFLAGS}]) +-]) +diff --git a/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4 +deleted file mode 100644 +index c3a8d69..0000000 +--- a/m4/ax_check_compile_flag.m4 ++++ /dev/null +@@ -1,72 +0,0 @@ +-# =========================================================================== +-# http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html +-# =========================================================================== +-# +-# SYNOPSIS +-# +-# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS]) +-# +-# DESCRIPTION +-# +-# Check whether the given FLAG works with the current language's compiler +-# or gives an error. (Warnings, however, are ignored) +-# +-# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on +-# success/failure. +-# +-# If EXTRA-FLAGS is defined, it is added to the current language's default +-# flags (e.g. CFLAGS) when the check is done. The check is thus made with +-# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to +-# force the compiler to issue an error when a bad flag is given. +-# +-# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this +-# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. +-# +-# LICENSE +-# +-# Copyright (c) 2008 Guido U. Draheim +-# Copyright (c) 2011 Maarten Bosmans +-# +-# This program is free software: you can redistribute it and/or modify it +-# under the terms of the GNU General Public License as published by the +-# Free Software Foundation, either version 3 of the License, or (at your +-# option) any later version. +-# +-# This program is distributed in the hope that it will be useful, but +-# WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +-# Public License for more details. +-# +-# You should have received a copy of the GNU General Public License along +-# with this program. If not, see . +-# +-# As a special exception, the respective Autoconf Macro's copyright owner +-# gives unlimited permission to copy, distribute and modify the configure +-# scripts that are the output of Autoconf when processing the Macro. You +-# need not follow the terms of the GNU General Public License when using +-# or distributing such scripts, even though portions of the text of the +-# Macro appear in them. The GNU General Public License (GPL) does govern +-# all other use of the material that constitutes the Autoconf Macro. +-# +-# This special exception to the GPL applies to versions of the Autoconf +-# Macro released by the Autoconf Archive. When you make and distribute a +-# modified version of the Autoconf Macro, you may extend this special +-# exception to the GPL to apply to your modified version as well. +- +-#serial 2 +- +-AC_DEFUN([AX_CHECK_COMPILE_FLAG], +-[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX +-AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl +-AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ +- ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS +- _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" +- AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], +- [AS_VAR_SET(CACHEVAR,[yes])], +- [AS_VAR_SET(CACHEVAR,[no])]) +- _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) +-AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes], +- [m4_default([$2], :)], +- [m4_default([$3], :)]) +-AS_VAR_POPDEF([CACHEVAR])dnl +-])dnl AX_CHECK_COMPILE_FLAGS +diff --git a/m4/ax_check_link_flag.m4 b/m4/ax_check_link_flag.m4 +deleted file mode 100644 +index e2d0d36..0000000 +--- a/m4/ax_check_link_flag.m4 ++++ /dev/null +@@ -1,71 +0,0 @@ +-# =========================================================================== +-# http://www.gnu.org/software/autoconf-archive/ax_check_link_flag.html +-# =========================================================================== +-# +-# SYNOPSIS +-# +-# AX_CHECK_LINK_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS]) +-# +-# DESCRIPTION +-# +-# Check whether the given FLAG works with the linker or gives an error. +-# (Warnings, however, are ignored) +-# +-# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on +-# success/failure. +-# +-# If EXTRA-FLAGS is defined, it is added to the linker's default flags +-# when the check is done. The check is thus made with the flags: "LDFLAGS +-# EXTRA-FLAGS FLAG". This can for example be used to force the linker to +-# issue an error when a bad flag is given. +-# +-# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this +-# macro in sync with AX_CHECK_{PREPROC,COMPILE}_FLAG. +-# +-# LICENSE +-# +-# Copyright (c) 2008 Guido U. Draheim +-# Copyright (c) 2011 Maarten Bosmans +-# +-# This program is free software: you can redistribute it and/or modify it +-# under the terms of the GNU General Public License as published by the +-# Free Software Foundation, either version 3 of the License, or (at your +-# option) any later version. +-# +-# This program is distributed in the hope that it will be useful, but +-# WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +-# Public License for more details. +-# +-# You should have received a copy of the GNU General Public License along +-# with this program. If not, see . +-# +-# As a special exception, the respective Autoconf Macro's copyright owner +-# gives unlimited permission to copy, distribute and modify the configure +-# scripts that are the output of Autoconf when processing the Macro. You +-# need not follow the terms of the GNU General Public License when using +-# or distributing such scripts, even though portions of the text of the +-# Macro appear in them. The GNU General Public License (GPL) does govern +-# all other use of the material that constitutes the Autoconf Macro. +-# +-# This special exception to the GPL applies to versions of the Autoconf +-# Macro released by the Autoconf Archive. When you make and distribute a +-# modified version of the Autoconf Macro, you may extend this special +-# exception to the GPL to apply to your modified version as well. +- +-#serial 2 +- +-AC_DEFUN([AX_CHECK_LINK_FLAG], +-[AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_ldflags_$4_$1])dnl +-AC_CACHE_CHECK([whether the linker accepts $1], CACHEVAR, [ +- ax_check_save_flags=$LDFLAGS +- LDFLAGS="$LDFLAGS $4 $1" +- AC_LINK_IFELSE([AC_LANG_PROGRAM()], +- [AS_VAR_SET(CACHEVAR,[yes])], +- [AS_VAR_SET(CACHEVAR,[no])]) +- LDFLAGS=$ax_check_save_flags]) +-AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes], +- [m4_default([$2], :)], +- [m4_default([$3], :)]) +-AS_VAR_POPDEF([CACHEVAR])dnl +-])dnl AX_CHECK_LINK_FLAGS +diff --git a/m4/ax_check_preproc_flag.m4 b/m4/ax_check_preproc_flag.m4 +deleted file mode 100644 +index b1cfef6..0000000 +--- a/m4/ax_check_preproc_flag.m4 ++++ /dev/null +@@ -1,72 +0,0 @@ +-# =========================================================================== +-# http://www.gnu.org/software/autoconf-archive/ax_check_preproc_flag.html +-# =========================================================================== +-# +-# SYNOPSIS +-# +-# AX_CHECK_PREPROC_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS]) +-# +-# DESCRIPTION +-# +-# Check whether the given FLAG works with the current language's +-# preprocessor or gives an error. (Warnings, however, are ignored) +-# +-# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on +-# success/failure. +-# +-# If EXTRA-FLAGS is defined, it is added to the preprocessor's default +-# flags when the check is done. The check is thus made with the flags: +-# "CPPFLAGS EXTRA-FLAGS FLAG". This can for example be used to force the +-# preprocessor to issue an error when a bad flag is given. +-# +-# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this +-# macro in sync with AX_CHECK_{COMPILE,LINK}_FLAG. +-# +-# LICENSE +-# +-# Copyright (c) 2008 Guido U. Draheim +-# Copyright (c) 2011 Maarten Bosmans +-# +-# This program is free software: you can redistribute it and/or modify it +-# under the terms of the GNU General Public License as published by the +-# Free Software Foundation, either version 3 of the License, or (at your +-# option) any later version. +-# +-# This program is distributed in the hope that it will be useful, but +-# WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +-# Public License for more details. +-# +-# You should have received a copy of the GNU General Public License along +-# with this program. If not, see . +-# +-# As a special exception, the respective Autoconf Macro's copyright owner +-# gives unlimited permission to copy, distribute and modify the configure +-# scripts that are the output of Autoconf when processing the Macro. You +-# need not follow the terms of the GNU General Public License when using +-# or distributing such scripts, even though portions of the text of the +-# Macro appear in them. The GNU General Public License (GPL) does govern +-# all other use of the material that constitutes the Autoconf Macro. +-# +-# This special exception to the GPL applies to versions of the Autoconf +-# Macro released by the Autoconf Archive. When you make and distribute a +-# modified version of the Autoconf Macro, you may extend this special +-# exception to the GPL to apply to your modified version as well. +- +-#serial 2 +- +-AC_DEFUN([AX_CHECK_PREPROC_FLAG], +-[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX +-AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]cppflags_$4_$1])dnl +-AC_CACHE_CHECK([whether _AC_LANG preprocessor accepts $1], CACHEVAR, [ +- ax_check_save_flags=$CPPFLAGS +- CPPFLAGS="$CPPFLAGS $4 $1" +- AC_PREPROC_IFELSE([AC_LANG_PROGRAM()], +- [AS_VAR_SET(CACHEVAR,[yes])], +- [AS_VAR_SET(CACHEVAR,[no])]) +- CPPFLAGS=$ax_check_save_flags]) +-AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes], +- [m4_default([$2], :)], +- [m4_default([$3], :)]) +-AS_VAR_POPDEF([CACHEVAR])dnl +-])dnl AX_CHECK_PREPROC_FLAGS +diff --git a/m4/ax_python_devel.m4 b/m4/ax_python_devel.m4 +deleted file mode 100644 +index cf2163c..0000000 +--- a/m4/ax_python_devel.m4 ++++ /dev/null +@@ -1,324 +0,0 @@ +-# =========================================================================== +-# http://www.gnu.org/software/autoconf-archive/ax_python_devel.html +-# =========================================================================== +-# +-# SYNOPSIS +-# +-# AX_PYTHON_DEVEL([version]) +-# +-# DESCRIPTION +-# +-# Note: Defines as a precious variable "PYTHON_VERSION". Don't override it +-# in your configure.ac. +-# +-# This macro checks for Python and tries to get the include path to +-# 'Python.h'. It provides the $(PYTHON_CPPFLAGS) and $(PYTHON_LDFLAGS) +-# output variables. It also exports $(PYTHON_EXTRA_LIBS) and +-# $(PYTHON_EXTRA_LDFLAGS) for embedding Python in your code. +-# +-# You can search for some particular version of Python by passing a +-# parameter to this macro, for example ">= '2.3.1'", or "== '2.4'". Please +-# note that you *have* to pass also an operator along with the version to +-# match, and pay special attention to the single quotes surrounding the +-# version number. Don't use "PYTHON_VERSION" for this: that environment +-# variable is declared as precious and thus reserved for the end-user. +-# +-# This macro should work for all versions of Python >= 2.1.0. As an end +-# user, you can disable the check for the python version by setting the +-# PYTHON_NOVERSIONCHECK environment variable to something else than the +-# empty string. +-# +-# If you need to use this macro for an older Python version, please +-# contact the authors. We're always open for feedback. +-# +-# LICENSE +-# +-# Copyright (c) 2009 Sebastian Huber +-# Copyright (c) 2009 Alan W. Irwin +-# Copyright (c) 2009 Rafael Laboissiere +-# Copyright (c) 2009 Andrew Collier +-# Copyright (c) 2009 Matteo Settenvini +-# Copyright (c) 2009 Horst Knorr +-# Copyright (c) 2013 Daniel Mullner +-# +-# This program is free software: you can redistribute it and/or modify it +-# under the terms of the GNU General Public License as published by the +-# Free Software Foundation, either version 3 of the License, or (at your +-# option) any later version. +-# +-# This program is distributed in the hope that it will be useful, but +-# WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +-# Public License for more details. +-# +-# You should have received a copy of the GNU General Public License along +-# with this program. If not, see . +-# +-# As a special exception, the respective Autoconf Macro's copyright owner +-# gives unlimited permission to copy, distribute and modify the configure +-# scripts that are the output of Autoconf when processing the Macro. You +-# need not follow the terms of the GNU General Public License when using +-# or distributing such scripts, even though portions of the text of the +-# Macro appear in them. The GNU General Public License (GPL) does govern +-# all other use of the material that constitutes the Autoconf Macro. +-# +-# This special exception to the GPL applies to versions of the Autoconf +-# Macro released by the Autoconf Archive. When you make and distribute a +-# modified version of the Autoconf Macro, you may extend this special +-# exception to the GPL to apply to your modified version as well. +- +-#serial 16 +- +-AU_ALIAS([AC_PYTHON_DEVEL], [AX_PYTHON_DEVEL]) +-AC_DEFUN([AX_PYTHON_DEVEL],[ +- # +- # Allow the use of a (user set) custom python version +- # +- AC_ARG_VAR([PYTHON_VERSION],[The installed Python +- version to use, for example '2.3'. This string +- will be appended to the Python interpreter +- canonical name.]) +- +- AC_PATH_PROG([PYTHON],[python[$PYTHON_VERSION]]) +- if test -z "$PYTHON"; then +- AC_MSG_ERROR([Cannot find python$PYTHON_VERSION in your system path]) +- PYTHON_VERSION="" +- fi +- +- # +- # Check for a version of Python >= 2.1.0 +- # +- AC_MSG_CHECKING([for a version of Python >= '2.1.0']) +- ac_supports_python_ver=`$PYTHON -c "import sys; \ +- ver = sys.version.split ()[[0]]; \ +- print (ver >= '2.1.0')"` +- if test "$ac_supports_python_ver" != "True"; then +- if test -z "$PYTHON_NOVERSIONCHECK"; then +- AC_MSG_RESULT([no]) +- AC_MSG_FAILURE([ +-This version of the AC@&t@_PYTHON_DEVEL macro +-doesn't work properly with versions of Python before +-2.1.0. You may need to re-run configure, setting the +-variables PYTHON_CPPFLAGS, PYTHON_LDFLAGS, PYTHON_SITE_PKG, +-PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand. +-Moreover, to disable this check, set PYTHON_NOVERSIONCHECK +-to something else than an empty string. +-]) +- else +- AC_MSG_RESULT([skip at user request]) +- fi +- else +- AC_MSG_RESULT([yes]) +- fi +- +- # +- # if the macro parameter ``version'' is set, honour it +- # +- if test -n "$1"; then +- AC_MSG_CHECKING([for a version of Python $1]) +- ac_supports_python_ver=`$PYTHON -c "import sys; \ +- ver = sys.version.split ()[[0]]; \ +- print (ver $1)"` +- if test "$ac_supports_python_ver" = "True"; then +- AC_MSG_RESULT([yes]) +- else +- AC_MSG_RESULT([no]) +- AC_MSG_ERROR([this package requires Python $1. +-If you have it installed, but it isn't the default Python +-interpreter in your system path, please pass the PYTHON_VERSION +-variable to configure. See ``configure --help'' for reference. +-]) +- PYTHON_VERSION="" +- fi +- fi +- +- # +- # Check if you have distutils, else fail +- # +- AC_MSG_CHECKING([for the distutils Python package]) +- ac_distutils_result=`$PYTHON -c "import distutils" 2>&1` +- if test -z "$ac_distutils_result"; then +- AC_MSG_RESULT([yes]) +- else +- AC_MSG_RESULT([no]) +- AC_MSG_ERROR([cannot import Python module "distutils". +-Please check your Python installation. The error was: +-$ac_distutils_result]) +- PYTHON_VERSION="" +- fi +- +- # +- # Check for Python include path +- # +- AC_MSG_CHECKING([for Python include path]) +- if test -z "$PYTHON_CPPFLAGS"; then +- python_path=`$PYTHON -c "import distutils.sysconfig; \ +- print (distutils.sysconfig.get_python_inc ());"` +- plat_python_path=`$PYTHON -c "import distutils.sysconfig; \ +- print (distutils.sysconfig.get_python_inc (plat_specific=1));"` +- if test -n "${python_path}"; then +- if test "${plat_python_path}" != "${python_path}"; then +- python_path="-I$python_path -I$plat_python_path" +- else +- python_path="-I$python_path" +- fi +- fi +- PYTHON_CPPFLAGS=$python_path +- fi +- AC_MSG_RESULT([$PYTHON_CPPFLAGS]) +- AC_SUBST([PYTHON_CPPFLAGS]) +- +- # +- # Check for Python library path +- # +- AC_MSG_CHECKING([for Python library path]) +- if test -z "$PYTHON_LDFLAGS"; then +- # (makes two attempts to ensure we've got a version number +- # from the interpreter) +- ac_python_version=`cat<]], +- [[Py_Initialize();]]) +- ],[pythonexists=yes],[pythonexists=no]) +- AC_LANG_POP([C]) +- # turn back to default flags +- CPPFLAGS="$ac_save_CPPFLAGS" +- LIBS="$ac_save_LIBS" +- +- AC_MSG_RESULT([$pythonexists]) +- +- if test ! "x$pythonexists" = "xyes"; then +- AC_MSG_FAILURE([ +- Could not link test program to Python. Maybe the main Python library has been +- installed in some non-standard library path. If so, pass it to configure, +- via the LDFLAGS environment variable. +- Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib" +- ============================================================================ +- ERROR! +- You probably have to install the development version of the Python package +- for your distribution. The exact name of this package varies among them. +- ============================================================================ +- ]) +- PYTHON_VERSION="" +- fi +- +- # +- # all done! +- # +-]) +diff --git a/m4/ax_ruby_ext.m4 b/m4/ax_ruby_ext.m4 +deleted file mode 100644 +index 8d5e5b0..0000000 +--- a/m4/ax_ruby_ext.m4 ++++ /dev/null +@@ -1,191 +0,0 @@ +-# =========================================================================== +-# http://www.gnu.org/software/autoconf-archive/ax_ruby_ext.html +-# =========================================================================== +-# +-# SYNOPSIS +-# +-# AX_RUBY_EXT +-# +-# DESCRIPTION +-# +-# Fetches the linker flags and C compiler flags for compiling and linking +-# Ruby binary extensions. The macro substitutes RUBY_VERSION, +-# RUBY_EXT_INC, RUBY_EXT_LIB, RUBY_EXT_CPPFLAGS, RUBY_EXT_LDFLAGS and +-# RUBY_EXT_DLEXT variables if Ruby executable has been found. It also +-# checks the same variables before trying to retrieve them from the Ruby +-# configuration. +-# +-# RUBY_VERSION: version of the Ruby interpreter +-# RUBY_EXT_INC: Ruby include directory +-# RUBY_EXT_LIB: Ruby extensions destination directory +-# RUBY_EXT_CPPFLAGS: C preprocessor flags to compile extensions +-# RUBY_EXT_LDFLAGS: linker flags to build extensions +-# RUBY_EXT_DLEXT: extensions suffix for ruby modules (e.g. "so") +-# +-# Examples: +-# +-# AX_RUBY_EXT +-# if test x"$RUBY" = x; then +-# AC_ERROR(["cannot find Ruby"]) +-# fi +-# +-# LICENSE +-# +-# Copyright (c) 2011 Stanislav Sedov +-# Copyright (c) 2013 Robert Escriva +-# +-# Redistribution and use in source and binary forms, with or without +-# modification, are permitted provided that the following conditions are +-# met: +-# +-# 1. Redistributions of source code must retain the above copyright +-# +-# notice, this list of conditions and the following disclaimer. +-# +-# 2. Redistributions in binary form must reproduce the above copyright +-# +-# notice, this list of conditions and the following disclaimer in the +-# documentation and/or other materials provided with the distribution. +-# +-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE +-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +-# THE POSSIBILITY OF SUCH DAMAGE. +- +-#serial 1 +- +-AC_DEFUN([AX_RUBY_EXT],[ +- +- # +- # Check if ruby executable exists. +- # +- AC_PATH_PROGS(RUBY, ["${RUBY-ruby}"], []) +- +- if test -n "$RUBY" ; then +- +- AC_MSG_NOTICE([Ruby executable: '$RUBY']) +- +- # +- # Check Ruby version. +- # +- AC_MSG_CHECKING([for Ruby version]) +- [RUBY_VERSION=`$RUBY -e 'puts RUBY_VERSION'`]; +- AC_MSG_RESULT([$RUBY_VERSION]) +- AC_SUBST(RUBY_VERSION) +- +- # +- # Check for Ruby extensions include path. +- # +- AC_ARG_VAR(RUBY_EXT_INC, [Directory to include ruby headers from]) +- AC_MSG_CHECKING([for Ruby headers include path]) +- if test -z "$RUBY_EXT_INC" ; then +- [RUBY_EXT_INC=`$RUBY -rrbconfig -e 'puts RbConfig::CONFIG["rubyhdrdir"]'`]; +- fi +- AC_MSG_RESULT([$RUBY_EXT_INC]) +- AC_SUBST(RUBY_EXT_INC) +- +- # +- # Check for Ruby config.h include path. +- # +- AC_ARG_VAR(RUBY_EXT_ARCHINC, [Another directory to include ruby headers from]) +- AC_MSG_CHECKING([for other Ruby headers include path]) +- if test -z "$RUBY_EXT_ARCHINC" ; then +- [RUBY_EXT_ARCHINC=`$RUBY -rrbconfig -e 'puts RbConfig::CONFIG["rubyhdrdir"] + "/" + RbConfig::CONFIG["arch"]'`]; +- fi +- AC_MSG_RESULT([$RUBY_EXT_ARCHINC]) +- AC_SUBST(RUBY_EXT_ARCHINC) +- +- # +- # Check for Ruby CPP flags. +- # +- AC_ARG_VAR(RUBY_EXT_CPPFLAGS, [CPPFLAGS to compile Ruby extensions]) +- AC_MSG_CHECKING([for Ruby extensions C preprocessor flags]) +- if test -z "$RUBY_EXT_CPPFLAGS" ; then +- [RUBY_EXT_CPPFLAGS=`$RUBY -rrbconfig -e 'puts RbConfig::CONFIG["CPPFLAGS"]'`]; +- fi +- AC_MSG_RESULT([$RUBY_EXT_CPPFLAGS]) +- AC_SUBST(RUBY_EXT_CPPFLAGS) +- +- # +- # Check for Ruby extensions link flags. +- # +- AC_ARG_VAR(RUBY_EXT_LDFLAGS, [LDFLAGS to build Ruby extensions]) +- AC_MSG_CHECKING([for Ruby extensions linker flags]) +- if test -z "$RUBY_EXT_LDFLAGS" ; then +- [RUBY_EXT_LDFLAGS=`$RUBY -rrbconfig -e 'puts RbConfig::CONFIG["LDFLAGS"]'`]; +- fi +- # Fix LDFLAGS for OS X. We don't want any -arch flags here, otherwise +- # linking might fail. We also including the proper flags to create a bundle. +- case "$host" in +- *darwin*) +- RUBY_EXT_LDFLAGS=`echo ${RUBY_EXT_LDFLAGS} | sed -e "s,-arch [[^ ]]*,,g"` +- RUBY_EXT_LDFLAGS="${RUBY_EXT_LDFLAGS} -bundle -undefined dynamic_lookup" +- ;; +- esac +- AC_MSG_RESULT([$RUBY_EXT_LDFLAGS]) +- AC_SUBST(RUBY_EXT_LDFLAGS) +- +- # +- # Check for Ruby dynamic library extension. +- # +- AC_ARG_VAR(RUBY_EXT_DLEXT, [Ruby dynamic library extension]) +- AC_MSG_CHECKING([for Ruby dynamic library extension]) +- if test -z "$RUBY_EXT_DLEXT" ; then +- [RUBY_EXT_DLEXT=`$RUBY -rrbconfig -e 'puts RbConfig::CONFIG["DLEXT"]'`]; +- RUBY_EXT_DLEXT=".${RUBY_EXT_DLEXT}" +- fi +- AC_MSG_RESULT([$RUBY_EXT_DLEXT]) +- AC_SUBST(RUBY_EXT_DLEXT) +- +- # +- # Check for the site arch dir +- # +- AC_ARG_VAR(RUBY_EXT_SITEARCH, [Ruby site arch dir]) +- AC_MSG_CHECKING([for Ruby extensions site arch dir]) +- if test -z "$RUBY_EXT_SITEARCH" ; then +- [RUBY_EXT_SITEARCH=`$RUBY -rrbconfig -e 'puts RbConfig::CONFIG["sitearchdir"]'`]; +- elif test -z "$RUBY_EXT_LIB" ; then +- [RUBY_EXT_LIB="${RUBY_EXT_SITEARCH}"]; +- fi +- AC_MSG_RESULT([$RUBY_EXT_SITEARCH]) +- AC_SUBST(RUBY_EXT_SITEARCH) +- +- # +- # Check for the vendor arch dir +- # +- AC_ARG_VAR(RUBY_EXT_VENDORARCH, [Ruby vendor arch dir]) +- AC_MSG_CHECKING([for Ruby extensions vendor arch dir]) +- if test -z "$RUBY_EXT_VENDORARCH" ; then +- [RUBY_EXT_VENDORARCH=`$RUBY -rrbconfig -e 'puts RbConfig::CONFIG["vendorarchdir"]'`]; +- elif test -z "$RUBY_EXT_LIB" ; then +- [RUBY_EXT_LIB="$RUBY_EXT_VENDORARCH"]; +- fi +- AC_MSG_RESULT([$RUBY_EXT_VENDORARCH]) +- AC_SUBST(RUBY_EXT_VENDORARCH) +- +- AC_ARG_VAR(RUBY_EXT_LIB, [Ruby extension dir]) +- if test -z "$RUBY_EXT_LIB" ; then +- test "_$prefix" = _NONE && prefix="$ac_default_prefix" +- if echo $RUBY_EXT_VENDORARCH | sed -e "s:^${prefix}:.:" | grep '^\.' >/dev/null; then +- RUBY_EXT_LIB='$(prefix)'/`echo $RUBY_EXT_VENDORARCH | sed -e "s:^${prefix}:.:"` +- elif echo $RUBY_EXT_SITEARCH | sed -e "s:^${prefix}:.:" | grep '^\.' >/dev/null; then +- RUBY_EXT_LIB='$(prefix)'/`echo $RUBY_EXT_SITEARCH | sed -e "s:^${prefix}:.:"` +- fi +- fi +- if test -z "$RUBY_EXT_LIB" ; then +- AC_MSG_ERROR([ +-------------------------------------------------- +-Could not auto-detect the Ruby extension dir +-Set RUBY_EXT_SITEARCH or RUBY_EXT_VENDORARCH +--------------------------------------------------]) +- fi +- AC_SUBST(RUBY_EXT_LIB) +- fi +-]) +diff --git a/man/hyperdex-migrate-data.1.md b/man/hyperdex-migrate-data.1.md +new file mode 100644 +index 0000000..f347bcc +--- /dev/null ++++ b/man/hyperdex-migrate-data.1.md +@@ -0,0 +1,23 @@ ++.TH "" "" ++[NAME] ++[SYNOPSIS] ++[DESCRIPTION] ++[OPTIONS] ++[ENVIRONMENT] ++[FILES] ++[EXAMPLES] ++[AUTHORS] ++ ++HyperDex is an open source project started by Cornell University and ++currently maintained by Cornell University and United Networks, LLC. ++For a complete list of contributors, see the AUTHORS file included in ++the HyperDex distribution. ++[REPORTING BUGS] ++ ++Report bugs to the HyperDex mailing list ++ where the developers can help ++troubleshoot problems and file bug reports. ++[COPYRIGHT] ++ ++Copyright (c) 2011-2013, The HyperDex Authors ++[SEE ALSO] +diff --git a/test-driver b/test-driver +new file mode 100755 +index 0000000..32bf39e +--- /dev/null ++++ b/test-driver +@@ -0,0 +1,127 @@ ++#! /bin/sh ++# test-driver - basic testsuite driver script. ++ ++scriptversion=2012-06-27.10; # UTC ++ ++# Copyright (C) 2011-2013 Free Software Foundation, Inc. ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2, or (at your option) ++# any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++# As a special exception to the GNU General Public License, if you ++# distribute this file as part of a program that contains a ++# configuration script generated by Autoconf, you may include it under ++# the same distribution terms that you use for the rest of that program. ++ ++# This file is maintained in Automake, please report ++# bugs to or send patches to ++# . ++ ++# Make unconditional expansion of undefined variables an error. This ++# helps a lot in preventing typo-related bugs. ++set -u ++ ++usage_error () ++{ ++ echo "$0: $*" >&2 ++ print_usage >&2 ++ exit 2 ++} ++ ++print_usage () ++{ ++ cat <$log_file 2>&1 ++estatus=$? ++if test $enable_hard_errors = no && test $estatus -eq 99; then ++ estatus=1 ++fi ++ ++case $estatus:$expect_failure in ++ 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; ++ 0:*) col=$grn res=PASS recheck=no gcopy=no;; ++ 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; ++ 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; ++ *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; ++ *:*) col=$red res=FAIL recheck=yes gcopy=yes;; ++esac ++ ++# Report outcome to console. ++echo "${col}${res}${std}: $test_name" ++ ++# Register the test result, and other relevant metadata. ++echo ":test-result: $res" > $trs_file ++echo ":global-test-result: $res" >> $trs_file ++echo ":recheck: $recheck" >> $trs_file ++echo ":copy-in-global-log: $gcopy" >> $trs_file ++ ++# Local Variables: ++# mode: shell-script ++# sh-indentation: 2 ++# eval: (add-hook 'write-file-hooks 'time-stamp) ++# time-stamp-start: "scriptversion=" ++# time-stamp-format: "%:y-%02m-%02d.%02H" ++# time-stamp-time-zone: "UTC" ++# time-stamp-end: "; # UTC" ++# End: +diff --git a/test/migration-test.cc b/test/migration-test.cc +new file mode 100644 +index 0000000..ffe109c +--- /dev/null ++++ b/test/migration-test.cc +@@ -0,0 +1,305 @@ ++// Copyright (c) 2014, Cornell University ++// All rights reserved. ++// ++// Redistribution and use in source and binary forms, with or without ++// modification, are permitted provided that the following conditions are met: ++// ++// * Redistributions of source code must retain the above copyright notice, ++// this list of conditions and the following disclaimer. ++// * Redistributions in binary form must reproduce the above copyright ++// notice, this list of conditions and the following disclaimer in the ++// documentation and/or other materials provided with the distribution. ++// * Neither the name of HyperDex nor the names of its contributors may be ++// used to endorse or promote products derived from this software without ++// specific prior written permission. ++// ++// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ++// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE ++// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR ++// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ++// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ++// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN ++// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ++// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ++// POSSIBILITY OF SUCH DAMAGE. ++ ++#include ++ ++// STL ++#include ++ ++// e ++#include ++ ++// po6 ++#include ++ ++// armnod ++#include "ygor.h" ++ ++// HyperDex ++#include ++#include ++#include ++ ++const char *_space_from_name = "profiles"; ++const char *_space_from_description = "space profiles \ ++key username \ ++attributes \ ++ string name, \ ++ float height, \ ++ int profile_views"; ++const char *_space_to_name = "profiles2"; ++const char *_space_to_description = "space profiles2 \ ++key username \ ++attributes \ ++ string name, \ ++ float height, \ ++ int profile_views"; ++ ++static bool _quiet = false; ++static int _testno = 0; ++static hyperdex::Client *_cl = NULL; ++static hyperdex::Admin *_ad = NULL; ++ ++static void test0(); ++static void add_space(); ++static void remove_space(); ++ ++int ++main(int argc, const char *argv[]) ++{ ++ try { ++ // TODO: make the host and port customizable ++ hyperdex::Client cl("127.0.0.1", 1982); ++ _cl = &cl; ++ hyperdex::Admin ad("127.0.0.1", 1982); ++ _ad = &ad; ++ ++ test0(); ++ ++ return EXIT_SUCCESS; ++ } catch (po6::error &e) { ++ std::cerr << "system error: " << e.what() << std::endl; ++ return EXIT_FAILURE; ++ } ++} ++ ++static void ++success() ++{ ++ if (!_quiet) std::cout << "Test " << _testno << ": [\x1b[32mOK\x1b[0m]\n"; ++} ++ ++#define FAIL(REASON) \ ++ do { \ ++ if (!_quiet) std::cout << "Test " << _testno << ": [\x1b[31mFAIL\x1b[0m]\n" \ ++ << "location: " << __FILE__ << ":" << __LINE__ << "\n" \ ++ << "reason: " << REASON << "\n"; \ ++ abort(); \ ++ } while (0) ++ ++static void ++setup_space() ++{ ++ hyperdex_admin_returncode status; ++ if (_ad->add_space(_space_from_description, &status) < 0) { ++ FAIL("admin operation failed: " << status); ++ } ++ if (_ad->add_space(_space_to_description, &status) < 0) { ++ FAIL("admin operation failed: " << status); ++ } ++} ++ ++static void ++remove_space() ++{ ++ hyperdex_admin_returncode status; ++ if (_ad->rm_space(_space_from_name, &status) < 0) { ++ FAIL("admin operation failed: " << status); ++ } ++ ++ if (_ad->rm_space(_space_to_name, &status) < 0) { ++ FAIL("admin operation failed: " << status); ++ } ++} ++ ++static armnod_generator * ++get_random_generator(const char *method, ++ const char *charset) ++{ ++ armnod_config *config = armnod_config_create(); ++ if (armnod_config_method(config, method) < 0) goto wrong_config; ++ if (armnod_config_charset(config, charset) < 0) goto wrong_config; ++ if (armnod_config_set_size(config, 1024) < 0) goto wrong_config; ++ ++ { ++ armnod_generator *gen(armnod_generator_create(config)); ++ armnod_generator_seed(gen, 0); ++ return gen; ++ } ++ ++wrong_config: ++ FAIL("armnod_config received a wrong parameter."); ++} ++ ++static void ++add_data(const char *space_name, uint64_t num_objects) ++{ ++ armnod_generator *alpha_gen = get_random_generator("normal", "alpha"); ++ armnod_generator *digit_gen = get_random_generator("normal", "digit"); ++ ++ const char *key_format = "object_%lu"; ++ for (size_t i = 0; i < num_objects; i++) { ++ char key[20] = {0}; ++ snprintf(key, 19, key_format, i); ++ size_t key_sz = strlen(key); ++ ++ hyperdex_client_attribute attrs[3]; ++ ++ size_t attrs_sz = 0; ++ ++ attrs[0].attr = "name"; ++ attrs[0].value = armnod_generate(alpha_gen); ++ attrs[0].value_sz = strlen(attrs[0].value); ++ attrs[0].datatype = HYPERDATATYPE_STRING; ++ ++ attrs[1].attr = "height"; ++ double valf = atof(armnod_generate(digit_gen)); ++ char buff[8] = {0}; ++ hyperdex_ds_pack_float(valf, buff); ++ attrs[1].value = buff; ++ attrs[1].value_sz = 8; ++ attrs[1].datatype = HYPERDATATYPE_FLOAT; ++ ++ attrs[2].attr = "profile_views"; ++ int64_t vali = atoi(armnod_generate(digit_gen)); ++ char bufi[8] = {0}; ++ hyperdex_ds_pack_int(vali, bufi); ++ attrs[2].value = bufi; ++ attrs[2].value_sz = 8; ++ attrs[2].datatype = HYPERDATATYPE_INT64; ++ ++ hyperdex_client_returncode op_status; ++ if (_cl->put(space_name, key, key_sz, attrs, 3, &op_status) < 0) { ++ FAIL("client operation failed: " << op_status); ++ } ++ ++ hyperdex_client_returncode loop_status; ++ if (_cl->loop(-1, &loop_status) < 0) { ++ FAIL("client operation failed: " << loop_status); ++ } ++ } ++} ++ ++inline static void ++check_attr(const hyperdex_client_attribute *attr, ++ const char *name, ++ const char *value, ++ hyperdatatype datatype) ++{ ++ if (strcmp(attr->attr, name) != 0) ++ FAIL("presence check: attribute is \"" << attr->attr << "\" instead of \"name\""); ++ ++ if (attr->datatype != datatype) ++ FAIL("presence check: attribute is not of datatype \"string\""); ++ ++ switch (datatype) { ++ case HYPERDATATYPE_STRING: { ++ std::string str(attr->value, attr->value_sz); ++ if (str.compare(value) != 0) ++ FAIL("presence check: attribute has the value \"" ++ << str << "\" instead of \"" << value << "\""); ++ break; ++ } ++ case HYPERDATATYPE_INT64: { ++ int64_t num; ++ hyperdex_ds_unpack_int(attr->value, attr->value_sz, &num); ++ int64_t val_int = atoi(value); ++ if (num != val_int) ++ FAIL("presence check: attribute has the value \"" ++ << num << "\" instead of \"" << val_int << "\""); ++ break; ++ } ++ case HYPERDATATYPE_FLOAT: { ++ double num; ++ hyperdex_ds_unpack_float(attr->value, attr->value_sz, &num); ++ double val_float = atof(value); ++ if (num != val_float) ++ FAIL("presence check: attribute has the value \"" ++ << num << "\" instead of \"" << val_float << "\""); ++ break; ++ } ++ default: ++ FAIL("Unknown datatype " << datatype); ++ } ++} ++ ++static void ++read_and_verify_data(const char *space_name, uint64_t num_objects) ++{ ++ armnod_generator *alpha_gen = get_random_generator("normal", "alpha"); ++ armnod_generator *digit_gen = get_random_generator("normal", "digit"); ++ ++ const char *key_format = "object_%lu"; ++ for (size_t i = 0; i < num_objects; i++) { ++ char key[20] = {0}; ++ snprintf(key, 19, key_format, i); ++ size_t key_sz = strlen(key); ++ ++ const hyperdex_client_attribute *attrs; ++ size_t attrs_sz; ++ ++ hyperdex_client_returncode get_status; ++ int64_t gid = _cl->get(space_name, key, key_sz, &get_status, &attrs, &attrs_sz); ++ if (gid < 0) { ++ FAIL("get encountered error: " << get_status); ++ } ++ ++ hyperdex_client_returncode loop_status; ++ int64_t lid = _cl->loop(10000, &loop_status); ++ if (lid < 0) { ++ FAIL("loop encountered error: " << loop_status); ++ } ++ ++ if (gid != lid) ++ FAIL("loop id (" << lid << ") does not match get id (" << gid << ")"); ++ ++ if (get_status != HYPERDEX_CLIENT_SUCCESS) ++ FAIL("operation " << gid << " (a presence check) returned " << get_status); ++ ++ check_attr(&attrs[0], "name", armnod_generate(alpha_gen), HYPERDATATYPE_STRING); ++ check_attr(&attrs[1], "height", armnod_generate(digit_gen), HYPERDATATYPE_FLOAT); ++ check_attr(&attrs[2], "profile_views", armnod_generate(digit_gen), HYPERDATATYPE_INT64); ++ } ++ ++ // armnod_config_destroy(alpha_gen->config); ++ armnod_generator_destroy(alpha_gen); ++ // armnod_config_destroy(digit_gen->config); ++ armnod_generator_destroy(digit_gen); ++} ++ ++static uint64_t num_objects = 100000; ++ ++static void ++test0() ++{ ++ setup_space(); ++ ++ add_data(_space_from_name, num_objects); ++ ++ hyperdex_admin_returncode status; ++ if (_ad->migrate_data(_space_from_name, _space_to_name, &status) < 0) { ++ FAIL("migration failure: " << status); ++ } ++ ++ std::cout << "Sleeping for 20 seconds for the migration to complete...\n"; ++ usleep(20 * 1000 * 1000); ++ ++ read_and_verify_data(_space_to_name, num_objects); ++ ++ remove_space(); ++ success(); ++} +diff --git a/tools/migrate-data.cc b/tools/migrate-data.cc +new file mode 100644 +index 0000000..9d247d3 +--- /dev/null ++++ b/tools/migrate-data.cc +@@ -0,0 +1,102 @@ ++// Copyright (c) 2012, Cornell University ++// All rights reserved. ++// ++// Redistribution and use in source and binary forms, with or without ++// modification, are permitted provided that the following conditions are met: ++// ++// * Redistributions of source code must retain the above copyright notice, ++// this list of conditions and the following disclaimer. ++// * Redistributions in binary form must reproduce the above copyright ++// notice, this list of conditions and the following disclaimer in the ++// documentation and/or other materials provided with the distribution. ++// * Neither the name of Replicant nor the names of its contributors may be ++// used to endorse or promote products derived from this software without ++// specific prior written permission. ++// ++// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ++// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE ++// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR ++// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ++// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ++// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN ++// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ++// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ++// POSSIBILITY OF SUCH DAMAGE. ++ ++// C ++#include ++#include ++ ++// HyperDex ++#include ++#include "tools/common.h" ++ ++int ++main(int argc, const char* argv[]) ++{ ++ hyperdex::connect_opts conn; ++ e::argparser ap; ++ ap.autohelp(); ++ ap.add("Connect to a cluster:", conn.parser()); ++ ++ if (!ap.parse(argc, argv)) ++ { ++ return EXIT_FAILURE; ++ } ++ ++ if (!conn.validate()) ++ { ++ std::cerr << "invalid host:port specification\n" << std::endl; ++ ap.usage(); ++ return EXIT_FAILURE; ++ } ++ ++ try ++ { ++ if (ap.args_sz() != 2) { ++ std::cerr << "invalid arguments: expecting exactly two space names\n" << std::endl; ++ ap.usage(); ++ return EXIT_FAILURE; ++ } ++ ++ ++ ++ hyperdex::Admin h(conn.host(), conn.port()); ++ hyperdex_admin_returncode rrc; ++ ++ int64_t rid = h.migrate_data(ap.args()[0], ap.args()[1], &rrc); ++ ++ if (rid < 0) ++ { ++ std::cerr << "could not migrate data: " << h.error_message() << std::endl; ++ return EXIT_FAILURE; ++ } ++ ++ hyperdex_admin_returncode lrc; ++ int64_t lid = h.loop(-1, &lrc); ++ ++ if (lid < 0) ++ { ++ std::cerr << "could not migrate data: " << h.error_message() << std::endl; ++ return EXIT_FAILURE; ++ } ++ ++ assert(rid == lid); ++ ++ if (rrc != HYPERDEX_ADMIN_SUCCESS) ++ { ++ std::cerr << "could not migrate_data: " << h.error_message() << std::endl; ++ return EXIT_FAILURE; ++ } ++ ++ std::cout << "migration in process..." << std::endl; ++ return EXIT_SUCCESS; ++ } ++ catch (std::exception& e) ++ { ++ std::cerr << "error: " << e.what() << std::endl; ++ return EXIT_FAILURE; ++ } ++} diff --git a/test/migration-test b/test/migration-test new file mode 100755 index 0000000000000000000000000000000000000000..7480dd7aadc50301ca90a12837f62ab44c83838a GIT binary patch literal 31772 zcmeHweSB2awf0FuVnj&7hl-#ud>TJUlkgQmbV3-MXuwDUMGz;GWReUfncU0-0u_q} zC}T=5wrZ)~D*d=#ZoRgty;`&yqF95yeKoZesanlztDRA-)S^wTHurh<+560%lR4Di zd++c4t0%w7I_ueMuf5jV`|Q2v%sG31(NnP^JuS^pN4jx^L2h80TR`T2!`M+JSc#Pw zXBuu}nsL671tb$6w@4v1&lDY!suj(aav7kb@F__*fs%B$I8pR`6GjQ8Yz)-1MoG3bxj^I#K<+~2~Xy<1=@}%HuS)Nl| zywZL}W%0)6nuE0q=YOuber|KHwWD)xXUW333+ESvLj}dcZ|bM)RjbyBl2jZgfuqe6 z@nIWa`tQ6yJ7Ze&Pd<3*SM&S6_O;;otEYeCk#R^{iVtNO)8eecXyZ&*&7~8J9ZjQ* z32xU8*L~T>dFg3qrWx~1BPq|YmEq&TryQSa@TtJ35})hvS&ffs%CzkB_^iWc13our z|Jz2_Ba7y|^UL>h8Uu&Q5AFS9&U^bNW#vyf_~x(wY2Epc|MsglZ<==S&C$2+^UZD< zQ}(@?2j6_|*3mC+Ex+l}WuBK#WbfP-*xk5s%SE1-Dz=U}G4|{S?pgBnPwE<7pPoAN zy@&p?Y~ubgW#6oO@~1OznX|C=wmA!@W?r}EJJVas{&n}9g(yDdu@*rZpCV-dE~mop zN6=H@e}Iluc+5fnw;c3mppm80Guffs_fUbUi{U;pcA9RSrOyDkj?8j7xINa+{j~6$GhgB3>({?EXtZ>n4H z>R+Mo_bj7tN;3W${F-h|Hr&-ULX_hwkBl?Sau3RK=a{f@E$}?budb1ZNj6A4Z*4L@ zN9wsz>fu<*<7L!4%k7ipDu2UhC*yz*Djat6_@j)2UC$4t9%T>5U>+aKcGY8xgICyj z-U$0&knyjP@plO=hH*CJSucGOA1m=Ir2alRzm>2tQ^xavj8DEycu49Wka|>{gV4h` z4BF)HlTnhb z7{04F`&I`UgW*V^y{y?E4hO=9ue^GtuRhQ&;p&xT&7synwZFC*^1jBFP^&K-@wZ2O zK2tQcU_-DqX!zS(T0`}|#z1SJ-5&|HLv1+H9@=V42-tWCO8Z7A2nPc7O1du8+7N8? zwFDwfAv>6yUrL4p5nnjC%_>g9bxrjRy0>zads)`%HD1^P_T z*Vcg?>zl)?t3t&K?TPJyNJo2XU8p`_SV{F^Uq@@3zwRbqLvzR{Fr3yrGw~5tnXtdUKDB&Huo0~-;HyWZXmdDHUw6qRv~?kBY*kgbtjJS& zO+M4+=RP!~bFrk+(r zg|w&BUmM(9RI~`^yexgJakS5d5X@a)U7lQ;P*#iUwbfVWkJL5sGVSd2p%I5et^Vd< zWUFs8Ismw?8M(Yz*d{EujDt{BWPV*pwCz<@q2{oMW|?O}>#SMGHHTqGQ4ud6U!>h1 zjD+E`XEm^S2wAYs7sACJ@VAuLRr@?u3w&m%pg+)B-&|hz+45HVstb{OAvznF!Jx`o z5JAuk7eNpaX5DLbArereijDN9as{s3Dj(xn6@e=$>=DJKa!4Ar$cH9WTV6Ha2k)wj zq^|jOf%bN2wbf-Y>NOlpRh_7oTO?`9aX13qPx;kH&&9}(#t!dp7ge$89;f|I7 z6YFHVW}l3%rLGCxi$BQ57YS@@qW z&w0jk<~CDJ-prqFp-eOL{}je>{^-J|a?aMX4C4%=2Jza_~&viEFab z(~UP}{zAx43aJ{{iXgFUHTiuS z&hK{W*stNa3Isi%;i`=?`Jjf6)8u@*xeMpvm`XIPblxN^sXV;X**CVx`HCu{hShO2x3BKf)+LD)tv5NGDUYz?2P;dvT9O~WT? zxJ$!b8a`da^EG^ih8Jr1Obsv5@L3w}*6`UH?$z))8eXa47i#!A4OidUm|Uab7iscM z8h){cw`uq#8s4el*J$_-4R>q!9u2=#!}n?UTn*o^;RPCgK*K+$;RiLmNW*(Hyja5z zY4|)1@6&KGaLTl!8oof2AJB09=KOIDU!=(oYPddL#5DXeP5z{YFVXNJ4ZmE&4SAn| z?f+U0_jaAg_I78^o$oTdyZR!Tu?Nvhd%K>=K4Jf?{%7RbMaK&T|1^1a&2g9DA1BW)Ii4r@ zhsm?cjT?gh9(i`P@soc8F#Fr&*~P{O1%D5DcCGON!GD$fc=COMzn%O9@;!pTjXb;1 z_yNIhBY!seeS&W%&n`2*L-3o(v#X4^3BHy*yU2Kr;MbF9*BGx9{A%*-660>cUrl}r z`9i@jBhRie?h^cB^6V1hd4ew{&#o|T2>xR7>;mH_Kc)XO$h*i73Vt$qc6spu!H*}; zt}fmu_|fFq#l?FBpH7}#Tl|3FKQ0E(E-k)K@E?$8R~FwP_;<*&3yZf2{!Q}iy5cp0 ze}z1|tazp1UnI}2D()8i&&acjiWdt0Y4Yr9;x55IPM%#%JWucslV{fwHw6DZ^6XOL zCqEJOPri`+py2Nz&#omtAo#D6FDBn7_}j_PBi|$V+sLyEi60RBHu4L|?-P7Gd3G7` z9fIFPo?S(}P4Knk*+s-_1izjJ@K=*(7ZEQM{4(;6s_sXNcxX~MZ)7$mClacHhB{ZG2wMywHWIMt9lZ8_!(SD|BB z2-Wz?|`_wyEdea8H zzZmL3=Eo`M-SuMR)JAXgSu_8eGXIXHTNk(tqhs6}adcH3Vm{5tb*!D%n=IFq>t z%um>#$NJD7;;RrRj0c4qN^jVBgaKo?vU4BJ{41{Gu9Imy`y!WiU+_mTy)&qrUrb_i zpu<%C1a$P~%UI^JNQ^BTOigC!VdB_hpF?E3Gk**%-o0y1c%#qL5;r6JRP4%~eYrc? zCQ#^ZRcP+c?*QrEcw%|?>_~Fq|BfgukG@R}SFrTOvh+KE_pXx6PBPa^W(%2{B(sT3 z3zSpAr;JRCOsQl_NHS$)wn}Cp7}MX&MQ#aC0~6c!7dYKLHp6uBSGd|V7dN6~x4HNo zNQk)VF5Ur9i|@10DP7z^3zduC2X49eEi%f*JIN>)zeJ`@x;R;Pv4tth#Tqio#VRnS zi`NrYF}WN}?CV3KUh}LrlBn5JxEN8hzbQ&``)-VHHn;x+5+mHc2cYKm3n)jrUC%fx zw|@-Wa{GH^l-u7Vquky{W~+32re0B-nWEed3NcxQH-ItSt|hG8_JD~U__L_l>86Vx z7bdy*BXk2c7oUT~2p4}0P;>DFbV?U*Wt^3ZzXEQ#*iS~e_&6Em;zMM%OBdaGMSYDa z%EjGeRLyP$W4ic7!pg;3FtH~;vehiF{(NtAJ9?pxf!I_gN746nuQ`rR2VK=MUNyf* z)~90A&^4sLTZ6O#E$tFyQEAJG_wxP`bKRk(Tx{m(k6jK`s!QvIUqW&Vi$xzN`cd=> zZMe2%VDE%T_XV{8w4i<+@}`G#S&1s9I{;fT4Up`bsu3PJlIcigTRz3etgbeEfY`#n9v zg}rNfkRqVy%P^3lALQl<8oQB2?)CHl?=&;*;5UbU&z=lXwrAgom~q!I)Rog$T2i;bOqCT_3=; z?#$OOabdK(YYa^8#Ycqp@{vCFKrG2eW`K|P0@r*TfKusWfF-Ky_z-Z*#|OzMAMYch ze7u89pY(B-Zt@nUC?7YGQ9f=2WBOP|*Hutf0FHg@k8r3_*nKcjMrPUtX|5CJ$GjvYIP|)mE4`T;pWFu_HDVlo?zd**Ykpi9|I#QsuELP zR&ZOkckjvj`U+7> zMn!Hu85Ow;$-E&W_c#@(mNS+qDsl!H6}dmX2b0apI?fy_YOfOSUNb18_5{;Z)D9!f zQvEQP*jW7A7cW8!JWZsIqg*75NS#0ijIbEKy79rB17oLWpdq)w6WcackdCZ<@j?7t=5&VWoeHsqN;GhzEIra+*sZd6!PnFaNCie8Z=*S<< zoCxpa*z_$})qO!$vb#$lYgXGY=#%nx7WJu?axNL=?PxN}+fPwQ?+NMcJ}OW){FW)o z+hb&o$ZO>}Fx_juYhFb+>v?{Fl-Owe!#91^mAoq0xq5BuqVaTDf&no1~}*G=^Ged5Z(jY-1O%rbdYm3b5`ov4~<5gw|@bqo|3La zQ^cHZ#AI|l&6R!SvA8G~%3kIXHpLd(y!yFs6ei2rCEQkHNvK@ekK(AA0Sh)=2l2>6RbnNVfxk=EEb%WGcLd z5mQ&;eSj?&?jWOF*hxmYu!YPR>B49|&aXytzQWSUMtTEm}`+tD?*xC2j}WO zP6iz7cw1EJ0k%}OH{SE@_Uw6#)1+SU?GXv@^4ppmm)PD=&>rvJZLY_}m$m5Az5JFK z`>7_y@}-pfG4ZVnQv6C6yPr~Bp8c4aV@OyczGUX!_9fnc?DhyVK6p!{PqYUNpspaW*rL#O#izi;3IWIU-@fpC^m-!Kom7SK_v2 zf9&TOhV>0kc0vy$Iq4eZJQsxlmU1 zMO2_#;LS`?RUIO;MpkDn7_&N?2&)X&fQdcuJ0NWkG;jAVqCk(u=94u_RqA>k!=*E5M*iMZdC7v26zv}34i`zL7~7v8#kh&MJm zrXC(zgFDSXhswwER@WH4WDoaEL)~}6y642bYJBN5jKlETi1lFf+IVCi?_lHG)(~33 zkhkABiJS^WK~@TC>P3E^Go^YU^_x*t6~w9 z<1$5hIzaK$#IC-M3lC$+GGdEiAZI1fH)0+5?)*5PaPM{F7YZURs7f>kb=NE@7WicY z7Hy!r=is-HVe_|;FE9u2nZhBnzPnDiMC79#C-DuNKaZgPQExn52}pc@DE`07AC&SL zq@-i~H&PP*QILvMTkQ*E~< zwPaC4(T-EL3hiEb%B;>R)05KAmqv$6*Oo^=DqT|^eW|p%V()BYoC`le?wy+rT2*n; zTSc#WpZYWdwVoY&?{&ms*L#tvxzl!{aq{=KcPgSEEr*WbiLZIPj-+`nd$;2q^GB@G z8%j5p-dO58($G+#0<8!i~qsq0A7^-Md0~u3Y4B@j>H2Ju;ey zd|AVMtHRYDs0#!)2kKpZ*OvAWf{DlF5l*~lQegO-+nW4FYpA`&-)z(e8}U?fsCE+` zg7?jC?l2g2!wj{Gsf@7srh}6OZS8?@ptUaGs%r|=-LyDSr>n9tz5W|&QbS)KDW`NOVAQ^2*^-`s&LwxaRU*qYXxT0>h} z6KV~-{o#V~p^jEW2vJj2$@esz6N2@weB&ZleF*KAmbUQme;0L`DMq5Q3|GD%4OS1) zMW`gcr-I@VbuVhQqdj0%t5L=0#d$e2gxXyTT;Tv}xIQd6I%%~US0v=(YZ1+;)lG;$JZr8Ox?RBr*Va%+yQ@AJzKK;6358tY=Fk>bey|`=Ad_8qxdN9bi}ky_ z%a>o2&{y7y;8G>t%ea)Pr1F+feXwDx2t3=bix)p_+JaXTgtd5&sS(Xj8D@WPPuZ)e zdOuLT2dCc8Q|apcGWGtJdcRA(Kd9s?F_qz=-fPnyN%s(M!@$c!z3-)-4;FIf)Am9x zZA!)xt|2g;vcDc4uEF{7-wY4)eZ!xk6V1a{{EyK6mw>tlkq$Z;9rzy5Qy6S|KrhE+ z;y7p-=6rmx{8ilB$_M=bbN5Qn0Dg?=1pPMXe$Ydpd!YY$(1W0-K#zhJ;MbxUXfqlB z@ssfY=r+)kOb0y#yC&gVg?P{#v6#r<;Yi!I+DPlnOPez0jO=}BXXFt-AD;uS4G&*T z0ePgBH;h?Gr~HoNW?4o~-in+_SLdF!C3}Z)<>Vz7&zm)aDk!rYpM3mggI}DnfI&{) z?)0*;S(PXlEYs`pnTqt;pjLWKB7G;|Sx8^3r*|aMzYF{dr1POHE5ARH{tV#dNXHL5 ziS(6;bi!%dDl0@p&dA`anHgqWOh0EK{T$>k2OTxh>$b{BUv4S^PCqV19haQOjtZpH zPBG@GIJB55SVl9_E0Mkl=T;e>u8edU3&NE9Pkg=#xdou3@-=(fEOUfCPe9)R$Q44) z(sxtB@7IvtbDH!|klrWDvGU6@Xvg_zqsNf`_w22Q9{$EG?7iIC-e%~V137+eu*ysK z3WFKnFC)GBH0l3=^xKd=SI^&+i0=v5@z5)Hh75F6rDn%fU(V7(%UROj-$CDlxCeAD`U=YrQ(tzb zrf&?&y9a$>Shvsgw^3Qhdg433Z{bG6QU*Y^^G;I{)2or5jvstd^#{w59zl8xeQbdF zm*wRBbGj#I(pNG(Ij+5 z-OJ#urU6H8wl#yqTH3X=%$d z??}t2&fK2ySQ;Km_$2Lu2gRE|+wpEeDV{?fPP?F%74Vf&nXis99vXEr?ZYv~_p<&A zb#ePx2KpbzKO*pt2>c@g|A;`U2<&sY1$Cu%n;*8@S4>2hK{qS$YA@cjv z-6Z^aA&&epZb30jh+|KNThP%aYutrrzj>Tx5@V92Vl0*CB+^YxC~E{N!(a@^g4DcT zsx$DMuQ*Pg?G{wwlO(U~K5mL(eLV9}<>St%@TYU4TO{D-tKcyNiv!aE!S_yZOXU9# zQR~>*OZ#YwX-5|B=JGg4(m9eYlyrrpYb9-vbhD(pCB0kH2PAz|(q|<-Ch6Ofek5tu z1+sie=SaFx(iM`fm9#<9&64hx^lnKXkn~YWpOy5Oq;E_5k)&BuW%-iMk#wP?D7$Z9E9o&w-{nS6s{blUcY{l;t9icQ68}`cu8^5HVPB^5SEswd z;X8-~T!KsdQ~i}fig2RmkEFXrQbgvTCAh>td;aA}!dKFeDt~{vTL|x$z)8U+`hV5W zO4wM16ZZ8gzZwsC--m~Iq!*Oq1$|ffRlmFz7)4cnHNND_0Zxr45D|wxem4STU#{}2 z{#!hVjkH5%Hf#J+a*E!BbdC**SK~vc9DokU{Is93Q}#>P*d}q6UyVnTanV;gS^V*Lk&-eb$J<}VYMni6UpSMqlI56Ju~{w~=+x@7*B zY#Cfik)#K0`PDkFL#3vGTIW?|v#B#4wdKz%a|_YDGBd|0Rq-Zk)t_XIKAbTA%6{Iy z<1x`Ih_TBg)_;5XFCrxeA5~3izNglcRrRD4sP?1y*Kv}oJnsd{dCez-P?=K4jT;Rem)eQtSP?WMEYLR^={sCjJ3&1fIpDXcE z{;U3v*LSM&dzz7eqnV9UJ8b4?DI-t04o*qBdqe`)-cjSMp2(GR)cBcx?Jk zBiF|?_2e3=e@&Lp!+P0n9TMjmSXoi^hk9ZLR^U|qTrxhvS{FPSpJ=FlDH%T-{Y;Gx ziSrEO9IO|f3P0CS{ezwPS!D!+avZ0>TjVYWqs8Md0eM*-XV)MS_M9`eKI{&y>Aop zBd@zI;D#|_#Pxfp#MOL-Qat`m=oxuEJ_&pV{8hip&oRY~7bI>haSLRD#3x`-8Haef zZ1KDVIM=0BzxSggaa<03ygb**4Z!oDM~%xWtqwTt8CdKVkQ#sQchGal0q66qF6g)S zGhFAF`Zr1a%CA2-=*hr^GY)>K{#ji|<8hK|edL+IQ~6u!fM4%`w>aQk0v~H|y$c@v zO_K+oUtqcR^?3&z^nB=ma~*cZM?IgRe7RKO>N$?ZqE!5@4P41cNRaEKe2=`o)O8d9 zJ}&({gOA4QM>}!U*CboJ>T=NkFH*mH?xb8Q`@Vzx5h?$yv}d-Ie_6`g*DoHD^7eL; zi~c5+zjJ_dU1Qar*Gc{Bg#5^H|3(Kr5#Wsf0bBe3p@aNU;EY?oEp9J6$aCFl+Ic|A z=Sw?takGQv+Usj3@KpXTa=^JB_ju@0-&du2W37Yyy$(3nI-x!G`g+kpKIVXDp`)gr zg|Z*pBn_GlJe6Nd9PrNzeB?ZEql0`0aJF;R9#kA|1@2OeM(+a7dKt9U%a4H5{#lp1 zg|z(oXXIdlpUQq0aJGj+TYFe2@W~_A<6a3|wA<<$p?{M2Zx}Z@=-(^lYoxqt=TAGx zPZ@36f50}5%mbdv{;M5uA8_`!HKlH0p-bA?2At!Fy`SGM@X3aK{rB5|GoHt!Ju04W z08eGlDF-|oH|MCw-XBhu`16;Ub{0!J3xTK7zZ^LIQqQ$vhANIV4)R=0G*x@PQ{w9R zyE#(N0}gtg1fFW${O6<|L-s$Lq@LeOyj`}#xe}j(2{-Mr%P#<)%HQ<@NB<`E1f-r# z4)QlU;9qmV|J?z9+5vxE;`Vj9j>PG>oNzt(gCk`z`p?8r3%yN z*B#`40G#bdJvRwf9DNS*uLyjs!PT>PV45e6cYw1V?c?bu4tgf!q>jUU;M8Nk-YXpB zn;h^jIpFsJXMd%h|5W#@o&fHWzUbt?9Q3^DApZ&QRQo+l!2Oa`^*+Y|Unp_D_@f^i zfU~}K$bKweCDye^!jTR8Z*B30jY*8^Zrx5b-$0GBG9xT}$Y2Rv?KNi(@w6ttR z7L60D|0juB4>ntm!*i+diV~kM7!p57`PNq~^!-yukb4KLuUO>cQ^&0#p3j3fCiQdu z^oj*cD&$)56^p_hb#;MoSTIFJ*m$6$&0NRcM2g!3EuqZ;4Jt0g1KqxMe`|fHC9#(R zR#UGk*p6?X>&Xuk0sw3mmrp$-zMG=@KJ$SzQ3c6?-=+B zgIGlVs)}oul~y22N3E|MglqnzCg7ZS^53@}9w5k#a=QvYvLYUBn>}1Y-HzhdM4xZP z>e7`SpJ&x_?nxn9m^@#8{i@QHmU9qCdgB9LOmsNPgs`J`n z=H?3Gt4h?K1`A5L4MI_|zU2V71gI+ZRcdiJH!RS0KG2;;eCpbRYU6-v`zq+GY`YD( z-D16QxtzFKn|!_9rjmBKn*z-_tu4wIpX0U)+6EPDW@-)e5oL-c*OT4?u{MJ!zZSXb zu|WaexZxEc-Lw{Aw{KzKc5CaW+bmR`$<^&;K;#1Kw&La19%3PTvA4nh)7}HNm^*AW zkYqD=E3j=eVbijH)isHh<-B&jSja!wN9xvgawro!Ir!?sAzu?NIBwHozotg)qoVfI zkPGpf^&slc3O4pD(Y7FAiPmllPWxJn@X&Ulh)n~MYslJ@WyFRFsW!hz4sq%|X2cdT z@XJ>AW!8QnpZ$tZAuzX4kx`9=WIv^Cs$j35Lm8g-0WnyC;G+cB}96S>{ zd)P9uuhF)(kg2%V=gaMSMzm~Yj1L07Y8B*Z30qT^ssnix#O5VARi3u8D_c_UMulgku$zjl zo|85`ky`^L3|}DjVZqg9ZqQ=STW#M#mzZ=B}x_>uvoE0r>E`tl(g%K zR$J!GM^k5Yw=%%w(YcRcGxz&lQmLrlVX_F7uVzs^Td8yc$qgjgSga_ Y%}XB0Fo$D^lJ|ug*^aHgPrWAk-`4F<9{>OV literal 0 HcmV?d00001 diff --git a/test/migration-test.cc b/test/migration-test.cc index ffe109ccb..bfbaa341d 100644 --- a/test/migration-test.cc +++ b/test/migration-test.cc @@ -295,8 +295,10 @@ test0() FAIL("migration failure: " << status); } - std::cout << "Sleeping for 20 seconds for the migration to complete...\n"; - usleep(20 * 1000 * 1000); + std::cout << "Sleeping for 5 seconds for the migration to complete...\n"; + std::cout << "This could fail if your disk is too slow (i.e. if you are using a HDD).\n"; + std::cout << "In this case, you could modify the test file to wait for longer.\n"; + usleep(5 * 1000 * 1000); read_and_verify_data(_space_to_name, num_objects); From d70013a0eb5d5b55f7a645339ef5440a718a81fd Mon Sep 17 00:00:00 2001 From: Derek Chiang Date: Thu, 22 May 2014 22:45:48 -0700 Subject: [PATCH 2/4] Add code for removing migration states when relevant spaces are removed --- admin/admin.cc | 6 ++++ admin/admin.h | 3 ++ admin/c.cc | 8 +++++ common/configuration.cc | 24 +++++++++++++- common/configuration.h | 2 ++ coordinator/coordinator.cc | 39 +++++++++++------------ daemon/migration_manager.cc | 58 ++++++++++++++++++---------------- daemon/migration_manager.h | 1 + daemon/replication_manager.cc | 10 ------ include/hyperdex/admin.h | 4 +++ include/hyperdex/admin.hpp | 4 ++- test/migration-test | Bin 31772 -> 31772 bytes test/migration-test.cc | 16 +++++++--- tools/rm-space.cc | 17 +++++++++- 14 files changed, 126 insertions(+), 66 deletions(-) diff --git a/admin/admin.cc b/admin/admin.cc index c072701d6..4d3a5398f 100644 --- a/admin/admin.cc +++ b/admin/admin.cc @@ -233,6 +233,12 @@ admin :: migrate_data(const char* space_from, const char* space_to, } } +uint16_t +admin :: num_ongoing_migrations(const char* space_name) +{ + return m_coord.config()->num_ongoing_migrations(space_name); +} + int admin :: validate_space(const char* description, hyperdex_admin_returncode* status) diff --git a/admin/admin.h b/admin/admin.h index b1b53f574..182573b6d 100644 --- a/admin/admin.h +++ b/admin/admin.h @@ -74,6 +74,9 @@ class admin const char** spaces); int64_t migrate_data(const char* space_from, const char* space_to, enum hyperdex_admin_returncode* status); + // Return the number of ongoing migrations from or to the given space + uint16_t num_ongoing_migrations(const char* space_name); + // manage servers int64_t server_register(uint64_t token, const char* address, enum hyperdex_admin_returncode* status); diff --git a/admin/c.cc b/admin/c.cc index fd1bfec46..de0acfcbd 100644 --- a/admin/c.cc +++ b/admin/c.cc @@ -215,6 +215,14 @@ hyperdex_admin_migrate_data(struct hyperdex_admin* _adm, ); } +HYPERDEX_API uint16_t +hyperdex_admin_num_ongoing_migrations(struct hyperdex_admin* _adm, + const char* space_name) +{ + hyperdex::admin* adm = reinterpret_cast(_adm); + return adm->num_ongoing_migrations(space_name); +} + HYPERDEX_API int64_t hyperdex_admin_server_register(struct hyperdex_admin* _adm, uint64_t token, diff --git a/common/configuration.cc b/common/configuration.cc index d92e321b5..705853a3a 100644 --- a/common/configuration.cc +++ b/common/configuration.cc @@ -665,13 +665,35 @@ configuration :: transfers_out_regions(const server_id& si, std::vector* migrations) const +void +configuration :: migrations_out(const server_id& sid, std::vector* migrations) const { for (size_t m = 0; m < m_migrations.size(); ++m) { migrations->push_back(m_migrations[m]); } } +uint16_t +configuration :: num_ongoing_migrations(const char* space_name) const +{ + for (size_t s = 0; s < m_spaces.size(); ++s) + { + if (strcmp(m_spaces[s].name, space_name)) + { + uint16_t counter = 0; + for (size_t m = 0; m < m_migrations.size(); ++m) + { + if (m_spaces[s].id == m_migrations[m].space_from || m_spaces[s].id == m_migrations[m].space_to) + { + counter++; + } + } + return counter; + } + } + return 0; +} + void configuration :: lookup_region(const subspace_id& ssid, const std::vector& hashes, diff --git a/common/configuration.h b/common/configuration.h index 7f16fff88..92516f048 100755 --- a/common/configuration.h +++ b/common/configuration.h @@ -115,6 +115,8 @@ class configuration // migrations public: void migrations_out(const server_id& s, std::vector* migrations) const; + // Return the number of ongoing migrations from or to the given space + uint16_t num_ongoing_migrations(const char* space_name) const; // hashing functions public: diff --git a/coordinator/coordinator.cc b/coordinator/coordinator.cc index dfdcde8f2..d883d36dd 100644 --- a/coordinator/coordinator.cc +++ b/coordinator/coordinator.cc @@ -669,6 +669,14 @@ coordinator :: space_rm(replicant_state_machine_context* ctx, const char* name) } } + for (size_t i = 0; i < m_migrations.size(); i++) + { + if (m_migrations[i].space_from == sid || m_migrations[i].space_to == sid) + { + m_migrations.erase(m_migrations.begin() + i); + } + } + remove(sid, &m_deferred_init); generate_next_configuration(ctx); return generate_response(ctx, COORD_SUCCESS); @@ -772,6 +780,7 @@ coordinator :: migration_complete(replicant_state_machine_context* ctx, const migration_id& mid, const region_id& rid) { + FILE* log = replicant_state_machine_log_stream(ctx); for (size_t m = 0; m < m_migrations.size(); m++) { if (m_migrations[m].id == mid) @@ -781,11 +790,16 @@ coordinator :: migration_complete(replicant_state_machine_context* ctx, if (m_migrations[m].outstanding_regions[r] == rid) { m_migrations[m].outstanding_regions.erase(m_migrations[m].outstanding_regions.begin() + r); - if (m_migrations[m].outstanding_regions.size() == 0) { - del_migration(m_migrations[m].id); + if (m_migrations[m].outstanding_regions.size() == 0) + { + fprintf(log, "the migration is actually completed\n"); + for (size_t j = m + 1; j < m_migrations.size(); ++j) + { + m_migrations[j - 1] = m_migrations[j]; + } + m_migrations.pop_back(); } - // TODO: do I need to call converge_intent? - generate_next_configuration(ctx); // TODO: is this an expensive operation? + generate_next_configuration(ctx); return generate_response(ctx, COORD_SUCCESS); } } @@ -1736,23 +1750,6 @@ coordinator :: get_migration(migration_id mid) return NULL; } -void -coordinator :: del_migration(migration_id mid) -{ - for (size_t i = 0; i < m_migrations.size(); ++i) - { - if (m_migrations[i].id == mid) - { - for (size_t j = i + 1; j < m_migrations.size(); ++j) - { - m_migrations[j - 1] = m_migrations[j]; - } - m_migrations.pop_back(); - break; - } - } -} - void coordinator :: check_ack_condition(replicant_state_machine_context* ctx) { diff --git a/daemon/migration_manager.cc b/daemon/migration_manager.cc index 5aee79afa..7ad28b6ca 100644 --- a/daemon/migration_manager.cc +++ b/daemon/migration_manager.cc @@ -144,47 +144,27 @@ migration_manager :: setup_migration_state(const std::vectormid) { - tmp.push_back((*migration_states)[ms_idx]); - // TODO: commenting out the following line seems to fix the - // bug, but check the correctness of this method again. - // ++m_idx; - ++ms_idx; + while (ms_idx < migration_states->size() && migrations[m_idx].id == (*migration_states)[ms_idx]->mid) { + // LOG(INFO) << "pushing back old migration_states"; + tmp.push_back((*migration_states)[ms_idx]); + ++ms_idx; + } + ++m_idx; // this particular line is problematic } else if (migrations[m_idx].id < (*migration_states)[ms_idx]->mid) { - LOG(INFO) << "initiating migration out state " << migrations[m_idx]; - - std::vector::iterator r_iter; - for (r_iter = regions.begin(); r_iter != regions.end(); r_iter++) { - region_id rid = (*r_iter); - if (m_daemon->m_config.space_of(rid) == migrations[m_idx].space_from) { - datalayer::returncode err; - std::auto_ptr iter; - iter.reset(m_daemon->m_data.make_region_iterator(snapshot_ptr, rid, &err)); - if (err != datalayer::SUCCESS) { - LOG(ERROR) << "failed to create region iterator"; - continue; // TODO: should we continue? - } - e::intrusive_ptr ptr( - new migration_out_state(migrations[m_idx].id, - migrations[m_idx].space_to, - rid, - iter)); - tmp.push_back(ptr); - } - } ++m_idx; } else if (migrations[m_idx].id > (*migration_states)[ms_idx]->mid) { - LOG(INFO) << "ending migration out state " << (*migration_states)[ms_idx]->mid; + // LOG(INFO) << "ending migration out state " << (*migration_states)[ms_idx]->mid; ++ms_idx; } } while (m_idx < migrations.size()) { - LOG(INFO) << "initiating migration out state " << migrations[m_idx]; + LOG(INFO) << "OMG initiating migration out state " << migrations[m_idx]; std::vector::iterator r_iter; for (r_iter = regions.begin(); r_iter != regions.end(); r_iter++) { @@ -245,6 +225,7 @@ migration_manager :: migrate_more_state(migration_out_state* mos) } if (mos->window.empty()) { + // LOG(INFO) << "completing the migration: " << mos->mid << " " << mos->rid; m_daemon->m_coord.migration_complete(mos->mid, mos->rid); } } @@ -265,6 +246,7 @@ migration_manager :: send_object(migration_out_state* mos, pending* op) virtual_server_id to = m_daemon->m_config.point_leader(mos->sid, op->key); const schema* sc = m_daemon->m_config.get_schema(op->rid); + // LOG(INFO) << "rid is: " << op->rid; if (sc == NULL) { // TODO: this happens occationally. Not sure why. Possibly because the // related space has been destroyed? @@ -309,6 +291,7 @@ migration_manager :: migration_ack(const server_id& from, uint64_t seq_no, uint16_t result) { + // LOG(INFO) << "acking " << rid << " " << seq_no; migration_out_state* mos = get_mos(rid); if (!mos) @@ -317,6 +300,7 @@ migration_manager :: migration_ack(const server_id& from, // that have already been completely migrated. Why is that? // Does that indicate a bug? // LOG(INFO) << "dropping RESP_MIGRATION for " << rid << " which we don't know about."; + // LOG(INFO) << "fucking returning"; return; } @@ -329,14 +313,18 @@ migration_manager :: migration_ack(const server_id& from, for (it = mos->window.begin(); it != mos->window.end(); ++it) { + // LOG(INFO) << "your seq: " << (*it)->seq_no << " my seq: " << seq_no; if ((*it)->seq_no == seq_no) { + // LOG(INFO) << "we found it!"; break; } } + // LOG(INFO) << "we are here"; if (it != mos->window.end()) { + // LOG(INFO) << "setting ack to true"; (*it)->acked = true; if (mos->window_sz < 1024) @@ -347,6 +335,7 @@ migration_manager :: migration_ack(const server_id& from, while (!mos->window.empty() && (*mos->window.begin())->acked) { + // LOG(INFO) << "popping object from window"; mos->window.pop_front(); } @@ -367,6 +356,19 @@ migration_manager :: get_mos(region_id rid) return NULL; } +void +migration_manager :: remove_mos(region_id rid) +{ + for (size_t i = 0; i < m_migrations_out.size(); ++i) + { + if (m_migrations_out[i]->rid == rid) + { + LOG(INFO) << "erasing mos: " << rid; + m_migrations_out.erase(m_migrations_out.begin() + i); + } + } +} + void migration_manager :: kickstarter() { diff --git a/daemon/migration_manager.h b/daemon/migration_manager.h index f5790b91a..cd8d8e266 100644 --- a/daemon/migration_manager.h +++ b/daemon/migration_manager.h @@ -82,6 +82,7 @@ class migration_manager void shutdown(); migration_out_state* get_mos(region_id rid); + void remove_mos(region_id rid); private: migration_manager(const migration_manager&); diff --git a/daemon/replication_manager.cc b/daemon/replication_manager.cc index abe3119d4..b8954c5dc 100644 --- a/daemon/replication_manager.cc +++ b/daemon/replication_manager.cc @@ -227,16 +227,6 @@ replication_manager :: debug_dump() unpause(); } -// OK, so basically, you create a new class, something called "response", which -// contains some state that specifies 1) whether the receiver is a client or a server, -// 2) extra state if the receiver is a server, i.e. state that identify the corresponding -// migration state for the object in question. When receiving a req_atomic or a -// migration_atomic, you generate such an object, then you call client_atomic with -// this response object. Then, client_atomic saves it into the key state. Then, -// when chain_ack is received, the point leader will look into the key state and -// call some method on this response class, that would generate an appropriate response -// that the point leader can send. - void replication_manager :: client_atomic(const server_id& from, const virtual_server_id& to, diff --git a/include/hyperdex/admin.h b/include/hyperdex/admin.h index b70255b1e..ae4b034c6 100644 --- a/include/hyperdex/admin.h +++ b/include/hyperdex/admin.h @@ -126,6 +126,10 @@ hyperdex_admin_migrate_data(struct hyperdex_admin* admin, const char* space_to, enum hyperdex_admin_returncode* status); +uint16_t +hyperdex_admin_num_ongoing_migrations(struct hyperdex_admin* admin, + const char* space_name); + int64_t hyperdex_admin_server_register(struct hyperdex_admin* admin, uint64_t token, diff --git a/include/hyperdex/admin.hpp b/include/hyperdex/admin.hpp index 8bb6f84cd..58f7e3eda 100644 --- a/include/hyperdex/admin.hpp +++ b/include/hyperdex/admin.hpp @@ -76,7 +76,9 @@ class Admin int64_t migrate_data(const char* space_from, const char* space_to, enum hyperdex_admin_returncode* status) - { return hyperdex_admin_migrate_data(m_adm, space_from, space_to, status); }; + { return hyperdex_admin_migrate_data(m_adm, space_from, space_to, status); } + uint16_t num_ongoing_migrations(const char* space_name) + { return hyperdex_admin_num_ongoing_migrations(m_adm, space_name); } int64_t server_register(uint64_t token, const char* address, enum hyperdex_admin_returncode* status) { return hyperdex_admin_server_register(m_adm, token, address, status); } diff --git a/test/migration-test b/test/migration-test index 7480dd7aadc50301ca90a12837f62ab44c83838a..f5efd01c5880b4e80a408337245f5d6d9ad06a70 100755 GIT binary patch delta 5744 zcmZ`-c~}%z67Sc50?IAI0FeQ?MTS#3REB#n5iz1fqhUrtK~WL$z#OP3>wLrwrjiXC zS)=YIQ3+mb5_LC#$G2!Uo5jS>2%9MCCXUf48na^5%vSZhH%$Hr-$z&fs_Iq!s_J$3 zbhiw$mO<9k9viz7I5@&6@?!EE7B}eRc zj-Hj>-YlybXy@9)dAm{UAe^)FVW(h*gU{>szU*tbYwrWGcy@9mEDw=H3bG5V*PlEBkYs|0p_fh95jgY$hf35%8 zp7Q!Zr;~@%U7qVI^g89SW(aalcY2fSnxVqEIJl6r+{Ia{F)IDp4Y#nDGU2N86z6{K z=AH>rBO2;Pp_OXT^BTe|i==uUJB;g7x!%B+M`UUhjSJU*!u4G|dj!{i{u^+`UR`D= zEm>MtTe1+(YRX_^jSB9$c*D~*A@++ZmRG<)mCB(6PimmwwGa$0ufcHF)lRjGS5zy} zVc*Du?c?31*|`?YE=Z_aF(JNUMf{@D960Pb3QkwK!*s7<(7D!kTy}iU8mVM%!PDfF zR90QRqB?PHxuHhU^0gLq4!q+z+9h9!CNxoAqHpq2)JX~t3j z!D|g!1g{DLg4eu3S3zt6>Dyo+B$E9AexbI+ZauIP+eq{UvGb_666+=)h#e;&h_w-T znG@40^>fNV7D23mfFM@;z)Gx+^lk8E=oy?%OPH^9HXHtj1~Hpe1Vs8p1X|(iFja); zK{}~Ks(1nyIf+mLZSYihR-&Aa+szRVrdNJ3n{~!5zGk$!S+(UBts1qu?ky20ywl;0 z@M>9|4vrD&a%ei_N34~j)8S;qtMW)MD2$9j(shwT8>;0;j3`LIMnI6>M4%PAB8N8A z^Q01_3kakl7n*Md0?UR9zmMuR7!eiD)<8m(#%4qH+_TQDjJ(9$j-uYmp_PE(u#iP-?Ppwi}<#|ov3$hDDAv!rIbK+L8$@tR!X%51f@y> zf>H^A&p4%flvvC+hb)3pGJ)rKtH#|8pjj$cpPCG7xxtG-8)%{@(?uUWw6P8jph3)N z4*@~uO#-dZ7Cp4FmXk^(HV|my@rwww!R=_<2E21e3@(Y%i~6^s+M4o30wU#d0-}Bc z0eX7V9=NZ>=Of7@i=dH8;0&iR{*F1#tlKsVZ^Rd9*#R=%<38iaUqo;CJ_+Ce*D2Ymx~G~n5*%3 z71=w{irMQmTWq#Z6e{^spp!z0_IZ-CVB|nRFdDptK(y~B0TXZED-=MmJVzG6@-zX# z^5a|ZyVz0e9<;=USjp9pM;m+|8)-u>4V9K{c8(YbZXx6=xcLwe+?)vrZclC^xW&0O zQ2@d18d(Il3k2-=gwEbH!>&`jkO~dcb zX~tyIjXf|SzM7T7zIfYP$K3C&jlM$}MKPJEw-%E`Kok=}KosLoKxUSGdVm6mVi;LO zG52pE@aDx_zX8PwE?7%hLWmsb1dRzXHqZZBbmfzGwIyVr5Td(91O%Zx0gRohG!4$lD2s$eRhYLPw%%qKG`7R3dUAfm~iz z76QD&&hRTNgz7H@*ChYCCEQ~Kxr;!*TsNCdbMVlZvtcs+xR%^DyJH^-F+{6lJ1TLR z0k*lzZF47%ym9`9?8eX; zb*Swa`t{L(>v@CysWW2Y%PEOygMol(LlFTn@jL?Fn2&BTeYO>iCyQu}n!swM@Vai3 z7b5IU7w^q|TDF0A<-vF2YWjxOi2n4W+LVR|U1QEJ%9V~}b;gqjw;p35_ybkVZ*7P1 ziG^CcwRM~P$fSK23g)8bhLebOIXyZl%xSRHvY;o&|CNFw^>gscv8Afc@ zrERIgXTRH~X^)f?3Xh}TD(6bN4=m@VQeA?5D7|RZIGENE=Z&YE5IvtUZ~m!SaC5?l z>Grsnb&cLn{M3@J(cuCK%U$}qa%1*BuNaa(vDn`mgZ6FHZc#~}**{|t*Emwp z3@n)BjjOODRWod`-)ug63U;MNF-LfmnkZkp261Uo@>ka=f&6JdtVed%D>~v zw}IsZvi%T*$K#NJ#~v``ghzT}$CULi{r37wY>XNX)1H0To^66Fvo%iQ<604@ ziYGehxsx8|6i;-v`Dpoe@dT&BEKB4<=tWnW9{m-ytDdW~XGL&$p0}Nwq(|wa5-SxC zez21~q(Znd&j*=4oL4N%Ars-*k^^i8Fnze{tz@m@H<^38;T&ZApmrWI^ggT!=IAx7 z5RCfwX|EZ4SSsWjG}s?lZ^)IM)8M4x1@;#RTA)Guj0HYy04f%Ig&#dL7W&9xDKK|o z4Er983rlcnHx_DSDFysWV{k=&X&!RlUaDbzaH4cAI;E7oM&?h;a`C&R$D&U9?uo}f z*uFTA?SkILd9wQ?2rkd{6L*JH&e?B-2nPS9%l z$gHsWYN$p-`KGjH03Qw7IEhm_YNeQ3m&8=EM0?y>>)gFBx9^+yKF&J-zt&#s-+S$I z?m1`ADBCm2S_d3n(o6E+OKlf=CynaNU{t4-Peyg{HoNG4P5<$D-&G%uoc%1W51`6> zf!|Ai>uy(Q7#n~)wkq}-oUu`{@1V&}^}MYI+e;)w;h85npu|?swvdx`%Yim{^pNq7 zvR`8t#r$EuT_oEir>m65ciHLLJ95f=TW}v|&C;51R9B^n{6f2WcrT`nif$fmf zwT{=bxiWh~J|=?eI2CB@OW2T{xZU1^U6wt0vS$!+nS7>n@L(@f=ElKslH@13NL_p( zl;(Aj%8>V$oTS;w<^`I>`6tm%lAI;?>1LkO$WXi__4)jkk75)*LF)7RE&qir)%Ap4 z2UiE1@#b2caKRymEd@Wv84h=N{iRUlxX}MJS6RYUYOoUhO~#R=zE1~VIi@@A<6#3j z2%E5@@nxPPh|eL&JV?sr{BV+1W>Pr+3?FXfRh&5A!}-me58?dA-^nAbsw!((QR7t? zv9=~6N-8d{t*@-BC@n9pu4pJ;hG+E^5VdX!luz__DqdlzSzWxgzO=5sxER`=@U~rE zwYmy6IlpUHj3@PAaDpktg{#&s$g7Ett!${Rs4Fk6FRjNDFgdMvGcy$%rr+M8`E|1ta&5f z@=A!xS}!4(Wfhi1#AE-Th^eZHSzew6M{3=ag>s0Q$&ATb4<2q0cNe(rnrN@YeWLF_ z(gEN4-dgC8j-a{UINwu}^t-YK^v!n4cnzHne$a!h>=6MEJmi2u47eAkk&K^BmZT49 z)hU!RWT-`kexm`R{5&T6Aai5ftmfnT=1s z{ljPaqnch#UWsIU>w(FX+59ynPXF0t>Pg``+mP>>%fU7Ri#XUopc?+=ul6!G$8qAd!AA0g?U%0@biTKpi8}8;BC=O9(XZ zT6qYXFOm2~L>u6Kz;yN^BnE~zj!p6OsAY=fq)ljeA9;(0w+RRhuMnu_HChQYPy?_` z03{H*){{r*s*=O_n4(cMNB1NfQN!J;*KKKdjb!}O~0B<`sVE(CiI=Qu$5+3gRH)PdkC7d z>F`2uonkN@>_cWKuBXGSkPV9AbT}IFtl~eDAU8AuMK^|yZKyrpV@4tRIRZlT76R4K z7dp0~784~z&n57Hi`F49Z>ZqANE={6STIY2*sw^e4K*-g>01RwiM|~|-lE|h0z$*9 z1VrE32=wv31gbpx|WPs`j$a@4R9;$4J%2n-myrECBKlg19^+21_DCT zDgr`MF@aND(g+n6{mmkekd#EgV}@3~6du0gO}&(_J`Fh%xx5{-+e@?!owk+zh4f`BNw znt+&pDS>l*{&(g4yd^p05i(K;?Bp`0-7=+`^t%f1R(_6d4g1M?kUL!w=vxXpxlcj9 zBi#4HcL)qHC!!J8=id=ydw4E6#QNw62(fVls=+x@9V;5+M3fLF5fH+@ziH{qd07(_ zMtV7m>b>a2>RThXTWy~(B>AsEFQpR8H;ICUB0B;?(daM&v3xfO82R#Tq69+a8S)5~ z#|a3P?+?S%QSR&@?1>7rh^wav1AGz{Y9%feN%J;4LkfhpK#CRGR0M=JM*>3IFEJ6j7Xr4(Xy^9cw+IRvWV zr&zVOD6Sz&6n7(Va|T4kO~#_xaf!IgH^q(J1zt6xUu140ATnO_%w2~i?* zE`f1c^X(@C0bXGz_!SmN^H+j%yjNowkC;H=BGIqkm`uh+cxcJmJRKjLC6{eQILnUsd!Dj?5Q-Ch6bF4^ zjlWxChtF>scNXjN#;v5q6^;7`@|MPR5fGd3&jdu@UL+9A`xZ(GMBknykLX(sfdcAH zBQ9qdB6D*pi5DXtMPPjM8ZxyQX@2@nq<}693?V4ttCrcTM%b%;bhc!?g=aW#$voj9 zwPit?@v+Z%442Eeo7%G#T9d*ipTg)5lnY9vp3#C5skhG;d$bWwC$02v#oXAWQR;d$ zHsBDhzO=osexe|MhQ-NK**R!R4r8_O*JO?InX4w#4JR7V`W2S>3BE`UV)UIGYkVF6N5Kbn+Nn zObKH%AwD%u@z6D>P7PDIUZYgLw&>P3AJaEqHqQ73r!wHJm3p-KCAbSN8?hW#P_M%n z>k3&|kt*B-$Fw<$TbE%%+HBSYZ>CKfpC?yqg~2p;Z^>0773gd$oA) zo()%YDh0lyKhXIoj5_d~8P;gLU^129o;v@f$wc1>KDuNwDe;@YkC#oRB(&N=^rQ8} z_1=m0E>5irZ5p=qJlYKGv}7kqpW}~v2-*?6{BqG&-~;zYw6CLWM|%kEPR#!a+D^20 z(Vk#ZqZENp{zfG7(b_8{X*pUw+Ag%UXwRW-MQe|*E?sEr(4I%ziB_^f;b=8z?Q!#I z(WavQ?%hCYa$I;#B$UV<^w}` z3J#8K@%R&!QQOkP!C)) zd3@UMk6(pL69ji~Og^|~`{HM?=xkrdeHTrpXv}Pz3x(M}>^*464rb?JFCL$Pli9(F zw97D(9mI-2ofGVsiWf*bep9jC2#@6Wgua8nW-4r!A4@B2Q+zPv) zEhm^=hr>C(3dJ3`m~&AvpzD55udsvLdaXmNMvH+Ic4SVZYXYjFKW?P?z~;_l?%ng} z_S*!6@Q+$a+_rPu$!*6D)}6ZG4O_fmuRIp%AijaQgL+}2gN6rbV9~-vN2?EuyB8)n zC^NKjStVS+Q0gH4xp%Ao&}hrt;Xu)38y87~R;3mr9nu23?7Y>0wbxBvV3j$zNCyM3<_V1hYybagE^d z(rm>*3LGt6%2tA3StQfI{4y2pfU2_pve}?prcw+iLE*9pq?(r%ge8EHILD)W@Kdq&e^Y8g`$(IbI{XN?aSEa?!Bv?aQPp=W0?{F diff --git a/test/migration-test.cc b/test/migration-test.cc index bfbaa341d..ba19fa2b8 100644 --- a/test/migration-test.cc +++ b/test/migration-test.cc @@ -267,8 +267,16 @@ read_and_verify_data(const char *space_name, uint64_t num_objects) if (gid != lid) FAIL("loop id (" << lid << ") does not match get id (" << gid << ")"); - if (get_status != HYPERDEX_CLIENT_SUCCESS) - FAIL("operation " << gid << " (a presence check) returned " << get_status); + if (get_status != HYPERDEX_CLIENT_SUCCESS) { + if (get_status == HYPERDEX_CLIENT_NOTFOUND) { + std::cout << "retrying" << std::endl; + usleep(0.5 * 1000 * 1000); + i -= 1; + continue; + } else { + FAIL("operation " << gid << " (a presence check) returned " << get_status); + } + } check_attr(&attrs[0], "name", armnod_generate(alpha_gen), HYPERDATATYPE_STRING); check_attr(&attrs[1], "height", armnod_generate(digit_gen), HYPERDATATYPE_FLOAT); @@ -281,7 +289,7 @@ read_and_verify_data(const char *space_name, uint64_t num_objects) armnod_generator_destroy(digit_gen); } -static uint64_t num_objects = 100000; +static uint64_t num_objects = 10000; static void test0() @@ -295,7 +303,7 @@ test0() FAIL("migration failure: " << status); } - std::cout << "Sleeping for 5 seconds for the migration to complete...\n"; + std::cout << "Sleeping for 10 seconds for the migration to complete...\n"; std::cout << "This could fail if your disk is too slow (i.e. if you are using a HDD).\n"; std::cout << "In this case, you could modify the test file to wait for longer.\n"; usleep(5 * 1000 * 1000); diff --git a/tools/rm-space.cc b/tools/rm-space.cc index 456fd23d0..a98e615d1 100644 --- a/tools/rm-space.cc +++ b/tools/rm-space.cc @@ -60,7 +60,22 @@ main(int argc, const char* argv[]) for (size_t i = 0; i < ap.args_sz(); ++i) { hyperdex_admin_returncode rrc; - int64_t rid = h.rm_space(ap.args()[i], &rrc); + + const char* space_name = ap.args()[i]; + uint16_t num_ongoing_migrations = h.num_ongoing_migrations(space_name); + + if (num_ongoing_migrations > 0) + { + std::cout << "There are currently " << num_ongoing_migrations << " ongoing migraitons that " + << "pertain to the space \"" << space_name << "\". Do you want to proceed to delete it? (Y/n)" << std::endl; + char c = getchar(); + if (!(c == 'y' || c == 'Y')) + { + continue; + } + } + + int64_t rid = h.rm_space(space_name, &rrc); if (rid < 0) { From cc6d1a980743b6aecc8b6e5958f2474742d9cbdf Mon Sep 17 00:00:00 2001 From: Derek Chiang Date: Thu, 22 May 2014 22:53:16 -0700 Subject: [PATCH 3/4] Remove useless log statements --- coordinator/coordinator.cc | 2 +- daemon/migration_manager.cc | 30 ++---------------------------- 2 files changed, 3 insertions(+), 29 deletions(-) diff --git a/coordinator/coordinator.cc b/coordinator/coordinator.cc index d883d36dd..c9ad9abf1 100644 --- a/coordinator/coordinator.cc +++ b/coordinator/coordinator.cc @@ -792,7 +792,7 @@ coordinator :: migration_complete(replicant_state_machine_context* ctx, m_migrations[m].outstanding_regions.erase(m_migrations[m].outstanding_regions.begin() + r); if (m_migrations[m].outstanding_regions.size() == 0) { - fprintf(log, "the migration is actually completed\n"); + fprintf(log, "completing migration %" PRIu64 "\n", m_migrations[m].id.get()); for (size_t j = m + 1; j < m_migrations.size(); ++j) { m_migrations[j - 1] = m_migrations[j]; diff --git a/daemon/migration_manager.cc b/daemon/migration_manager.cc index 7ad28b6ca..85e99a60e 100644 --- a/daemon/migration_manager.cc +++ b/daemon/migration_manager.cc @@ -128,9 +128,6 @@ migration_manager :: setup_migration_state(const std::vector >* migration_states) { std::vector > tmp; - // In reality, tmp probably will store way more elements than - // migrations, since one migration will likely correspond to - // many migration out states. tmp.reserve(migrations.size()); size_t m_idx = 0; size_t ms_idx = 0; @@ -145,7 +142,6 @@ migration_manager :: setup_migration_state(const std::vectormid) { while (ms_idx < migration_states->size() && migrations[m_idx].id == (*migration_states)[ms_idx]->mid) { - // LOG(INFO) << "pushing back old migration_states"; tmp.push_back((*migration_states)[ms_idx]); ++ms_idx; } @@ -157,15 +153,12 @@ migration_manager :: setup_migration_state(const std::vector (*migration_states)[ms_idx]->mid) { - // LOG(INFO) << "ending migration out state " << (*migration_states)[ms_idx]->mid; ++ms_idx; } } while (m_idx < migrations.size()) { - LOG(INFO) << "OMG initiating migration out state " << migrations[m_idx]; - std::vector::iterator r_iter; for (r_iter = regions.begin(); r_iter != regions.end(); r_iter++) { region_id rid = (*r_iter); @@ -213,7 +206,7 @@ migration_manager :: migrate_more_state(migration_out_state* mos) if (rc != datalayer::SUCCESS) { if (rc == datalayer::INVALID_REGION) - LOG(INFO) << "trying to send an object whose region no longer exists."; + LOG(ERROR) << "trying to send an object whose region no longer exists."; else LOG(ERROR) << "error unpacking value during migration"; break; @@ -225,7 +218,6 @@ migration_manager :: migrate_more_state(migration_out_state* mos) } if (mos->window.empty()) { - // LOG(INFO) << "completing the migration: " << mos->mid << " " << mos->rid; m_daemon->m_coord.migration_complete(mos->mid, mos->rid); } } @@ -246,11 +238,8 @@ migration_manager :: send_object(migration_out_state* mos, pending* op) virtual_server_id to = m_daemon->m_config.point_leader(mos->sid, op->key); const schema* sc = m_daemon->m_config.get_schema(op->rid); - // LOG(INFO) << "rid is: " << op->rid; if (sc == NULL) { - // TODO: this happens occationally. Not sure why. Possibly because the - // related space has been destroyed? - LOG(INFO) << "trying to send an object whose region no longer exists."; + LOG(ERROR) << "trying to send an object whose region no longer exists."; return; } std::vector funcs; @@ -291,40 +280,27 @@ migration_manager :: migration_ack(const server_id& from, uint64_t seq_no, uint16_t result) { - // LOG(INFO) << "acking " << rid << " " << seq_no; migration_out_state* mos = get_mos(rid); if (!mos) { - // TODO: it seems that sometimes we receive ACK for regions - // that have already been completely migrated. Why is that? - // Does that indicate a bug? - // LOG(INFO) << "dropping RESP_MIGRATION for " << rid << " which we don't know about."; - // LOG(INFO) << "fucking returning"; return; } po6::threads::mutex::hold hold(&mos->mtx); - // TODO: do we need to check if the ACK comes from the right server? - // The state transfer manager does that. - std::list >::iterator it; for (it = mos->window.begin(); it != mos->window.end(); ++it) { - // LOG(INFO) << "your seq: " << (*it)->seq_no << " my seq: " << seq_no; if ((*it)->seq_no == seq_no) { - // LOG(INFO) << "we found it!"; break; } } - // LOG(INFO) << "we are here"; if (it != mos->window.end()) { - // LOG(INFO) << "setting ack to true"; (*it)->acked = true; if (mos->window_sz < 1024) @@ -335,7 +311,6 @@ migration_manager :: migration_ack(const server_id& from, while (!mos->window.empty() && (*mos->window.begin())->acked) { - // LOG(INFO) << "popping object from window"; mos->window.pop_front(); } @@ -363,7 +338,6 @@ migration_manager :: remove_mos(region_id rid) { if (m_migrations_out[i]->rid == rid) { - LOG(INFO) << "erasing mos: " << rid; m_migrations_out.erase(m_migrations_out.begin() + i); } } From 26f2d7c5066ef4d7ab6b1f73c8ffa3f5c3c776fb Mon Sep 17 00:00:00 2001 From: Derek Chiang Date: Thu, 22 May 2014 22:57:05 -0700 Subject: [PATCH 4/4] Remove accidentally included file --- hyper.diff | 1203 ---------------------------------------------------- 1 file changed, 1203 deletions(-) delete mode 100644 hyper.diff diff --git a/hyper.diff b/hyper.diff deleted file mode 100644 index a4c88e743..000000000 --- a/hyper.diff +++ /dev/null @@ -1,1203 +0,0 @@ -diff --git a/.gitignore b/.gitignore -index c8a9772..597718e 100644 ---- a/.gitignore -+++ b/.gitignore -@@ -61,6 +61,7 @@ - /hyperdex-initiate-transfer - /hyperdex-kill - /hyperdex-list-spaces -+/hyperdex-migrate-data - /hyperdex-perf-counters - /hyperdex-raw-backup - /hyperdex-rm-space -@@ -89,4 +90,3 @@ - /test/search-stress-test - /test/simple-consistency-stress-test - /ylwrap --hyperdex-migrate-data -diff --git a/admin/admin.cc b/admin/admin.cc -index 886dbd2..7eb4044 100644 ---- a/admin/admin.cc -+++ b/admin/admin.cc -@@ -205,22 +205,20 @@ admin :: migrate_data(const char* space_from, const char* space_to, - int64_t id = m_next_admin_id; - ++m_next_admin_id; - e::intrusive_ptr op = new coord_rpc_generic(id, status, "migrate"); -- uint64_t space_from_sz = strlen(space_from); -- uint64_t space_to_sz = strlen(space_to); -+ uint32_t space_from_sz = strlen(space_from) + 1; -+ uint32_t space_to_sz = strlen(space_to) + 1; - - // Pack -- size_t total_sz = sizeof(uint64_t) * 2 + space_from_sz + space_to_sz; -- char buf[total_sz]; -- char* pos = buf; -- e::pack64be(space_from_sz, pos); -- pos += sizeof(uint64_t); -+ size_t total_sz = sizeof(uint32_t) * 2 + space_from_sz + space_to_sz; -+ std::vector buf(total_sz); -+ char* pos = &buf[0]; -+ pos = e::pack64be(space_from_sz, pos); - memcpy(pos, space_from, space_from_sz); - pos += space_from_sz; -- e::pack64be(space_to_sz, pos); -- pos += sizeof(uint64_t); -+ pos = e::pack64be(space_to_sz, pos); - memcpy(pos, space_to, space_to_sz); - -- int64_t cid = m_coord.rpc("migrate", buf, total_sz, -+ int64_t cid = m_coord.rpc("migrate", &buf[0], total_sz, - &op->repl_status, &op->repl_output, &op->repl_output_sz); - - if (cid >= 0) -diff --git a/bindings/__init__.py b/bindings/__init__.py -index a52901f..1d022b5 100644 ---- a/bindings/__init__.py -+++ b/bindings/__init__.py -@@ -70,6 +70,10 @@ class SpaceDescription(object): - args = (('const char*', 'description'),) - class SpaceList(object): - args = (('const char*', 'spaces'),) -+class SpaceFrom(object): -+ args = (('const char*', 'space_from'),) -+class SpaceTo(object): -+ args = (('const char*', 'space_to'),) - class Token(object): - args = (('uint64_t', 'token'),) - class Address(object): -@@ -167,6 +171,7 @@ Admin = [ - Method('add_space', AsyncCall, (SpaceDescription,), (AdminStatus,)), - Method('rm_space', AsyncCall, (SpaceName,), (AdminStatus,)), - Method('list_spaces', AsyncCall, (), (AdminStatus, SpaceList)), -+ Method('migrate_data', AsyncCall, (SpaceFrom, SpaceTo), (AdminStatus,)), - Method('server_register', AsyncCall, (Token, Address), (AdminStatus,)), - Method('server_online', AsyncCall, (Token,), (AdminStatus,)), - Method('server_offline', AsyncCall, (Token,), (AdminStatus,)), -diff --git a/common/network_msgtype.cc b/common/network_msgtype.cc -index 65d53cb..88b0dcb 100644 ---- a/common/network_msgtype.cc -+++ b/common/network_msgtype.cc -@@ -55,6 +55,8 @@ hyperdex :: operator << (std::ostream& lhs, const network_msgtype& rhs) - STRINGIFY(CHAIN_SUBSPACE); - STRINGIFY(CHAIN_ACK); - STRINGIFY(CHAIN_GC); -+ STRINGIFY(REQ_MIGRATION); -+ STRINGIFY(RESP_MIGRATION); - STRINGIFY(XFER_OP); - STRINGIFY(XFER_ACK); - STRINGIFY(XFER_HS); -diff --git a/common/network_msgtype.h b/common/network_msgtype.h -index 0fa1a10..26c80c0 100755 ---- a/common/network_msgtype.h -+++ b/common/network_msgtype.h -@@ -50,9 +50,6 @@ enum network_msgtype - RESP_SEARCH_ITEM = 35, - RESP_SEARCH_DONE = 36, - -- REQ_MIGRATION = 37, -- RESP_MIGRATION = 38, -- - REQ_SORTED_SEARCH = 40, - RESP_SORTED_SEARCH = 41, - -@@ -70,6 +67,9 @@ enum network_msgtype - CHAIN_ACK = 66, - CHAIN_GC = 67, - -+ REQ_MIGRATION = 78, -+ RESP_MIGRATION = 79, -+ - XFER_OP = 80, - XFER_ACK = 81, - XFER_HS = 82, // handshake syn -diff --git a/coordinator/transitions.cc b/coordinator/transitions.cc -index 269abd9..64fff03 100644 ---- a/coordinator/transitions.cc -+++ b/coordinator/transitions.cc -@@ -200,27 +200,23 @@ hyperdex_coordinator_migrate_data(struct replicant_state_machine_context* ctx, - PROTECT_UNINITIALIZED; - FILE* log = replicant_state_machine_log_stream(ctx); - coordinator* c = static_cast(obj); -+ e::slice space_from; -+ e::slice space_to; -+ e::unpacker up(data, data_sz); -+ up = up >> space_from >> space_to; -+ CHECK_UNPACK(migrate_data); -+ -+ if (space_from.empty() || space_to.empty() || -+ space_from.data()[space_from.size() - 1] != '\0' || -+ space_to.data()[space_to.size() - 1] != '\0') -+ { -+ fprintf(log, "received malformed \"migrate_data\" message\n"); \ -+ return generate_response(ctx, hyperdex::COORD_MALFORMED); \ -+ } - -- char* pos = const_cast(data); -- -- uint64_t space_from_sz; -- e::unpacker up_one(pos, sizeof(uint64_t)); -- up_one >> space_from_sz; -- pos += sizeof(uint64_t); -- char space_from[space_from_sz + 1]; -- memcpy(space_from, pos, space_from_sz); -- pos += space_from_sz; -- space_from[space_from_sz] = '\0'; -- -- uint64_t space_to_sz; -- e::unpacker up_two(pos, sizeof(uint64_t)); -- up_two >> space_to_sz; -- pos += sizeof(uint64_t); -- char space_to[space_to_sz + 1]; -- memcpy(space_to, pos, space_to_sz); -- space_to[space_to_sz] = '\0'; -- -- c->new_migration(ctx, space_from, space_to); -+ c->new_migration(ctx, -+ reinterpret_cast(space_from.data()), -+ reinterpret_cast(space_to.data())); - } - - void -diff --git a/doc/api/c.admin.tex b/doc/api/c.admin.tex -index b65be72..277df66 100644 ---- a/doc/api/c.admin.tex -+++ b/doc/api/c.admin.tex -@@ -222,6 +222,37 @@ int64_t hyperdex_admin_list_spaces(struct hyperdex_admin* admin, - \input{\topdir/api/fragments/c/admin/out_asynccall_spacelist} - \end{itemize} - -+%%%%%%%%%%%%%%%%%%%% migrate_data %%%%%%%%%%%%%%%%%%%% -+\pagebreak -+\subsubsection{\code{migrate\_data}} -+\label{api:c:migrate_data} -+\index{migrate\_data!C API} -+\input{\topdir/api/desc/migrate_data} -+ -+\paragraph{Definition:} -+\begin{ccode} -+int64_t hyperdex_admin_migrate_data(struct hyperdex_admin* admin, -+ const char* space_from, -+ const char* space_to, -+ enum hyperdex_admin_returncode* status); -+\end{ccode} -+ -+\paragraph{Parameters:} -+\begin{itemize}[noitemsep] -+\item \code{struct hyperdex\_admin* admin}\\ -+\input{\topdir/api/fragments/c/admin/in_asynccall_structadmin} -+\item \code{const char* space\_from}\\ -+\input{\topdir/api/fragments/c/admin/in_asynccall_spacefrom} -+\item \code{const char* space\_to}\\ -+\input{\topdir/api/fragments/c/admin/in_asynccall_spaceto} -+\end{itemize} -+ -+\paragraph{Returns:} -+\begin{itemize}[noitemsep] -+\item \code{enum hyperdex\_admin\_returncode* status}\\ -+\input{\topdir/api/fragments/c/admin/out_asynccall_adminstatus} -+\end{itemize} -+ - %%%%%%%%%%%%%%%%%%%% server_register %%%%%%%%%%%%%%%%%%%% - \pagebreak - \subsubsection{\code{server\_register}} -diff --git a/hyperdex-migrate b/hyperdex-migrate -deleted file mode 100755 -index 97402e3..0000000 ---- a/hyperdex-migrate -+++ /dev/null -@@ -1,228 +0,0 @@ --#! /bin/bash -- --# hyperdex-migrate - temporary wrapper script for .libs/hyperdex-migrate --# Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1.3ubuntu1 --# --# The hyperdex-migrate program cannot be directly executed until all the libtool --# libraries that it depends on are installed. --# --# This wrapper script should never be moved out of the build directory. --# If it is, it will not operate correctly. -- --# Sed substitution that helps us do robust quoting. It backslashifies --# metacharacters that are still active within double-quoted strings. --sed_quote_subst='s/\([`"$\\]\)/\\\1/g' -- --# Be Bourne compatible --if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then -- emulate sh -- NULLCMD=: -- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which -- # is contrary to our usage. Disable this feature. -- alias -g '${1+"$@"}'='"$@"' -- setopt NO_GLOB_SUBST --else -- case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac --fi --BIN_SH=xpg4; export BIN_SH # for Tru64 --DUALCASE=1; export DUALCASE # for MKS sh -- --# The HP-UX ksh and POSIX shell print the target directory to stdout --# if CDPATH is set. --(unset CDPATH) >/dev/null 2>&1 && unset CDPATH -- --relink_command="(cd /media/Work_Study/CS/workspace/HyperDex/HyperDex; { test -z \"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset COMPILER_PATH || { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z \"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; { test -z \"\${LD_LIBRARY_PATH+set}\" || unset LD_LIBRARY_PATH || { LD_LIBRARY_PATH=; export LD_LIBRARY_PATH; }; }; PATH=/home/derek/.rvm/gems/ruby-2.0.0-p0/bin:/home/derek/.rvm/gems/ruby-2.0.0-p0@global/bin:/home/derek/.rvm/rubies/ruby-2.0.0-p0/bin:/home/derek/.rvm/bin:/usr/lib/mipsel-linux/bin:/usr/local/heroku/bin:/home/derek/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/go/bin:/home/derek/go/bin:/home/derek/Dropbox/CS/workspace/go:/usr/lib/scala/bin:/usr/lib/akka/bin:/media/Work_Study/CS/workspace/Play:/home/derek/.cabal/bin:/usr/lib/vertx/bin:/usr/lib/jvm/jdk1.7.0/bin:/home/derek/Dropbox/CS/workspace/go/bin; export PATH; g++ -fvisibility=hidden -fvisibility-inlines-hidden -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -g -O2 -o \$progdir/\$file tools/migrate.o ./.libs/libhyperdex-admin.so /usr/lib/x86_64-linux-gnu/libpopt.so -Wl,-rpath -Wl,/media/Work_Study/CS/workspace/HyperDex/HyperDex/.libs)" -- --# This environment variable determines our operation mode. --if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then -- # install mode needs the following variables: -- generated_by_libtool_version='2.4.2' -- notinst_deplibs=' libhyperdex-admin.la' --else -- # When we are sourced in execute mode, $file and $ECHO are already set. -- if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then -- file="$0" -- --# A function that is used when there is no print builtin or printf. --func_fallback_echo () --{ -- eval 'cat <<_LTECHO_EOF --$1 --_LTECHO_EOF' --} -- ECHO="printf %s\\n" -- fi -- --# Very basic option parsing. These options are (a) specific to --# the libtool wrapper, (b) are identical between the wrapper --# /script/ and the wrapper /executable/ which is used only on --# windows platforms, and (c) all begin with the string --lt- --# (application programs are unlikely to have options which match --# this pattern). --# --# There are only two supported options: --lt-debug and --# --lt-dump-script. There is, deliberately, no --lt-help. --# --# The first argument to this parsing function should be the --# script's ./libtool value, followed by no. --lt_option_debug= --func_parse_lt_options () --{ -- lt_script_arg0=$0 -- shift -- for lt_opt -- do -- case "$lt_opt" in -- --lt-debug) lt_option_debug=1 ;; -- --lt-dump-script) -- lt_dump_D=`$ECHO "X$lt_script_arg0" | /bin/sed -e 's/^X//' -e 's%/[^/]*$%%'` -- test "X$lt_dump_D" = "X$lt_script_arg0" && lt_dump_D=. -- lt_dump_F=`$ECHO "X$lt_script_arg0" | /bin/sed -e 's/^X//' -e 's%^.*/%%'` -- cat "$lt_dump_D/$lt_dump_F" -- exit 0 -- ;; -- --lt-*) -- $ECHO "Unrecognized --lt- option: '$lt_opt'" 1>&2 -- exit 1 -- ;; -- esac -- done -- -- # Print the debug banner immediately: -- if test -n "$lt_option_debug"; then -- echo "hyperdex-migrate:hyperdex-migrate:${LINENO}: libtool wrapper (GNU libtool) 2.4.2 Debian-2.4.2-1.3ubuntu1" 1>&2 -- fi --} -- --# Used when --lt-debug. Prints its arguments to stdout --# (redirection is the responsibility of the caller) --func_lt_dump_args () --{ -- lt_dump_args_N=1; -- for lt_arg -- do -- $ECHO "hyperdex-migrate:hyperdex-migrate:${LINENO}: newargv[$lt_dump_args_N]: $lt_arg" -- lt_dump_args_N=`expr $lt_dump_args_N + 1` -- done --} -- --# Core function for launching the target application --func_exec_program_core () --{ -- -- if test -n "$lt_option_debug"; then -- $ECHO "hyperdex-migrate:hyperdex-migrate:${LINENO}: newargv[0]: $progdir/$program" 1>&2 -- func_lt_dump_args ${1+"$@"} 1>&2 -- fi -- exec "$progdir/$program" ${1+"$@"} -- -- $ECHO "$0: cannot exec $program $*" 1>&2 -- exit 1 --} -- --# A function to encapsulate launching the target application --# Strips options in the --lt-* namespace from $@ and --# launches target application with the remaining arguments. --func_exec_program () --{ -- case " $* " in -- *\ --lt-*) -- for lt_wr_arg -- do -- case $lt_wr_arg in -- --lt-*) ;; -- *) set x "$@" "$lt_wr_arg"; shift;; -- esac -- shift -- done ;; -- esac -- func_exec_program_core ${1+"$@"} --} -- -- # Parse options -- func_parse_lt_options "$0" ${1+"$@"} -- -- # Find the directory that this script lives in. -- thisdir=`$ECHO "$file" | /bin/sed 's%/[^/]*$%%'` -- test "x$thisdir" = "x$file" && thisdir=. -- -- # Follow symbolic links until we get to the real thisdir. -- file=`ls -ld "$file" | /bin/sed -n 's/.*-> //p'` -- while test -n "$file"; do -- destdir=`$ECHO "$file" | /bin/sed 's%/[^/]*$%%'` -- -- # If there was a directory component, then change thisdir. -- if test "x$destdir" != "x$file"; then -- case "$destdir" in -- [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;; -- *) thisdir="$thisdir/$destdir" ;; -- esac -- fi -- -- file=`$ECHO "$file" | /bin/sed 's%^.*/%%'` -- file=`ls -ld "$thisdir/$file" | /bin/sed -n 's/.*-> //p'` -- done -- -- # Usually 'no', except on cygwin/mingw when embedded into -- # the cwrapper. -- WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no -- if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then -- # special case for '.' -- if test "$thisdir" = "."; then -- thisdir=`pwd` -- fi -- # remove .libs from thisdir -- case "$thisdir" in -- *[\\/].libs ) thisdir=`$ECHO "$thisdir" | /bin/sed 's%[\\/][^\\/]*$%%'` ;; -- .libs ) thisdir=. ;; -- esac -- fi -- -- # Try to get the absolute directory name. -- absdir=`cd "$thisdir" && pwd` -- test -n "$absdir" && thisdir="$absdir" -- -- program=lt-'hyperdex-migrate' -- progdir="$thisdir/.libs" -- -- if test ! -f "$progdir/$program" || -- { file=`ls -1dt "$progdir/$program" "$progdir/../$program" 2>/dev/null | /bin/sed 1q`; \ -- test "X$file" != "X$progdir/$program"; }; then -- -- file="$$-$program" -- -- if test ! -d "$progdir"; then -- mkdir "$progdir" -- else -- rm -f "$progdir/$file" -- fi -- -- # relink executable if necessary -- if test -n "$relink_command"; then -- if relink_command_output=`eval $relink_command 2>&1`; then : -- else -- printf %s\n "$relink_command_output" >&2 -- rm -f "$progdir/$file" -- exit 1 -- fi -- fi -- -- mv -f "$progdir/$file" "$progdir/$program" 2>/dev/null || -- { rm -f "$progdir/$program"; -- mv -f "$progdir/$file" "$progdir/$program"; } -- rm -f "$progdir/$file" -- fi -- -- if test -f "$progdir/$program"; then -- if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then -- # Run the actual program with our arguments. -- func_exec_program ${1+"$@"} -- fi -- else -- # The program doesn't exist. -- $ECHO "$0: error: \`$progdir/$program' does not exist" 1>&2 -- $ECHO "This script is just a wrapper for $program." 1>&2 -- $ECHO "See the libtool documentation for more information." 1>&2 -- exit 1 -- fi --fi -diff --git a/m4/.gitignore b/m4/.gitignore -new file mode 100644 -index 0000000..e69de29 -diff --git a/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4 -new file mode 100644 -index 0000000..c3a8d69 ---- /dev/null -+++ b/m4/ax_check_compile_flag.m4 -@@ -0,0 +1,72 @@ -+# =========================================================================== -+# http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html -+# =========================================================================== -+# -+# SYNOPSIS -+# -+# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS]) -+# -+# DESCRIPTION -+# -+# Check whether the given FLAG works with the current language's compiler -+# or gives an error. (Warnings, however, are ignored) -+# -+# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on -+# success/failure. -+# -+# If EXTRA-FLAGS is defined, it is added to the current language's default -+# flags (e.g. CFLAGS) when the check is done. The check is thus made with -+# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to -+# force the compiler to issue an error when a bad flag is given. -+# -+# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this -+# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. -+# -+# LICENSE -+# -+# Copyright (c) 2008 Guido U. Draheim -+# Copyright (c) 2011 Maarten Bosmans -+# -+# This program is free software: you can redistribute it and/or modify it -+# under the terms of the GNU General Public License as published by the -+# Free Software Foundation, either version 3 of the License, or (at your -+# option) any later version. -+# -+# This program is distributed in the hope that it will be useful, but -+# WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -+# Public License for more details. -+# -+# You should have received a copy of the GNU General Public License along -+# with this program. If not, see . -+# -+# As a special exception, the respective Autoconf Macro's copyright owner -+# gives unlimited permission to copy, distribute and modify the configure -+# scripts that are the output of Autoconf when processing the Macro. You -+# need not follow the terms of the GNU General Public License when using -+# or distributing such scripts, even though portions of the text of the -+# Macro appear in them. The GNU General Public License (GPL) does govern -+# all other use of the material that constitutes the Autoconf Macro. -+# -+# This special exception to the GPL applies to versions of the Autoconf -+# Macro released by the Autoconf Archive. When you make and distribute a -+# modified version of the Autoconf Macro, you may extend this special -+# exception to the GPL to apply to your modified version as well. -+ -+#serial 2 -+ -+AC_DEFUN([AX_CHECK_COMPILE_FLAG], -+[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX -+AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl -+AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ -+ ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS -+ _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" -+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], -+ [AS_VAR_SET(CACHEVAR,[yes])], -+ [AS_VAR_SET(CACHEVAR,[no])]) -+ _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) -+AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes], -+ [m4_default([$2], :)], -+ [m4_default([$3], :)]) -+AS_VAR_POPDEF([CACHEVAR])dnl -+])dnl AX_CHECK_COMPILE_FLAGS -diff --git a/m4/ax_check_link_flag.m4 b/m4/ax_check_link_flag.m4 -new file mode 100644 -index 0000000..e2d0d36 ---- /dev/null -+++ b/m4/ax_check_link_flag.m4 -@@ -0,0 +1,71 @@ -+# =========================================================================== -+# http://www.gnu.org/software/autoconf-archive/ax_check_link_flag.html -+# =========================================================================== -+# -+# SYNOPSIS -+# -+# AX_CHECK_LINK_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS]) -+# -+# DESCRIPTION -+# -+# Check whether the given FLAG works with the linker or gives an error. -+# (Warnings, however, are ignored) -+# -+# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on -+# success/failure. -+# -+# If EXTRA-FLAGS is defined, it is added to the linker's default flags -+# when the check is done. The check is thus made with the flags: "LDFLAGS -+# EXTRA-FLAGS FLAG". This can for example be used to force the linker to -+# issue an error when a bad flag is given. -+# -+# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this -+# macro in sync with AX_CHECK_{PREPROC,COMPILE}_FLAG. -+# -+# LICENSE -+# -+# Copyright (c) 2008 Guido U. Draheim -+# Copyright (c) 2011 Maarten Bosmans -+# -+# This program is free software: you can redistribute it and/or modify it -+# under the terms of the GNU General Public License as published by the -+# Free Software Foundation, either version 3 of the License, or (at your -+# option) any later version. -+# -+# This program is distributed in the hope that it will be useful, but -+# WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -+# Public License for more details. -+# -+# You should have received a copy of the GNU General Public License along -+# with this program. If not, see . -+# -+# As a special exception, the respective Autoconf Macro's copyright owner -+# gives unlimited permission to copy, distribute and modify the configure -+# scripts that are the output of Autoconf when processing the Macro. You -+# need not follow the terms of the GNU General Public License when using -+# or distributing such scripts, even though portions of the text of the -+# Macro appear in them. The GNU General Public License (GPL) does govern -+# all other use of the material that constitutes the Autoconf Macro. -+# -+# This special exception to the GPL applies to versions of the Autoconf -+# Macro released by the Autoconf Archive. When you make and distribute a -+# modified version of the Autoconf Macro, you may extend this special -+# exception to the GPL to apply to your modified version as well. -+ -+#serial 2 -+ -+AC_DEFUN([AX_CHECK_LINK_FLAG], -+[AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_ldflags_$4_$1])dnl -+AC_CACHE_CHECK([whether the linker accepts $1], CACHEVAR, [ -+ ax_check_save_flags=$LDFLAGS -+ LDFLAGS="$LDFLAGS $4 $1" -+ AC_LINK_IFELSE([AC_LANG_PROGRAM()], -+ [AS_VAR_SET(CACHEVAR,[yes])], -+ [AS_VAR_SET(CACHEVAR,[no])]) -+ LDFLAGS=$ax_check_save_flags]) -+AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes], -+ [m4_default([$2], :)], -+ [m4_default([$3], :)]) -+AS_VAR_POPDEF([CACHEVAR])dnl -+])dnl AX_CHECK_LINK_FLAGS -diff --git a/m4/ax_check_preproc_flag.m4 b/m4/ax_check_preproc_flag.m4 -new file mode 100644 -index 0000000..b1cfef6 ---- /dev/null -+++ b/m4/ax_check_preproc_flag.m4 -@@ -0,0 +1,72 @@ -+# =========================================================================== -+# http://www.gnu.org/software/autoconf-archive/ax_check_preproc_flag.html -+# =========================================================================== -+# -+# SYNOPSIS -+# -+# AX_CHECK_PREPROC_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS]) -+# -+# DESCRIPTION -+# -+# Check whether the given FLAG works with the current language's -+# preprocessor or gives an error. (Warnings, however, are ignored) -+# -+# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on -+# success/failure. -+# -+# If EXTRA-FLAGS is defined, it is added to the preprocessor's default -+# flags when the check is done. The check is thus made with the flags: -+# "CPPFLAGS EXTRA-FLAGS FLAG". This can for example be used to force the -+# preprocessor to issue an error when a bad flag is given. -+# -+# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this -+# macro in sync with AX_CHECK_{COMPILE,LINK}_FLAG. -+# -+# LICENSE -+# -+# Copyright (c) 2008 Guido U. Draheim -+# Copyright (c) 2011 Maarten Bosmans -+# -+# This program is free software: you can redistribute it and/or modify it -+# under the terms of the GNU General Public License as published by the -+# Free Software Foundation, either version 3 of the License, or (at your -+# option) any later version. -+# -+# This program is distributed in the hope that it will be useful, but -+# WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -+# Public License for more details. -+# -+# You should have received a copy of the GNU General Public License along -+# with this program. If not, see . -+# -+# As a special exception, the respective Autoconf Macro's copyright owner -+# gives unlimited permission to copy, distribute and modify the configure -+# scripts that are the output of Autoconf when processing the Macro. You -+# need not follow the terms of the GNU General Public License when using -+# or distributing such scripts, even though portions of the text of the -+# Macro appear in them. The GNU General Public License (GPL) does govern -+# all other use of the material that constitutes the Autoconf Macro. -+# -+# This special exception to the GPL applies to versions of the Autoconf -+# Macro released by the Autoconf Archive. When you make and distribute a -+# modified version of the Autoconf Macro, you may extend this special -+# exception to the GPL to apply to your modified version as well. -+ -+#serial 2 -+ -+AC_DEFUN([AX_CHECK_PREPROC_FLAG], -+[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX -+AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]cppflags_$4_$1])dnl -+AC_CACHE_CHECK([whether _AC_LANG preprocessor accepts $1], CACHEVAR, [ -+ ax_check_save_flags=$CPPFLAGS -+ CPPFLAGS="$CPPFLAGS $4 $1" -+ AC_PREPROC_IFELSE([AC_LANG_PROGRAM()], -+ [AS_VAR_SET(CACHEVAR,[yes])], -+ [AS_VAR_SET(CACHEVAR,[no])]) -+ CPPFLAGS=$ax_check_save_flags]) -+AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes], -+ [m4_default([$2], :)], -+ [m4_default([$3], :)]) -+AS_VAR_POPDEF([CACHEVAR])dnl -+])dnl AX_CHECK_PREPROC_FLAGS -diff --git a/m4/ax_python_devel.m4 b/m4/ax_python_devel.m4 -new file mode 100644 -index 0000000..cf2163c ---- /dev/null -+++ b/m4/ax_python_devel.m4 -@@ -0,0 +1,324 @@ -+# =========================================================================== -+# http://www.gnu.org/software/autoconf-archive/ax_python_devel.html -+# =========================================================================== -+# -+# SYNOPSIS -+# -+# AX_PYTHON_DEVEL([version]) -+# -+# DESCRIPTION -+# -+# Note: Defines as a precious variable "PYTHON_VERSION". Don't override it -+# in your configure.ac. -+# -+# This macro checks for Python and tries to get the include path to -+# 'Python.h'. It provides the $(PYTHON_CPPFLAGS) and $(PYTHON_LDFLAGS) -+# output variables. It also exports $(PYTHON_EXTRA_LIBS) and -+# $(PYTHON_EXTRA_LDFLAGS) for embedding Python in your code. -+# -+# You can search for some particular version of Python by passing a -+# parameter to this macro, for example ">= '2.3.1'", or "== '2.4'". Please -+# note that you *have* to pass also an operator along with the version to -+# match, and pay special attention to the single quotes surrounding the -+# version number. Don't use "PYTHON_VERSION" for this: that environment -+# variable is declared as precious and thus reserved for the end-user. -+# -+# This macro should work for all versions of Python >= 2.1.0. As an end -+# user, you can disable the check for the python version by setting the -+# PYTHON_NOVERSIONCHECK environment variable to something else than the -+# empty string. -+# -+# If you need to use this macro for an older Python version, please -+# contact the authors. We're always open for feedback. -+# -+# LICENSE -+# -+# Copyright (c) 2009 Sebastian Huber -+# Copyright (c) 2009 Alan W. Irwin -+# Copyright (c) 2009 Rafael Laboissiere -+# Copyright (c) 2009 Andrew Collier -+# Copyright (c) 2009 Matteo Settenvini -+# Copyright (c) 2009 Horst Knorr -+# Copyright (c) 2013 Daniel Mullner -+# -+# This program is free software: you can redistribute it and/or modify it -+# under the terms of the GNU General Public License as published by the -+# Free Software Foundation, either version 3 of the License, or (at your -+# option) any later version. -+# -+# This program is distributed in the hope that it will be useful, but -+# WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -+# Public License for more details. -+# -+# You should have received a copy of the GNU General Public License along -+# with this program. If not, see . -+# -+# As a special exception, the respective Autoconf Macro's copyright owner -+# gives unlimited permission to copy, distribute and modify the configure -+# scripts that are the output of Autoconf when processing the Macro. You -+# need not follow the terms of the GNU General Public License when using -+# or distributing such scripts, even though portions of the text of the -+# Macro appear in them. The GNU General Public License (GPL) does govern -+# all other use of the material that constitutes the Autoconf Macro. -+# -+# This special exception to the GPL applies to versions of the Autoconf -+# Macro released by the Autoconf Archive. When you make and distribute a -+# modified version of the Autoconf Macro, you may extend this special -+# exception to the GPL to apply to your modified version as well. -+ -+#serial 16 -+ -+AU_ALIAS([AC_PYTHON_DEVEL], [AX_PYTHON_DEVEL]) -+AC_DEFUN([AX_PYTHON_DEVEL],[ -+ # -+ # Allow the use of a (user set) custom python version -+ # -+ AC_ARG_VAR([PYTHON_VERSION],[The installed Python -+ version to use, for example '2.3'. This string -+ will be appended to the Python interpreter -+ canonical name.]) -+ -+ AC_PATH_PROG([PYTHON],[python[$PYTHON_VERSION]]) -+ if test -z "$PYTHON"; then -+ AC_MSG_ERROR([Cannot find python$PYTHON_VERSION in your system path]) -+ PYTHON_VERSION="" -+ fi -+ -+ # -+ # Check for a version of Python >= 2.1.0 -+ # -+ AC_MSG_CHECKING([for a version of Python >= '2.1.0']) -+ ac_supports_python_ver=`$PYTHON -c "import sys; \ -+ ver = sys.version.split ()[[0]]; \ -+ print (ver >= '2.1.0')"` -+ if test "$ac_supports_python_ver" != "True"; then -+ if test -z "$PYTHON_NOVERSIONCHECK"; then -+ AC_MSG_RESULT([no]) -+ AC_MSG_FAILURE([ -+This version of the AC@&t@_PYTHON_DEVEL macro -+doesn't work properly with versions of Python before -+2.1.0. You may need to re-run configure, setting the -+variables PYTHON_CPPFLAGS, PYTHON_LDFLAGS, PYTHON_SITE_PKG, -+PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand. -+Moreover, to disable this check, set PYTHON_NOVERSIONCHECK -+to something else than an empty string. -+]) -+ else -+ AC_MSG_RESULT([skip at user request]) -+ fi -+ else -+ AC_MSG_RESULT([yes]) -+ fi -+ -+ # -+ # if the macro parameter ``version'' is set, honour it -+ # -+ if test -n "$1"; then -+ AC_MSG_CHECKING([for a version of Python $1]) -+ ac_supports_python_ver=`$PYTHON -c "import sys; \ -+ ver = sys.version.split ()[[0]]; \ -+ print (ver $1)"` -+ if test "$ac_supports_python_ver" = "True"; then -+ AC_MSG_RESULT([yes]) -+ else -+ AC_MSG_RESULT([no]) -+ AC_MSG_ERROR([this package requires Python $1. -+If you have it installed, but it isn't the default Python -+interpreter in your system path, please pass the PYTHON_VERSION -+variable to configure. See ``configure --help'' for reference. -+]) -+ PYTHON_VERSION="" -+ fi -+ fi -+ -+ # -+ # Check if you have distutils, else fail -+ # -+ AC_MSG_CHECKING([for the distutils Python package]) -+ ac_distutils_result=`$PYTHON -c "import distutils" 2>&1` -+ if test -z "$ac_distutils_result"; then -+ AC_MSG_RESULT([yes]) -+ else -+ AC_MSG_RESULT([no]) -+ AC_MSG_ERROR([cannot import Python module "distutils". -+Please check your Python installation. The error was: -+$ac_distutils_result]) -+ PYTHON_VERSION="" -+ fi -+ -+ # -+ # Check for Python include path -+ # -+ AC_MSG_CHECKING([for Python include path]) -+ if test -z "$PYTHON_CPPFLAGS"; then -+ python_path=`$PYTHON -c "import distutils.sysconfig; \ -+ print (distutils.sysconfig.get_python_inc ());"` -+ plat_python_path=`$PYTHON -c "import distutils.sysconfig; \ -+ print (distutils.sysconfig.get_python_inc (plat_specific=1));"` -+ if test -n "${python_path}"; then -+ if test "${plat_python_path}" != "${python_path}"; then -+ python_path="-I$python_path -I$plat_python_path" -+ else -+ python_path="-I$python_path" -+ fi -+ fi -+ PYTHON_CPPFLAGS=$python_path -+ fi -+ AC_MSG_RESULT([$PYTHON_CPPFLAGS]) -+ AC_SUBST([PYTHON_CPPFLAGS]) -+ -+ # -+ # Check for Python library path -+ # -+ AC_MSG_CHECKING([for Python library path]) -+ if test -z "$PYTHON_LDFLAGS"; then -+ # (makes two attempts to ensure we've got a version number -+ # from the interpreter) -+ ac_python_version=`cat<]], -+ [[Py_Initialize();]]) -+ ],[pythonexists=yes],[pythonexists=no]) -+ AC_LANG_POP([C]) -+ # turn back to default flags -+ CPPFLAGS="$ac_save_CPPFLAGS" -+ LIBS="$ac_save_LIBS" -+ -+ AC_MSG_RESULT([$pythonexists]) -+ -+ if test ! "x$pythonexists" = "xyes"; then -+ AC_MSG_FAILURE([ -+ Could not link test program to Python. Maybe the main Python library has been -+ installed in some non-standard library path. If so, pass it to configure, -+ via the LDFLAGS environment variable. -+ Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib" -+ ============================================================================ -+ ERROR! -+ You probably have to install the development version of the Python package -+ for your distribution. The exact name of this package varies among them. -+ ============================================================================ -+ ]) -+ PYTHON_VERSION="" -+ fi -+ -+ # -+ # all done! -+ # -+]) -diff --git a/test-driver b/test-driver -deleted file mode 100755 -index 32bf39e..0000000 ---- a/test-driver -+++ /dev/null -@@ -1,127 +0,0 @@ --#! /bin/sh --# test-driver - basic testsuite driver script. -- --scriptversion=2012-06-27.10; # UTC -- --# Copyright (C) 2011-2013 Free Software Foundation, Inc. --# --# This program is free software; you can redistribute it and/or modify --# it under the terms of the GNU General Public License as published by --# the Free Software Foundation; either version 2, or (at your option) --# any later version. --# --# This program is distributed in the hope that it will be useful, --# but WITHOUT ANY WARRANTY; without even the implied warranty of --# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --# GNU General Public License for more details. --# --# You should have received a copy of the GNU General Public License --# along with this program. If not, see . -- --# As a special exception to the GNU General Public License, if you --# distribute this file as part of a program that contains a --# configuration script generated by Autoconf, you may include it under --# the same distribution terms that you use for the rest of that program. -- --# This file is maintained in Automake, please report --# bugs to or send patches to --# . -- --# Make unconditional expansion of undefined variables an error. This --# helps a lot in preventing typo-related bugs. --set -u -- --usage_error () --{ -- echo "$0: $*" >&2 -- print_usage >&2 -- exit 2 --} -- --print_usage () --{ -- cat <$log_file 2>&1 --estatus=$? --if test $enable_hard_errors = no && test $estatus -eq 99; then -- estatus=1 --fi -- --case $estatus:$expect_failure in -- 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; -- 0:*) col=$grn res=PASS recheck=no gcopy=no;; -- 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; -- 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; -- *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; -- *:*) col=$red res=FAIL recheck=yes gcopy=yes;; --esac -- --# Report outcome to console. --echo "${col}${res}${std}: $test_name" -- --# Register the test result, and other relevant metadata. --echo ":test-result: $res" > $trs_file --echo ":global-test-result: $res" >> $trs_file --echo ":recheck: $recheck" >> $trs_file --echo ":copy-in-global-log: $gcopy" >> $trs_file -- --# Local Variables: --# mode: shell-script --# sh-indentation: 2 --# eval: (add-hook 'write-file-hooks 'time-stamp) --# time-stamp-start: "scriptversion=" --# time-stamp-format: "%:y-%02m-%02d.%02H" --# time-stamp-time-zone: "UTC" --# time-stamp-end: "; # UTC" --# End: -diff --git a/test/migration-test.cc b/test/migration-test.cc -index ffe109c..bfbaa34 100644 ---- a/test/migration-test.cc -+++ b/test/migration-test.cc -@@ -295,8 +295,10 @@ test0() - FAIL("migration failure: " << status); - } - -- std::cout << "Sleeping for 20 seconds for the migration to complete...\n"; -- usleep(20 * 1000 * 1000); -+ std::cout << "Sleeping for 5 seconds for the migration to complete...\n"; -+ std::cout << "This could fail if your disk is too slow (i.e. if you are using a HDD).\n"; -+ std::cout << "In this case, you could modify the test file to wait for longer.\n"; -+ usleep(5 * 1000 * 1000); - - read_and_verify_data(_space_to_name, num_objects); - -diff --git a/tools/migrate-data.cc b/tools/migrate-data.cc -index 9d247d3..50ef8cf 100644 ---- a/tools/migrate-data.cc -+++ b/tools/migrate-data.cc -@@ -1,4 +1,4 @@ --// Copyright (c) 2012, Cornell University -+// Copyright (c) 2014, Cornell University - // All rights reserved. - // - // Redistribution and use in source and binary forms, with or without -@@ -9,7 +9,7 @@ - // * Redistributions in binary form must reproduce the above copyright - // notice, this list of conditions and the following disclaimer in the - // documentation and/or other materials provided with the distribution. --// * Neither the name of Replicant nor the names of its contributors may be -+// * Neither the name of HyperDex nor the names of its contributors may be - // used to endorse or promote products derived from this software without - // specific prior written permission. - // -@@ -53,16 +53,15 @@ main(int argc, const char* argv[]) - return EXIT_FAILURE; - } - -- try -+ if (ap.args_sz() != 2) - { -- if (ap.args_sz() != 2) { -- std::cerr << "invalid arguments: expecting exactly two space names\n" << std::endl; -- ap.usage(); -- return EXIT_FAILURE; -- } -- -- -+ std::cerr << "invalid arguments: expecting exactly two space names\n" << std::endl; -+ ap.usage(); -+ return EXIT_FAILURE; -+ } - -+ try -+ { - hyperdex::Admin h(conn.host(), conn.port()); - hyperdex_admin_returncode rrc; - -@@ -91,7 +90,6 @@ main(int argc, const char* argv[]) - return EXIT_FAILURE; - } - -- std::cout << "migration in process..." << std::endl; - return EXIT_SUCCESS; - } - catch (std::exception& e)