public class ConventionTraitDef extends RelTraitDef<Convention>
ConverterRule instance.
Conversion data is held in a LoadingCache
with weak keys so that the JVM's garbage
collector may reclaim the conversion data after the planner itself has been
garbage collected. The conversion information consists of a graph of
conversions (from one calling convention to another) and a map of graph arcs
to ConverterRules.
| Modifier and Type | Class and Description |
|---|---|
private static class |
ConventionTraitDef.ConversionData
Workspace for converting from one convention to another.
|
| Modifier and Type | Field and Description |
|---|---|
private com.google.common.cache.LoadingCache<RelOptPlanner,ConventionTraitDef.ConversionData> |
conversionCache
Weak-key cache of RelOptPlanner to ConversionData.
|
static ConventionTraitDef |
INSTANCE |
| Modifier | Constructor and Description |
|---|---|
private |
ConventionTraitDef() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canConvert(RelOptPlanner planner,
Convention fromConvention,
Convention toConvention)
Tests whether the given RelTrait can be converted to another RelTrait.
|
private RelNode |
changeConvention(RelNode rel,
Convention source,
Convention target,
com.google.common.collect.Multimap<Pair<Convention,Convention>,ConverterRule> mapArcToConverterRule)
Tries to convert a relational expression to the target convention of an
arc.
|
RelNode |
convert(RelOptPlanner planner,
RelNode rel,
Convention toConvention,
boolean allowInfiniteCostConverters)
Converts the given RelNode to the given RelTrait.
|
void |
deregisterConverterRule(RelOptPlanner planner,
ConverterRule converterRule)
Provides notification that a particular
ConverterRule has been
de-registered from a RelOptPlanner. |
private ConventionTraitDef.ConversionData |
getConversionData(RelOptPlanner planner) |
Convention |
getDefault()
Returns the default member of this trait.
|
String |
getSimpleName() |
Class<Convention> |
getTraitClass() |
void |
registerConverterRule(RelOptPlanner planner,
ConverterRule converterRule)
Provides notification of the registration of a particular
ConverterRule with a RelOptPlanner. |
canConvert, canonize, canonizeComposite, multiplepublic static final ConventionTraitDef INSTANCE
private final com.google.common.cache.LoadingCache<RelOptPlanner,ConventionTraitDef.ConversionData> conversionCache
public Class<Convention> getTraitClass()
getTraitClass in class RelTraitDef<Convention>public String getSimpleName()
getSimpleName in class RelTraitDef<Convention>RelNode.explain(org.apache.calcite.rel.RelWriter)).public Convention getDefault()
RelTraitDefgetDefault in class RelTraitDef<Convention>public void registerConverterRule(RelOptPlanner planner, ConverterRule converterRule)
RelTraitDefConverterRule with a RelOptPlanner. The default
implementation does nothing.registerConverterRule in class RelTraitDef<Convention>planner - the planner registering the ruleconverterRule - the registered converter rulepublic void deregisterConverterRule(RelOptPlanner planner, ConverterRule converterRule)
RelTraitDefConverterRule has been
de-registered from a RelOptPlanner. The default implementation
does nothing.deregisterConverterRule in class RelTraitDef<Convention>planner - the planner registering the ruleconverterRule - the registered converter rulepublic RelNode convert(RelOptPlanner planner, RelNode rel, Convention toConvention, boolean allowInfiniteCostConverters)
RelTraitDefconvert in class RelTraitDef<Convention>planner - the planner requesting the conversionrel - RelNode to converttoConvention - RelTrait to convert toallowInfiniteCostConverters - flag indicating whether infinite cost
converters are allowedprivate RelNode changeConvention(RelNode rel, Convention source, Convention target, com.google.common.collect.Multimap<Pair<Convention,Convention>,ConverterRule> mapArcToConverterRule)
public boolean canConvert(RelOptPlanner planner, Convention fromConvention, Convention toConvention)
RelTraitDefcanConvert in class RelTraitDef<Convention>planner - the planner requesting the conversion testfromConvention - the RelTrait to convert fromtoConvention - the RelTrait to convert toprivate ConventionTraitDef.ConversionData getConversionData(RelOptPlanner planner)
Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.