31 #include "mongo/base/static_assert.h" 32 #include "mongo/db/operation_context.h" 35 #include "mongo/stdx/functional.h" 56 int i =
_find(k, found);
66 int i =
_find(k, found);
67 if (i >= 0 && found) {
69 n =
opCtx->recoveryUnit()->writing(
n);
78 int i =
_find(k, found);
87 invariant(
n->hash == k.
hash());
95 for (
int i = 0; i <
n; i++) {
void kill(OperationContext *opCtx, const Namespace &k)
Definition: hashtab.h:64
void *const _buf
Definition: hashtab.h:132
void iterAll(IteratorCallback callback)
Definition: hashtab.h:94
MONGO_DISALLOW_COPYING(NamespaceHashTable)
int n
Definition: hashtab.h:134
NamespaceDetails value
Definition: hashtab.h:108
Copyright (C) 2014 MongoDB Inc.
Definition: bson_collection_catalog_entry.cpp:38
MONGO_STATIC_ASSERT(sizeof(Node)==628)
Simple, fixed size hash table used for namespace mapping (effectively the contents of the MMAP V1 ....
Definition: hashtab.h:44
BSONObj key
Definition: btree_interface.cpp:334
int maxChain
Definition: hashtab.h:135
int hash
Definition: hashtab.h:106
bool inUse() const
Definition: hashtab.h:110
Namespace key
Definition: hashtab.h:107
Definition: namespace_details.h:47
stdx::function< void(const Namespace &k, NamespaceDetails &v)> IteratorCallback
Definition: hashtab.h:48
NamespaceHashTable(void *buf, int buflen, const char *name)
Definition: hashtab.cpp:75
NamespaceDetails * get(const Namespace &k) const
Definition: hashtab.h:54
Definition: hashtab.h:105
OperationContext const IndexDescriptor InsertDeleteOptions *options void
Definition: index_catalog_impl.cpp:97
int hash() const
Value returned is always > 0.
Definition: namespace.h:99
Node & _nodes(int i) const
Definition: hashtab.h:125
This is used for storing a namespace on disk in a fixed witdh form and should only be used for that,...
Definition: namespace.h:49
int _find(const Namespace &k, bool &found) const
Definition: hashtab.cpp:39
void setUnused()
Definition: hashtab.h:114
bool put(OperationContext *opCtx, const Namespace &k, const NamespaceDetails &value)
returns false if too full
Definition: hashtab.h:76
Database *const OperationContext *const const StringData name
Definition: database_impl.cpp:82
Collection *const OperationContext *const opCtx
Definition: collection_impl.cpp:80
const char * _name
Definition: hashtab.h:131