public class RelOptCostImpl extends java.lang.Object implements RelOptCost
RelOptCost
interface. It it defined in terms of a single scalar quantity; somewhat
arbitrarily, it returns this scalar for rows processed and zero for both CPU
and I/O.Modifier and Type | Class and Description |
---|---|
private static class |
RelOptCostImpl.Factory
Implementation of
RelOptCostFactory that creates
RelOptCostImpl s. |
Modifier and Type | Field and Description |
---|---|
static RelOptCostFactory |
FACTORY |
private double |
value |
Constructor and Description |
---|
RelOptCostImpl(double value) |
Modifier and Type | Method and Description |
---|---|
double |
divideBy(RelOptCost cost)
Computes the ratio between this cost and another cost.
|
boolean |
equals(java.lang.Object obj) |
boolean |
equals(RelOptCost other)
Compares this to another cost.
|
double |
getCpu() |
double |
getIo() |
double |
getRows() |
int |
hashCode() |
boolean |
isEqWithEpsilon(RelOptCost other)
Compares this to another cost, allowing for slight roundoff errors.
|
boolean |
isInfinite() |
boolean |
isLe(RelOptCost other)
Compares this to another cost.
|
boolean |
isLt(RelOptCost other)
Compares this to another cost.
|
RelOptCost |
minus(RelOptCost other)
Subtracts another cost from this.
|
RelOptCost |
multiplyBy(double factor)
Multiplies this cost by a scalar factor.
|
RelOptCost |
plus(RelOptCost other)
Adds another cost to this.
|
java.lang.String |
toString()
Forces implementations to override
Object.toString() and provide a
good cost rendering to use during tracing. |
public static final RelOptCostFactory FACTORY
private final double value
public double getRows()
getRows
in interface RelOptCost
RelNode.estimateRowCount(org.apache.calcite.rel.metadata.RelMetadataQuery)
)public double getIo()
getIo
in interface RelOptCost
public double getCpu()
getCpu
in interface RelOptCost
public boolean isInfinite()
isInfinite
in interface RelOptCost
public boolean isLe(RelOptCost other)
RelOptCost
isLe
in interface RelOptCost
other
- another costpublic boolean isLt(RelOptCost other)
RelOptCost
isLt
in interface RelOptCost
other
- another costpublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(RelOptCost other)
RelOptCost
equals
in interface RelOptCost
other
- another costpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public boolean isEqWithEpsilon(RelOptCost other)
RelOptCost
isEqWithEpsilon
in interface RelOptCost
other
- another costpublic RelOptCost minus(RelOptCost other)
RelOptCost
minus
in interface RelOptCost
other
- another costpublic RelOptCost plus(RelOptCost other)
RelOptCost
plus
in interface RelOptCost
other
- another costpublic RelOptCost multiplyBy(double factor)
RelOptCost
multiplyBy
in interface RelOptCost
factor
- scalar factorpublic double divideBy(RelOptCost cost)
RelOptCost
divideBy is the inverse of RelOptCost.multiplyBy(double)
. For any
finite, non-zero cost and factor f,
cost.divideBy(cost.multiplyBy(f))
yields 1 / f
.
divideBy
in interface RelOptCost
cost
- Other costpublic java.lang.String toString()
RelOptCost
Object.toString()
and provide a
good cost rendering to use during tracing.toString
in interface RelOptCost
toString
in class java.lang.Object
Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.