com.ebay.erl.mobius.core.criterion
Class LogicalExpression

java.lang.Object
  extended by com.ebay.erl.mobius.core.criterion.TupleCriterion
      extended by com.ebay.erl.mobius.core.criterion.LogicalExpression
All Implemented Interfaces:
java.io.Serializable, org.apache.hadoop.conf.Configurable

public class LogicalExpression
extends TupleCriterion

Creates a composited TupleCriterion such as A_Criteria and B_Criteria.

This product is licensed under the Apache License, Version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0. This product contains portions derived from Apache hadoop which is licensed under the Apache License, Version 2.0, available at http://hadoop.apache.org. © 2007 – 2012 eBay Inc., Evan Chiu, Woody Zhou, Neel Sundaresan

See Also:
Serialized Form

Nested Class Summary
static class LogicalExpression.Operator
          logical operator, AND or OR.
 
Constructor Summary
LogicalExpression(TupleCriterion leftCriterion, TupleCriterion rightCriterion, LogicalExpression.Operator op)
          Create a TupleCriterion equals to leftCriterion op rightCriterion, where op is either LogicalExpression.Operator.AND or LogicalExpression.Operator.OR.
 
Method Summary
protected  boolean evaluate(Tuple tuple, org.apache.hadoop.conf.Configuration configuration)
          Sub class shall override this method to verify if the tuple meet the the criteria or not.
 java.lang.String[] getInvolvedColumns()
          return an array of column names that are required by this criterion.
 
Methods inherited from class com.ebay.erl.mobius.core.criterion.TupleCriterion
accept, and, getConf, not, or, setConf, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogicalExpression

public LogicalExpression(TupleCriterion leftCriterion,
                         TupleCriterion rightCriterion,
                         LogicalExpression.Operator op)
Create a TupleCriterion equals to leftCriterion op rightCriterion, where op is either LogicalExpression.Operator.AND or LogicalExpression.Operator.OR.

Parameters:
leftCriterion -
rightCriterion -
op -
Method Detail

evaluate

protected boolean evaluate(Tuple tuple,
                           org.apache.hadoop.conf.Configuration configuration)
Sub class shall override this method to verify if the tuple meet the the criteria or not.

Specified by:
evaluate in class TupleCriterion
Parameters:
tuple - a tuple to be test
configuration - Hadoop configuration
Returns:
true if the tuple meets this criteria, false otherwise.

getInvolvedColumns

public java.lang.String[] getInvolvedColumns()
return an array of column names that are required by this criterion.

Specified by:
getInvolvedColumns in class TupleCriterion