From c892b2d02f23a36024086d037e7fe416f9f596ba Mon Sep 17 00:00:00 2001 From: Igor Putovny Date: Wed, 12 Jun 2024 17:27:05 +0200 Subject: [PATCH] Rename --- proto/aggregator/aggregator.c | 14 +++++++------- proto/aggregator/aggregator.h | 6 +++--- proto/aggregator/config.Y | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/proto/aggregator/aggregator.c b/proto/aggregator/aggregator.c index a46c7827..dd8e0b56 100644 --- a/proto/aggregator/aggregator.c +++ b/proto/aggregator/aggregator.c @@ -900,7 +900,7 @@ run_aggregation(struct aggregator_proto *p) } static void -flush_trie(struct aggregator_proto *p) +flush_aggregator(struct aggregator_proto *p) { lp_flush(p->bucket_pool); lp_flush(p->route_pool); @@ -929,7 +929,7 @@ aggregate_on_feed_end(struct channel *C) if (C == p->src) { run_aggregation(p); - flush_trie(p); + flush_aggregator(p); p->root = NULL; if (p->first_run) @@ -1497,7 +1497,7 @@ aggregator_rt_notify(struct proto *P, struct channel *src_ch, net *net, rte *new } assert(p->root != NULL); - settle_kick(&p->aggr_timer); + settle_kick(&p->notify_settle); } static int @@ -1555,7 +1555,7 @@ aggregator_init(struct proto_config *CF) p->aggr_on = cf->aggr_on; p->net_present = cf->net_present; p->merge_by = cf->merge_by; - p->aggr_timer_cf = cf->aggr_timer_cf; + p->notify_settle_cf = cf->notify_settle_cf; P->rt_notify = aggregator_rt_notify; P->preexport = aggregator_preexport; @@ -1652,7 +1652,7 @@ aggregator_start(struct proto *P) p->first_run = 1; p->aggr_done = 0; - settle_init(&p->aggr_timer, &p->aggr_timer_cf, aggregate_on_settle_timer, p); + settle_init(&p->notify_settle, &p->notify_settle_cf, aggregate_on_settle_timer, p); return PS_UP; } @@ -1678,7 +1678,7 @@ aggregator_shutdown(struct proto *P) } HASH_WALK_END; - settle_cancel(&p->aggr_timer); + settle_cancel(&p->notify_settle); assert(p->root != NULL); p->root = NULL; @@ -1695,7 +1695,7 @@ aggregator_reconfigure(struct proto *P, struct proto_config *CF) TRACE(D_EVENTS, "Reconfiguring"); /* Compare timer configuration */ - if (cf->aggr_timer_cf.min != p->aggr_timer_cf.min || cf->aggr_timer_cf.max != p->aggr_timer_cf.max) + if (cf->notify_settle_cf.min != p->notify_settle_cf.min || cf->notify_settle_cf.max != p->notify_settle_cf.max) return 0; /* Compare numeric values (shortcut) */ diff --git a/proto/aggregator/aggregator.h b/proto/aggregator/aggregator.h index d6cda91e..8c27d4bf 100644 --- a/proto/aggregator/aggregator.h +++ b/proto/aggregator/aggregator.h @@ -28,7 +28,7 @@ struct aggregator_config { struct aggr_item *aggr_on; int net_present; const struct f_line *merge_by; - struct settle_config aggr_timer_cf; + struct settle_config notify_settle_cf; }; struct aggregator_route { @@ -74,8 +74,8 @@ struct aggregator_proto { uint addr_type; linpool *trie_pool; struct trie_node *root; - struct settle_config aggr_timer_cf; - struct settle aggr_timer; + struct settle_config notify_settle_cf; + struct settle notify_settle; int before_count; int after_count; int aggr_done; diff --git a/proto/aggregator/config.Y b/proto/aggregator/config.Y index 4d6651c2..6483151b 100644 --- a/proto/aggregator/config.Y +++ b/proto/aggregator/config.Y @@ -38,7 +38,7 @@ aggregator_proto_start: proto_start AGGREGATOR AGGREGATOR_CFG->dst = channel_config_new(NULL, "destination", 0, this_proto); AGGREGATOR_CFG->src->ra_mode = AGGREGATOR_CFG->dst->ra_mode = RA_ANY; - AGGREGATOR_CFG->aggr_timer_cf = (struct settle_config) { + AGGREGATOR_CFG->notify_settle_cf = (struct settle_config) { .min = 10 MS_, .max = 100 MS_, }; @@ -84,7 +84,7 @@ aggregator_proto_item: $4->args++; AGGREGATOR_CFG->merge_by = $4; } - | RELOAD AFTER settle { AGGREGATOR_CFG->aggr_timer_cf = $3; } + | RELOAD AFTER settle { AGGREGATOR_CFG->notify_settle_cf = $3; } ; aggregator_proto_opts: /* empty */ | aggregator_proto_opts aggregator_proto_item ';' ;