mirror of
https://github.com/zeek/zeek.git
synced 2025-10-16 21:48:21 +00:00
Make &broker_store take argument of type string.
It turns out that directly passing a Broker::Store is not really a bright idea. Because - if we do that - we have to later try to intercept when the master/clone is generated to figure out what the actual name of the backing store is. Turns out that it is much easier to just use the name directly - and check if a store with that name exists when we want to insert something. I might want to reconsider this in the future in any case. At the moment this approach just stores one table into an entire store. In theory, one store should be able to handle several tables, but... that's more complex. So let's start with this for now.
This commit is contained in:
parent
031f0cac05
commit
8db83a5ed2
8 changed files with 88 additions and 27 deletions
|
@ -558,10 +558,11 @@ void Attributes::CheckAttr(Attr* a)
|
|||
break;
|
||||
}
|
||||
|
||||
const Expr *broker_store = a->AttrExpr();
|
||||
if ( broker_store->Type()->Tag() != TYPE_OPAQUE || broker_store->Type()->AsOpaqueType()->Name() != "Broker::Store" )
|
||||
Error("&broker_store must take an opaque of Broker::Store");
|
||||
|
||||
if ( a->AttrExpr()->Type()->Tag() != TYPE_STRING )
|
||||
{
|
||||
Error("&broker_store must take a string argument");
|
||||
break;
|
||||
}
|
||||
|
||||
// Temporary since Broker does not support ListVals - and we cannot easily convert to set/vector
|
||||
if ( type->AsTableType()->IndexTypes()->length() != 1 )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue