mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-14 09:58:50 +08:00
Use narrow includes in key backed types; remove some unnecessary return statements.
This commit is contained in:
parent
91949439d2
commit
7bca503528
@ -36,6 +36,7 @@
|
|||||||
#include "flow/genericactors.actor.h"
|
#include "flow/genericactors.actor.h"
|
||||||
#include "flow/TLSConfig.actor.h"
|
#include "flow/TLSConfig.actor.h"
|
||||||
|
|
||||||
|
#include "fdbclient/DatabaseContext.h"
|
||||||
#include "fdbclient/FDBTypes.h"
|
#include "fdbclient/FDBTypes.h"
|
||||||
#include "fdbclient/BackupAgent.actor.h"
|
#include "fdbclient/BackupAgent.actor.h"
|
||||||
#include "fdbclient/Status.h"
|
#include "fdbclient/Status.h"
|
||||||
|
@ -23,9 +23,10 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include "fdbclient/ClientBooleanParams.h"
|
||||||
|
#include "fdbclient/CommitTransaction.h"
|
||||||
#include "fdbclient/GenericTransactionHelper.h"
|
#include "fdbclient/GenericTransactionHelper.h"
|
||||||
#include "fdbclient/IClientApi.h"
|
#include "fdbclient/IClientApi.h"
|
||||||
#include "fdbclient/DatabaseContext.h"
|
|
||||||
#include "fdbclient/Subspace.h"
|
#include "fdbclient/Subspace.h"
|
||||||
#include "flow/ObjectSerializer.h"
|
#include "flow/ObjectSerializer.h"
|
||||||
#include "flow/genericactors.actor.h"
|
#include "flow/genericactors.actor.h"
|
||||||
@ -285,17 +286,17 @@ public:
|
|||||||
|
|
||||||
template <class Transaction>
|
template <class Transaction>
|
||||||
void set(Transaction tr, T const& val) {
|
void set(Transaction tr, T const& val) {
|
||||||
return tr->set(key, BinaryWriter::toValue<T>(val, Unversioned()));
|
tr->set(key, BinaryWriter::toValue<T>(val, Unversioned()));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Transaction>
|
template <class Transaction>
|
||||||
void atomicOp(Transaction tr, T const& val, MutationRef::Type type) {
|
void atomicOp(Transaction tr, T const& val, MutationRef::Type type) {
|
||||||
return tr->atomicOp(key, BinaryWriter::toValue<T>(val, Unversioned()), type);
|
tr->atomicOp(key, BinaryWriter::toValue<T>(val, Unversioned()), type);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Transaction>
|
template <class Transaction>
|
||||||
void clear(Transaction tr) {
|
void clear(Transaction tr) {
|
||||||
return tr->clear(key);
|
tr->clear(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
Key key;
|
Key key;
|
||||||
@ -375,18 +376,18 @@ public:
|
|||||||
|
|
||||||
template <class Transaction>
|
template <class Transaction>
|
||||||
void erase(Transaction tr, KeyType const& key) {
|
void erase(Transaction tr, KeyType const& key) {
|
||||||
return tr->clear(subspace.begin.withSuffix(KeyCodec::pack(key)));
|
tr->clear(subspace.begin.withSuffix(KeyCodec::pack(key)));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Transaction>
|
template <class Transaction>
|
||||||
void erase(Transaction tr, KeyType const& begin, KeyType const& end) {
|
void erase(Transaction tr, KeyType const& begin, KeyType const& end) {
|
||||||
return tr->clear(KeyRangeRef(subspace.begin.withSuffix(KeyCodec::pack(begin)),
|
tr->clear(KeyRangeRef(subspace.begin.withSuffix(KeyCodec::pack(begin)),
|
||||||
subspace.begin.withSuffix(KeyCodec::pack(end))));
|
subspace.begin.withSuffix(KeyCodec::pack(end))));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Transaction>
|
template <class Transaction>
|
||||||
void clear(Transaction tr) {
|
void clear(Transaction tr) {
|
||||||
return tr->clear(subspace);
|
tr->clear(subspace);
|
||||||
}
|
}
|
||||||
|
|
||||||
KeyRange subspace;
|
KeyRange subspace;
|
||||||
@ -471,7 +472,7 @@ public:
|
|||||||
|
|
||||||
template <class Transaction>
|
template <class Transaction>
|
||||||
typename std::enable_if<!is_transaction_creator<Transaction>, void>::type set(Transaction tr, T const& val) {
|
typename std::enable_if<!is_transaction_creator<Transaction>, void>::type set(Transaction tr, T const& val) {
|
||||||
return tr->set(key, ObjectWriter::toValue(val, versionOptions));
|
tr->set(key, ObjectWriter::toValue(val, versionOptions));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class DB>
|
template <class DB>
|
||||||
@ -486,7 +487,7 @@ public:
|
|||||||
|
|
||||||
template <class Transaction>
|
template <class Transaction>
|
||||||
typename std::enable_if<!is_transaction_creator<Transaction>, void>::type clear(Transaction tr) {
|
typename std::enable_if<!is_transaction_creator<Transaction>, void>::type clear(Transaction tr) {
|
||||||
return tr->clear(key);
|
tr->clear(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
Key key;
|
Key key;
|
||||||
@ -569,18 +570,18 @@ public:
|
|||||||
|
|
||||||
template <class Transaction>
|
template <class Transaction>
|
||||||
void erase(Transaction tr, KeyType const& key) {
|
void erase(Transaction tr, KeyType const& key) {
|
||||||
return tr->clear(subspace.begin.withSuffix(KeyCodec::pack(key)));
|
tr->clear(subspace.begin.withSuffix(KeyCodec::pack(key)));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Transaction>
|
template <class Transaction>
|
||||||
void erase(Transaction tr, KeyType const& begin, KeyType const& end) {
|
void erase(Transaction tr, KeyType const& begin, KeyType const& end) {
|
||||||
return tr->clear(KeyRangeRef(subspace.begin.withSuffix(KeyCodec::pack(begin)),
|
tr->clear(KeyRangeRef(subspace.begin.withSuffix(KeyCodec::pack(begin)),
|
||||||
subspace.begin.withSuffix(KeyCodec::pack(end))));
|
subspace.begin.withSuffix(KeyCodec::pack(end))));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Transaction>
|
template <class Transaction>
|
||||||
void clear(Transaction tr) {
|
void clear(Transaction tr) {
|
||||||
return tr->clear(subspace);
|
tr->clear(subspace);
|
||||||
}
|
}
|
||||||
|
|
||||||
KeyRange subspace;
|
KeyRange subspace;
|
||||||
@ -641,18 +642,18 @@ public:
|
|||||||
|
|
||||||
template <class Transaction>
|
template <class Transaction>
|
||||||
void erase(Transaction tr, ValueType const& val) {
|
void erase(Transaction tr, ValueType const& val) {
|
||||||
return tr->clear(subspace.begin.withSuffix(Codec::pack(val)));
|
tr->clear(subspace.begin.withSuffix(Codec::pack(val)));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Transaction>
|
template <class Transaction>
|
||||||
void erase(Transaction tr, ValueType const& begin, ValueType const& end) {
|
void erase(Transaction tr, ValueType const& begin, ValueType const& end) {
|
||||||
return tr->clear(
|
tr->clear(
|
||||||
KeyRangeRef(subspace.begin.withSuffix(Codec::pack(begin)), subspace.begin.withSuffix(Codec::pack(end))));
|
KeyRangeRef(subspace.begin.withSuffix(Codec::pack(begin)), subspace.begin.withSuffix(Codec::pack(end))));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Transaction>
|
template <class Transaction>
|
||||||
void clear(Transaction tr) {
|
void clear(Transaction tr) {
|
||||||
return tr->clear(subspace);
|
tr->clear(subspace);
|
||||||
}
|
}
|
||||||
|
|
||||||
KeyRange subspace;
|
KeyRange subspace;
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#include "fdbclient/SystemData.h"
|
#include "fdbclient/SystemData.h"
|
||||||
#include "fdbserver/MoveKeys.actor.h"
|
#include "fdbserver/MoveKeys.actor.h"
|
||||||
#include "fdbserver/Knobs.h"
|
#include "fdbserver/Knobs.h"
|
||||||
|
#include "fdbclient/ReadYourWrites.h"
|
||||||
#include "fdbserver/TSSMappingUtil.actor.h"
|
#include "fdbserver/TSSMappingUtil.actor.h"
|
||||||
|
|
||||||
#include "flow/actorcompiler.h" // This must be the last #include.
|
#include "flow/actorcompiler.h" // This must be the last #include.
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#elif !defined(TSS_MAPPING_UTIL_SERVER_H)
|
#elif !defined(TSS_MAPPING_UTIL_SERVER_H)
|
||||||
#define TSS_MAPPING_UTIL_SERVER_H
|
#define TSS_MAPPING_UTIL_SERVER_H
|
||||||
|
|
||||||
|
#include "fdbclient/ReadYourWrites.h"
|
||||||
#include "fdbclient/StorageServerInterface.h"
|
#include "fdbclient/StorageServerInterface.h"
|
||||||
#include "flow/actorcompiler.h" // This must be the last #include.
|
#include "flow/actorcompiler.h" // This must be the last #include.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user