fixup! clang-format

This commit is contained in:
Xiaoge Su 2022-03-14 23:15:49 -07:00
parent 99b030c2f6
commit bd19845ef6
4 changed files with 21 additions and 19 deletions

View File

@ -49,4 +49,4 @@ public:
bool isAtomic(std::string const& knobName) const override; bool isAtomic(std::string const& knobName) const override;
}; };
#endif // FDBCLIENT_CLIENTKNOBCCOLLECTION_H #endif // FDBCLIENT_CLIENTKNOBCCOLLECTION_H

View File

@ -73,4 +73,4 @@ public:
static ConfigMutationRef createClearMutation(Arena, KeyRef); static ConfigMutationRef createClearMutation(Arena, KeyRef);
}; };
#endif // FDBCLIENT_IKNOBCOLLECTION_H #endif // FDBCLIENT_IKNOBCOLLECTION_H

View File

@ -29,31 +29,33 @@
// A list of knob key value pairs // A list of knob key value pairs
class KnobKeyValuePairs { class KnobKeyValuePairs {
public: public:
using container_t = std::unordered_map<std::string, ParsedKnobValue>; using container_t = std::unordered_map<std::string, ParsedKnobValue>;
private: private:
// Here the knob value is directly stored, unlike KnobValue, for simplicity // Here the knob value is directly stored, unlike KnobValue, for simplicity
container_t knobs; container_t knobs;
public: public:
// Sets a value for a given knob // Sets a value for a given knob
void set(const std::string& name, const ParsedKnobValue value); void set(const std::string& name, const ParsedKnobValue value);
// Gets a list of knobs for given type // Gets a list of knobs for given type
const container_t& getKnobs() const; const container_t& getKnobs() const;
}; };
// For knobs, temporarily change the values, the original values will be recovered // For knobs, temporarily change the values, the original values will be recovered
class KnobProtectiveGroup { class KnobProtectiveGroup {
KnobKeyValuePairs overriddenKnobs; KnobKeyValuePairs overriddenKnobs;
KnobKeyValuePairs originalKnobs; KnobKeyValuePairs originalKnobs;
// Snapshots the current knob values base on those knob keys in overriddenKnobs // Snapshots the current knob values base on those knob keys in overriddenKnobs
void snapshotOriginalKnobs(); void snapshotOriginalKnobs();
void assignKnobs(const KnobKeyValuePairs& overrideKnobs);
void assignKnobs(const KnobKeyValuePairs& overrideKnobs);
public: public:
KnobProtectiveGroup(const KnobKeyValuePairs& overridenKnobs_); KnobProtectiveGroup(const KnobKeyValuePairs& overridenKnobs_);
~KnobProtectiveGroup(); ~KnobProtectiveGroup();
}; };
#endif // FDBSERVER_KNOBPROTECTIVEGROUPS_H #endif // FDBSERVER_KNOBPROTECTIVEGROUPS_H

View File

@ -27,4 +27,4 @@
#define SERVER_KNOBS (&IKnobCollection::getGlobalKnobCollection().getServerKnobs()) #define SERVER_KNOBS (&IKnobCollection::getGlobalKnobCollection().getServerKnobs())
#endif // FDBSERVER_KNOBS_H #endif // FDBSERVER_KNOBS_H