Class ReflectiveRelMetadataProvider

  extended by org.eigenbase.rel.metadata.ReflectiveRelMetadataProvider
All Implemented Interfaces:
RelMetadataProvider, ReflectiveVisitor
Direct Known Subclasses:
FarragoRelMetadataProvider, FarragoTestPersonalityFactory.FarragoTestRelMetadataProvider, FtrsDataServer.FtrsRelMetadataProvider, LoptMetadataProvider, MedJdbcMetadataProvider, RelMdColumnOrigins, RelMdColumnUniqueness, RelMdDistinctRowCount, RelMdExplainVisibility, RelMdPercentageOriginalRows, RelMdPopulationSize, RelMdRowCount, RelMdSelectivity, RelMdUniqueKeys

public abstract class ReflectiveRelMetadataProvider
extends Object
implements RelMetadataProvider, ReflectiveVisitor

ReflectiveRelMetadataProvider provides an abstract base for reflective implementations of the RelMetadataProvider interface. For an example, see DefaultRelMetadataProvider.

TODO jvs 28-Mar-2006: most of this should probably be refactored into ReflectUtil.

$Id: //open/dev/farrago/src/org/eigenbase/rel/metadata/ $
John V. Sichi

Field Summary
private  Map<String,List<Class>> parameterTypeMap
private  ReflectiveVisitDispatcher<ReflectiveRelMetadataProvider,RelNode> visitDispatcher
Constructor Summary
protected ReflectiveRelMetadataProvider()
          Creates a ReflectiveRelMetadataProvider.
Method Summary
 Object getRelMetadata(RelNode rel, String metadataQueryName, Object[] args)
          Retrieves metadata about a relational expression.
protected  void mapParameterTypes(String metadataQueryName, List<Class> parameterTypes)
          Maps the parameter type signature to look up for a given metadata query.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


private final Map<String,List<Class>> parameterTypeMap


private final ReflectiveVisitDispatcher<ReflectiveRelMetadataProvider,RelNode> visitDispatcher
Constructor Detail


protected ReflectiveRelMetadataProvider()
Creates a ReflectiveRelMetadataProvider.

Method Detail


protected void mapParameterTypes(String metadataQueryName,
                                 List<Class> parameterTypes)
Maps the parameter type signature to look up for a given metadata query.

metadataQueryName - name of metadata query to map
parameterTypes - argument types (beyond the overloaded rel type) to map


public Object getRelMetadata(RelNode rel,
                             String metadataQueryName,
                             Object[] args)
Description copied from interface: RelMetadataProvider
Retrieves metadata about a relational expression.

Specified by:
getRelMetadata in interface RelMetadataProvider
rel - relational expression of interest
metadataQueryName - name of metadata query to invoke
args - arguments to metadata query (expected number and type depend on query name; must have well-defined hashCode/equals for use by caching); null can be used instead of empty array
metadata result (actual type depends on query name), or null if the provider cannot answer the given query/rel combination; it is better to return null than to return a possibly incorrect answer