hadoop-zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From he...@apache.org
Subject svn commit: r990941 - in /hadoop/zookeeper/trunk: CHANGES.txt src/contrib/zkpython/src/c/pyzk_docstrings.h src/contrib/zkpython/src/c/zookeeper.c
Date Mon, 30 Aug 2010 21:04:58 GMT
Author: henry
Date: Mon Aug 30 21:04:58 2010
New Revision: 990941

URL: http://svn.apache.org/viewvc?rev=990941&view=rev
Log:
ZOOKEEPER-853: Make zookeeper.is_unrecoverable return True or False in
zkpython

Modified:
    hadoop/zookeeper/trunk/CHANGES.txt
    hadoop/zookeeper/trunk/src/contrib/zkpython/src/c/pyzk_docstrings.h
    hadoop/zookeeper/trunk/src/contrib/zkpython/src/c/zookeeper.c

Modified: hadoop/zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/CHANGES.txt?rev=990941&r1=990940&r2=990941&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/CHANGES.txt (original)
+++ hadoop/zookeeper/trunk/CHANGES.txt Mon Aug 30 21:04:58 2010
@@ -114,6 +114,9 @@ IMPROVEMENTS:
 
   ZOOKEEPER-733. use netty to handle client connections (breed and phunt)
 
+  ZOOKEEPER-853. Make zookeeper.is_unrecoverable return True or False
+  in zkpython (Andrei Savu via henryr)
+
 NEW FEATURES:
   ZOOKEEPER-729. Java client API to recursively delete a subtree.
   (Kay Kay via henry)

Modified: hadoop/zookeeper/trunk/src/contrib/zkpython/src/c/pyzk_docstrings.h
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/zkpython/src/c/pyzk_docstrings.h?rev=990941&r1=990940&r2=990941&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/zkpython/src/c/pyzk_docstrings.h (original)
+++ hadoop/zookeeper/trunk/src/contrib/zkpython/src/c/pyzk_docstrings.h Mon Aug 30 21:04:58
2010
@@ -287,7 +287,7 @@ const char pyzk_is_unrecoverable_doc[] =
 " zh the zookeeper handle (see zookeeper.init)\n"
 "\n"
 "RETURNS:\n"
-  "INVALIDSTATE if connection is unrecoverable\n";
+  "True if connection is unrecoverable, otherwise False\n";
 
 const char pyzk_set_debug_level_doc[] = 
 "\brief sets the debugging level for the library \n"

Modified: hadoop/zookeeper/trunk/src/contrib/zkpython/src/c/zookeeper.c
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/zkpython/src/c/zookeeper.c?rev=990941&r1=990940&r2=990941&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/zkpython/src/c/zookeeper.c (original)
+++ hadoop/zookeeper/trunk/src/contrib/zkpython/src/c/zookeeper.c Mon Aug 30 21:04:58 2010
@@ -1387,7 +1387,7 @@ PyObject *pyzoo_recv_timeout(PyObject *s
   return Py_BuildValue("i",recv_timeout);  
 }
 
-/* Returns > 0 if connection is unrecoverable, 0 otherwise */
+/* Returns True if connection is unrecoverable, False otherwise */
 PyObject *pyis_unrecoverable(PyObject *self, PyObject *args)
 {
   int zkhid;
@@ -1395,7 +1395,9 @@ PyObject *pyis_unrecoverable(PyObject *s
     return NULL;
   CHECK_ZHANDLE(zkhid);
   int ret = is_unrecoverable(zhandles[zkhid]);
-  return Py_BuildValue("i",ret); // TODO: make this a boolean
+  if (ret > 0)
+    Py_RETURN_TRUE;
+  Py_RETURN_FALSE;
 }
 
 /* Set the debug level for logging, returns None */



Mime
View raw message