org.eigenbase.rel.metadata
Class CachingRelMetadataProvider
java.lang.Object
org.eigenbase.rel.metadata.CachingRelMetadataProvider
- All Implemented Interfaces:
- RelMetadataProvider
public class CachingRelMetadataProvider
- extends Object
- implements RelMetadataProvider
CachingRelMetadataProvider implements the RelMetadataProvider
interface by caching results from an underlying provider.
- Version:
- $Id: //open/dev/farrago/src/org/eigenbase/rel/metadata/CachingRelMetadataProvider.java#7 $
- Author:
- John V. Sichi
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
cache
private final Map<List,CachingRelMetadataProvider.CacheEntry> cache
underlyingProvider
private final RelMetadataProvider underlyingProvider
planner
private final RelOptPlanner planner
CachingRelMetadataProvider
public CachingRelMetadataProvider(RelMetadataProvider underlyingProvider,
RelOptPlanner planner)
getRelMetadata
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
- Parameters:
rel
- relational expression of interestmetadataQueryName
- name of metadata query to invokeargs
- 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
- Returns:
- 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