summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/wiredtiger/wiredtiger_util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/storage/wiredtiger/wiredtiger_util.h')
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_util.h39
1 files changed, 29 insertions, 10 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_util.h b/src/mongo/db/storage/wiredtiger/wiredtiger_util.h
index 5817a5855f6..a3c1b9deae0 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_util.h
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_util.h
@@ -90,6 +90,35 @@ struct WiredTigerItem : public WT_ITEM {
}
};
+/**
+ * Returns a WT_EVENT_HANDLER with MongoDB's default handlers.
+ * The default handlers just log so it is recommended that you consider calling them even if
+ * you are capturing the output.
+ *
+ * There is no default "close" handler. You only need to provide one if you need to call a
+ * destructor.
+ */
+class WiredTigerEventHandler : private WT_EVENT_HANDLER {
+public:
+ WT_EVENT_HANDLER* getWtEventHandler();
+
+ bool wasStartupSuccessful() {
+ return _startupSuccessful;
+ }
+
+ void setStartupSuccessful() {
+ _startupSuccessful = true;
+ }
+
+private:
+ int suppressibleStartupErrorLog(WT_EVENT_HANDLER* handler,
+ WT_SESSION* sesion,
+ int errorCode,
+ const char* message);
+
+ bool _startupSuccessful = false;
+};
+
class WiredTigerUtil {
MONGO_DISALLOW_COPYING(WiredTigerUtil);
@@ -183,16 +212,6 @@ public:
*/
static size_t getCacheSizeMB(double requestedCacheSizeGB);
- /**
- * Returns a WT_EVENT_HANDER with MongoDB's default handlers.
- * The default handlers just log so it is recommended that you consider calling them even if
- * you are capturing the output.
- *
- * There is no default "close" handler. You only need to provide one if you need to call a
- * destructor.
- */
- static WT_EVENT_HANDLER defaultEventHandlers();
-
class ErrorAccumulator : public WT_EVENT_HANDLER {
public:
ErrorAccumulator(std::vector<std::string>* errors);