Skip to content

Commit

Permalink
Undo changes to make quiet and returnKey available
Browse files Browse the repository at this point in the history
Likely better to add new Reply classes to handle this
  • Loading branch information
Ngo The Trung authored and Ngo-The-Trung committed Aug 27, 2018
1 parent c73e012 commit 113ac12
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
7 changes: 4 additions & 3 deletions mcrouter/lib/carbon/RequestCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class RequestCommon {
fbtraceInfo_ = McFbtraceRef::moveRef(carbonFbtraceInfo);
}
#endif
/*
bool quiet() const {
return quiet_;
}
Expand All @@ -100,7 +101,7 @@ class RequestCommon {
}
bool& returnKey() {
return returnKey_;
}
}*/

/**
* Tells whether or not "serializedBuffer()" is dirty, in which case it can't
Expand Down Expand Up @@ -142,8 +143,8 @@ class RequestCommon {

private:
static constexpr size_t kTraceIdSize = 11;
bool quiet_{false};
bool returnKey_{false};
// bool quiet_{false};
// bool returnKey_{false};
};


Expand Down
14 changes: 7 additions & 7 deletions mcrouter/lib/network/McBinaryParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ void McServerBinaryParser::consumeSetLike() {
auto& message = currentMessage_.get<Request>();
message.key() = std::move(currentKey_);
message.exptime() = ntohl(extras->exptime);
message.quiet() = quiet;
// message.quiet() = quiet;
callback_->onRequest(std::move(message));
}

Expand All @@ -251,16 +251,16 @@ void McServerBinaryParser::consumeAppendLike() {
auto& message = currentMessage_.get<Request>();
message.key() = std::move(currentKey_);
message.value() = std::move(currentValue_);
message.quiet() = quiet;
// message.quiet() = quiet;
callback_->onRequest(std::move(message));
}

template <class Request, bool quiet, bool returnKey>
void McServerBinaryParser::consumeGetLike() {
auto& message = currentMessage_.get<Request>();
message.key() = std::move(currentKey_);
message.quiet() = quiet;
message.returnKey() = returnKey;
// message.quiet() = quiet;
// message.returnKey() = returnKey;
callback_->onRequest(std::move(message));
}

Expand All @@ -274,14 +274,14 @@ void McServerBinaryParser::consumeArithLike() {
// upstream servers because we use the ASCII protocol for upstreams
// message.initialValue() = ntohl(extras->initialValue);
// message.exptime() = ntohl(extras->exptime);
message.quiet() = quiet;
// message.quiet() = quiet;
callback_->onRequest(std::move(message));
}

template <bool quiet>
void McServerBinaryParser::consumeQuit() {
auto& message = currentMessage_.get<McQuitRequest>();
message.quiet() = quiet;
// message.quiet() = quiet;
callback_->onRequest(std::move(message));
}

Expand All @@ -296,7 +296,7 @@ void McServerBinaryParser::consumeFlush() {
auto& message = currentMessage_.get<McFlushAllRequest>();
// Binary protocol only fields
// message.exptime() = ntohl(extras->exptime);
message.quiet() = quiet;
// message.quiet() = quiet;
callback_->onRequest(std::move(message));
}

Expand Down
2 changes: 1 addition & 1 deletion mcrouter/lib/network/WriteBuffer-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ WriteBuffer::prepareTyped(
typeId_ = static_cast<uint32_t>(Reply::typeId);

// The current congestion control only supports mc_caret_protocol.
// May extend to other protocals in the future.
// May extend to other protocols in the future.
switch (protocol_) {
case mc_ascii_protocol:
return asciiReply_.prepare(
Expand Down
2 changes: 1 addition & 1 deletion mcrouter/lib/network/gen/MemcacheMessages.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class McGetReply : public carbon::ReplyCommon {

private:
folly::Optional<folly::IOBuf> value_;
uint64_t flags_{0};
uint64_t flags_{0}; // FIXME Shouldn't this be 32 bits?
std::string message_;
carbon::Result result_{mc_res_unknown};
int16_t appSpecificErrorCode_{0};
Expand Down

0 comments on commit 113ac12

Please sign in to comment.