org.eigenbase.relopt
Class TableAccessMap

java.lang.Object
  extended by org.eigenbase.relopt.TableAccessMap

public class TableAccessMap
extends Object

TableAccessMap represents the tables accessed by a query plan, with READ/WRITE information.

Version:
$Id: //open/dev/farrago/src/org/eigenbase/relopt/TableAccessMap.java#16 $
Author:
John V. Sichi

Nested Class Summary
static class TableAccessMap.Mode
           
private  class TableAccessMap.TableRelVisitor
           
 
Field Summary
private  Map<List<String>,TableAccessMap.Mode> accessMap
           
 
Constructor Summary
TableAccessMap()
          Constructs a permanently empty TableAccessMap.
TableAccessMap(List<String> table, TableAccessMap.Mode mode)
          Constructs a TableAccessMap for a single table
TableAccessMap(RelNode rel)
          Constructs a TableAccessMap for all tables accessed by a RelNode and its descendants.
 
Method Summary
 List<String> getQualifiedName(RelOptTable table)
          Constructs a qualified name for an optimizer table reference.
 TableAccessMap.Mode getTableAccessMode(List<String> tableName)
          Determines the access mode of a table.
 Set<List<String>> getTablesAccessed()
           
 boolean isTableAccessed(List<String> tableName)
          Determines whether a table is accessed at all.
 boolean isTableAccessedForRead(List<String> tableName)
          Determines whether a table is accessed for read.
 boolean isTableAccessedForWrite(List<String> tableName)
          Determines whether a table is accessed for write.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

accessMap

private final Map<List<String>,TableAccessMap.Mode> accessMap
Constructor Detail

TableAccessMap

public TableAccessMap()
Constructs a permanently empty TableAccessMap.


TableAccessMap

public TableAccessMap(RelNode rel)
Constructs a TableAccessMap for all tables accessed by a RelNode and its descendants.

Parameters:
rel - the RelNode for which to build the map

TableAccessMap

public TableAccessMap(List<String> table,
                      TableAccessMap.Mode mode)
Constructs a TableAccessMap for a single table

Parameters:
table - fully qualified name of the table, represented as a list
mode - access mode for the table
Method Detail

getTablesAccessed

public Set<List<String>> getTablesAccessed()
Returns:
set of qualified names for all tables accessed

isTableAccessed

public boolean isTableAccessed(List<String> tableName)
Determines whether a table is accessed at all.

Parameters:
tableName - qualified name of the table of interest
Returns:
true if table is accessed

isTableAccessedForRead

public boolean isTableAccessedForRead(List<String> tableName)
Determines whether a table is accessed for read.

Parameters:
tableName - qualified name of the table of interest
Returns:
true if table is accessed for read

isTableAccessedForWrite

public boolean isTableAccessedForWrite(List<String> tableName)
Determines whether a table is accessed for write.

Parameters:
tableName - qualified name of the table of interest
Returns:
true if table is accessed for write

getTableAccessMode

public TableAccessMap.Mode getTableAccessMode(List<String> tableName)
Determines the access mode of a table.

Parameters:
tableName - qualified name of the table of interest
Returns:
access mode

getQualifiedName

public List<String> getQualifiedName(RelOptTable table)
Constructs a qualified name for an optimizer table reference.

Parameters:
table - table of interest
Returns:
qualified name