aboutsummaryrefslogtreecommitdiffstats
path: root/ydb/library/pdisk_io/spdk_state.h
blob: 2129a325da6eafe94837045d9104172c8b68e319 (plain) (blame)
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
#pragma once

#include <util/system/yassert.h>

namespace NKikimr::NPDisk {

class ISpdkState {
public:
    virtual void LaunchThread(int (*fn)(void *), void *cookie) = 0;
    virtual ui8 *Malloc(ui64 size, ui32 align) = 0;
    virtual void Free(ui8 *buff) = 0;
    //virtual ui64 GetDeviceSize() = 0;
    virtual void WaitAllThreads() = 0;
    virtual ~ISpdkState() {};
};

class TSpdkStateOSS : public ISpdkState {
public:
    TSpdkStateOSS() {}

    void LaunchThread(int (*)(void *), void *) override {
         Y_FAIL("Spdk is not supported now");
    }

    ui8 *Malloc(ui64, ui32) override {
         Y_FAIL("Spdk is not supported now");
    }

    void Free(ui8 *) override {
         Y_FAIL("Spdk is not supported now");
    }

    //ui64 GetDeviceSize() override {
    //     Y_FAIL("Spdk is not supported now");
    //}

    void WaitAllThreads() override {
         Y_FAIL("Spdk is not supported now");
    }
};

}