summaryrefslogtreecommitdiffstats
path: root/database
diff options
context:
space:
mode:
authorTimotej S <6674623+underhood@users.noreply.github.com>2021-09-29 17:53:53 +0200
committerGitHub <noreply@github.com>2021-09-29 17:53:53 +0200
commitdad48421a6b3482f9cb71973885cf1160408855f (patch)
treecc66313a014c333e8baa09d3e34f46c98e4ce96b /database
parent8d0a2384412882cf9b641f17cf4e0602db4cce4d (diff)
Makes New Cloud architecture optional for ACLK-NG (#11587)
ACLK-NG supports both new and old cloud protocol. Protobuf and C++ compiler are required only for new cloud protocol. There is no reason to skip building whole ACLK-NG when protobuf is missing.
Diffstat (limited to 'database')
-rw-r--r--database/sqlite/sqlite_aclk_alert.c8
-rw-r--r--database/sqlite/sqlite_aclk_chart.c12
-rw-r--r--database/sqlite/sqlite_aclk_node.c4
3 files changed, 12 insertions, 12 deletions
diff --git a/database/sqlite/sqlite_aclk_alert.c b/database/sqlite/sqlite_aclk_alert.c
index a84db5986d..ce957c7823 100644
--- a/database/sqlite/sqlite_aclk_alert.c
+++ b/database/sqlite/sqlite_aclk_alert.c
@@ -102,7 +102,7 @@ int rrdcalc_status_to_proto_enum(RRDCALC_STATUS status)
void aclk_push_alert_event(struct aclk_database_worker_config *wc, struct aclk_database_cmd cmd)
{
-#ifndef ACLK_NG
+#ifndef ENABLE_NEW_CLOUD_PROTOCOL
UNUSED(wc);
UNUSED(cmd);
#else
@@ -259,7 +259,7 @@ void aclk_send_alarm_health_log(char *node_id)
void aclk_push_alarm_health_log(struct aclk_database_worker_config *wc, struct aclk_database_cmd cmd)
{
UNUSED(cmd);
-#ifndef ACLK_NG
+#ifndef ENABLE_NEW_CLOUD_PROTOCOL
UNUSED(wc);
#else
int rc;
@@ -362,7 +362,7 @@ void aclk_send_alarm_configuration(char *config_hash)
int aclk_push_alert_config_event(struct aclk_database_worker_config *wc, struct aclk_database_cmd cmd)
{
UNUSED(wc);
-#ifndef ACLK_NG
+#ifndef ENABLE_NEW_CLOUD_PROTOCOL
UNUSED(cmd);
#else
int rc = 0;
@@ -482,7 +482,7 @@ int aclk_push_alert_config_event(struct aclk_database_worker_config *wc, struct
// Start streaming alerts
void aclk_start_alert_streaming(char *node_id, uint64_t batch_id, uint64_t start_seq_id)
{
-#ifdef ACLK_NG
+#ifdef ENABLE_NEW_CLOUD_PROTOCOL
if (unlikely(!node_id))
return;
diff --git a/database/sqlite/sqlite_aclk_chart.c b/database/sqlite/sqlite_aclk_chart.c
index 8da62fbb76..6a19af70d4 100644
--- a/database/sqlite/sqlite_aclk_chart.c
+++ b/database/sqlite/sqlite_aclk_chart.c
@@ -123,7 +123,7 @@ int aclk_add_chart_event(struct aclk_database_worker_config *wc, struct aclk_dat
int rc = 0;
CHECK_SQLITE_CONNECTION(db_meta);
-#ifdef ACLK_NG
+#ifdef ENABLE_NEW_CLOUD_PROTOCOL
char *claim_id = is_agent_claimed();
RRDSET *st = cmd.data;
@@ -169,7 +169,7 @@ int aclk_add_dimension_event(struct aclk_database_worker_config *wc, struct aclk
int rc = 0;
CHECK_SQLITE_CONNECTION(db_meta);
-#ifdef ACLK_NG
+#ifdef ENABLE_NEW_CLOUD_PROTOCOL
char *claim_id = is_agent_claimed();
RRDDIM *rd = cmd.data;
@@ -216,7 +216,7 @@ int aclk_add_dimension_event(struct aclk_database_worker_config *wc, struct aclk
void aclk_send_chart_event(struct aclk_database_worker_config *wc, struct aclk_database_cmd cmd)
{
-#ifdef ACLK_NG
+#ifdef ENABLE_NEW_CLOUD_PROTOCOL
int rc;
wc->chart_pending = 0;
@@ -351,7 +351,7 @@ bind_fail:
int aclk_send_chart_config(struct aclk_database_worker_config *wc, struct aclk_database_cmd cmd)
{
UNUSED(wc);
-#ifdef ACLK_NG
+#ifdef ENABLE_NEW_CLOUD_PROTOCOL
CHECK_SQLITE_CONNECTION(db_meta);
@@ -470,7 +470,7 @@ void aclk_receive_chart_reset(struct aclk_database_worker_config *wc, struct acl
wc->chart_sequence_id = 0;
wc->chart_timestamp = 0;
-#ifdef ACLK_NG
+#ifdef ENABLE_NEW_CLOUD_PROTOCOL
RRDHOST *host = wc->host;
rrdhost_rdlock(host);
RRDSET *st;
@@ -674,7 +674,7 @@ fail:
// Start streaming charts / dimensions for node_id
void aclk_start_streaming(char *node_id, uint64_t sequence_id, time_t created_at, uint64_t batch_id)
{
-#ifdef ACLK_NG
+#ifdef ENABLE_NEW_CLOUD_PROTOCOL
if (unlikely(!node_id))
return;
diff --git a/database/sqlite/sqlite_aclk_node.c b/database/sqlite/sqlite_aclk_node.c
index 98dbd1f99b..0738024211 100644
--- a/database/sqlite/sqlite_aclk_node.c
+++ b/database/sqlite/sqlite_aclk_node.c
@@ -3,7 +3,7 @@
#include "sqlite_functions.h"
#include "sqlite_aclk_node.h"
-#ifdef ACLK_NG
+#ifdef ENABLE_NEW_CLOUD_PROTOCOL
#include "../../aclk/aclk_charts_api.h"
#endif
@@ -11,7 +11,7 @@ void sql_build_node_info(struct aclk_database_worker_config *wc, struct aclk_dat
{
UNUSED(cmd);
-#ifdef ACLK_NG
+#ifdef ENABLE_NEW_CLOUD_PROTOCOL
struct update_node_info node_info;
rrd_wrlock();