File tree Expand file tree Collapse file tree 4 files changed +14
-25
lines changed Expand file tree Collapse file tree 4 files changed +14
-25
lines changed Original file line number Diff line number Diff line change 2828#include < set>
2929#include < unordered_map>
3030
31- #define MIN_CHECKPOINT_ITEMS 10
32- #define MAX_CHECKPOINT_ITEMS 50000
33- #define DEFAULT_CHECKPOINT_ITEMS 500
34-
35- #define MIN_CHECKPOINT_PERIOD 1 // 1 sec.
36- #define MAX_CHECKPOINT_PERIOD 3600 // 3600 sec.
37- #define DEFAULT_CHECKPOINT_PERIOD 5 // 5 sec.
38-
3931/* *
4032 * The state of a given checkpoint.
4133 */
Original file line number Diff line number Diff line change 1212#include " checkpoint_config.h"
1313
1414#include " bucket_logger.h"
15- #include " checkpoint.h"
1615#include " configuration.h"
1716#include " ep_engine.h"
1817
@@ -68,15 +67,6 @@ class CheckpointConfig::ChangeListener : public ValueChangedListener {
6867 CheckpointConfig& config;
6968};
7069
71- // Test only
72- CheckpointConfig::CheckpointConfig ()
73- : checkpointPeriod(DEFAULT_CHECKPOINT_PERIOD),
74- checkpointMaxItems(DEFAULT_CHECKPOINT_ITEMS),
75- maxCheckpoints(2 ),
76- itemNumBasedNewCheckpoint(true ),
77- persistenceEnabled(true ) { /* empty */
78- }
79-
8070CheckpointConfig::CheckpointConfig (rel_time_t period,
8171 size_t max_items,
8272 size_t max_ckpts,
Original file line number Diff line number Diff line change @@ -26,8 +26,7 @@ std::string to_string(CheckpointRemoval mode);
2626class CheckpointConfig {
2727public:
2828 // Test only
29- CheckpointConfig ();
30-
29+ CheckpointConfig () = default ;
3130 CheckpointConfig (rel_time_t period,
3231 size_t max_items,
3332 size_t max_ckpts,
@@ -86,20 +85,20 @@ class CheckpointConfig {
8685 class ChangeListener ;
8786
8887 // Period of a checkpoint in terms of time in sec
89- rel_time_t checkpointPeriod;
88+ rel_time_t checkpointPeriod{DEFAULT_CHECKPOINT_PERIOD} ;
9089
9190 // Number of max items allowed in each checkpoint
92- size_t checkpointMaxItems;
91+ size_t checkpointMaxItems{DEFAULT_CHECKPOINT_ITEMS} ;
9392
9493 // Number of max checkpoints allowed
95- size_t maxCheckpoints;
94+ size_t maxCheckpoints{ 2 } ;
9695
9796 // Flag indicating if a new checkpoint is created once the number of items
9897 // in the current checkpoint is greater than the max number allowed.
99- bool itemNumBasedNewCheckpoint;
98+ bool itemNumBasedNewCheckpoint{ true } ;
10099
101100 // Flag indicating if persistence is enabled.
102- bool persistenceEnabled;
101+ bool persistenceEnabled{ true } ;
103102
104103 CheckpointRemoval checkpointRemovalMode = CheckpointRemoval::Eager;
105104};
Original file line number Diff line number Diff line change 2020#include < list>
2121#include < memory>
2222
23+ #define MIN_CHECKPOINT_ITEMS 10
24+ #define MAX_CHECKPOINT_ITEMS 50000
25+ #define DEFAULT_CHECKPOINT_ITEMS 500
26+
27+ #define MIN_CHECKPOINT_PERIOD 1 // 1 sec.
28+ #define MAX_CHECKPOINT_PERIOD 3600 // 3600 sec.
29+ #define DEFAULT_CHECKPOINT_PERIOD 5 // 5 sec.
30+
2331class Checkpoint ;
2432class CheckpointManager ;
2533class VBucket ;
You can’t perform that action at this time.
0 commit comments