]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/osd/scheduler/OpScheduler.h
import ceph quincy 17.2.6
[ceph.git] / ceph / src / osd / scheduler / OpScheduler.h
index 4f95dfe1da2b623057f9661a2698adfa89264775..1575bcae4f6d9cb845d50c5360608be9058b1efa 100644 (file)
 #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
@@ -40,7 +43,7 @@ public:
   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;
@@ -48,6 +51,9 @@ public:
   // 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() {};
 };
@@ -55,7 +61,9 @@ public:
 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
@@ -117,7 +125,7 @@ public:
     return queue.empty();
   }
 
-  OpSchedulerItem dequeue() final {
+  WorkItem dequeue() final {
     return queue.dequeue();
   }
 
@@ -131,6 +139,10 @@ public:
     out << ", cutoff=" << cutoff << ")";
   }
 
+  void update_configuration() final {
+    // no-op
+  }
+
   ~ClassedOpQueueScheduler() final {};
 };