public static PlanNodeCostEstimate networkCost(double networkCost) { return new PlanNodeCostEstimate(0, 0, networkCost); }
public PlanNodeCostEstimate add(PlanNodeCostEstimate other) { return new PlanNodeCostEstimate( cpuCost + other.cpuCost, memoryCost + other.memoryCost, networkCost + other.networkCost); } }
public static PlanNodeCostEstimate memoryCost(double memoryCost) { return new PlanNodeCostEstimate(0, memoryCost, 0); }
public static PlanNodeCostEstimate calculateRemoteRepartitionCost(double inputSizeInBytes) { return new PlanNodeCostEstimate(inputSizeInBytes, 0, inputSizeInBytes); }
public static PlanNodeCostEstimate cpuCost(double cpuCost) { return new PlanNodeCostEstimate(cpuCost, 0, 0); }
public CostComparisonAssertion smaller(double cpu, double memory, double network) { checkState(smaller == null, "already set"); smaller = new PlanNodeCostEstimate(cpu, memory, network); return this; }
public CostComparisonAssertion larger(double cpu, double memory, double network) { checkState(larger == null, "already set"); larger = new PlanNodeCostEstimate(cpu, memory, network); return this; } }
@Override public PlanNodeCostEstimate visitRowNumber(RowNumberNode node, Void context) { List<Symbol> symbols = node.getOutputSymbols(); // when maxRowCountPerPartition is set, the RowNumberOperator // copies values for all the columns into a page builder if (!node.getMaxRowCountPerPartition().isPresent()) { symbols = ImmutableList.<Symbol>builder() .addAll(node.getPartitionBy()) .add(node.getRowNumberSymbol()) .build(); } PlanNodeStatsEstimate stats = getStats(node); double cpuCost = stats.getOutputSizeInBytes(symbols, types); double memoryCost = node.getPartitionBy().isEmpty() ? 0 : stats.getOutputSizeInBytes(node.getSource().getOutputSymbols(), types); return new PlanNodeCostEstimate(cpuCost, memoryCost, 0); }
return new PlanNodeCostEstimate(cpuCost, memoryCost, 0);
@Override public PlanNodeCostEstimate visitAggregation(AggregationNode node, Void context) { if (node.getStep() != FINAL && node.getStep() != SINGLE) { return PlanNodeCostEstimate.unknown(); } PlanNodeStatsEstimate aggregationStats = getStats(node); PlanNodeStatsEstimate sourceStats = getStats(node.getSource()); double cpuCost = sourceStats.getOutputSizeInBytes(node.getSource().getOutputSymbols(), types); double memoryCost = aggregationStats.getOutputSizeInBytes(node.getOutputSymbols(), types); return new PlanNodeCostEstimate(cpuCost, memoryCost, 0); }