Skip to content

Commit

Permalink
add flags to incr and decr requests
Browse files Browse the repository at this point in the history
Summary: for completeness, we need flags in these requests in order to activate KCB on them.

Differential Revision: D64873645

fbshipit-source-id: 691781a4a31a87e9cceac9550d1c20d0c1b8dabd
  • Loading branch information
Lenar Fatikhov authored and facebook-github-bot committed Oct 25, 2024
1 parent 73df27f commit 5a43902
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mcrouter/lib/network/Memcache.idl
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ request McIncrRequest with 1: MemcacheRequestCommon {

1: carbon::Keys<folly::IOBuf> key;
2: int64_t delta;
3: uint64_t flags;
};

reply McIncrReply with 1: MemcacheReplyCommon {
Expand All @@ -279,6 +280,7 @@ request McDecrRequest with 1: MemcacheRequestCommon {

1: carbon::Keys<folly::IOBuf> key;
2: int64_t delta;
3: uint64_t flags;
};

reply McDecrReply with 1: MemcacheReplyCommon {
Expand Down
2 changes: 2 additions & 0 deletions mcrouter/lib/network/gen/Memcache.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ struct McIncrRequest {
-1: MemcacheRequestCommon memcacheRequestCommon (cpp.mixin)
1: carbon.IOBufKey key
2: i64 delta
3: i64_8073 flags
}(cpp.methods = "
template <class V>
void visitFields(V&& v);
Expand Down Expand Up @@ -458,6 +459,7 @@ struct McDecrRequest {
-1: MemcacheRequestCommon memcacheRequestCommon (cpp.mixin)
1: carbon.IOBufKey key
2: i64 delta
3: i64_8073 flags
}(cpp.methods = "
template <class V>
void visitFields(V&& v);
Expand Down
14 changes: 14 additions & 0 deletions mcrouter/lib/network/gen/MemcacheMessages-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1124,6 +1124,7 @@ void McIncrRequest::serialize(Writer&& writer) const {
writer.writeField(-1 /* field id */, memcacheRequestCommon_ref());
writer.writeField(1 /* field id */, key_ref());
writer.writeField(2 /* field id */, delta_ref());
writer.writeField(3 /* field id */, flags_ref());
writer.writeFieldStop();
writer.writeStructEnd();
}
Expand All @@ -1142,6 +1143,9 @@ void McIncrRequest::visitFields(V&& v) {
if (!v.visitField(2, "delta", *this->delta_ref())) {
return;
}
if (!v.visitField(3, "flags", *this->flags_ref())) {
return;
}
}

template <class V>
Expand All @@ -1158,6 +1162,9 @@ void McIncrRequest::visitFields(V&& v) const {
if (!v.visitField(2, "delta", *this->delta_ref())) {
return;
}
if (!v.visitField(3, "flags", *this->flags_ref())) {
return;
}
}

template <class Writer>
Expand Down Expand Up @@ -1222,6 +1229,7 @@ void McDecrRequest::serialize(Writer&& writer) const {
writer.writeField(-1 /* field id */, memcacheRequestCommon_ref());
writer.writeField(1 /* field id */, key_ref());
writer.writeField(2 /* field id */, delta_ref());
writer.writeField(3 /* field id */, flags_ref());
writer.writeFieldStop();
writer.writeStructEnd();
}
Expand All @@ -1240,6 +1248,9 @@ void McDecrRequest::visitFields(V&& v) {
if (!v.visitField(2, "delta", *this->delta_ref())) {
return;
}
if (!v.visitField(3, "flags", *this->flags_ref())) {
return;
}
}

template <class V>
Expand All @@ -1256,6 +1267,9 @@ void McDecrRequest::visitFields(V&& v) const {
if (!v.visitField(2, "delta", *this->delta_ref())) {
return;
}
if (!v.visitField(3, "flags", *this->flags_ref())) {
return;
}
}

template <class Writer>
Expand Down
8 changes: 8 additions & 0 deletions mcrouter/lib/network/gen/MemcacheMessagesThrift.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,10 @@ void McIncrRequest::deserialize(carbon::CarbonProtocolReader& reader) {
reader.readField(delta_ref(), fieldType);
break;
}
case 3: {
reader.readField(flags_ref(), fieldType);
break;
}
default: {
reader.skip(fieldType);
break;
Expand Down Expand Up @@ -934,6 +938,10 @@ void McDecrRequest::deserialize(carbon::CarbonProtocolReader& reader) {
reader.readField(delta_ref(), fieldType);
break;
}
case 3: {
reader.readField(flags_ref(), fieldType);
break;
}
default: {
reader.skip(fieldType);
break;
Expand Down

0 comments on commit 5a43902

Please sign in to comment.