Skip to content
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

Merged
merged 1 commit into from
Oct 23, 2024
Merged

Conversation

romange
Copy link
Collaborator

@romange romange commented Oct 20, 2024

This pr follows #3946

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);
Copy link
Collaborator Author

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) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved from below.

@romange
Copy link
Collaborator Author

romange commented Oct 23, 2024

@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"
Copy link
Contributor

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

Comment on lines +934 to +946
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;
}
Copy link
Contributor

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

Copy link
Collaborator Author

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.

@romange romange merged commit e24f697 into main Oct 23, 2024
12 checks passed
@romange romange deleted the Pr3 branch October 23, 2024 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants