Skip to content

Commit f9e722f

Browse files
committed
MB-48529: Remove CheckpointConfig(EPEngine&)
Unnecessary proxy to CheckpointConfig(EPConfig&), both prod/test code can call the latter directly. Change-Id: Ie0360606c1d1a475e981456ad1b93382625dfb4a Reviewed-on: http://review.couchbase.org/c/kv_engine/+/163770 Reviewed-by: Richard de Mellow <[email protected]> Tested-by: Paolo Cocchi <[email protected]>
1 parent f534348 commit f9e722f

File tree

6 files changed

+5
-20
lines changed

6 files changed

+5
-20
lines changed

engines/ep/src/checkpoint_config.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,6 @@ CheckpointConfig::CheckpointConfig(rel_time_t period,
9191
checkpointRemovalMode(checkpoint_removal_mode) {
9292
}
9393

94-
CheckpointConfig::CheckpointConfig(EventuallyPersistentEngine& e)
95-
: CheckpointConfig(e.getConfiguration()) {
96-
}
97-
9894
CheckpointConfig::CheckpointConfig(Configuration& config)
9995
: CheckpointConfig(config.getChkPeriod(),
10096
config.getChkMaxItems(),

engines/ep/src/checkpoint_config.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class CheckpointConfig {
3535
bool persistence_enabled,
3636
CheckpointRemoval checkpoint_removal_mode);
3737

38-
explicit CheckpointConfig(EventuallyPersistentEngine& e);
38+
explicit CheckpointConfig(Configuration& config);
3939

4040
rel_time_t getCheckpointPeriod() const {
4141
return checkpointPeriod;
@@ -69,11 +69,6 @@ class CheckpointConfig {
6969
friend class EventuallyPersistentEngine;
7070
friend class SynchronousEPEngine;
7171

72-
/**
73-
* Helper constructor from config. Only called by other constructors.
74-
*/
75-
explicit CheckpointConfig(Configuration& config);
76-
7772
bool validateCheckpointMaxItemsParam(size_t checkpoint_max_items);
7873
bool validateCheckpointPeriodParam(size_t checkpoint_period);
7974

engines/ep/src/ep_engine.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2168,7 +2168,7 @@ cb::engine_errc EventuallyPersistentEngine::initialize(const char* config) {
21682168
dcpFlowControlManager_ = std::make_unique<DcpFlowControlManager>(*this);
21692169
}
21702170

2171-
checkpointConfig = std::make_unique<CheckpointConfig>(*this);
2171+
checkpointConfig = std::make_unique<CheckpointConfig>(configuration);
21722172
CheckpointConfig::addConfigChangeListener(*this);
21732173

21742174
kvBucket = makeBucket(configuration);

engines/ep/tests/mock/mock_synchronous_ep_engine.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ SynchronousEPEngine::SynchronousEPEngine(const cb::ArenaMallocClient& client,
6767
dcpConnMap_ = std::make_unique<MockDcpConnMap>(*this);
6868

6969
// checkpointConfig is needed by CheckpointManager (via EPStore).
70-
checkpointConfig = std::make_unique<CheckpointConfig>(*this);
70+
checkpointConfig = std::make_unique<CheckpointConfig>(configuration);
7171
CheckpointConfig::addConfigChangeListener(*this);
7272

7373
// Simplified setup for switching FlowControl on/off

engines/ep/tests/mock/mock_synchronous_ep_engine.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,4 @@ class SynchronousEPEngine : public EventuallyPersistentEngine {
8989
using EventuallyPersistentEngine::doConnAggStatsInner;
9090
using EventuallyPersistentEngine::doEngineStats;
9191
MockReplicationThrottle& getMockReplicationThrottle();
92-
93-
// re-create the checkpoint config from the engine config.
94-
// For use after altering the engine config.
95-
void updateCheckpointConfig() {
96-
*checkpointConfig = CheckpointConfig(*this);
97-
}
9892
};

engines/ep/tests/module_tests/checkpoint_remover_test.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ void CheckpointRemoverEPTest::testExpellingOccursBeforeCursorDropping(
396396
auto vb = store->getVBuckets().getBucket(vbid);
397397
auto* manager =
398398
static_cast<MockCheckpointManager*>(vb->checkpointManager.get());
399-
CheckpointConfig c(*engine.get());
399+
CheckpointConfig c(config);
400400
manager->resetConfig(c);
401401

402402
auto producer = createDcpProducer(cookie, IncludeDeleteTime::Yes);
@@ -502,7 +502,7 @@ TEST_F(CheckpointRemoverEPTest, DISABLED_noCursorDropWhenTargetMet) {
502502
auto vb = store->getVBuckets().getBucket(vbid);
503503
auto* checkpointManager =
504504
static_cast<MockCheckpointManager*>(vb->checkpointManager.get());
505-
CheckpointConfig c(*engine.get());
505+
CheckpointConfig c(config);
506506
checkpointManager->resetConfig(c);
507507

508508
auto producer = createDcpProducer(cookie, IncludeDeleteTime::Yes);

0 commit comments

Comments
 (0)