mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 22:58:20 +00:00
intel: Replace Broker::publish_id() with new_min_data_store
This commit is contained in:
parent
9f8e27118e
commit
7622cdb04e
1 changed files with 10 additions and 1 deletions
|
@ -11,6 +11,9 @@ module Intel;
|
||||||
global insert_item: event(item: Item) &is_used;
|
global insert_item: event(item: Item) &is_used;
|
||||||
global insert_indicator: event(item: Item) &is_used;
|
global insert_indicator: event(item: Item) &is_used;
|
||||||
|
|
||||||
|
# Event to transfer the min_data_store to connecting nodes.
|
||||||
|
global new_min_data_store: event(store: MinDataStore) &is_used;
|
||||||
|
|
||||||
# By default the manager sends its current min_data_store to connecting workers.
|
# By default the manager sends its current min_data_store to connecting workers.
|
||||||
# During testing it's handy to suppress this, since receipt of the store
|
# During testing it's handy to suppress this, since receipt of the store
|
||||||
# introduces nondeterminism when mixed with explicit data insertions.
|
# introduces nondeterminism when mixed with explicit data insertions.
|
||||||
|
@ -35,7 +38,7 @@ event Cluster::node_up(name: string, id: string)
|
||||||
# this by the insert_indicator event.
|
# this by the insert_indicator event.
|
||||||
if ( send_store_on_node_up && name in Cluster::nodes && Cluster::nodes[name]$node_type == Cluster::WORKER )
|
if ( send_store_on_node_up && name in Cluster::nodes && Cluster::nodes[name]$node_type == Cluster::WORKER )
|
||||||
{
|
{
|
||||||
Broker::publish_id(Cluster::node_topic(name), "Intel::min_data_store");
|
Broker::publish(Cluster::node_topic(name), new_min_data_store, min_data_store);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,6 +95,12 @@ event Intel::insert_indicator(item: Intel::Item) &priority=5
|
||||||
{
|
{
|
||||||
Intel::_insert(item, F);
|
Intel::_insert(item, F);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Handling of a complete MinDataStore snapshot
|
||||||
|
event new_min_data_store(store: MinDataStore)
|
||||||
|
{
|
||||||
|
min_data_store = store;
|
||||||
|
}
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@if ( Cluster::local_node_type() == Cluster::PROXY )
|
@if ( Cluster::local_node_type() == Cluster::PROXY )
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue