diff options
Diffstat (limited to 'src/mongo/db/catalog/health_log.h')
-rw-r--r-- | src/mongo/db/catalog/health_log.h | 44 |
1 files changed, 5 insertions, 39 deletions
diff --git a/src/mongo/db/catalog/health_log.h b/src/mongo/db/catalog/health_log.h index ba2bcbf440a..f9fe3c5b4c3 100644 --- a/src/mongo/db/catalog/health_log.h +++ b/src/mongo/db/catalog/health_log.h @@ -29,21 +29,14 @@ #pragma once +#include "mongo/db/catalog/health_log_interface.h" #include "mongo/db/concurrency/deferred_writer.h" -#include "mongo/db/service_context.h" namespace mongo { class HealthLogEntry; -/** - * The interface to the local healthlog. - * - * This class contains facilities for creating and asynchronously writing to the local healthlog - * collection. There should only be one instance of this class, initialized on startup and cleaned - * up on shutdown. - */ -class HealthLog { +class HealthLog : public HealthLogInterface { HealthLog(const HealthLog&) = delete; HealthLog& operator=(const HealthLog&) = delete; @@ -55,38 +48,11 @@ public: */ HealthLog(); - /** - * The maximum size of the in-memory buffer of health-log entries, in bytes. - */ - static const int64_t kMaxBufferSize = 25'000'000; - - /** - * Start the worker thread writing the buffer to the collection. - */ - void startup(void); + void startup() override; - /** - * Stop the worker thread. - */ - void shutdown(void); + void shutdown() override; - /** - * The name of the collection. - */ - static const NamespaceString nss; - - /** - * Get the current context's HealthLog. - */ - static HealthLog& get(ServiceContext* ctx); - static HealthLog& get(OperationContext* ctx); - - /** - * Asynchronously insert the given entry. - * - * Return `false` iff there is no more space in the buffer. - */ - bool log(const HealthLogEntry& entry); + bool log(const HealthLogEntry& entry) override; private: DeferredWriter _writer; |