Package org.apache.calcite.rel.metadata
Class JaninoRelMetadataProvider
java.lang.Object
org.apache.calcite.rel.metadata.JaninoRelMetadataProvider
- All Implemented Interfaces:
 MetadataHandlerProvider,RelMetadataProvider
public class JaninoRelMetadataProvider
extends Object
implements RelMetadataProvider, MetadataHandlerProvider
Implementation of the 
RelMetadataProvider interface that generates
 a class that dispatches to the underlying providers.- 
Nested Class Summary
Nested Classes - 
Field Summary
Fields - 
Method Summary
Modifier and TypeMethodDescription<@Nullable M extends @Nullable Metadata>
UnboundMetadata<M>Deprecated.static voidboolean<MH extends MetadataHandler<?>>
MHProvide a handler for the requested metadata class.List<MetadataHandler<?>>handlers(Class<? extends MetadataHandler<?>> handlerClass) Retrieves a list ofMetadataHandlerfor implements a particularMetadataHandler.class.<M extends Metadata>
com.google.common.collect.Multimap<Method,MetadataHandler<M>> handlers(MetadataDef<M> def) Deprecated.inthashCode()static JaninoRelMetadataProviderof(RelMetadataProvider provider) Creates a JaninoRelMetadataProvider.voidDeprecated.<H extends MetadataHandler<?>>
HRevise the handler for a given kind of metadata. 
- 
Field Details
- 
DEFAULT
 
 - 
 - 
Method Details
- 
of
Creates a JaninoRelMetadataProvider.- Parameters:
 provider- Underlying provider
 - 
equals
 - 
hashCode
public int hashCode() - 
apply
@Deprecated public <@Nullable M extends @Nullable Metadata> UnboundMetadata<M> apply(Class<? extends RelNode> relClass, Class<? extends @Nullable M> metadataClass) Deprecated.Description copied from interface:RelMetadataProviderRetrieves metadata of a particular type and for a particular sub-class of relational expression.The object returned is a function. It can be applied to a relational expression of the given type to create a metadata object.
For example, you might call
RelMetadataProvider provider; LogicalFilter filter; RexNode predicate; Function<RelNode, Metadata> function = provider.apply(LogicalFilter.class, Selectivity.class}; Selectivity selectivity = function.apply(filter); Double d = selectivity.selectivity(predicate);
- Specified by:
 applyin interfaceRelMetadataProvider- Parameters:
 relClass- Type of relational expressionmetadataClass- Type of metadata- Returns:
 - Function that will field a metadata instance; or null if this provider cannot supply metadata of this type
 
 - 
handlers
@Deprecated public <M extends Metadata> com.google.common.collect.Multimap<Method,MetadataHandler<M>> handlers(MetadataDef<M> def) Deprecated.- Specified by:
 handlersin interfaceRelMetadataProvider
 - 
handlers
Description copied from interface:RelMetadataProviderRetrieves a list ofMetadataHandlerfor implements a particularMetadataHandler.class. The resolution order is specificity of the relNode class, with preference given to handlers that occur earlier in the list.For instance, given a return list of {A, B, C} where A implements RelNode and Scan, B implements Scan, and C implements LogicalScan and Filter.
Scan dispatches to a.method(Scan); LogicalFilter dispatches to c.method(Filter); LogicalScan dispatches to c.method(LogicalScan); Aggregate dispatches to a.method(RelNode).
The behavior is undefined if the class hierarchy for dispatching is not a tree.
- Specified by:
 handlersin interfaceRelMetadataProvider
 - 
revise
Description copied from interface:MetadataHandlerProviderRevise the handler for a given kind of metadata.Should be invoked if the existing handler throws a
MetadataHandlerProvider.NoHandlerexception.- Specified by:
 revisein interfaceMetadataHandlerProvider- Type Parameters:
 H- The type metadata the handler provides.- Parameters:
 handlerClass- The type of class to revise.- Returns:
 - A new handler that should be used instead of any previous handler provided.
 
 - 
register
Deprecated.Registers some classes. Does not flush the providers, but next time we need to generate a provider, it will handle all of these classes. So, calling this method reduces the number of times we need to re-generate. - 
handler
Description copied from interface:MetadataHandlerProviderProvide a handler for the requested metadata class.- Specified by:
 handlerin interfaceMetadataHandlerProvider- Type Parameters:
 MH- The metadata type the handler relates to.- Parameters:
 handlerClass- The handler interface expected- Returns:
 - The handler implementation.
 
 - 
clearStaticCache
@API(status=INTERNAL) public static void clearStaticCache() 
 -