[ovs-dev] [PATCH v3 15/16] ovsdb-idl: Change interface to conditional monitoring.

Ben Pfaff blp at ovn.org
Mon Dec 19 16:53:21 UTC 2016


On Mon, Dec 19, 2016 at 10:34:20AM +0200, Liran Schour wrote:
> ovs-dev-bounces at openvswitch.org wrote on 18/12/2016 10:18:33 AM:
> 
> > Most users of OVSDB react to whatever is currently in their view of the
> > database, as opposed to keeping track of changes and reacting to those
> > changes individually.  The interface to conditional monitoring was
> > different, in that it expected the client to say what to add or remove 
> from
> > monitoring instead of what to monitor.  This seemed reasonable at the 
> time,
> > but in practice it turns out that the usual approach actually works 
> better,
> > because the condition is generally a function of the data visible in the
> > database.  This commit changes the approach.
> > 
> > This commit also changes the meaning of an empty condition for a table.
> > Previously, an empty condition meant to replicate every row.  Now, an 
> empty
> > condition means to replicate no rows.  This is more convenient for code
> > that gradually constructs conditions, because it does not need special
> > cases for replicating nothing.
> > 
> > This commit also changes the internal implementation of conditions from
> > linked lists to arrays.  I just couldn't see an advantage to using 
> linked
> > lists.
> > 
> > Signed-off-by: Ben Pfaff <blp at ovn.org>
> > ---
> 
> One small issue. Maybe it will be good to sort the clauses array when 
> adding a new clause so ovsdb_idl_clause_equals() will not return false on 
> none sorted equals conditions.

An earlier version of this patch did that.  I removed it because I
realized that, ordinarily, the code would always add clauses in the same
order.

Actually, now that I think about it, it's a bit of a waste to use an
array for clauses, because adding a clause is O(n) due to the search.
We should use a hash table.  I'll look at doing that.

> Acked-by: Liran Schour <lirans at il.ibm.com>

Thanks!


More information about the dev mailing list