public interface RelTrait
CallingConvention.JAVA
is a trait
of the ConventionTraitDef
trait definition.
If all instances of RelTrait for a particular RelTraitDef are defined in
an enum
and no new RelTraits can be introduced at runtime, you need
not override hashCode()
and equals(Object)
. If, however,
new RelTrait instances are generated at runtime (e.g. based on state external
to the planner), you must implement hashCode()
and
equals(Object)
for proper canonization
of your RelTrait objects.
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o)
|
RelTraitDef |
getTraitDef()
Returns the RelTraitDef that defines this RelTrait.
|
int |
hashCode()
|
void |
register(RelOptPlanner planner)
Registers a trait instance with the planner.
|
boolean |
satisfies(RelTrait trait)
Returns whether this trait satisfies a given trait.
|
java.lang.String |
toString()
Returns a succinct name for this trait.
|
RelTraitDef getTraitDef()
int hashCode()
hashCode
in class java.lang.Object
boolean equals(java.lang.Object o)
equals
in class java.lang.Object
boolean satisfies(RelTrait trait)
A trait satisfies another if it is the same or stricter. For example,
ORDER BY x, y
satisfies ORDER BY x
.
A trait's satisfies
relation must be a partial order (reflexive,
anti-symmetric, transitive). Many traits cannot be "loosened"; their
satisfies
is an equivalence relation, where only X satisfies X.
If a trait has multiple values
(see RelCompositeTrait
)
a collection (T0, T1, ...) satisfies T if any Ti satisfies T.
trait
- Given traitjava.lang.String toString()
toString
in class java.lang.Object
void register(RelOptPlanner planner)
This is an opportunity to add rules that relate to that trait. However, typical implementations will do nothing.
planner
- PlannerCopyright © 2012–2019 The Apache Software Foundation. All rights reserved.