On Thu, Feb 25, 2016 at 09:26:42AM +0200, Liran Schour wrote:
> Ben Pfaff <b...@ovn.org> wrote on 25/02/2016 02:25:32 AM:
> > On Thu, Feb 18, 2016 at 11:46:40AM +0000, Liran Schour wrote:
> > > Change ovsdb_condition to be a 3-element json array or a boolean 
> value.
> > > Conditions utilities will be used later for conditional monitoring.
> > > 
> > > Signed-off-by: Liran Schour <lir...@il.ibm.com>
> > > 
> > > ---
> > > v3->v4:
> > > * Pass index_map only to ovsdb_condition_evaluate_or_datum()
> > > * Added ovsdb_condition_is_[true|false]()
> > > * Added ovsdb_condition_get_max_function()
> > > * Added ovsdb_condition_diff()
> > > 
> > > v2->v3:
> > > * Remove condition_add() and condition_remove() and all sub-functions
> > > * Allow single bollean value XOR <condition>
>
> > It seems strange that ovsdb_condition_evaluate_or_datum() returns true
> > if there are no clauses.  What's the rationale?
> 
> The rationale here is that we want that an empty condition will be treated 
> as implicit true in conditional monitoring. In that way if the user send a 
> monitor_cond request with an empty "where" condition, The result will be 
> the same as the former monitor2 request. 
> Maybe ovsdb_condition_evaluate_or_datum() should return true only if one 
> of the clauses is true and check if condition is empty before calling 
> ovsdb_condition_evaluate_or_datum(). What do you think?

Let's try that.  I think that it's less surprising to the reader.

> > I don't understand the purpose of ovsdb_condition_max_function().
> 
> I needed a way to tell if a condition has only functions of type 
> {false,true,"==","includes}. I need that to start track changes according 
> to condition's clauses to reduce computation in conditional monitoring on 
> the server side. Maybe I should replace it to a more explicit function 
> like: ovsdb_condition_is_every_function_false_or_equal(). What do you 
> think?

That's a pretty specific function name!

What about a function that returns a bitmap of all the OVSDB_F_*
included in a condition?  Or a function that takes a condition and such
a bitmap and returns true if the condition only contains the operators
in the bitmap?  (One could define a convenient macro or enum with the
operators that you're currently interested in.)

> Thanks for the review. I am planning to submit a new version of the series 
> (V5) with bug fixes of the clause based change tracking implementation 
> soon.

Thanks!
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to