forked from OpenAtomFoundation/pika
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpika_hash.h
156 lines (139 loc) · 3.27 KB
/
pika_hash.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
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
#ifndef __PIKA_HASH_H__
#define __PIKA_HASH_H__
#include "pika_command.h"
#include "nemo.h"
/*
* hash
*/
class HDelCmd : public Cmd {
public:
HDelCmd() {}
virtual void Do();
private:
std::string key_;
std::vector<std::string> fields_;
virtual void DoInitial(PikaCmdArgsType &argvs, const CmdInfo* const ptr_info);
};
class HGetCmd : public Cmd {
public:
HGetCmd() {}
virtual void Do();
private:
std::string key_, field_;
virtual void DoInitial(PikaCmdArgsType &argvs, const CmdInfo* const ptr_info);
};
class HGetallCmd : public Cmd {
public:
HGetallCmd() {}
virtual void Do();
private:
std::string key_;
virtual void DoInitial(PikaCmdArgsType &argvs, const CmdInfo* const ptr_info);
};
class HSetCmd : public Cmd {
public:
HSetCmd() {}
virtual void Do();
private:
std::string key_, field_, value_;
virtual void DoInitial(PikaCmdArgsType &argvs, const CmdInfo* const ptr_info);
};
class HExistsCmd : public Cmd {
public:
HExistsCmd() {}
virtual void Do();
private:
std::string key_, field_;
virtual void DoInitial(PikaCmdArgsType &argvs, const CmdInfo* const ptr_info);
};
class HIncrbyCmd : public Cmd {
public:
HIncrbyCmd() {}
virtual void Do();
private:
std::string key_, field_;
int64_t by_;
virtual void DoInitial(PikaCmdArgsType &argvs, const CmdInfo* const ptr_info);
};
class HIncrbyfloatCmd : public Cmd {
public:
HIncrbyfloatCmd() {}
virtual void Do();
private:
std::string key_, field_;
double by_;
virtual void DoInitial(PikaCmdArgsType &argvs, const CmdInfo* const ptr_info);
};
class HKeysCmd : public Cmd {
public:
HKeysCmd() {}
virtual void Do();
private:
std::string key_;
virtual void DoInitial(PikaCmdArgsType &argvs, const CmdInfo* const ptr_info);
};
class HLenCmd : public Cmd {
public:
HLenCmd() {}
virtual void Do();
private:
std::string key_;
virtual void DoInitial(PikaCmdArgsType &argvs, const CmdInfo* const ptr_info);
};
class HMgetCmd : public Cmd {
public:
HMgetCmd() {}
virtual void Do();
private:
std::string key_;
std::vector<std::string> fields_;
virtual void DoInitial(PikaCmdArgsType &argvs, const CmdInfo* const ptr_info);
};
class HMsetCmd : public Cmd {
public:
HMsetCmd() {}
virtual void Do();
private:
std::string key_;
std::vector<nemo::FV> fv_v_;
virtual void DoInitial(PikaCmdArgsType &argvs, const CmdInfo* const ptr_info);
};
class HSetnxCmd : public Cmd {
public:
HSetnxCmd() {}
virtual void Do();
private:
std::string key_, field_, value_;
virtual void DoInitial(PikaCmdArgsType &argvs, const CmdInfo* const ptr_info);
};
class HStrlenCmd : public Cmd {
public:
HStrlenCmd() {}
virtual void Do();
private:
std::string key_, field_;
virtual void DoInitial(PikaCmdArgsType &argvs, const CmdInfo* const ptr_info);
};
class HValsCmd : public Cmd {
public:
HValsCmd() {}
virtual void Do();
private:
std::string key_, field_;
virtual void DoInitial(PikaCmdArgsType &argvs, const CmdInfo* const ptr_info);
};
class HScanCmd : public Cmd {
public:
HScanCmd() : pattern_("*"), count_(10) {}
virtual void Do();
private:
std::string key_, pattern_;
int64_t cursor_, count_;
bool use_pattern_, use_count_;
virtual void DoInitial(PikaCmdArgsType &argvs, const CmdInfo* const ptr_info);
virtual void Clear() {
pattern_ = "*";
count_ = 10;
}
};
#endif