summaryrefslogtreecommitdiffstats
path: root/src/common/io_exerciser/Model.h
blob: 58d107409a654d7e0b416105d1f3b5690086b6dd (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
#pragma once

#include "IoOp.h"

#include <boost/asio/io_context.hpp>

#include "librados/librados_asio.h"

#include "include/interval_set.h"
#include "global/global_init.h"
#include "global/global_context.h"
#include "common/Thread.h"

/* Overview
 *
 * class Model
 *   Virtual class. Models apply IoOps generated by an
 *   IoSequence, they can choose how many I/Os to execute in
 *   parallel and scale up the size of I/Os by the blocksize
 *
 */

namespace ceph {
  namespace io_exerciser {

    class Model
    {
    protected:
      int num_io{0};
      std::string oid;
      uint64_t block_size;

    public:
      Model(const std::string& oid, uint64_t block_size);
      virtual ~Model() = default;

      virtual bool readyForIoOp(IoOp& op) = 0;
      virtual void applyIoOp(IoOp& op) = 0;
      
      const std::string get_oid() const;
      const uint64_t get_block_size() const;
      int get_num_io() const;
    };

    /* Simple RADOS I/O generator */

    
  }
}