Skip to content

Commit

Permalink
[Refactor] EPE::getInner should use cookie reference
Browse files Browse the repository at this point in the history
It cannot be nullptr

Change-Id: Id4c9e9e9c1efd88ede44edc4056ca2f32da9f403
Reviewed-on: https://review.couchbase.org/c/kv_engine/+/181248
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Vesko Karaganev <vesko.karaganev@couchbase.com>
  • Loading branch information
trondn committed Oct 17, 2022
1 parent 0f1d3cf commit aab1123
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions engines/ep/src/ep_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ cb::EngineErrorItemPair EventuallyPersistentEngine::get(
options = static_cast<get_options_t>(options | GET_DELETED_VALUE);
break;
}
return acquireEngine(this)->getInner(&cookie, key, vbucket, options);
return acquireEngine(this)->getInner(cookie, key, vbucket, options);
}

cb::EngineErrorItemPair EventuallyPersistentEngine::get_if(
Expand Down Expand Up @@ -2294,15 +2294,15 @@ void EventuallyPersistentEngine::itemRelease(ItemIface* itm) {
}

cb::EngineErrorItemPair EventuallyPersistentEngine::getInner(
CookieIface* cookie,
CookieIface& cookie,
const DocKey& key,
Vbid vbucket,
get_options_t options) {
ScopeTimer2<HdrMicroSecStopwatch, TracerStopwatch> timer(
std::forward_as_tuple(stats.getCmdHisto),
std::forward_as_tuple(cookie, cb::tracing::Code::Get));

GetValue gv(kvBucket->get(key, vbucket, cookie, options));
GetValue gv(kvBucket->get(key, vbucket, &cookie, options));
cb::engine_errc ret = gv.getStatus();

if (ret == cb::engine_errc::success) {
Expand Down
2 changes: 1 addition & 1 deletion engines/ep/src/ep_engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ class EventuallyPersistentEngine : public EngineIface, public DcpIface {

void itemRelease(ItemIface* itm);

cb::EngineErrorItemPair getInner(CookieIface* cookie,
cb::EngineErrorItemPair getInner(CookieIface& cookie,
const DocKey& key,
Vbid vbucket,
get_options_t options);
Expand Down
2 changes: 1 addition & 1 deletion engines/ep/tests/module_tests/hash_table_eviction_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class STHashTableEvictionTest : public STParameterizedEvictionTest {
DELETE_TEMP | HIDE_LOCKED_CAS | TRACK_STATISTICS);
{
auto [status, item] =
engine->getInner(cookie, key, vbucket, options);
engine->getInner(*cookie, key, vbucket, options);
EXPECT_EQ(cb::engine_errc::success, status);
EXPECT_TRUE(item);
}
Expand Down

0 comments on commit aab1123

Please sign in to comment.