BrokerStore<->Zeek tables: &backend works for in-memory stores.

Currently this requires using this with a normal cluster - or sending
messages by yourself.

It, in principle, should also work with SQLITE - but that is a bit
nonsensical without being able to change the storage location.
This commit is contained in:
Johanna Amann 2020-07-01 16:38:10 -07:00
parent 318a72c303
commit a220b02722
9 changed files with 118 additions and 33 deletions

View file

@ -235,13 +235,15 @@ void Manager::InitializeBrokerStoreForwarding()
id->GetVal()->AsTableVal()->SetBrokerStore(storename);
AddForwardedStore(storename, {NewRef{}, id->GetVal()->AsTableVal()});
auto backend = bro_broker::to_backend_type(e);
// we only create masters here. For clones, we do all the work of setting up
// the forwarding - but we do not try to initialize the clone. We can only initialize
// the clone, once a node has a connection to a master. This is currently done in scriptland
// - check FIXME.
if ( zeek_table_manager )
MakeMaster(storename, backend, broker::backend_options{});
else
{
MakeClone(storename);
auto backend = bro_broker::to_backend_type(e);
MakeMaster(storename, backend, broker::backend_options{});
}
}
}