com.lucidera.opt
Class LoptIterCalcRule

java.lang.Object
  extended by org.eigenbase.relopt.RelOptRule
      extended by com.lucidera.opt.LoptIterCalcRule
Direct Known Subclasses:
LoptIterCalcRule.CartesianJoinRule, LoptIterCalcRule.DefaultRule, LoptIterCalcRule.HashJoinRule, LoptIterCalcRule.JavaUdxRule, LoptIterCalcRule.JdbcQueryRule, LoptIterCalcRule.LcsRowScanRule, LoptIterCalcRule.NestedLoopJoinRule, LoptIterCalcRule.TableAccessRule, LoptIterCalcRule.TableAppendRule, LoptIterCalcRule.TableDeleteRule, LoptIterCalcRule.TableMergeRule

public abstract class LoptIterCalcRule
extends RelOptRule

LoptIterCalcRule decorates an IterCalcRel with an error handling tag, according to the LucidDb requirements.

Version:
$Id: //open/dev/farrago/src/com/lucidera/opt/LoptIterCalcRule.java#18 $
Author:
John Pham

Nested Class Summary
private static class LoptIterCalcRule.CartesianJoinRule
          A rule for tagging a calculator on top of a cartesian product join.
private static class LoptIterCalcRule.DefaultRule
          A default rule for tagging any calculator
private static class LoptIterCalcRule.HashJoinRule
          A rule for tagging a calculator on top of a hash join.
private static class LoptIterCalcRule.JavaUdxRule
          A rule for tagging a calculator on top of a Java UDX
private static class LoptIterCalcRule.JdbcQueryRule
          A rule for tagging a calculator on top of a JDBC query
private static class LoptIterCalcRule.LcsRowScanRule
          A rule for tagging a calculator on top of a column store row scan.
private static class LoptIterCalcRule.NestedLoopJoinRule
          A rule for tagging a calculator on top of a nested loop join.
private static class LoptIterCalcRule.TableAccessRule
          A rule for tagging a calculator on top of a table scan.
private static class LoptIterCalcRule.TableAppendRule
          A rule for tagging a calculator beneath a table modification.
private static class LoptIterCalcRule.TableDeleteRule
          A rule for tagging a calculator beneath a table modification.
private static class LoptIterCalcRule.TableMergeRule
          A rule for tagging a calculator beneath a table modification.
 
Field Summary
static String CARTESIAN_JOIN_PREFIX
           
static LoptIterCalcRule cartesianJoinInstance
           
static LoptIterCalcRule defaultInstance
           
static String HASH_JOIN_PREFIX
           
static LoptIterCalcRule hashJoinInstance
           
static String JAVA_UDX_PREFIX
           
static LoptIterCalcRule javaUdxInstance
           
static String JDBC_QUERY_PREFIX
           
static LoptIterCalcRule jdbcQueryInstance
           
static String LCS_ROWSCAN_PREFIX
           
static LoptIterCalcRule lcsAppendInstance
           
static LoptIterCalcRule lcsDeleteInstance
           
static LoptIterCalcRule lcsMergeInstance
           
static LoptIterCalcRule lcsRowScanInstance
           
static LoptIterCalcRule nestedLoopJoinInstance
           
static String NLJ_PREFIX
           
static String TABLE_ACCESS_PREFIX
           
static String TABLE_APPEND_PREFIX
           
static String TABLE_DELETE_PREFIX
           
static String TABLE_MERGE_PREFIX
           
static LoptIterCalcRule tableAccessInstance
           
 
Fields inherited from class org.eigenbase.relopt.RelOptRule
ANY, description, operands
 
Constructor Summary
LoptIterCalcRule(RelOptRuleOperand operand)
          Constructs a new LoptIterCalcRule
 
Method Summary
protected  String getDefaultTag(IterCalcRel rel)
          Gets the default tag for an IterCalcRel, based upon its id.
protected  String getTableTag(String action, String[] qualifiedName, RelNode rel)
          Gets a tag corresponding to a table name.
protected  IterCalcRel replaceTag(IterCalcRel calc, String tag)
          Sets the tag of an IterCalcRel to the specified tag
protected  IteratorToFennelConverter replaceTagAsFennel(IteratorToFennelConverter converter, IterCalcRel calc, String tag)
          Replaces the tag of an IterCalcRel underneath an IteratorToFennelConverter.
protected  void setIterCalcTypeMap(FennelRel rel, String tag)
           
