#pragma once
#include <ostream>
+#include <variant>
#include "common/ceph_context.h"
+#include "mon/MonClient.h"
#include "osd/scheduler/OpSchedulerItem.h"
namespace ceph::osd::scheduler {
using client = uint64_t;
+using WorkItem = std::variant<std::monostate, OpSchedulerItem, double>;
/**
* Base interface for classes responsible for choosing
virtual bool empty() const = 0;
// Return next op to be processed
- virtual OpSchedulerItem dequeue() = 0;
+ virtual WorkItem dequeue() = 0;
// Dump formatted representation for the queue
virtual void dump(ceph::Formatter &f) const = 0;
// Print human readable brief description with relevant parameters
virtual void print(std::ostream &out) const = 0;
+ // Apply config changes to the scheduler (if any)
+ virtual void update_configuration() = 0;
+
// Destructor
virtual ~OpScheduler() {};
};
std::ostream &operator<<(std::ostream &lhs, const OpScheduler &);
using OpSchedulerRef = std::unique_ptr<OpScheduler>;
-OpSchedulerRef make_scheduler(CephContext *cct);
+OpSchedulerRef make_scheduler(
+ CephContext *cct, int whoami, uint32_t num_shards, int shard_id,
+ bool is_rotational, std::string_view osd_objectstore, MonClient *monc);
/**
* Implements OpScheduler in terms of OpQueue
return queue.empty();
}
- OpSchedulerItem dequeue() final {
+ WorkItem dequeue() final {
return queue.dequeue();
}
out << ", cutoff=" << cutoff << ")";
}
+ void update_configuration() final {
+ // no-op
+ }
+
~ClassedOpQueueScheduler() final {};
};