summaryrefslogtreecommitdiff
path: root/src/test/bench/rados_backend.h
blob: 911d6c7d487fc326c57fcbca3f3999c87f980610 (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
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-

#ifndef RADOSBACKENDH
#define RADOSBACKENDH

#include "backend.h"
#include "include/Context.h"
#include "include/rados/librados.hpp"

class RadosBackend : public Backend {
  librados::IoCtx *ioctx;
public:
  RadosBackend(
    librados::IoCtx *ioctx)
    : ioctx(ioctx) {}
  void write(
    const string &oid,
    uint64_t offset,
    const bufferlist &bl,
    Context *on_applied,
    Context *on_commit);

  void read(
    const string &oid,
    uint64_t offset,
    uint64_t length,
    bufferlist *bl,
    Context *on_complete);
};

#endif