BeamCostModel implements RelOptCost { @Override public boolean isInfinite() { return (this.equals(INFINITY)) || (this.cpu == Double.POSITIVE_INFINITY) || (this.cpuRate == Double.POSITIVE_INFINITY); } BeamCostModel(double cpu, double cpuRate); @Override double getCpu(); @Override boolean isInfinite(); @Override double getIo(); double getCpuRate(); @Override boolean isLe(RelOptCost other); @Override boolean isLt(RelOptCost other); @Override double getRows(); @Override int hashCode(); @SuppressWarnings("NonOverridingEquals") @Override boolean equals(RelOptCost other); @Override boolean equals(@Nullable Object obj); @Override boolean isEqWithEpsilon(RelOptCost other); @Override BeamCostModel minus(RelOptCost other); @Override BeamCostModel multiplyBy(double factor); @Override double divideBy(RelOptCost cost); @Override BeamCostModel plus(RelOptCost other); @Override String toString(); static BeamCostModel convertRelOptCost(RelOptCost ic); static final BeamCostModel.Factory FACTORY; }
@Test public void testDefaultConstructorIsInfinite() { BeamCostModel cost = BeamCostModel.FACTORY.makeCost(1, 1, 1); Assert.assertTrue(cost.isInfinite()); }
@Test public void testOneInfiniteValue() { BeamCostModel cost = BeamCostModel.FACTORY.makeCost(Double.POSITIVE_INFINITY, 1); Assert.assertTrue(cost.isInfinite()); }