mirror of
https://github.com/zeek/zeek.git
synced 2025-10-15 04:58:21 +00:00
Broker Store updates: get a bit more infrastructure in place.
This compiles, but besides giving debug messages (and partially performing inserts/updates) it is not really helpful and definitely WIP. This also shows that I might have to re-think the approach that we will take here. So far, we actually insert tables as tables into Brokerstores. This opens up the potential to just have several tables synchronized via a single brokerstore. However, it turns out, that the current store_event API sends the complete table with each update. Which is problematic for obvious reasons - and not really sustainable.
This commit is contained in:
parent
8db83a5ed2
commit
558e89b3ba
5 changed files with 164 additions and 26 deletions
|
@ -6,21 +6,28 @@ redef exit_only_after_terminate = T;
|
|||
module TestModule;
|
||||
|
||||
global tablestore: opaque of Broker::Store;
|
||||
#global tabletwostore: opaque of Broker::Store;
|
||||
global setstore: opaque of Broker::Store;
|
||||
|
||||
global t: table[string] of count &broker_store="table";
|
||||
#global ct: table[string, string] of count &broker_store="table2";
|
||||
global s: set[string] &broker_store="set";
|
||||
|
||||
event zeek_init()
|
||||
{
|
||||
tablestore = Broker::create_master("table");
|
||||
#tabletwostore = Broker::create_master("table2");
|
||||
setstore = Broker::create_master("set");
|
||||
print "inserting";
|
||||
t["a"] = 5;
|
||||
add s["hi"];
|
||||
print "changing";
|
||||
t["a"] = 2;
|
||||
print "deleting";
|
||||
delete t["a"];
|
||||
delete s["hi"];
|
||||
#add s["hi"];
|
||||
#print "changing";
|
||||
t["a"] = 2;
|
||||
t["b"] = 3;
|
||||
t["c"] = 4;
|
||||
t["whatever"] = 5;
|
||||
#print "deleting";
|
||||
#delete t["a"];
|
||||
#delete s["hi"];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue