rgw_acl.cc
rgw_acl_s3.cc
rgw_acl_swift.cc
+ rgw_aio_throttle.cc
rgw_auth.cc
rgw_auth_s3.cc
rgw_basic_types.cc
rgw_policy_s3.cc
rgw_putobj.cc
rgw_putobj_processor.cc
- rgw_putobj_throttle.cc
rgw_quota.cc
rgw_rados.cc
rgw_resolve.cc
--- /dev/null
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+/*
+ * Ceph - scalable distributed file system
+ *
+ * Copyright (C) 2018 Red Hat, Inc.
+ *
+ * This is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software
+ * Foundation. See file COPYING.
+ *
+ */
+
+#pragma once
+
+#include <boost/intrusive/list.hpp>
+#include "rgw_common.h"
+#include "services/svc_rados.h" // cant forward declare RGWSI_RADOS::Obj
+
+namespace librados {
+class ObjectReadOperation;
+class ObjectWriteOperation;
+}
+
+namespace rgw {
+
+struct AioResult {
+ rgw_raw_obj obj;
+ int result = 0;
+};
+struct AioResultEntry : AioResult, boost::intrusive::list_base_hook<> {
+ virtual ~AioResultEntry() {}
+};
+// a list of polymorphic entries that frees them on destruction
+template <typename T, typename ...Args>
+struct OwningList : boost::intrusive::list<T, Args...> {
+ OwningList() = default;
+ ~OwningList() { this->clear_and_dispose(std::default_delete<T>{}); }
+ OwningList(OwningList&&) = default;
+ OwningList& operator=(OwningList&&) = default;
+ OwningList(const OwningList&) = delete;
+ OwningList& operator=(const OwningList&) = delete;
+};
+using AioResultList = OwningList<AioResultEntry>;
+
+// returns the first error code or 0 if all succeeded
+inline int check_for_errors(const AioResultList& results) {
+ for (auto& e : results) {
+ if (e.result < 0) {
+ return e.result;
+ }
+ }
+ return 0;
+}
+
+// interface to submit async librados operations and wait on their completions.
+// each call returns a list of results from prior completions
+class Aio {
+ public:
+ virtual ~Aio() {}
+
+ virtual AioResultList submit(RGWSI_RADOS::Obj& obj,
+ const rgw_raw_obj& raw_obj,
+ librados::ObjectReadOperation *op,
+ bufferlist *data, uint64_t cost) = 0;
+
+ virtual AioResultList submit(RGWSI_RADOS::Obj& obj,
+ const rgw_raw_obj& raw_obj,
+ librados::ObjectWriteOperation *op,
+ uint64_t cost) = 0;
+
+ // poll for any ready completions without waiting
+ virtual AioResultList poll() = 0;
+
+ // return any ready completions. if there are none, wait for the next
+ virtual AioResultList wait() = 0;
+
+ // wait for all outstanding completions and return their results
+ virtual AioResultList drain() = 0;
+};
+
+} // namespace rgw
--- /dev/null
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+/*
+ * Ceph - scalable distributed file system
+ *
+ * Copyright (C) 2018 Red Hat, Inc.
+ *
+ * This is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software
+ * Foundation. See file COPYING.
+ *
+ */
+
+#include "include/rados/librados.hpp"
+
+#include "rgw_aio_throttle.h"
+#include "rgw_rados.h"
+
+namespace rgw {
+
+void AioThrottle::aio_cb(void *cb, void *arg)
+{
+ Pending& p = *static_cast<Pending*>(arg);
+ p.result = p.completion->get_return_value();
+ p.parent->put(p);
+}
+
+bool AioThrottle::waiter_ready() const
+{
+ switch (waiter) {
+ case Wait::Available: return is_available();
+ case Wait::Completion: return has_completion();
+ case Wait::Drained: return is_drained();
+ default: return false;
+ }
+}
+
+AioResultList AioThrottle::submit(RGWSI_RADOS::Obj& obj,
+ const rgw_raw_obj& raw_obj,
+ librados::ObjectWriteOperation *op,
+ uint64_t cost)
+{
+ auto p = std::make_unique<Pending>();
+ p->obj = raw_obj;
+ p->cost = cost;
+
+ if (cost > window) {
+ p->result = -EDEADLK; // would never succeed
+ completed.push_back(*p);
+ } else {
+ get(*p);
+ p->result = obj.aio_operate(p->completion, op);
+ if (p->result < 0) {
+ put(*p);
+ }
+ }
+ p.release();
+ return std::move(completed);
+}
+
+AioResultList AioThrottle::submit(RGWSI_RADOS::Obj& obj,
+ const rgw_raw_obj& raw_obj,
+ librados::ObjectReadOperation *op,
+ bufferlist *data, uint64_t cost)
+{
+ auto p = std::make_unique<Pending>();
+ p->obj = raw_obj;
+ p->cost = cost;
+
+ if (cost > window) {
+ p->result = -EDEADLK; // would never succeed
+ completed.push_back(*p);
+ } else {
+ get(*p);
+ p->result = obj.aio_operate(p->completion, op, data);
+ if (p->result < 0) {
+ put(*p);
+ }
+ }
+ p.release();
+ return std::move(completed);
+}
+
+void AioThrottle::get(Pending& p)
+{
+ std::unique_lock lock{mutex};
+
+ // wait for the write size to become available
+ pending_size += p.cost;
+ if (!is_available()) {
+ ceph_assert(waiter == Wait::None);
+ waiter = Wait::Available;
+ cond.wait(lock, [this] { return is_available(); });
+ waiter = Wait::None;
+ }
+
+ // register the pending write and attach a completion
+ p.parent = this;
+ p.completion = librados::Rados::aio_create_completion(&p, nullptr, aio_cb);
+ pending.push_back(p);
+}
+
+void AioThrottle::put(Pending& p)
+{
+ p.completion->release();
+ p.completion = nullptr;
+
+ std::scoped_lock lock{mutex};
+
+ // move from pending to completed
+ pending.erase(pending.iterator_to(p));
+ completed.push_back(p);
+
+ pending_size -= p.cost;
+
+ if (waiter_ready()) {
+ cond.notify_one();
+ }
+}
+
+AioResultList AioThrottle::poll()
+{
+ std::unique_lock lock{mutex};
+ return std::move(completed);
+}
+
+AioResultList AioThrottle::wait()
+{
+ std::unique_lock lock{mutex};
+ if (completed.empty() && !pending.empty()) {
+ ceph_assert(waiter == Wait::None);
+ waiter = Wait::Completion;
+ cond.wait(lock, [this] { return has_completion(); });
+ waiter = Wait::None;
+ }
+ return std::move(completed);
+}
+
+AioResultList AioThrottle::drain()
+{
+ std::unique_lock lock{mutex};
+ if (!pending.empty()) {
+ ceph_assert(waiter == Wait::None);
+ waiter = Wait::Drained;
+ cond.wait(lock, [this] { return is_drained(); });
+ waiter = Wait::None;
+ }
+ return std::move(completed);
+}
+
+} // namespace rgw
--- /dev/null
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+/*
+ * Ceph - scalable distributed file system
+ *
+ * Copyright (C) 2018 Red Hat, Inc.
+ *
+ * This is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software
+ * Foundation. See file COPYING.
+ *
+ */
+
+#pragma once
+
+#include <memory>
+#include "common/ceph_mutex.h"
+#include "services/svc_rados.h"
+#include "rgw_aio.h"
+
+namespace librados {
+class AioCompletion;
+}
+
+namespace rgw {
+
+// a throttle for aio operations that enforces a maximum window on outstanding
+// bytes. only supports a single waiter, so all public functions must be called
+// from the same thread
+class AioThrottle : public Aio {
+ protected:
+ const uint64_t window;
+ uint64_t pending_size = 0;
+
+ bool is_available() const { return pending_size <= window; }
+ bool has_completion() const { return !completed.empty(); }
+ bool is_drained() const { return pending.empty(); }
+
+ struct Pending : AioResultEntry {
+ AioThrottle *parent = nullptr;
+ uint64_t cost = 0;
+ librados::AioCompletion *completion = nullptr;
+ };
+ OwningList<Pending> pending;
+ AioResultList completed;
+
+ enum class Wait { None, Available, Completion, Drained };
+ Wait waiter = Wait::None;
+
+ bool waiter_ready() const;
+
+ ceph::mutex mutex = ceph::make_mutex("AioThrottle");
+ ceph::condition_variable cond;
+
+ void get(Pending& p);
+ void put(Pending& p);
+
+ static void aio_cb(void *cb, void *arg);
+
+ public:
+ AioThrottle(uint64_t window) : window(window) {}
+
+ virtual ~AioThrottle() {
+ // must drain before destructing
+ ceph_assert(pending.empty());
+ ceph_assert(completed.empty());
+ }
+
+ AioResultList submit(RGWSI_RADOS::Obj& obj, const rgw_raw_obj& raw_obj,
+ librados::ObjectReadOperation *op,
+ bufferlist *data, uint64_t cost) override;
+
+ AioResultList submit(RGWSI_RADOS::Obj& obj, const rgw_raw_obj& raw_obj,
+ librados::ObjectWriteOperation *op,
+ uint64_t cost) override;
+
+ AioResultList poll() override;
+
+ AioResultList wait() override;
+
+ AioResultList drain() override;
+};
+
+} // namespace rgw
#include "rgw_ldap.h"
#include "rgw_token.h"
#include "rgw_putobj_processor.h"
-#include "rgw_putobj_throttle.h"
+#include "rgw_aio_throttle.h"
#include "rgw_compression.h"
const std::string& bucket_name;
const std::string& obj_name;
RGWFileHandle* rgw_fh;
- std::optional<rgw::putobj::AioThrottle> aio;
+ std::optional<rgw::AioThrottle> aio;
std::optional<rgw::putobj::AtomicObjectProcessor> processor;
rgw::putobj::DataProcessor* filter;
boost::optional<RGWPutObj_Compress> compressor;
#include "rgw_acl.h"
#include "rgw_acl_s3.h"
#include "rgw_acl_swift.h"
+#include "rgw_aio_throttle.h"
#include "rgw_user.h"
#include "rgw_bucket.h"
#include "rgw_log.h"
#include "rgw_role.h"
#include "rgw_tag_s3.h"
#include "rgw_putobj_processor.h"
-#include "rgw_putobj_throttle.h"
#include "services/svc_zone.h"
#include "services/svc_quota.h"
}
// create the object processor
+ rgw::AioThrottle aio(store->ctx()->_conf->rgw_put_obj_min_window_size);
using namespace rgw::putobj;
- AioThrottle aio(store->ctx()->_conf->rgw_put_obj_min_window_size);
constexpr auto max_processor_size = std::max(sizeof(MultipartObjectProcessor),
sizeof(AtomicObjectProcessor));
ceph::static_ptr<ObjectProcessor, max_processor_size> processor;
store->gen_rand_obj_instance_name(&obj);
}
+ rgw::AioThrottle aio(s->cct->_conf->rgw_put_obj_min_window_size);
using namespace rgw::putobj;
- AioThrottle aio(s->cct->_conf->rgw_put_obj_min_window_size);
AtomicObjectProcessor processor(&aio, store, s->bucket_info,
s->bucket_owner.get_id(),
*static_cast<RGWObjectCtx*>(s->obj_ctx),
store->gen_rand_obj_instance_name(&obj);
}
+ rgw::AioThrottle aio(store->ctx()->_conf->rgw_put_obj_min_window_size);
using namespace rgw::putobj;
- AioThrottle aio(store->ctx()->_conf->rgw_put_obj_min_window_size);
AtomicObjectProcessor processor(&aio, store, binfo, bowner.get_id(),
obj_ctx, obj, 0, s->req_id);
+++ /dev/null
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
-// vim: ts=8 sw=2 smarttab
-/*
- * Ceph - scalable distributed file system
- *
- * Copyright (C) 2018 Red Hat, Inc.
- *
- * This is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software
- * Foundation. See file COPYING.
- *
- */
-
-#pragma once
-
-#include <boost/intrusive/list.hpp>
-#include "rgw_common.h"
-#include "services/svc_rados.h" // cant forward declare RGWSI_RADOS::Obj
-
-namespace librados {
-class ObjectReadOperation;
-class ObjectWriteOperation;
-}
-
-namespace rgw::putobj {
-
-struct Result {
- rgw_raw_obj obj;
- int result = 0;
-};
-struct ResultEntry : Result, boost::intrusive::list_base_hook<> {
- virtual ~ResultEntry() {}
-};
-// a list of polymorphic entries that frees them on destruction
-template <typename T, typename ...Args>
-struct OwningList : boost::intrusive::list<T, Args...> {
- OwningList() = default;
- ~OwningList() { this->clear_and_dispose(std::default_delete<T>{}); }
- OwningList(OwningList&&) = default;
- OwningList& operator=(OwningList&&) = default;
- OwningList(const OwningList&) = delete;
- OwningList& operator=(const OwningList&) = delete;
-};
-using ResultList = OwningList<ResultEntry>;
-
-// returns the first error code or 0 if all succeeded
-inline int check_for_errors(const ResultList& results) {
- for (auto& e : results) {
- if (e.result < 0) {
- return e.result;
- }
- }
- return 0;
-}
-
-// interface to submit async librados operations and wait on their completions.
-// each call returns a list of results from prior completions
-class Aio {
- public:
- virtual ~Aio() {}
-
- virtual ResultList submit(RGWSI_RADOS::Obj& obj,
- const rgw_raw_obj& raw_obj,
- librados::ObjectReadOperation *op,
- bufferlist *data, uint64_t cost) = 0;
-
- virtual ResultList submit(RGWSI_RADOS::Obj& obj,
- const rgw_raw_obj& raw_obj,
- librados::ObjectWriteOperation *op,
- uint64_t cost) = 0;
-
- // poll for any ready completions without waiting
- virtual ResultList poll() = 0;
-
- // return any ready completions. if there are none, wait for the next
- virtual ResultList wait() = 0;
-
- // wait for all outstanding completions and return their results
- virtual ResultList drain() = 0;
-};
-
-} // namespace rgw::putobj
*
*/
-#include "rgw_putobj_aio.h"
+#include "rgw_aio.h"
#include "rgw_putobj_processor.h"
#include "rgw_multi.h"
#include "services/svc_sys_obj.h"
}
-static int process_completed(const ResultList& completed, RawObjSet *written)
+static int process_completed(const AioResultList& completed, RawObjSet *written)
{
std::optional<int> error;
for (auto& r : completed) {
#include "rgw_rados.h"
#include "services/svc_rados.h"
-namespace rgw::putobj {
+namespace rgw {
+
+class Aio;
+
+namespace putobj {
// a data consumer that writes an object in a bucket
class ObjectProcessor : public DataProcessor {
};
-class Aio;
using RawObjSet = std::set<rgw_raw_obj>;
// a data sink that writes to rados objects and deletes them on cancelation
rgw_zone_set *zones_trace, bool *canceled) override;
};
-} // namespace rgw::putobj
+} // namespace putobj
+} // namespace rgw
+++ /dev/null
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
-// vim: ts=8 sw=2 smarttab
-/*
- * Ceph - scalable distributed file system
- *
- * Copyright (C) 2018 Red Hat, Inc.
- *
- * This is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software
- * Foundation. See file COPYING.
- *
- */
-
-#include "include/rados/librados.hpp"
-
-#include "rgw_putobj_throttle.h"
-#include "rgw_rados.h"
-
-namespace rgw::putobj {
-
-void AioThrottle::aio_cb(void *cb, void *arg)
-{
- Pending& p = *static_cast<Pending*>(arg);
- p.result = p.completion->get_return_value();
- p.parent->put(p);
-}
-
-bool AioThrottle::waiter_ready() const
-{
- switch (waiter) {
- case Wait::Available: return is_available();
- case Wait::Completion: return has_completion();
- case Wait::Drained: return is_drained();
- default: return false;
- }
-}
-
-ResultList AioThrottle::submit(RGWSI_RADOS::Obj& obj,
- const rgw_raw_obj& raw_obj,
- librados::ObjectWriteOperation *op,
- uint64_t cost)
-{
- auto p = std::make_unique<Pending>();
- p->obj = raw_obj;
- p->cost = cost;
-
- if (cost > window) {
- p->result = -EDEADLK; // would never succeed
- completed.push_back(*p);
- } else {
- get(*p);
- p->result = obj.aio_operate(p->completion, op);
- if (p->result < 0) {
- put(*p);
- }
- }
- p.release();
- return std::move(completed);
-}
-
-ResultList AioThrottle::submit(RGWSI_RADOS::Obj& obj,
- const rgw_raw_obj& raw_obj,
- librados::ObjectReadOperation *op,
- bufferlist *data, uint64_t cost)
-{
- auto p = std::make_unique<Pending>();
- p->obj = raw_obj;
- p->cost = cost;
-
- if (cost > window) {
- p->result = -EDEADLK; // would never succeed
- completed.push_back(*p);
- } else {
- get(*p);
- p->result = obj.aio_operate(p->completion, op, data);
- if (p->result < 0) {
- put(*p);
- }
- }
- p.release();
- return std::move(completed);
-}
-
-void AioThrottle::get(Pending& p)
-{
- std::unique_lock lock{mutex};
-
- // wait for the write size to become available
- pending_size += p.cost;
- if (!is_available()) {
- ceph_assert(waiter == Wait::None);
- waiter = Wait::Available;
- cond.wait(lock, [this] { return is_available(); });
- waiter = Wait::None;
- }
-
- // register the pending write and attach a completion
- p.parent = this;
- p.completion = librados::Rados::aio_create_completion(&p, nullptr, aio_cb);
- pending.push_back(p);
-}
-
-void AioThrottle::put(Pending& p)
-{
- p.completion->release();
- p.completion = nullptr;
-
- std::scoped_lock lock{mutex};
-
- // move from pending to completed
- pending.erase(pending.iterator_to(p));
- completed.push_back(p);
-
- pending_size -= p.cost;
-
- if (waiter_ready()) {
- cond.notify_one();
- }
-}
-
-ResultList AioThrottle::poll()
-{
- std::unique_lock lock{mutex};
- return std::move(completed);
-}
-
-ResultList AioThrottle::wait()
-{
- std::unique_lock lock{mutex};
- if (completed.empty() && !pending.empty()) {
- ceph_assert(waiter == Wait::None);
- waiter = Wait::Completion;
- cond.wait(lock, [this] { return has_completion(); });
- waiter = Wait::None;
- }
- return std::move(completed);
-}
-
-ResultList AioThrottle::drain()
-{
- std::unique_lock lock{mutex};
- if (!pending.empty()) {
- ceph_assert(waiter == Wait::None);
- waiter = Wait::Drained;
- cond.wait(lock, [this] { return is_drained(); });
- waiter = Wait::None;
- }
- return std::move(completed);
-}
-
-} // namespace rgw::putobj
+++ /dev/null
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
-// vim: ts=8 sw=2 smarttab
-/*
- * Ceph - scalable distributed file system
- *
- * Copyright (C) 2018 Red Hat, Inc.
- *
- * This is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software
- * Foundation. See file COPYING.
- *
- */
-
-#pragma once
-
-#include <memory>
-#include "common/ceph_mutex.h"
-#include "services/svc_rados.h"
-#include "rgw_putobj_aio.h"
-
-namespace librados {
-class AioCompletion;
-}
-
-namespace rgw::putobj {
-
-// a throttle for aio operations that enforces a maximum window on outstanding
-// bytes. only supports a single waiter, so all public functions must be called
-// from the same thread
-class AioThrottle : public Aio {
- protected:
- const uint64_t window;
- uint64_t pending_size = 0;
-
- bool is_available() const { return pending_size <= window; }
- bool has_completion() const { return !completed.empty(); }
- bool is_drained() const { return pending.empty(); }
-
- struct Pending : ResultEntry {
- AioThrottle *parent = nullptr;
- uint64_t cost = 0;
- librados::AioCompletion *completion = nullptr;
- };
- OwningList<Pending> pending;
- ResultList completed;
-
- enum class Wait { None, Available, Completion, Drained };
- Wait waiter = Wait::None;
-
- bool waiter_ready() const;
-
- ceph::mutex mutex = ceph::make_mutex("AioThrottle");
- ceph::condition_variable cond;
-
- void get(Pending& p);
- void put(Pending& p);
-
- static void aio_cb(void *cb, void *arg);
-
- public:
- AioThrottle(uint64_t window) : window(window) {}
-
- virtual ~AioThrottle() {
- // must drain before destructing
- ceph_assert(pending.empty());
- ceph_assert(completed.empty());
- }
-
- ResultList submit(RGWSI_RADOS::Obj& obj, const rgw_raw_obj& raw_obj,
- librados::ObjectReadOperation *op,
- bufferlist *data, uint64_t cost) override;
-
- ResultList submit(RGWSI_RADOS::Obj& obj, const rgw_raw_obj& raw_obj,
- librados::ObjectWriteOperation *op,
- uint64_t cost) override;
-
- ResultList poll() override;
-
- ResultList wait() override;
-
- ResultList drain() override;
-};
-
-} // namespace rgw::putobj
#include "rgw_cache.h"
#include "rgw_acl.h"
#include "rgw_acl_s3.h" /* for dumping s3policy in debug log */
+#include "rgw_aio_throttle.h"
#include "rgw_bucket.h"
#include "rgw_rest_conn.h"
#include "rgw_cr_rados.h"
#include "rgw_cr_rest.h"
#include "rgw_putobj_processor.h"
-#include "rgw_putobj_throttle.h"
#include "cls/rgw/cls_rgw_ops.h"
#include "cls/rgw/cls_rgw_client.h"
obj_time_weight set_mtime_weight;
set_mtime_weight.high_precision = high_precision_time;
+ rgw::AioThrottle aio(cct->_conf->rgw_put_obj_min_window_size);
using namespace rgw::putobj;
- AioThrottle aio(cct->_conf->rgw_put_obj_min_window_size);
AtomicObjectProcessor processor(&aio, this, dest_bucket_info, user_id,
obj_ctx, dest_obj, olh_epoch, tag);
int ret = processor.prepare();
string tag;
append_rand_alpha(cct, tag, tag, 32);
+ rgw::AioThrottle aio(cct->_conf->rgw_put_obj_min_window_size);
using namespace rgw::putobj;
- AioThrottle aio(cct->_conf->rgw_put_obj_min_window_size);
AtomicObjectProcessor processor(&aio, this, dest_bucket_info,
dest_bucket_info.owner, obj_ctx,
dest_obj, olh_epoch, tag);
*
*/
-#include "rgw/rgw_putobj_throttle.h"
+#include "rgw/rgw_aio_throttle.h"
#include "rgw/rgw_rados.h"
#include "include/rados/librados.hpp"
}
};
-using PutObj_Throttle = RadosFixture;
+using Aio_Throttle = RadosFixture;
-namespace rgw::putobj {
+namespace rgw {
-inline bool operator==(const Result& lhs, const Result& rhs) {
+inline bool operator==(const AioResult& lhs, const AioResult& rhs) {
return lhs.obj == rhs.obj && lhs.result == rhs.result;
}
-std::ostream& operator<<(std::ostream& out, const Result& r) {
+std::ostream& operator<<(std::ostream& out, const AioResult& r) {
return out << "{r=" << r.result << " obj='" << r.obj << "'";
}
-TEST_F(PutObj_Throttle, NoThrottleUpToMax)
+TEST_F(Aio_Throttle, NoThrottleUpToMax)
{
AioThrottle throttle(4);
auto raw = make_raw_obj(__PRETTY_FUNCTION__);
auto completions = throttle.drain();
ASSERT_EQ(4u, completions.size());
for (auto& c : completions) {
- EXPECT_EQ(Result({raw, -EINVAL}), c);
+ EXPECT_EQ(AioResult({raw, -EINVAL}), c);
}
}
-TEST_F(PutObj_Throttle, CostOverWindow)
+TEST_F(Aio_Throttle, CostOverWindow)
{
AioThrottle throttle(4);
auto raw = make_raw_obj(__PRETTY_FUNCTION__);
librados::ObjectWriteOperation op;
auto c = throttle.submit(obj, raw, &op, 8);
ASSERT_EQ(1u, c.size());
- EXPECT_EQ(Result({raw, -EDEADLK}), c.front());
+ EXPECT_EQ(AioResult({raw, -EDEADLK}), c.front());
}
-TEST_F(PutObj_Throttle, AioThrottleOverMax)
+TEST_F(Aio_Throttle, ThrottleOverMax)
{
constexpr uint64_t window = 4;
AioThrottle throttle(window);
EXPECT_EQ(window, max_outstanding);
}
-} // namespace rgw::putobj
+} // namespace rgw