summaryrefslogtreecommitdiffstats
path: root/database/storage_engine.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-06-09 04:52:47 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-06-09 04:52:57 +0000
commit00151562145df50cc65e9902d52d5fa77f89fe50 (patch)
tree2737716802f6725a5074d606ec8fe5422c58a83c /database/storage_engine.h
parentReleasing debian version 1.34.1-1. (diff)
downloadnetdata-00151562145df50cc65e9902d52d5fa77f89fe50.tar.xz
netdata-00151562145df50cc65e9902d52d5fa77f89fe50.zip
Merging upstream version 1.35.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'database/storage_engine.h')
-rw-r--r--database/storage_engine.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/database/storage_engine.h b/database/storage_engine.h
new file mode 100644
index 000000000..0aa70d093
--- /dev/null
+++ b/database/storage_engine.h
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#ifndef NETDATA_STORAGEENGINEAPI_H
+#define NETDATA_STORAGEENGINEAPI_H
+
+#include "rrd.h"
+
+typedef struct storage_engine STORAGE_ENGINE;
+
+// ------------------------------------------------------------------------
+// function pointers for all APIs provided by a storge engine
+typedef struct storage_engine_api {
+ struct rrddim_collect_ops collect_ops;
+ struct rrddim_query_ops query_ops;
+} STORAGE_ENGINE_API;
+
+struct storage_engine {
+ RRD_MEMORY_MODE id;
+ const char* name;
+ STORAGE_ENGINE_API api;
+};
+
+extern STORAGE_ENGINE* storage_engine_get(RRD_MEMORY_MODE mmode);
+extern STORAGE_ENGINE* storage_engine_find(const char* name);
+
+// Iterator over existing engines
+extern STORAGE_ENGINE* storage_engine_foreach_init();
+extern STORAGE_ENGINE* storage_engine_foreach_next(STORAGE_ENGINE* it);
+
+#endif