mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-15 02:18:39 +08:00
Remove createGlobal*Knobs functions
This commit is contained in:
parent
b46384e1b8
commit
e29ed3bf99
@ -3632,9 +3632,6 @@ int main(int argc, char* argv[]) {
|
||||
args = NULL;
|
||||
}
|
||||
|
||||
createGlobalFlowKnobs();
|
||||
createGlobalClientKnobs();
|
||||
|
||||
for(auto k=knobs.begin(); k!=knobs.end(); ++k) {
|
||||
try {
|
||||
if (!globalFlowKnobs->setKnob(k->first, k->second) &&
|
||||
|
@ -2833,9 +2833,6 @@ struct CLIOptions {
|
||||
return;
|
||||
}
|
||||
|
||||
createGlobalFlowKnobs();
|
||||
createGlobalClientKnobs();
|
||||
|
||||
for(auto k=knobs.begin(); k!=knobs.end(); ++k) {
|
||||
try {
|
||||
if (!globalFlowKnobs->setKnob(k->first, k->second) &&
|
||||
|
@ -246,11 +246,6 @@ void ClientKnobs::initialize(bool randomize) {
|
||||
// clang-format on
|
||||
}
|
||||
|
||||
void createGlobalClientKnobs() {
|
||||
globalClientKnobs = std::make_unique<ClientKnobs>();
|
||||
CLIENT_KNOBS = globalClientKnobs.get();
|
||||
}
|
||||
|
||||
TEST_CASE("/fdbclient/knobs/initialize") {
|
||||
// This test depends on TASKBUCKET_TIMEOUT_VERSIONS being defined as a constant multiple of CORE_VERSIONSPERSECOND
|
||||
ClientKnobs clientKnobs;
|
||||
|
@ -234,6 +234,4 @@ public:
|
||||
extern std::unique_ptr<ClientKnobs> globalClientKnobs;
|
||||
extern ClientKnobs const* CLIENT_KNOBS;
|
||||
|
||||
void createGlobalClientKnobs();
|
||||
|
||||
#endif
|
||||
|
@ -22,8 +22,8 @@
|
||||
#include "fdbrpc/Locality.h"
|
||||
#include <cmath>
|
||||
|
||||
std::unique_ptr<ServerKnobs> globalServerKnobs{};
|
||||
ServerKnobs const* SERVER_KNOBS = nullptr;
|
||||
std::unique_ptr<ServerKnobs> globalServerKnobs = std::make_unique<ServerKnobs>();
|
||||
ServerKnobs const* SERVER_KNOBS = globalServerKnobs.get();
|
||||
|
||||
#define init( knob, value ) initKnob( knob, value, #knob )
|
||||
|
||||
@ -697,8 +697,3 @@ void ServerKnobs::initialize(bool randomize, ClientKnobs* clientKnobs, bool isSi
|
||||
clientKnobs->INIT_MID_SHARD_BYTES = MIN_SHARD_BYTES;
|
||||
}
|
||||
}
|
||||
|
||||
void createGlobalServerKnobs() {
|
||||
globalServerKnobs = std::make_unique<ServerKnobs>();
|
||||
SERVER_KNOBS = globalServerKnobs.get();
|
||||
}
|
||||
|
@ -627,6 +627,4 @@ public:
|
||||
extern std::unique_ptr<ServerKnobs> globalServerKnobs;
|
||||
extern ServerKnobs const* SERVER_KNOBS;
|
||||
|
||||
void createGlobalServerKnobs();
|
||||
|
||||
#endif
|
||||
|
@ -1561,10 +1561,6 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
enableBuggify(opts.buggifyEnabled, BuggifyType::General);
|
||||
|
||||
createGlobalFlowKnobs();
|
||||
createGlobalClientKnobs();
|
||||
createGlobalServerKnobs();
|
||||
|
||||
if (!globalServerKnobs->setKnob("log_directory", opts.logFolder)) ASSERT(false);
|
||||
if (role != Simulation) {
|
||||
if (!globalServerKnobs->setKnob("commit_batches_mem_bytes_hard_limit", std::to_string(opts.memLimit)))
|
||||
|
@ -346,8 +346,3 @@ void Knobs::trace() const {
|
||||
for(auto &k : bool_knobs)
|
||||
TraceEvent("Knob").detail("Name", k.first.c_str()).detail("Value", *k.second);
|
||||
}
|
||||
|
||||
void createGlobalFlowKnobs() {
|
||||
globalFlowKnobs = std::make_unique<FlowKnobs>();
|
||||
FLOW_KNOBS = globalFlowKnobs.get();
|
||||
}
|
||||
|
@ -256,6 +256,4 @@ public:
|
||||
extern std::unique_ptr<FlowKnobs> globalFlowKnobs;
|
||||
extern FlowKnobs const* FLOW_KNOBS;
|
||||
|
||||
void createGlobalFlowKnobs();
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user