本文整理汇总了Java中org.apache.calcite.rel.convert.ConverterRule.getInTrait方法的典型用法代码示例。如果您正苦于以下问题:Java ConverterRule.getInTrait方法的具体用法?Java ConverterRule.getInTrait怎么用?Java ConverterRule.getInTrait使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.calcite.rel.convert.ConverterRule
的用法示例。
在下文中一共展示了ConverterRule.getInTrait方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: registerConverterRule
import org.apache.calcite.rel.convert.ConverterRule; //导入方法依赖的package包/类
public void registerConverterRule(
RelOptPlanner planner,
ConverterRule converterRule) {
if (converterRule.isGuaranteed()) {
ConversionData conversionData = getConversionData(planner);
final Convention inConvention =
(Convention) converterRule.getInTrait();
final Convention outConvention =
(Convention) converterRule.getOutTrait();
conversionData.conversionGraph.addVertex(inConvention);
conversionData.conversionGraph.addVertex(outConvention);
conversionData.conversionGraph.addEdge(inConvention, outConvention);
conversionData.mapArcToConverterRule.put(
Pair.of(inConvention, outConvention), converterRule);
}
}
示例2: removeRule
import org.apache.calcite.rel.convert.ConverterRule; //导入方法依赖的package包/类
public boolean removeRule(RelOptRule rule) {
if (!ruleSet.remove(rule)) {
// Rule was not present.
return false;
}
// Remove description.
unmapRuleDescription(rule);
// Remove operands.
for (Iterator<RelOptRuleOperand> iter = classOperands.values().iterator();
iter.hasNext();) {
RelOptRuleOperand entry = iter.next();
if (entry.getRule().equals(rule)) {
iter.remove();
}
}
// Remove trait mappings. (In particular, entries from conversion
// graph.)
if (rule instanceof ConverterRule) {
ConverterRule converterRule = (ConverterRule) rule;
final RelTrait ruleTrait = converterRule.getInTrait();
final RelTraitDef ruleTraitDef = ruleTrait.getTraitDef();
if (traitDefs.contains(ruleTraitDef)) {
ruleTraitDef.deregisterConverterRule(this, converterRule);
}
}
return true;
}
示例3: registerConverterRule
import org.apache.calcite.rel.convert.ConverterRule; //导入方法依赖的package包/类
public void registerConverterRule(
RelOptPlanner planner,
ConverterRule converterRule) {
if (!converterRule.isGuaranteed()) {
return;
}
RelTrait fromTrait = converterRule.getInTrait();
RelTrait toTrait = converterRule.getOutTrait();
conversionMap.put(fromTrait, Pair.of(toTrait, converterRule));
}