felix.optimizer
Class DataCracker1991

java.lang.Object
  extended by felix.optimizer.DataCracker1991

public class DataCracker1991
extends java.lang.Object

An object of DataCracker1991 will try its best to discover opportunities of partitioning the data.


Field Summary
 java.util.HashMap<java.lang.String,java.lang.Integer> predField2varID
          The inverse map of varID2predField.
 java.util.HashMap<java.lang.Integer,java.lang.Integer> varID2field
          Map from variable ID to predicate's field ID.
 java.util.HashMap<java.lang.Integer,FelixPredicate> varID2pred
          Map from variable ID to the predicate.
 java.util.HashMap<java.lang.Integer,java.lang.String> varID2predField
          Map from variable ID to the signature of predicate's field.
 
Constructor Summary
DataCracker1991()
           
 
Method Summary
 void decompose(StatOperator op)
          Decompose the data used by the given operator.
 java.util.HashSet<tuffy.ra.Expression> getExpressions(FelixClause fc, tuffy.mln.Predicate _p, int base, int nThread, boolean isSignature)
          Given a clause appearing in the statOperator, return the appended expression to this clause to partition the data.
 java.lang.String toCanonicalFieldName(FelixPredicate p, int fieldNum)
          Generate the signature of predicate's field.
 java.lang.String toCanonicalFieldName(tuffy.mln.Predicate p, int fieldNum)
          Generate the signature of predicate's field.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

varID2predField

public java.util.HashMap<java.lang.Integer,java.lang.String> varID2predField
Map from variable ID to the signature of predicate's field. This ID is used in the ILP solver.


varID2pred

public java.util.HashMap<java.lang.Integer,FelixPredicate> varID2pred
Map from variable ID to the predicate. This ID is used in the ILP solver.


varID2field

public java.util.HashMap<java.lang.Integer,java.lang.Integer> varID2field
Map from variable ID to predicate's field ID. This ID is used in the ILP solver.


predField2varID

public java.util.HashMap<java.lang.String,java.lang.Integer> predField2varID
The inverse map of varID2predField.

Constructor Detail

DataCracker1991

public DataCracker1991()
Method Detail

toCanonicalFieldName

public java.lang.String toCanonicalFieldName(FelixPredicate p,
                                             int fieldNum)
Generate the signature of predicate's field.

Parameters:
p -
fieldNum -
Returns:

toCanonicalFieldName

public java.lang.String toCanonicalFieldName(tuffy.mln.Predicate p,
                                             int fieldNum)
Generate the signature of predicate's field.

Parameters:
p -
fieldNum -
Returns:

decompose

public void decompose(StatOperator op)
Decompose the data used by the given operator.

Parameters:
op -

getExpressions

public java.util.HashSet<tuffy.ra.Expression> getExpressions(FelixClause fc,
                                                             tuffy.mln.Predicate _p,
                                                             int base,
                                                             int nThread,
                                                             boolean isSignature)
Given a clause appearing in the statOperator, return the appended expression to this clause to partition the data.

Parameters:
fc -
_p - if this value is not NULL and fc is NULL, generate a human-readable version for predicate _p
base - Number of partitions.
nThread - ID of the current partition.
isSignature - if this parameter is false, then it can be used as clause's constraints.
Returns: