@Test public void testGetQueryCostType() throws Exception { assertEquals(cost1.getQueryCostType(), QueryCostType.HIGH); assertEquals(cost2.getQueryCostType(), QueryCostType.HIGH); assertEquals(cost0.getQueryCostType(), QueryCostType.LOW); assertEquals(scost0.getQueryCostType(), QueryCostType.VERY_LOW); }
public QueryCostTO build() { Long estimatedExecTimeMillis = null; Double estimatedResourceUsage = null; try { estimatedExecTimeMillis = cost.getEstimatedExecTimeMillis(); } catch (UnsupportedOperationException e) { log.debug("estimated exec time not supported for {}", cost.getClass().getCanonicalName()); } try { estimatedResourceUsage = cost.getEstimatedResourceUsage(); } catch (UnsupportedOperationException e) { log.debug("estimated resource usage not supported for {}", cost.getClass().getCanonicalName()); } return new QueryCostTO(estimatedExecTimeMillis, estimatedResourceUsage, cost.getQueryCostType()); } }
public QueryCostTO build() { Long estimatedExecTimeMillis = null; Double estimatedResourceUsage = null; try { estimatedExecTimeMillis = cost.getEstimatedExecTimeMillis(); } catch (UnsupportedOperationException e) { log.debug("estimated exec time not supported for {}", cost.getClass().getCanonicalName()); } try { estimatedResourceUsage = cost.getEstimatedResourceUsage(); } catch (UnsupportedOperationException e) { log.debug("estimated resource usage not supported for {}", cost.getClass().getCanonicalName()); } return new QueryCostTO(estimatedExecTimeMillis, estimatedResourceUsage, cost.getQueryCostType()); } }