* @returns -ERANGE if the version of the object is greater than ver
*/
CEPH_RADOS_API int rados_watch(rados_ioctx_t io, const char *o, uint64_t ver,
- uint64_t *handle, rados_watchcb_t watchcb,
- void *arg);
+ uint64_t *handle,
+ rados_watchcb_t watchcb, void *arg)
+ __attribute__((deprecated));
/**
* @returns 0 on success, negative error code on failure
*/
CEPH_RADOS_API int rados_notify(rados_ioctx_t io, const char *o, uint64_t ver,
- const char *buf, int buf_len);
+ const char *buf, int buf_len)
+ __attribute__((deprecated));
/**
* Sychronously notify watchers of an object
bufferlist *pbl);
// watch/notify
- int watch(const std::string& o, uint64_t ver, uint64_t *handle,
- librados::WatchCtx *ctx) __attribute__ ((deprecated));
int watch2(const std::string& o, uint64_t *handle,
librados::WatchCtx2 *ctx);
int unwatch(const std::string& o, uint64_t handle);
- int notify(const std::string& o, uint64_t ver, bufferlist& bl) __attribute__ ((deprecated));
int notify2(const std::string& o, ///< object
bufferlist& bl, ///< optional broadcast payload
uint64_t timeout_ms, ///< timeout (in ms)
uint64_t handle, ///< our watch handle
bufferlist& bl); ///< optional reply payload
+ // old, deprecated versions
+ int watch(const std::string& o, uint64_t ver, uint64_t *handle,
+ librados::WatchCtx *ctx) __attribute__ ((deprecated));
+ int notify(const std::string& o, uint64_t ver, bufferlist& bl)
+ __attribute__ ((deprecated));
+
/**
* Set allocation hint for an object
*
// --
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+
TEST_F(LibRadosWatchNotify, WatchNotify) {
ASSERT_EQ(0, sem_init(&sem, 0, 0));
char buf[128];
ASSERT_EQ(0, ioctx.unwatch("foo", handle));
}
+#pragma GCC diagnostic pop
+
// --
}
};
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+
void
test_loop(Rados &cluster, std::string pool_name, std::string obj_name)
{
ioctx.close();
}
+#pragma GCC diagnostic pop
+
void
test_replicated(Rados &cluster, std::string pool_name, std::string obj_name)
{
{
}
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+
int StRadosNotify::run()
{
rados_t cl;
return 0;
}
+
+#pragma GCC diagnostic pop
{
}
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+
int StRadosWatch::
run()
{
return r;
}
+
+#pragma GCC diagnostic pop
}
};
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+
struct WatcherUnwatcher : public Thread {
string pool;
WatcherUnwatcher(string& _pool) : pool(_pool) {}
ASSERT_EQ(0, destroy_one_pool_pp(pool_name, ncluster));
sem_destroy(&sem);
}
+
+#pragma GCC diagnostic pop