class VolcanoCost extends Object implements RelOptCost
VolcanoCost represents the cost of a plan node.
This class is immutable: none of the methods modify any member variables.
| Modifier and Type | Class and Description |
|---|---|
private static class |
VolcanoCost.Factory
Implementation of
RelOptCostFactory
that creates VolcanoCosts. |
| Modifier and Type | Field and Description |
|---|---|
(package private) double |
cpu |
static RelOptCostFactory |
FACTORY |
(package private) static VolcanoCost |
HUGE |
(package private) static VolcanoCost |
INFINITY |
(package private) double |
io |
(package private) double |
rowCount |
(package private) static VolcanoCost |
TINY |
(package private) static VolcanoCost |
ZERO |
| Constructor and Description |
|---|
VolcanoCost(double rowCount,
double cpu,
double io) |
| Modifier and Type | Method and Description |
|---|---|
double |
divideBy(RelOptCost cost)
Computes the ratio between this cost and another cost.
|
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.
|
String |
toString()
Forces implementations to override
Object.toString() and provide a
good cost rendering to use during tracing. |
static final VolcanoCost INFINITY
static final VolcanoCost HUGE
static final VolcanoCost ZERO
static final VolcanoCost TINY
public static final RelOptCostFactory FACTORY
final double cpu
final double io
final double rowCount
public double getCpu()
getCpu in interface RelOptCostpublic boolean isInfinite()
isInfinite in interface RelOptCostpublic double getIo()
getIo in interface RelOptCostpublic boolean isLe(RelOptCost other)
RelOptCostisLe in interface RelOptCostother - another costpublic boolean isLt(RelOptCost other)
RelOptCostisLt in interface RelOptCostother - another costpublic double getRows()
getRows in interface RelOptCostRelNode.estimateRowCount(org.apache.calcite.rel.metadata.RelMetadataQuery))public boolean equals(RelOptCost other)
RelOptCostequals in interface RelOptCostother - another costpublic boolean isEqWithEpsilon(RelOptCost other)
RelOptCostisEqWithEpsilon in interface RelOptCostother - another costpublic RelOptCost minus(RelOptCost other)
RelOptCostminus in interface RelOptCostother - another costpublic RelOptCost multiplyBy(double factor)
RelOptCostmultiplyBy in interface RelOptCostfactor - scalar factorpublic double divideBy(RelOptCost cost)
RelOptCostdivideBy 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 RelOptCostcost - Other costpublic RelOptCost plus(RelOptCost other)
RelOptCostplus in interface RelOptCostother - another costpublic String toString()
RelOptCostObject.toString() and provide a
good cost rendering to use during tracing.toString in interface RelOptCosttoString in class ObjectCopyright © 2012–2018 The Apache Software Foundation. All rights reserved.