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

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

public class ColumnsCriterion
extends TupleCriterion

To create a TupleCriterion instance that evaluate the values relationship between two given columns in a row.

See Also:
Serialized Form

Field Summary
protected  java.lang.String column1
           
protected  java.lang.String column2
           
protected  TupleColumnComparator comparator
           
protected  java.lang.String[] involvedColumns
          Create a criterion that check the values from column1 and column2 follows the given operator or not.
protected  RelationalOperator operator
           
 
Constructor Summary
ColumnsCriterion(java.lang.String column1, java.lang.String column2, RelationalOperator operator)
           
 
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
 

Field Detail

column1

protected java.lang.String column1

column2

protected java.lang.String column2

operator

protected RelationalOperator operator

comparator

protected transient TupleColumnComparator comparator

involvedColumns

protected final java.lang.String[] involvedColumns
Create a criterion that check the values from column1 and column2 follows the given operator or not.

Only the following types of RelationalOperator is supported: RelationalOperator.EQ, RelationalOperator.NE, RelationalOperator.GE, RelationalOperator.GT, RelationalOperator.LE or RelationalOperator.LT

Constructor Detail

ColumnsCriterion

public ColumnsCriterion(java.lang.String column1,
                        java.lang.String column2,
                        RelationalOperator operator)
Method Detail

evaluate

protected boolean evaluate(Tuple tuple,
                           org.apache.hadoop.conf.Configuration configuration)
Description copied from class: TupleCriterion
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()
Description copied from class: TupleCriterion
return an array of column names that are required by this criterion.

Specified by:
getInvolvedColumns in class TupleCriterion