-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add new hash expire cmd to pika #2883
base: unstable
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -137,6 +137,27 @@ const std::string kCmdNameHScanx = "hscanx"; | |
const std::string kCmdNamePKHScanRange = "pkhscanrange"; | ||
const std::string kCmdNamePKHRScanRange = "pkhrscanrange"; | ||
|
||
// PKHash | ||
const std::string kCmdNamePKHSet = "pkhset"; | ||
const std::string kCmdNamePKHExpire = "pkhexpire"; | ||
const std::string kCmdNamePKHExpireat = "pkhexpireat"; | ||
const std::string kCmdNamePKHExpiretime = "pkhexpiretime"; | ||
const std::string kCmdNamePKHTTL = "pkhttl"; | ||
const std::string kCmdNamePKHPersist = "pkhpersist"; | ||
const std::string kCmdNamePKHGet = "pkhget"; | ||
const std::string kCmdNamePKHExists = "pkhexists"; | ||
const std::string kCmdNamePKHDel = "pkhdel"; | ||
const std::string kCmdNamePKHLen = "pkhlen"; | ||
const std::string kCmdNamePKHStrlen = "pkhstrlen"; | ||
const std::string kCmdNamePKHIncrby = "pkhincrby"; | ||
const std::string kCmdNamePKHMSet = "pkhmset"; | ||
const std::string kCmdNamePKHSetex = "pkhmsetex"; | ||
const std::string kCmdNamePKHMGet = "pkhmget"; | ||
const std::string kCmdNamePKHKeys = "pkhkeys"; | ||
const std::string kCmdNamePKHVals = "pkhvals"; | ||
const std::string kCmdNamePKHGetall = "pkhgetall"; | ||
const std::string kCmdNamePKHScan = "pkhscan"; | ||
|
||
// List | ||
const std::string kCmdNameLIndex = "lindex"; | ||
const std::string kCmdNameLInsert = "linsert"; | ||
|
@@ -247,7 +268,6 @@ const std::string kCmdNameXInfo = "xinfo"; | |
|
||
const std::string kClusterPrefix = "pkcluster"; | ||
|
||
|
||
/* | ||
* If a type holds a key, a new data structure | ||
* that uses the key will use this error | ||
|
@@ -290,7 +310,8 @@ enum CmdFlags { | |
kCmdFlagsOperateKey = (1 << 19), // redis keySpace | ||
kCmdFlagsStream = (1 << 20), | ||
kCmdFlagsFast = (1 << 21), | ||
kCmdFlagsSlow = (1 << 22) | ||
kCmdFlagsSlow = (1 << 22), | ||
kCmdFlagsPKHash = (1 << 23), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Flag Inconsistencies Found: Missing The following files are missing the
Please ensure that 🔗 Analysis chainLGTM: New PKHash flag added. The To ensure the new flag is being utilized correctly, please run the following script to check for its usage across the codebase: 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Verify the usage of the new kCmdFlagsPKHash flag
# Search for uses of the new flag
echo "Searching for uses of kCmdFlagsPKHash:"
rg "kCmdFlagsPKHash" --type cpp
# Search for potential places where the flag should be used
echo "Potential places where kCmdFlagsPKHash should be used:"
rg "kCmdFlags(Kv|Hash|List|Set|Zset|Bit|HyperLogLog|Geo|PubSub|Stream)" --type cpp
Length of output: 23556 Script: #!/bin/bash
# Description: Verify that kCmdFlagsPKHash is used in all relevant command definitions
# List of potential flag definitions where kCmdFlagsPKHash should be applied
potential_flags=(
"kCmdFlagsKv"
"kCmdFlagsHash"
"kCmdFlagsList"
"kCmdFlagsSet"
"kCmdFlagsZset"
"kCmdFlagsBit"
"kCmdFlagsHyperLogLog"
"kCmdFlagsGeo"
"kCmdFlagsPubSub"
"kCmdFlagsStream"
)
echo "Verifying usage of kCmdFlagsPKHash in relevant command definitions:"
for flag in "${potential_flags[@]}"; do
echo "Checking for commands using ${flag}:"
rg "${flag}" --type cpp | while read -r line; do
file=$(echo "$line" | cut -d':' -f1)
if ! grep -q "kCmdFlagsPKHash" "$file"; then
echo "Missing kCmdFlagsPKHash in $file"
fi
done
done
Length of output: 47799 |
||
}; | ||
|
||
void inline RedisAppendContent(std::string& str, const std::string& value); | ||
|
@@ -483,7 +504,7 @@ class CmdRes { | |
struct UnblockTaskArgs { | ||
std::string key; | ||
std::shared_ptr<DB> db; | ||
net::DispatchThread* dispatchThread{ nullptr }; | ||
net::DispatchThread* dispatchThread{nullptr}; | ||
UnblockTaskArgs(std::string key_, std::shared_ptr<DB> db_, net::DispatchThread* dispatchThread_) | ||
: key(std::move(key_)), db(db_), dispatchThread(dispatchThread_) {} | ||
}; | ||
|
@@ -572,7 +593,7 @@ class Cmd : public std::enable_shared_from_this<Cmd> { | |
std::shared_ptr<std::string> GetResp(); | ||
|
||
void SetStage(CmdStage stage); | ||
void SetCmdId(uint32_t cmdId){cmdId_ = cmdId;} | ||
void SetCmdId(uint32_t cmdId) { cmdId_ = cmdId; } | ||
|
||
virtual void DoBinlog(); | ||
|
||
|
@@ -614,7 +635,7 @@ class Cmd : public std::enable_shared_from_this<Cmd> { | |
|
||
private: | ||
virtual void DoInitial() = 0; | ||
virtual void Clear(){}; | ||
virtual void Clear() {}; | ||
|
||
Cmd& operator=(const Cmd&); | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove hardcoded Debug build type and compiler flags.
The changes force Debug build type and add debug-specific compiler flags that disable optimizations. This could significantly impact performance in production environments and conflicts with the existing build type logic below (lines 46-55).
Consider one of these alternatives: