summaryrefslogtreecommitdiffstats
path: root/database/engine
diff options
context:
space:
mode:
authorMarkos Fountoulakis <44345837+mfundul@users.noreply.github.com>2019-12-05 00:21:22 +0200
committerChris Akritidis <43294513+cakrit@users.noreply.github.com>2019-12-04 14:21:22 -0800
commit16f835489c1a93b5dbd84747c52c883f43b716f0 (patch)
treefe91de0b4fa0d85f52870550e410bc1d0dead434 /database/engine
parenta7a88ba2723242da1de6626df0541d2091bd9b2b (diff)
Implement netdata command server and cli tool (#7325)
* Checkpoint commit (POC) * Implemented command server in the daemon * Add netdatacli implementation * Added prints in command server setup functions * Make libuv version 1 a hard dependency for the agent * Additional documentation * Improved accuracy of names and documentation * Fixed documentation * Fixed buffer overflow * Added support for exit status in cli. Added prefixes for exit code, stdout and stderr. Fixed parsers. * Fix compilation errors * Fix compile errors * Fix compile errors * Fix compile error * Fix linker error for muslc
Diffstat (limited to 'database/engine')
-rw-r--r--database/engine/rrdengine.c3
-rw-r--r--database/engine/rrdengine.h6
-rw-r--r--database/engine/rrdengineapi.c2
-rw-r--r--database/engine/rrdenginelib.h3
4 files changed, 4 insertions, 10 deletions
diff --git a/database/engine/rrdengine.c b/database/engine/rrdengine.c
index b6b6548ecf..9615665f85 100644
--- a/database/engine/rrdengine.c
+++ b/database/engine/rrdengine.c
@@ -8,7 +8,7 @@ rrdeng_stats_t global_fs_errors = 0;
rrdeng_stats_t rrdeng_reserved_file_descriptors = 0;
rrdeng_stats_t global_flushing_errors = 0;
-void sanity_check(void)
+static void sanity_check(void)
{
/* Magic numbers must fit in the super-blocks */
BUILD_BUG_ON(strlen(RRDENG_DF_MAGIC) > RRDENG_MAGIC_SZ);
@@ -845,6 +845,7 @@ void rrdengine_main(void)
int ret;
struct rrdengine_instance *ctx;
+ sanity_check();
ret = rrdeng_init(&ctx, "/tmp", RRDENG_MIN_PAGE_CACHE_SIZE_MB, RRDENG_MIN_DISK_SPACE_MB);
if (ret) {
exit(ret);
diff --git a/database/engine/rrdengine.h b/database/engine/rrdengine.h
index 78a35a0bfd..67f1b41c3d 100644
--- a/database/engine/rrdengine.h
+++ b/database/engine/rrdengine.h
@@ -7,14 +7,11 @@
#define _GNU_SOURCE
#endif
#include <fcntl.h>
-#include <aio.h>
-#include <uv.h>
-#include <assert.h>
#include <lz4.h>
#include <Judy.h>
#include <openssl/sha.h>
#include <openssl/evp.h>
-#include <stdint.h>
+#include "../../daemon/common.h"
#include "../rrd.h"
#include "rrddiskprotocol.h"
#include "rrdenginelib.h"
@@ -177,7 +174,6 @@ struct rrdengine_instance {
struct rrdengine_statistics stats;
};
-extern void sanity_check(void);
extern int init_rrd_files(struct rrdengine_instance *ctx);
extern void finalize_rrd_files(struct rrdengine_instance *ctx);
extern void rrdeng_test_quota(struct rrdengine_worker_config* wc);
diff --git a/database/engine/rrdengineapi.c b/database/engine/rrdengineapi.c
index baf4a99733..0ae3d44d28 100644
--- a/database/engine/rrdengineapi.c
+++ b/database/engine/rrdengineapi.c
@@ -745,8 +745,6 @@ int rrdeng_init(struct rrdengine_instance **ctxp, char *dbfiles_path, unsigned p
int error;
uint32_t max_open_files;
- sanity_check();
-
max_open_files = rlimit_nofile.rlim_cur / 4;
/* reserve RRDENG_FD_BUDGET_PER_INSTANCE file descriptors for this instance */
diff --git a/database/engine/rrdenginelib.h b/database/engine/rrdenginelib.h
index 5685b65a5c..295f7df056 100644
--- a/database/engine/rrdenginelib.h
+++ b/database/engine/rrdenginelib.h
@@ -3,10 +3,9 @@
#ifndef NETDATA_RRDENGINELIB_H
#define NETDATA_RRDENGINELIB_H
-#include "rrdengine.h"
-
/* Forward declarations */
struct rrdeng_page_descr;
+struct rrdengine_instance;
#define STR_HELPER(x) #x
#define STR(x) STR_HELPER(x)