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
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intNOTE: the multiplication factors below are not calibrated yet...these are chosen based on approximations for now.static final intstatic final intstatic final intstatic final intstatic final intstatic final doublestatic final intstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionDrillCostBase(double rowCount, double cpu, double io, double network) DrillCostBase(double rowCount, double cpu, double io, double network, double memory) -
Method Summary
Modifier and TypeMethodDescriptiondoubledivideBy(org.apache.calcite.plan.RelOptCost cost) booleanbooleanequals(org.apache.calcite.plan.RelOptCost other) doublegetCpu()doublegetIo()doubledoubledoublegetRows()inthashCode()booleanisEqWithEpsilon(org.apache.calcite.plan.RelOptCost other) booleanbooleanisLe(org.apache.calcite.plan.RelOptCost other) booleanisLt(org.apache.calcite.plan.RelOptCost other) org.apache.calcite.plan.RelOptCostminus(org.apache.calcite.plan.RelOptCost other) org.apache.calcite.plan.RelOptCostmultiplyBy(double factor) org.apache.calcite.plan.RelOptCostplus(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:
getRowsin interfaceorg.apache.calcite.plan.RelOptCost
-
getCpu
public double getCpu()- Specified by:
getCpuin interfaceorg.apache.calcite.plan.RelOptCost
-
getIo
public double getIo()- Specified by:
getIoin interfaceorg.apache.calcite.plan.RelOptCost
-
getNetwork
public double getNetwork()- Specified by:
getNetworkin interfaceDrillRelOptCost
-
getMemory
public double getMemory()- Specified by:
getMemoryin interfaceDrillRelOptCost
-
hashCode
public int hashCode() -
equals
-
isInfinite
public boolean isInfinite()- Specified by:
isInfinitein interfaceorg.apache.calcite.plan.RelOptCost
-
equals
public boolean equals(org.apache.calcite.plan.RelOptCost other) - Specified by:
equalsin interfaceorg.apache.calcite.plan.RelOptCost
-
isEqWithEpsilon
public boolean isEqWithEpsilon(org.apache.calcite.plan.RelOptCost other) - Specified by:
isEqWithEpsilonin interfaceorg.apache.calcite.plan.RelOptCost
-
isLe
public boolean isLe(org.apache.calcite.plan.RelOptCost other) - Specified by:
isLein interfaceorg.apache.calcite.plan.RelOptCost
-
isLt
public boolean isLt(org.apache.calcite.plan.RelOptCost other) - Specified by:
isLtin interfaceorg.apache.calcite.plan.RelOptCost
-
plus
public org.apache.calcite.plan.RelOptCost plus(org.apache.calcite.plan.RelOptCost other) - Specified by:
plusin interfaceorg.apache.calcite.plan.RelOptCost
-
minus
public org.apache.calcite.plan.RelOptCost minus(org.apache.calcite.plan.RelOptCost other) - Specified by:
minusin interfaceorg.apache.calcite.plan.RelOptCost
-
multiplyBy
public org.apache.calcite.plan.RelOptCost multiplyBy(double factor) - Specified by:
multiplyByin interfaceorg.apache.calcite.plan.RelOptCost
-
divideBy
public double divideBy(org.apache.calcite.plan.RelOptCost cost) - Specified by:
divideByin interfaceorg.apache.calcite.plan.RelOptCost
-
toString
-