protected  void transformToTag(RelOptRuleCall call, IterCalcRel calc, String tag)
          Transform call to an IterCalcRel with a replaced tag
 
Methods inherited from class org.eigenbase.relopt.RelOptRule
convert, equals, equals, getOperand, getOperands, getOutConvention, getOutTrait, hashCode, matches, mergeTraitsAndConvert, mergeTraitsAndConvert, onMatch, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

tableAccessInstance

public static LoptIterCalcRule tableAccessInstance

lcsRowScanInstance

public static LoptIterCalcRule lcsRowScanInstance

jdbcQueryInstance

public static LoptIterCalcRule jdbcQueryInstance

javaUdxInstance

public static LoptIterCalcRule javaUdxInstance

lcsAppendInstance

public static LoptIterCalcRule lcsAppendInstance

lcsMergeInstance

public static LoptIterCalcRule lcsMergeInstance

lcsDeleteInstance

public static LoptIterCalcRule lcsDeleteInstance

hashJoinInstance

public static LoptIterCalcRule hashJoinInstance

nestedLoopJoinInstance

public static LoptIterCalcRule nestedLoopJoinInstance

cartesianJoinInstance

public static LoptIterCalcRule cartesianJoinInstance

defaultInstance

public static LoptIterCalcRule defaultInstance

TABLE_ACCESS_PREFIX

public static final String TABLE_ACCESS_PREFIX
See Also:
Constant Field Values

LCS_ROWSCAN_PREFIX

public static final String LCS_ROWSCAN_PREFIX
See Also:
Constant Field Values

JDBC_QUERY_PREFIX

public static final String JDBC_QUERY_PREFIX
See Also:
Constant Field Values

JAVA_UDX_PREFIX

public static final String JAVA_UDX_PREFIX
See Also:
Constant Field Values

TABLE_APPEND_PREFIX

public static final String TABLE_APPEND_PREFIX
See Also:
Constant Field Values

TABLE_MERGE_PREFIX

public static final String TABLE_MERGE_PREFIX
See Also:
Constant Field Values

TABLE_DELETE_PREFIX

public static final String TABLE_DELETE_PREFIX
See Also:
Constant Field Values

HASH_JOIN_PREFIX

public static final String HASH_JOIN_PREFIX
See Also:
Constant Field Values

NLJ_PREFIX

public static final String NLJ_PREFIX
See Also:
Constant Field Values

CARTESIAN_JOIN_PREFIX

public static final String CARTESIAN_JOIN_PREFIX
See Also:
Constant Field Values
Constructor Detail

LoptIterCalcRule

public LoptIterCalcRule(RelOptRuleOperand operand)
Constructs a new LoptIterCalcRule

Method Detail

transformToTag

protected void transformToTag(RelOptRuleCall call,
                              IterCalcRel calc,
                              String tag)
Transform call to an IterCalcRel with a replaced tag


replaceTag

protected IterCalcRel replaceTag(IterCalcRel calc,
                                 String tag)
Sets the tag of an IterCalcRel to the specified tag

Returns:
a new IterCalcRel with the specified tag

replaceTagAsFennel

protected IteratorToFennelConverter replaceTagAsFennel(IteratorToFennelConverter converter,
                                                       IterCalcRel calc,
                                                       String tag)
Replaces the tag of an IterCalcRel underneath an IteratorToFennelConverter. Replaces the tag, then duplicates the converter.

Returns:
the duplicated converter

getTableTag

protected String getTableTag(String action,
                             String[] qualifiedName,
                             RelNode rel)
Gets a tag corresponding to a table name. The tag is built from elements of the qualified name, joined by dots. The tag is prefixed with an action name, and is optionally suffixed with a unique identifier. The tag has the overall format:"action.table[.uniqueSuffix]". The unique suffix is appended when the table's relation is provided. The suffix has a combination of the relation's runtime id and the current timestamp.

Parameters:
action - an action such as "delete" or "merge"
qualifiedName - a qualified table name
rel - the relation accessing a table for read or write. If not null, the relation is used to generate a unique suffix.

getDefaultTag

protected String getDefaultTag(IterCalcRel rel)
Gets the default tag for an IterCalcRel, based upon its id. The generated tag will be unique for the server process.

Parameters:
rel - the relation to build a tag for

setIterCalcTypeMap

protected void setIterCalcTypeMap(FennelRel rel,
                                  String tag)