Class DrillCostBase
java.lang.Object
org.apache.drill.exec.planner.cost.DrillCostBase
- All Implemented Interfaces:
org.apache.calcite.plan.RelOptCost
,DrillRelOptCost
Implementation of the DrillRelOptCost, modeled similar to VolcanoCost
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
NOTE: the multiplication factors below are not calibrated yet...these are chosen based on approximations for now.static final int
static final int
static final int
static final int
static final int
static final double
static final int
static final int
static final int
-
Constructor Summary
ConstructorDescriptionDrillCostBase
(double rowCount, double cpu, double io, double network) DrillCostBase
(double rowCount, double cpu, double io, double network, double memory) -
Method Summary
Modifier and TypeMethodDescriptiondouble
divideBy
(org.apache.calcite.plan.RelOptCost cost) boolean
boolean
equals
(org.apache.calcite.plan.RelOptCost other) double
getCpu()
double
getIo()
double
double
double
getRows()
int
hashCode()
boolean
isEqWithEpsilon
(org.apache.calcite.plan.RelOptCost other) boolean
boolean
isLe
(org.apache.calcite.plan.RelOptCost other) boolean
isLt
(org.apache.calcite.plan.RelOptCost other) org.apache.calcite.plan.RelOptCost
minus
(org.apache.calcite.plan.RelOptCost other) org.apache.calcite.plan.RelOptCost
multiplyBy
(double factor) org.apache.calcite.plan.RelOptCost
plus
(org.apache.calcite.plan.RelOptCost other) toString()
-
Field Details
-
BASE_CPU_COST
public static final int BASE_CPU_COSTNOTE: the multiplication factors below are not calibrated yet...these are chosen based on approximations for now. For reference purposes, assume each disk on a server can have a sustained I/O throughput of 100 MBytes/sec. Suppose there is an array of 16 disks per server..theoretically one could get 1.6GBytes/sec. Suppose network speed is 1GBit/sec which is 128MBytes/sec, although actual transfer rate over the network may be lower. We are only concerned with relative costs, not absolute values. For relative costing, let's assume sending data over the network is about 16x slower than reading/writing to an array of local disks.- See Also:
-
BYTE_DISK_READ_COST
public static final int BYTE_DISK_READ_COST- See Also:
-
BYTE_NETWORK_COST
public static final int BYTE_NETWORK_COST- See Also:
-
SVR_CPU_COST
public static final int SVR_CPU_COST- See Also:
-
FUNC_CPU_COST
public static final int FUNC_CPU_COST- See Also:
-
PROJECT_CPU_COST
public static final int PROJECT_CPU_COST- See Also:
-
HASH_CPU_COST
public static final int HASH_CPU_COST- See Also:
-
MEMORY_TO_CPU_RATIO
public static final double MEMORY_TO_CPU_RATIO- See Also:
-
RANGE_PARTITION_CPU_COST
public static final int RANGE_PARTITION_CPU_COST- See Also:
-
COMPARE_CPU_COST
public static final int COMPARE_CPU_COST- See Also:
-
AVG_FIELD_WIDTH
public static final int AVG_FIELD_WIDTH- See Also:
-
-
Constructor Details
-
DrillCostBase
public DrillCostBase(double rowCount, double cpu, double io, double network) -
DrillCostBase
public DrillCostBase(double rowCount, double cpu, double io, double network, double memory)
-
-
Method Details
-
getRows
public double getRows()- Specified by:
getRows
in interfaceorg.apache.calcite.plan.RelOptCost
-
getCpu
public double getCpu()- Specified by:
getCpu
in interfaceorg.apache.calcite.plan.RelOptCost
-
getIo
public double getIo()- Specified by:
getIo
in interfaceorg.apache.calcite.plan.RelOptCost
-
getNetwork
public double getNetwork()- Specified by:
getNetwork
in interfaceDrillRelOptCost
-
getMemory
public double getMemory()- Specified by:
getMemory
in interfaceDrillRelOptCost
-
hashCode
public int hashCode() -
equals
-
isInfinite
public boolean isInfinite()- Specified by:
isInfinite
in interfaceorg.apache.calcite.plan.RelOptCost
-
equals
public boolean equals(org.apache.calcite.plan.RelOptCost other) - Specified by:
equals
in interfaceorg.apache.calcite.plan.RelOptCost
-
isEqWithEpsilon
public boolean isEqWithEpsilon(org.apache.calcite.plan.RelOptCost other) - Specified by:
isEqWithEpsilon
in interfaceorg.apache.calcite.plan.RelOptCost
-
isLe
public boolean isLe(org.apache.calcite.plan.RelOptCost other) - Specified by:
isLe
in interfaceorg.apache.calcite.plan.RelOptCost
-
isLt
public boolean isLt(org.apache.calcite.plan.RelOptCost other) - Specified by:
isLt
in interfaceorg.apache.calcite.plan.RelOptCost
-
plus
public org.apache.calcite.plan.RelOptCost plus(org.apache.calcite.plan.RelOptCost other) - Specified by:
plus
in interfaceorg.apache.calcite.plan.RelOptCost
-
minus
public org.apache.calcite.plan.RelOptCost minus(org.apache.calcite.plan.RelOptCost other) - Specified by:
minus
in interfaceorg.apache.calcite.plan.RelOptCost
-
multiplyBy
public org.apache.calcite.plan.RelOptCost multiplyBy(double factor) - Specified by:
multiplyBy
in interfaceorg.apache.calcite.plan.RelOptCost
-
divideBy
public double divideBy(org.apache.calcite.plan.RelOptCost cost) - Specified by:
divideBy
in interfaceorg.apache.calcite.plan.RelOptCost
-
toString
-