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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
|
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "../zen.h"
namespace zen {
class DropCommand : public CacheStoreCommand
{
public:
static constexpr char Name[] = "drop";
static constexpr char Description[] = "Drop cache namespace or bucket";
DropCommand();
~DropCommand();
virtual void Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) override;
virtual cxxopts::Options& Options() override { return m_Options; }
private:
cxxopts::Options m_Options{Name, Description};
std::string m_HostName;
std::string m_NamespaceName;
std::string m_BucketName;
};
class CacheInfoCommand : public CacheStoreCommand
{
public:
static constexpr char Name[] = "cache-info";
static constexpr char Description[] = "Info on cache, namespace or bucket";
CacheInfoCommand();
~CacheInfoCommand();
virtual void Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) override;
virtual cxxopts::Options& Options() override { return m_Options; }
private:
cxxopts::Options m_Options{Name, Description};
std::string m_HostName;
std::string m_NamespaceName;
std::string m_SizeInfoBucketNames;
bool m_BucketSizeInfo = false;
std::string m_BucketName;
};
class CacheStatsCommand : public CacheStoreCommand
{
public:
static constexpr char Name[] = "cache-stats";
static constexpr char Description[] = "Stats on cache";
CacheStatsCommand();
~CacheStatsCommand();
virtual void Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) override;
virtual cxxopts::Options& Options() override { return m_Options; }
private:
cxxopts::Options m_Options{Name, Description};
std::string m_HostName;
};
class CacheDetailsCommand : public CacheStoreCommand
{
public:
static constexpr char Name[] = "cache-details";
static constexpr char Description[] = "Details on cache";
CacheDetailsCommand();
~CacheDetailsCommand();
virtual void Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) override;
virtual cxxopts::Options& Options() override { return m_Options; }
private:
cxxopts::Options m_Options{Name, Description};
std::string m_HostName;
bool m_CSV = false;
bool m_Details = false;
bool m_AttachmentDetails = false;
std::string m_Namespace;
std::string m_Bucket;
std::string m_ValueKey;
};
class CacheGenerateCommand : public CacheStoreCommand
{
public:
static constexpr char Name[] = "cache-gen";
static constexpr char Description[] = "Generates cache values into a bucket";
CacheGenerateCommand();
~CacheGenerateCommand();
virtual void Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) override;
virtual cxxopts::Options& Options() override { return m_Options; }
private:
cxxopts::Options m_Options{Name, Description};
std::string m_HostName;
std::string m_Namespace;
std::string m_Bucket;
uint64_t m_Count = 1;
uint64_t m_MinSize = 0;
uint64_t m_MaxSize = 0;
uint32_t m_MinAttachmentCount = 0;
uint32_t m_MaxAttachmentCount = 0;
};
class CacheGetCommand : public CacheStoreCommand
{
public:
static constexpr char Name[] = "cache-get";
static constexpr char Description[] = "Get cache values/records or attachments from a bucket";
CacheGetCommand();
~CacheGetCommand();
virtual void Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) override;
virtual cxxopts::Options& Options() override { return m_Options; }
private:
cxxopts::Options m_Options{Name, Description};
std::string m_HostName;
std::string m_Namespace;
std::string m_Bucket;
std::string m_ValueKey;
std::string m_AttachmentHash;
std::filesystem::path m_OutputPath;
bool m_AsText = false;
bool m_Decompress = true;
};
} // namespace zen
|