summaryrefslogtreecommitdiffstats
path: root/src/osd/mClockOpClassQueue.cc
blob: ccaf98f0f22e7bb20f34e55ee7fe38f971e0123c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// -*- 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) 2016 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 <memory>

#include "osd/mClockOpClassQueue.h"
#include "common/dout.h"

namespace dmc = crimson::dmclock;
using namespace std::placeholders;

#define dout_context cct
#define dout_subsys ceph_subsys_osd
#undef dout_prefix
#define dout_prefix *_dout


namespace ceph {

  /*
   * class mClockOpClassQueue
   */

  mClockOpClassQueue::mClockOpClassQueue(CephContext *cct) :
    queue(std::bind(&mClockOpClassQueue::op_class_client_info_f, this, _1),
	  cct->_conf->osd_op_queue_mclock_anticipation_timeout),
    client_info_mgr(cct)
  {
    // empty
  }

  const dmc::ClientInfo* mClockOpClassQueue::op_class_client_info_f(
    const osd_op_type_t& op_type)
  {
    return client_info_mgr.get_client_info(op_type);
  }

  // Formatted output of the queue
  void mClockOpClassQueue::dump(ceph::Formatter *f) const {
    queue.dump(f);
  }
} // namespace ceph