Skip to content

Commit

Permalink
Remove unused method in ServerCookieIface
Browse files Browse the repository at this point in the history
engine_error2mcbp is no longer used anywhere

Change-Id: Ibb56c191038f865f5468848ad0c222279fc4918b
Reviewed-on: https://review.couchbase.org/c/kv_engine/+/184905
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Paolo Cocchi <paolo.cocchi@couchbase.com>
  • Loading branch information
trondn committed Jan 13, 2023
1 parent b024bb0 commit 62383fa
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 44 deletions.
15 changes: 0 additions & 15 deletions daemon/server_api.cc
Expand Up @@ -137,21 +137,6 @@ struct ServerCookieApi : public ServerCookieIface {
uint32_t get_privilege_context_revision(CookieIface& cookie) override {
return asCookie(cookie).getPrivilegeContext().getGeneration();
}
cb::mcbp::Status engine_error2mcbp(CookieIface& void_cookie,
cb::engine_errc code) override {
auto& cookie = dynamic_cast<const Cookie&>(void_cookie);
auto& connection = cookie.getConnection();

code = connection.remapErrorCode(code);
if (code == cb::engine_errc::disconnect) {
throw cb::engine_error(
cb::engine_errc::disconnect,
"engine_error2mcbp: " + std::to_string(connection.getId()) +
": Disconnect client");
}

return cb::mcbp::to_status(cb::engine_errc(code));
}

std::pair<uint32_t, std::string> get_log_info(
CookieIface& void_cookie) override {
Expand Down
4 changes: 0 additions & 4 deletions engines/ep/tests/module_tests/wrapped_server_cookie_iface.h
Expand Up @@ -62,10 +62,6 @@ class WrappedServerCookieIface : public ServerCookieIface {
uint32_t get_privilege_context_revision(CookieIface& cookie) override {
return wrapped->get_privilege_context_revision(cookie);
}
cb::mcbp::Status engine_error2mcbp(CookieIface& cookie,
cb::engine_errc code) override {
return wrapped->engine_error2mcbp(cookie, code);
}
std::pair<uint32_t, std::string> get_log_info(
CookieIface& cookie) override {
return wrapped->get_log_info(cookie);
Expand Down
16 changes: 0 additions & 16 deletions include/memcached/server_cookie_iface.h
Expand Up @@ -108,22 +108,6 @@ struct ServerCookieIface {
/// the sid / cid is costly.
virtual uint32_t get_privilege_context_revision(CookieIface& cookie) = 0;

/**
* Method to map an engine error code to the appropriate mcbp response
* code (the client may not support all error codes so we may have
* to remap some).
*
* @param cookie the client cookie (to look up the client connection)
* @param code the engine error code to get the mcbp response code.
* @return the mcbp response status to use
* @throws std::engine_error if the error code results in being
* cb::engine_errc::disconnect after remapping
* std::logic_error if the error code doesn't make sense
* std::invalid_argument if the code doesn't exist
*/
virtual cb::mcbp::Status engine_error2mcbp(CookieIface& cookie,
cb::engine_errc code) = 0;

/**
* Get the log information to be used for a log entry.
*
Expand Down
9 changes: 0 additions & 9 deletions programs/engine_testapp/mock_server.cc
Expand Up @@ -287,15 +287,6 @@ struct MockServerCookieApi : public ServerCookieIface {
return privilege_context_revision;
}

cb::mcbp::Status engine_error2mcbp(CookieIface& cookie,
cb::engine_errc code) override {
if (code == cb::engine_errc::disconnect) {
return cb::mcbp::Status(cb::engine_errc(-1));
}

return cb::mcbp::to_status(cb::engine_errc(code));
}

std::pair<uint32_t, std::string> get_log_info(
CookieIface& cookie) override {
// The DCP test suite don't use a real cookie, and until we've
Expand Down

0 comments on commit 62383fa

Please sign in to comment.