@ThreadSafe public class CostCalculatorWithEstimatedExchanges extends Object implements CostCalculator
Certain rules (e.g. ReorderJoins and DetermineJoinDistributionType) are run before exchanges
are added to a plan. This cost calculator adds the implied costs for the exchanges that will be added later.
It is needed to account for the differences in exchange costs for different types of joins.
CostCalculator.EstimatedExchanges| Constructor and Description |
|---|
CostCalculatorWithEstimatedExchanges(CostCalculator costCalculator,
TaskCountEstimator taskCountEstimator) |
| Modifier and Type | Method and Description |
|---|---|
PlanCostEstimate |
calculateCost(PlanNode node,
StatsProvider stats,
CostProvider sourcesCosts,
Session session,
TypeProvider types)
Calculates cumulative cost of a node.
|
static LocalCostEstimate |
calculateJoinCostWithoutOutput(PlanNode probe,
PlanNode build,
StatsProvider stats,
TypeProvider types,
boolean replicated,
int estimatedSourceDistributedTaskCount) |
static LocalCostEstimate |
calculateJoinInputCost(PlanNode probe,
PlanNode build,
StatsProvider stats,
TypeProvider types,
boolean replicated,
int estimatedSourceDistributedTaskCount) |
static LocalCostEstimate |
calculateLocalRepartitionCost(double inputSizeInBytes) |
static LocalCostEstimate |
calculateRemoteGatherCost(double inputSizeInBytes) |
static LocalCostEstimate |
calculateRemoteRepartitionCost(double inputSizeInBytes) |
static LocalCostEstimate |
calculateRemoteReplicateCost(double inputSizeInBytes,
int destinationTaskCount) |
@Inject public CostCalculatorWithEstimatedExchanges(CostCalculator costCalculator, TaskCountEstimator taskCountEstimator)
public PlanCostEstimate calculateCost(PlanNode node, StatsProvider stats, CostProvider sourcesCosts, Session session, TypeProvider types)
CostCalculatorcalculateCost in interface CostCalculatornode - The node to compute cost for.stats - The stats provider for node's stats and child nodes' stats, to be used if stats are needed to compute cost for the nodepublic static LocalCostEstimate calculateRemoteGatherCost(double inputSizeInBytes)
public static LocalCostEstimate calculateRemoteRepartitionCost(double inputSizeInBytes)
public static LocalCostEstimate calculateLocalRepartitionCost(double inputSizeInBytes)
public static LocalCostEstimate calculateRemoteReplicateCost(double inputSizeInBytes, int destinationTaskCount)
public static LocalCostEstimate calculateJoinCostWithoutOutput(PlanNode probe, PlanNode build, StatsProvider stats, TypeProvider types, boolean replicated, int estimatedSourceDistributedTaskCount)
public static LocalCostEstimate calculateJoinInputCost(PlanNode probe, PlanNode build, StatsProvider stats, TypeProvider types, boolean replicated, int estimatedSourceDistributedTaskCount)
Copyright © 2012–2019. All rights reserved.