-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathrequest.cpp
52 lines (41 loc) · 1.65 KB
/
request.cpp
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
#include "request.h"
namespace NCloud::NBlockStore {
////////////////////////////////////////////////////////////////////////////////
#define BLOCKSTORE_DECLARE_METHOD(name, ...) #name,
static const TString RequestNames[] = {
BLOCKSTORE_SERVICE(BLOCKSTORE_DECLARE_METHOD)
};
#undef BLOCKSTORE_DECLARE_METHOD
////////////////////////////////////////////////////////////////////////////////
const TString& GetBlockStoreRequestName(EBlockStoreRequest request)
{
if (request < EBlockStoreRequest::MAX) {
return RequestNames[(int)request];
}
static const TString Unknown = "unknown";
return Unknown;
}
TStringBuf GetSysRequestName(ESysRequestType requestType)
{
switch (requestType) {
case ESysRequestType::Compaction: return "Compaction";
case ESysRequestType::Flush: return "Flush";
case ESysRequestType::ConvertToMixedIndex: return "ConvertToMixedIndex";
case ESysRequestType::ConvertToRangeMap: return "ConvertToRangeMap";
case ESysRequestType::Cleanup: return "Cleanup";
case ESysRequestType::Migration: return "Migration";
case ESysRequestType::WriteDeviceBlocks: return "WriteDeviceBlocks";
case ESysRequestType::ZeroDeviceBlocks: return "ZeroDeviceBlocks";
case ESysRequestType::Resync: return "Resync";
case ESysRequestType::ConfirmBlobs: return "ConfirmBlobs";
default: return "unknown";
}
}
TStringBuf GetPrivateRequestName(EPrivateRequestType requestType)
{
switch (requestType) {
case EPrivateRequestType::DescribeBlocks: return "DescribeBlocks";
default: return "unknown";
}
}
} // namespace NCloud::NBlockStore