From d84b2a95e2393decd845728f0a88f9d75d3d4e3b Mon Sep 17 00:00:00 2001 From: sfc-gh-tclinkenbeard Date: Mon, 5 Jul 2021 00:35:33 -0700 Subject: [PATCH] Make function declarations less verbose --- fdbclient/BackupAgent.actor.h | 32 +++++++++++++--------------- fdbclient/DatabaseContext.h | 10 ++++----- fdbclient/ISingleThreadTransaction.h | 12 +++++------ fdbclient/NativeAPI.actor.h | 30 +++++++++++++------------- fdbclient/PaxosConfigTransaction.h | 10 ++++----- fdbclient/ReadYourWrites.h | 12 +++++------ fdbclient/SimpleConfigTransaction.h | 10 ++++----- fdbclient/SpecialKeySpace.actor.h | 2 +- fdbclient/TaskBucket.h | 10 ++++----- fdbrpc/LoadBalance.actor.h | 2 +- fdbserver/LocalConfiguration.h | 2 +- fdbserver/WorkerInterface.actor.h | 4 ++-- 12 files changed, 66 insertions(+), 70 deletions(-) diff --git a/fdbclient/BackupAgent.actor.h b/fdbclient/BackupAgent.actor.h index 7813ddc39b..ec868c763d 100644 --- a/fdbclient/BackupAgent.actor.h +++ b/fdbclient/BackupAgent.actor.h @@ -280,7 +280,7 @@ public: static Key getPauseKey(); // parallel restore - Future parallelRestoreFinish(Database cx, UID randomUID, UnlockDB unlockDB = UnlockDB::TRUE); + Future parallelRestoreFinish(Database cx, UID randomUID, UnlockDB = UnlockDB::TRUE); Future submitParallelRestore(Database cx, Key backupTag, Standalone> backupRanges, @@ -308,12 +308,12 @@ public: Key tagName, Key url, Standalone> ranges, - WaitForComplete waitForComplete = WaitForComplete::TRUE, + WaitForComplete = WaitForComplete::TRUE, Version targetVersion = ::invalidVersion, - Verbose verbose = Verbose::TRUE, + Verbose = Verbose::TRUE, Key addPrefix = Key(), Key removePrefix = Key(), - LockDB lockDB = LockDB::TRUE, + LockDB = LockDB::TRUE, OnlyApplyMutationLogs = OnlyApplyMutationLogs::FALSE, InconsistentSnapshotOnly = InconsistentSnapshotOnly::FALSE, Version beginVersion = ::invalidVersion); @@ -367,7 +367,7 @@ public: Future abortRestore(Database cx, Key tagName); // Waits for a restore tag to reach a final (stable) state. - Future waitRestore(Database cx, Key tagName, Verbose verbose); + Future waitRestore(Database cx, Key tagName, Verbose); // Get a string describing the status of a tag Future restoreStatus(Reference tr, Key tagName); @@ -384,7 +384,7 @@ public: int snapshotIntervalSeconds, std::string tagName, Standalone> backupRanges, - StopWhenDone stopWhenDone = StopWhenDone::TRUE, + StopWhenDone = StopWhenDone::TRUE, UsePartitionedLog = UsePartitionedLog::FALSE, IncrementalBackupOnly = IncrementalBackupOnly::FALSE); Future submitBackup(Database cx, @@ -432,14 +432,14 @@ public: Future> getLastRestorable(Reference tr, Key tagName, - Snapshot snapshot = Snapshot::FALSE); + Snapshot = Snapshot::FALSE); void setLastRestorable(Reference tr, Key tagName, Version version); // stopWhenDone will return when the backup is stopped, if enabled. Otherwise, it // will return when the backup directory is restorable. Future waitBackup(Database cx, std::string tagName, - StopWhenDone stopWhenDone = StopWhenDone::TRUE, + StopWhenDone = StopWhenDone::TRUE, Reference* pContainer = nullptr, UID* pUID = nullptr); @@ -507,7 +507,7 @@ public: Standalone> backupRanges, Key addPrefix, Key removePrefix, - ForceAction forceAction = ForceAction::FALSE); + ForceAction = ForceAction::FALSE); Future unlockBackup(Reference tr, Key tagName); Future unlockBackup(Database cx, Key tagName) { @@ -526,7 +526,7 @@ public: Future submitBackup(Reference tr, Key tagName, Standalone> backupRanges, - StopWhenDone stopWhenDone = StopWhenDone::TRUE, + StopWhenDone = StopWhenDone::TRUE, Key addPrefix = StringRef(), Key removePrefix = StringRef(), LockDB lockDatabase = LockDB::FALSE, @@ -566,25 +566,23 @@ public: [=](Reference tr) { return getStateValue(tr, logUid); }); } - Future getDestUid(Reference tr, UID logUid, Snapshot snapshot = Snapshot::FALSE); + Future getDestUid(Reference tr, UID logUid, Snapshot = Snapshot::FALSE); Future getDestUid(Database cx, UID logUid) { return runRYWTransaction(cx, [=](Reference tr) { return getDestUid(tr, logUid); }); } - Future getLogUid(Reference tr, Key tagName, Snapshot snapshot = Snapshot::FALSE); + Future getLogUid(Reference tr, Key tagName, Snapshot = Snapshot::FALSE); Future getLogUid(Database cx, Key tagName) { return runRYWTransaction(cx, [=](Reference tr) { return getLogUid(tr, tagName); }); } Future getRangeBytesWritten(Reference tr, UID logUid, - Snapshot snapshot = Snapshot::FALSE); - Future getLogBytesWritten(Reference tr, - UID logUid, - Snapshot snapshot = Snapshot::FALSE); + Snapshot = Snapshot::FALSE); + Future getLogBytesWritten(Reference tr, UID logUid, Snapshot = Snapshot::FALSE); // stopWhenDone will return when the backup is stopped, if enabled. Otherwise, it // will return when the backup directory is restorable. - Future waitBackup(Database cx, Key tagName, StopWhenDone stopWhenDone = StopWhenDone::TRUE); + Future waitBackup(Database cx, Key tagName, StopWhenDone = StopWhenDone::TRUE); Future waitSubmitted(Database cx, Key tagName); Future waitUpgradeToLatestDrVersion(Database cx, Key tagName); diff --git a/fdbclient/DatabaseContext.h b/fdbclient/DatabaseContext.h index 2dcdcd786c..d95ca71c32 100644 --- a/fdbclient/DatabaseContext.h +++ b/fdbclient/DatabaseContext.h @@ -159,9 +159,9 @@ public: LocalityData clientLocality, EnableLocalityLoadBalance, TaskPriority taskID = TaskPriority::DefaultEndpoint, - LockAware lockAware = LockAware::FALSE, + LockAware = LockAware::FALSE, int apiVersion = Database::API_VERSION_LATEST, - IsSwitchable switchable = IsSwitchable::FALSE); + IsSwitchable = IsSwitchable::FALSE); ~DatabaseContext(); @@ -242,7 +242,7 @@ public: // new cluster. Future switchConnectionFile(Reference standby); Future connectionFileChanged(); - IsSwitchable switchable{ IsSwitchable::FALSE }; + IsSwitchable switchable{ false }; // Management API, Attempt to kill or suspend a process, return 1 for request sent out, 0 for failure Future rebootWorker(StringRef address, bool check = false, int duration = 0); @@ -261,9 +261,9 @@ public: LocalityData const& clientLocality, EnableLocalityLoadBalance, LockAware, - IsInternal internal = IsInternal::TRUE, + IsInternal = IsInternal::TRUE, int apiVersion = Database::API_VERSION_LATEST, - IsSwitchable switchable = IsSwitchable::FALSE); + IsSwitchable = IsSwitchable::FALSE); explicit DatabaseContext(const Error& err); diff --git a/fdbclient/ISingleThreadTransaction.h b/fdbclient/ISingleThreadTransaction.h index 5ab1808df2..407bf97ca1 100644 --- a/fdbclient/ISingleThreadTransaction.h +++ b/fdbclient/ISingleThreadTransaction.h @@ -50,18 +50,18 @@ public: virtual void setVersion(Version v) = 0; virtual Future getReadVersion() = 0; virtual Optional getCachedReadVersion() const = 0; - virtual Future> get(const Key& key, Snapshot snapshot = Snapshot::FALSE) = 0; - virtual Future getKey(const KeySelector& key, Snapshot snapshot = Snapshot::FALSE) = 0; + virtual Future> get(const Key& key, Snapshot = Snapshot::FALSE) = 0; + virtual Future getKey(const KeySelector& key, Snapshot = Snapshot::FALSE) = 0; virtual Future> getRange(const KeySelector& begin, const KeySelector& end, int limit, - Snapshot snapshot = Snapshot::FALSE, - Reverse reverse = Reverse::FALSE) = 0; + Snapshot = Snapshot::FALSE, + Reverse = Reverse::FALSE) = 0; virtual Future> getRange(KeySelector begin, KeySelector end, GetRangeLimits limits, - Snapshot snapshot = Snapshot::FALSE, - Reverse reverse = Reverse::FALSE) = 0; + Snapshot = Snapshot::FALSE, + Reverse = Reverse::FALSE) = 0; virtual Future>> getAddressesForKey(Key const& key) = 0; virtual Future>> getRangeSplitPoints(KeyRange const& range, int64_t chunkSize) = 0; virtual Future getEstimatedRangeSizeBytes(KeyRange const& keys) = 0; diff --git a/fdbclient/NativeAPI.actor.h b/fdbclient/NativeAPI.actor.h index b1b787442c..9c64af215f 100644 --- a/fdbclient/NativeAPI.actor.h +++ b/fdbclient/NativeAPI.actor.h @@ -115,7 +115,7 @@ private: void setNetworkOption(FDBNetworkOptions::Option option, Optional value = Optional()); // Configures the global networking machinery -void setupNetwork(uint64_t transportId = 0, UseMetrics useMetrics = UseMetrics::FALSE); +void setupNetwork(uint64_t transportId = 0, UseMetrics = UseMetrics::FALSE); // This call blocks while the network is running. To use the API in a single-threaded // environment, the calling program must have ACTORs already launched that are waiting @@ -251,20 +251,20 @@ public: Future getRawReadVersion(); Optional getCachedReadVersion() const; - [[nodiscard]] Future> get(const Key& key, Snapshot snapshot = Snapshot::FALSE); + [[nodiscard]] Future> get(const Key& key, Snapshot = Snapshot::FALSE); [[nodiscard]] Future watch(Reference watch); - [[nodiscard]] Future getKey(const KeySelector& key, Snapshot snapshot = Snapshot::FALSE); + [[nodiscard]] Future getKey(const KeySelector& key, Snapshot = Snapshot::FALSE); // Future< Optional > get( const KeySelectorRef& key ); [[nodiscard]] Future getRange(const KeySelector& begin, const KeySelector& end, int limit, - Snapshot snapshot = Snapshot::FALSE, - Reverse reverse = Reverse::FALSE); + Snapshot = Snapshot::FALSE, + Reverse = Reverse::FALSE); [[nodiscard]] Future getRange(const KeySelector& begin, const KeySelector& end, GetRangeLimits limits, - Snapshot snapshot = Snapshot::FALSE, - Reverse reverse = Reverse::FALSE); + Snapshot = Snapshot::FALSE, + Reverse = Reverse::FALSE); [[nodiscard]] Future getRange(const KeyRange& keys, int limit, Snapshot snapshot = Snapshot::FALSE, @@ -292,14 +292,14 @@ public: const KeySelector& begin, const KeySelector& end, int limit, - Snapshot snapshot = Snapshot::FALSE, - Reverse reverse = Reverse::FALSE); + Snapshot = Snapshot::FALSE, + Reverse = Reverse::FALSE); [[nodiscard]] Future getRangeStream(const PromiseStream>& results, const KeySelector& begin, const KeySelector& end, GetRangeLimits limits, - Snapshot snapshot = Snapshot::FALSE, - Reverse reverse = Reverse::FALSE); + Snapshot = Snapshot::FALSE, + Reverse = Reverse::FALSE); [[nodiscard]] Future getRangeStream(const PromiseStream>& results, const KeyRange& keys, int limit, @@ -351,13 +351,13 @@ public: // The returned list would still be in form of [keys.begin, splitPoint1, splitPoint2, ... , keys.end] Future>> getRangeSplitPoints(KeyRange const& keys, int64_t chunkSize); // If checkWriteConflictRanges is true, existing write conflict ranges will be searched for this key - void set(const KeyRef& key, const ValueRef& value, AddConflictRange addConflictRange = AddConflictRange::TRUE); + void set(const KeyRef& key, const ValueRef& value, AddConflictRange = AddConflictRange::TRUE); void atomicOp(const KeyRef& key, const ValueRef& value, MutationRef::Type operationType, - AddConflictRange addConflictRange = AddConflictRange::TRUE); - void clear(const KeyRangeRef& range, AddConflictRange addConflictRange = AddConflictRange::TRUE); - void clear(const KeyRef& key, AddConflictRange addConflictRange = AddConflictRange::TRUE); + AddConflictRange = AddConflictRange::TRUE); + void clear(const KeyRangeRef& range, AddConflictRange = AddConflictRange::TRUE); + void clear(const KeyRef& key, AddConflictRange = AddConflictRange::TRUE); [[nodiscard]] Future commit(); // Throws not_committed or commit_unknown_result errors in normal operation void setOption(FDBTransactionOptions::Option option, Optional value = Optional()); diff --git a/fdbclient/PaxosConfigTransaction.h b/fdbclient/PaxosConfigTransaction.h index c30fd98ac4..f3af19bb98 100644 --- a/fdbclient/PaxosConfigTransaction.h +++ b/fdbclient/PaxosConfigTransaction.h @@ -38,17 +38,17 @@ public: Future getReadVersion() override; Optional getCachedReadVersion() const override; - Future> get(Key const& key, Snapshot snapshot = Snapshot::FALSE) override; + Future> get(Key const& key, Snapshot = Snapshot::FALSE) override; Future> getRange(KeySelector const& begin, KeySelector const& end, int limit, - Snapshot snapshot = Snapshot::FALSE, - Reverse reverse = Reverse::FALSE) override; + Snapshot = Snapshot::FALSE, + Reverse = Reverse::FALSE) override; Future> getRange(KeySelector begin, KeySelector end, GetRangeLimits limits, - Snapshot snapshot = Snapshot::FALSE, - Reverse reverse = Reverse::FALSE) override; + Snapshot = Snapshot::FALSE, + Reverse = Reverse::FALSE) override; void set(KeyRef const& key, ValueRef const& value) override; void clear(KeyRangeRef const&) override { throw client_invalid_operation(); } void clear(KeyRef const&) override; diff --git a/fdbclient/ReadYourWrites.h b/fdbclient/ReadYourWrites.h index ea7fbca718..7a3afecbe0 100644 --- a/fdbclient/ReadYourWrites.h +++ b/fdbclient/ReadYourWrites.h @@ -71,18 +71,18 @@ public: void setVersion(Version v) override { tr.setVersion(v); } Future getReadVersion() override; Optional getCachedReadVersion() const override { return tr.getCachedReadVersion(); } - Future> get(const Key& key, Snapshot snapshot = Snapshot::FALSE) override; - Future getKey(const KeySelector& key, Snapshot snapshot = Snapshot::FALSE) override; + Future> get(const Key& key, Snapshot = Snapshot::FALSE) override; + Future getKey(const KeySelector& key, Snapshot = Snapshot::FALSE) override; Future> getRange(const KeySelector& begin, const KeySelector& end, int limit, - Snapshot snapshot = Snapshot::FALSE, - Reverse reverse = Reverse::FALSE) override; + Snapshot = Snapshot::FALSE, + Reverse = Reverse::FALSE) override; Future> getRange(KeySelector begin, KeySelector end, GetRangeLimits limits, - Snapshot snapshot = Snapshot::FALSE, - Reverse reverse = Reverse::FALSE) override; + Snapshot = Snapshot::FALSE, + Reverse = Reverse::FALSE) override; Future> getRange(const KeyRange& keys, int limit, Snapshot snapshot = Snapshot::FALSE, diff --git a/fdbclient/SimpleConfigTransaction.h b/fdbclient/SimpleConfigTransaction.h index 2d3c05cda1..ced40721af 100644 --- a/fdbclient/SimpleConfigTransaction.h +++ b/fdbclient/SimpleConfigTransaction.h @@ -47,17 +47,17 @@ public: Future getReadVersion() override; Optional getCachedReadVersion() const override; - Future> get(Key const& key, Snapshot snapshot = Snapshot::FALSE) override; + Future> get(Key const& key, Snapshot = Snapshot::FALSE) override; Future> getRange(KeySelector const& begin, KeySelector const& end, int limit, - Snapshot snapshot = Snapshot::FALSE, - Reverse reverse = Reverse::FALSE) override; + Snapshot = Snapshot::FALSE, + Reverse = Reverse::FALSE) override; Future> getRange(KeySelector begin, KeySelector end, GetRangeLimits limits, - Snapshot snapshot = Snapshot::FALSE, - Reverse reverse = Reverse::FALSE) override; + Snapshot = Snapshot::FALSE, + Reverse = Reverse::FALSE) override; Future commit() override; Version getCommittedVersion() const override; void setOption(FDBTransactionOptions::Option option, Optional value = Optional()) override; diff --git a/fdbclient/SpecialKeySpace.actor.h b/fdbclient/SpecialKeySpace.actor.h index 8b33e155ee..88dc855769 100644 --- a/fdbclient/SpecialKeySpace.actor.h +++ b/fdbclient/SpecialKeySpace.actor.h @@ -168,7 +168,7 @@ public: KeySelector begin, KeySelector end, GetRangeLimits limits, - Reverse reverse = Reverse::FALSE); + Reverse = Reverse::FALSE); void set(ReadYourWritesTransaction* ryw, const KeyRef& key, const ValueRef& value); diff --git a/fdbclient/TaskBucket.h b/fdbclient/TaskBucket.h index 29d2e3e71e..8502f29114 100644 --- a/fdbclient/TaskBucket.h +++ b/fdbclient/TaskBucket.h @@ -140,9 +140,9 @@ class FutureBucket; class TaskBucket : public ReferenceCounted { public: TaskBucket(const Subspace& subspace, - AccessSystemKeys sysAccess = AccessSystemKeys::FALSE, - PriorityBatch priorityBatch = PriorityBatch::FALSE, - LockAware lockAware = LockAware::FALSE); + AccessSystemKeys = AccessSystemKeys::FALSE, + PriorityBatch = PriorityBatch::FALSE, + LockAware = LockAware::FALSE); virtual ~TaskBucket(); void setOptions(Reference tr) { @@ -308,9 +308,7 @@ class TaskFuture; class FutureBucket : public ReferenceCounted { public: - FutureBucket(const Subspace& subspace, - AccessSystemKeys sysAccess = AccessSystemKeys::FALSE, - LockAware lockAware = LockAware::FALSE); + FutureBucket(const Subspace& subspace, AccessSystemKeys = AccessSystemKeys::FALSE, LockAware = LockAware::FALSE); virtual ~FutureBucket(); void setOptions(Reference tr) { diff --git a/fdbrpc/LoadBalance.actor.h b/fdbrpc/LoadBalance.actor.h index adaa2f29da..4869adb766 100644 --- a/fdbrpc/LoadBalance.actor.h +++ b/fdbrpc/LoadBalance.actor.h @@ -249,7 +249,7 @@ struct RequestData : NonCopyable { Future response; Reference modelHolder; - TriedAllOptions triedAllOptions{ TriedAllOptions::FALSE }; + TriedAllOptions triedAllOptions{ false }; bool requestStarted = false; // true once the request has been sent to an alternative bool requestProcessed = false; // true once a response has been received and handled by checkAndProcessResult diff --git a/fdbserver/LocalConfiguration.h b/fdbserver/LocalConfiguration.h index 515a722451..097f853868 100644 --- a/fdbserver/LocalConfiguration.h +++ b/fdbserver/LocalConfiguration.h @@ -51,7 +51,7 @@ public: LocalConfiguration(std::string const& dataFolder, std::string const& configPath, std::map const& manualKnobOverrides, - IsTest isTest = IsTest::FALSE); + IsTest = IsTest::FALSE); LocalConfiguration(LocalConfiguration&&); LocalConfiguration& operator=(LocalConfiguration&&); ~LocalConfiguration(); diff --git a/fdbserver/WorkerInterface.actor.h b/fdbserver/WorkerInterface.actor.h index afaeae4aa8..e642d015dd 100644 --- a/fdbserver/WorkerInterface.actor.h +++ b/fdbserver/WorkerInterface.actor.h @@ -833,8 +833,8 @@ struct ServerDBInfo; class Database openDBOnServer(Reference> const& db, TaskPriority taskID = TaskPriority::DefaultEndpoint, - LockAware lockAware = LockAware::FALSE, - EnableLocalityLoadBalance enableLocalityLoadBalance = EnableLocalityLoadBalance::TRUE); + LockAware = LockAware::FALSE, + EnableLocalityLoadBalance = EnableLocalityLoadBalance::TRUE); ACTOR Future extractClusterInterface(Reference>> a, Reference>> b);