]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rados: support python API of "set_osdmap_full_try" 17418/head
authorsongweibin <song.weibin@zte.com.cn>
Fri, 1 Sep 2017 07:59:09 +0000 (15:59 +0800)
committersongweibin <song.weibin@zte.com.cn>
Fri, 1 Sep 2017 08:30:42 +0000 (16:30 +0800)
Signed-off-by: songweibin <song.weibin@zte.com.cn>
src/include/rados/librados.h
src/librados/librados.cc
src/pybind/rados/rados.pyx

index 20af80d68a1f5dbb840d41ff5ef48747ad6322c0..44831cb5f3b820de65ce4f5b00844ffd4b241409 100644 (file)
@@ -3509,6 +3509,10 @@ CEPH_RADOS_API int rados_blacklist_add(rados_t cluster,
                                       char *client_address,
                                       uint32_t expire_seconds);
 
+CEPH_RADOS_API void rados_set_osdmap_full_try(rados_ioctx_t io);
+
+CEPH_RADOS_API void rados_unset_osdmap_full_try(rados_ioctx_t io);
+
 /**
  * Enable an application on a pool
  *
index f7683cdc19305020e7057d904af00a9419768dab..e9157abcf91ecdfc4f9a230dc2319550f1982e30 100644 (file)
@@ -3087,6 +3087,18 @@ extern "C" int rados_blacklist_add(rados_t cluster, char *client_address,
   return radosp->blacklist_add(client_address, expire_seconds);
 }
 
+extern "C" void rados_set_osdmap_full_try(rados_ioctx_t io)
+{
+  librados::IoCtxImpl *ctx = (librados::IoCtxImpl *)io;
+  ctx->objecter->set_osdmap_full_try();
+}
+
+extern "C" void rados_unset_osdmap_full_try(rados_ioctx_t io)
+{
+  librados::IoCtxImpl *ctx = (librados::IoCtxImpl *)io;
+  ctx->objecter->unset_osdmap_full_try();
+}
+
 extern "C" int rados_application_enable(rados_ioctx_t io, const char *app_name,
                                         int force)
 {
index d6a55e5fc32b7d5cd080a223a641087f679a7a36..dde4eb238a1344ea97445bf5bd4722791c526c03 100644 (file)
@@ -153,6 +153,8 @@ cdef extern from "rados/librados.h" nogil:
     int rados_blacklist_add(rados_t cluster, char *client_address, uint32_t expire_seconds)
     int rados_application_enable(rados_ioctx_t io, const char *app_name,
                                  int force)
+    void rados_set_osdmap_full_try(rados_ioctx_t io)
+    void rados_unset_osdmap_full_try(rados_ioctx_t io)
     int rados_application_list(rados_ioctx_t io, char *values,
                              size_t *values_len)
     int rados_application_metadata_get(rados_ioctx_t io, const char *app_name,
@@ -3576,6 +3578,20 @@ returned %d, but should return zero on success." % (self.name, ret))
         if ret < 0:
             raise make_ex(ret, "Ioctx.rados_lock_exclusive(%s): failed to set lock %s on %s" % (self.name, name, key))
 
+    def set_osdmap_full_try(self):
+        """
+        Set global osdmap_full_try label to true
+        """
+        with nogil:
+            rados_set_osdmap_full_try(self.io)
+
+    def unset_osdmap_full_try(self):
+        """
+        Unset
+        """
+        with nogil:
+            rados_unset_osdmap_full_try(self.io)
+
     def application_enable(self, app_name, force=False):
         """
         Enable an application on an OSD pool