-
Notifications
You must be signed in to change notification settings - Fork 990
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
chore: pass SinkReplyBuilder and Transaction explicitly. Part2 #3954
Conversation
static void RandomKey(CmdArgList args, ConnectionContext* cntx); | ||
static void FieldTtl(CmdArgList args, ConnectionContext* cntx); | ||
static void FieldExpire(CmdArgList args, ConnectionContext* cntx); | ||
static void Del(CmdArgList args, Transaction* tx, SinkReplyBuilder* builder); |
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.
now we are going to pass Transaction* tx, SinkReplyBuilder* builder
explicitly.
@@ -863,6 +862,99 @@ OpResult<uint64_t> OpTtl(Transaction* t, EngineShard* shard, string_view key) { | |||
} | |||
} | |||
|
|||
ErrorReply RenameGeneric(CmdArgList args, bool destination_should_not_exist, Transaction* tx) { |
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.
moved from below.
This pr follows #3946 Signed-off-by: Roman Gershman <[email protected]>
@BorysTheDev ping |
@@ -13,7 +13,6 @@ | |||
#include "server/cluster/cluster_defs.h" | |||
#include "server/engine_shard_set.h" | |||
#include "server/error.h" | |||
#include "server/generic_family.h" |
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.
I like when we remove such huge files from includes
string arg_sv = absl::AsciiStrToUpper(ToSV(arg)); | ||
if (arg_sv == "NX") { | ||
flags |= ExpireFlags::EXPIRE_NX; | ||
} else if (arg_sv == "XX") { | ||
flags |= ExpireFlags::EXPIRE_XX; | ||
} else if (arg_sv == "GT") { | ||
flags |= ExpireFlags::EXPIRE_GT; | ||
} else if (arg_sv == "LT") { | ||
flags |= ExpireFlags::EXPIRE_LT; | ||
} else { | ||
builder->SendError(absl::StrCat("Unsupported option: ", arg_sv)); | ||
return nullopt; | ||
} |
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.
can you rewrite it with CmdArgParser
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.
I prefer to avoid rewriting stuff during refactoring PRs. this one is huge as it is.
This pr follows #3946