![]() |
Storage Engine API
|
A KVPrefix may be prepended to the keys of entries in an underlying KV store. More...
#include <kv_prefix.h>
A KVPrefix may be prepended to the keys of entries in an underlying KV store.
Prefixing keys as such allows multiple MongoDB collections share an underlying table. This can be a beneficial tradeoff for workloads that create many collections.
Public Member Functions | |
bool | isPrefixed () const |
int64_t | toBSONValue () const |
int64_t | repr () const |
std::string | toString () const |
bool | operator< (const KVPrefix &rhs) const |
bool | operator== (const KVPrefix &rhs) const |
bool | operator!= (const KVPrefix &rhs) const |
Static Public Member Functions | |
static KVPrefix | fromBSONElement (const BSONElement value) |
static void | setLargestPrefix (KVPrefix largestPrefix) |
static KVPrefix | getNextPrefix (const NamespaceString &ns) |
Returns 'KVPrefix::kNotPrefixed' if 'storageGlobalParams.groupCollections' is false or the input 'ns' is a namespace disallowed for grouping. More... | |
static KVPrefix | generateNextPrefix () |
Unconditionally returns a new prefix. More... | |
Static Public Attributes | |
static const KVPrefix | kNotPrefixed = KVPrefix(-1) |
Private Member Functions | |
KVPrefix (int64_t value) | |
Private Attributes | |
int64_t | _value |
Static Private Attributes | |
static stdx::mutex | _nextValueMutex |
static int64_t | _nextValue = 0 |
|
inlineexplicitprivate |
|
static |
|
static |
Unconditionally returns a new prefix.
Only useful for testing.
|
static |
Returns 'KVPrefix::kNotPrefixed' if 'storageGlobalParams.groupCollections' is false or the input 'ns' is a namespace disallowed for grouping.
Otherwise returns the next 'KVPrefix' ensuring it is unique with respect to active collections and indexes.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
std::string mongo::KVPrefix::toString | ( | ) | const |
|
staticprivate |
|
staticprivate |
|
private |