forked from ydb-platform/nbs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.h
69 lines (53 loc) · 1.9 KB
/
server.h
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#pragma once
#include "public.h"
#include <cloud/blockstore/libs/diagnostics/incomplete_requests.h>
#include <cloud/blockstore/libs/diagnostics/public.h>
#include <cloud/blockstore/libs/service/public.h>
#include <cloud/storage/core/libs/common/affinity.h>
#include <cloud/storage/core/libs/common/error.h>
#include <cloud/storage/core/libs/common/startable.h>
#include <library/cpp/threading/future/future.h>
#include <util/system/sysstat.h>
namespace NCloud::NBlockStore::NVhost {
////////////////////////////////////////////////////////////////////////////////
struct TStorageOptions
{
TString DeviceName;
TString DiskId;
TString ClientId;
ui32 BlockSize = 0;
ui64 BlocksCount = 0;
ui32 VhostQueuesCount = 0;
bool UnalignedRequestsDisabled = false;
};
////////////////////////////////////////////////////////////////////////////////
struct IServer
: public IStartable
, public IIncompleteRequestProvider
{
virtual NThreading::TFuture<NProto::TError> StartEndpoint(
TString socketPath,
IStoragePtr storage,
const TStorageOptions& options) = 0;
virtual NThreading::TFuture<NProto::TError> StopEndpoint(
const TString& socketPath) = 0;
virtual NProto::TError UpdateEndpoint(
const TString& socketPath,
ui64 blocksCount) = 0;
};
////////////////////////////////////////////////////////////////////////////////
struct TServerConfig
{
size_t ThreadsCount = 1;
ui32 SocketAccessMode = S_IRGRP | S_IWGRP | S_IRUSR | S_IWUSR;
TAffinity Affinity;
};
////////////////////////////////////////////////////////////////////////////////
IServerPtr CreateServer(
ILoggingServicePtr logging,
IServerStatsPtr serverStats,
IVhostQueueFactoryPtr vhostQueueFactory,
IDeviceHandlerFactoryPtr deviceHandlerFactory,
TServerConfig serverConfig,
TVhostCallbacks callbacks);
} // namespace NCloud::NBlockStore::NVhost