summaryrefslogtreecommitdiff
path: root/src/mongo/s/catalog_cache_loader.h
diff options
context:
space:
mode:
authorjannaerin <golden.janna@gmail.com>2018-03-29 10:57:49 -0400
committerjannaerin <golden.janna@gmail.com>2018-03-29 11:59:51 -0400
commitffe832ba22cc229478fc8b845117cb94993b6039 (patch)
tree5b433eda1f8a8ac56b7fd02212de71b14d6594c1 /src/mongo/s/catalog_cache_loader.h
parentb0f022596c6b80e5d2d331f8fe3172c28954c027 (diff)
downloadmongo-ffe832ba22cc229478fc8b845117cb94993b6039.tar.gz
SERVER-34145 Add stub methods for persisting DB version on primary
Diffstat (limited to 'src/mongo/s/catalog_cache_loader.h')
-rw-r--r--src/mongo/s/catalog_cache_loader.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mongo/s/catalog_cache_loader.h b/src/mongo/s/catalog_cache_loader.h
index ebafdff76fd..7f0737eed77 100644
--- a/src/mongo/s/catalog_cache_loader.h
+++ b/src/mongo/s/catalog_cache_loader.h
@@ -35,6 +35,7 @@
#include "mongo/base/string_data.h"
#include "mongo/s/catalog/type_chunk.h"
#include "mongo/s/catalog/type_collection.h"
+#include "mongo/s/catalog/type_database.h"
#include "mongo/s/chunk_version.h"
#include "mongo/stdx/memory.h"
#include "mongo/util/concurrency/notification.h"
@@ -126,6 +127,21 @@ public:
callbackFn) = 0;
/**
+ * Non-blocking call, which requests the most recent db version for the given dbName from the
+ * the persistent metadata store and invokes the callback function with the result.
+ * The callback function must never throw - it is a fatal error to do so.
+ *
+ * If for some reason the asynchronous fetch operation cannot be dispatched (for example on
+ * shutdown), throws a DBException. Otherwise it is guaranteed that the callback function will
+ * be invoked even on error.
+ *
+ * The callbackFn object must not be destroyed until it has been called.
+ */
+ virtual void getDatabase(
+ StringData dbName,
+ stdx::function<void(OperationContext*, StatusWith<DatabaseType>)> callbackFn) = 0;
+
+ /**
* Waits for any pending changes for the specified collection to be persisted locally (not
* necessarily replicated). If newer changes come after this method has started running, they
* will not be waited for except if there is a drop.