@Test public void testEstimateConf() { Configuration estimateConf = driver.getEstimateConnectionConf(); assertNotNull(estimateConf); assertTrue(estimateConf != driver.getConf()); assertEquals(estimateConf.get(JDBC_USER), "estimateUser"); assertEquals(estimateConf.get(JDBC_POOL_MAX_SIZE.getConfigKey()), "50"); assertEquals(estimateConf.get(JDBC_POOL_IDLE_TIME.getConfigKey()), "800"); assertEquals(estimateConf.get(JDBC_GET_CONNECTION_TIMEOUT.getConfigKey()), "25000"); assertEquals(estimateConf.get(JDBC_MAX_STATEMENTS_PER_CONNECTION.getConfigKey()), "15"); }
protected final Configuration getEstimateConnectionConf() { if (estimateConf == null) { Configuration tmpConf = new Configuration(getConf()); for (String key : asList(JDBC_CONNECTION_PROPERTIES, JDBC_DB_URI, JDBC_DRIVER_CLASS, JDBC_USER, JDBC_PASSWORD, JDBC_POOL_MAX_SIZE.getConfigKey(), JDBC_POOL_IDLE_TIME.getConfigKey(), JDBC_MAX_IDLE_TIME_EXCESS_CONNECTIONS.getConfigKey(), JDBC_MAX_STATEMENTS_PER_CONNECTION.getConfigKey(), JDBC_GET_CONNECTION_TIMEOUT.getConfigKey())) { String val = getKeyOrFallBack(tmpConf, getEstimateKey(key), key); if (val != null) { tmpConf.set(key, val); } } if (tmpConf.get(JDBC_PASSWORD) == null) { tmpConf.set(JDBC_PASSWORD, ""); } estimateConf = tmpConf; } return estimateConf; }
JDBCDriver extends AbstractLensDriver { protected final Configuration getEstimateConnectionConf() { if (estimateConf == null) { Configuration tmpConf = new Configuration(getConf()); for (String key : asList(JDBC_CONNECTION_PROPERTIES, JDBC_DB_URI, JDBC_DRIVER_CLASS, JDBC_USER, JDBC_PASSWORD, JDBC_POOL_MAX_SIZE.getConfigKey(), JDBC_POOL_IDLE_TIME.getConfigKey(), JDBC_MAX_IDLE_TIME_EXCESS_CONNECTIONS.getConfigKey(), JDBC_MAX_STATEMENTS_PER_CONNECTION.getConfigKey(), JDBC_GET_CONNECTION_TIMEOUT.getConfigKey())) { String val = getKeyOrFallBack(tmpConf, getEstimateKey(key), key); if (val != null) { tmpConf.set(key, val); } } if (tmpConf.get(JDBC_PASSWORD) == null) { tmpConf.set(JDBC_PASSWORD, ""); } estimateConf = tmpConf; } return estimateConf; } }
JDBCDriver extends AbstractLensDriver { protected final Configuration getEstimateConnectionConf() { if (estimateConf == null) { Configuration tmpConf = new Configuration(getConf()); for (String key : asList(JDBC_CONNECTION_PROPERTIES, JDBC_DB_URI, JDBC_DRIVER_CLASS, JDBC_USER, JDBC_PASSWORD, JDBC_POOL_MAX_SIZE.getConfigKey(), JDBC_POOL_IDLE_TIME.getConfigKey(), JDBC_MAX_IDLE_TIME_EXCESS_CONNECTIONS.getConfigKey(), JDBC_MAX_STATEMENTS_PER_CONNECTION.getConfigKey(), JDBC_GET_CONNECTION_TIMEOUT.getConfigKey())) { String val = getKeyOrFallBack(tmpConf, getEstimateKey(key), key); if (val != null) { tmpConf.set(key, val); } } if (tmpConf.get(JDBC_PASSWORD) == null) { tmpConf.set(JDBC_PASSWORD, ""); } estimateConf = tmpConf; } return estimateConf; }  }
JDBCDriver extends AbstractLensDriver { protected final Configuration getEstimateConnectionConf() { if (estimateConf == null) { Configuration tmpConf = new Configuration(getConf()); for (String key : asList(JDBC_CONNECTION_PROPERTIES, JDBC_DB_URI, JDBC_DRIVER_CLASS, JDBC_USER, JDBC_PASSWORD, JDBC_POOL_MAX_SIZE.getConfigKey(), JDBC_POOL_IDLE_TIME.getConfigKey(), JDBC_MAX_IDLE_TIME_EXCESS_CONNECTIONS.getConfigKey(), JDBC_MAX_STATEMENTS_PER_CONNECTION.getConfigKey(), JDBC_GET_CONNECTION_TIMEOUT.getConfigKey())) { String val = getKeyOrFallBack(tmpConf, getEstimateKey(key), key); if (val != null) { tmpConf.set(key, val); } } if (tmpConf.get(JDBC_PASSWORD) == null) { tmpConf.set(JDBC_PASSWORD, ""); } estimateConf = tmpConf; } return estimateConf; }  @Override void configure(Configuration conf, String driverType, String driverName); void init(); QueryCost calculateQueryCost(AbstractQueryContext qctx); @Override QueryCost estimate(AbstractQueryContext qctx); @Override DriverQueryPlan explain(AbstractQueryContext explainCtx); void validate(AbstractQueryContext pContext); @Override void prepare(PreparedQueryContext pContext); @Override DriverQueryPlan explainAndPrepare(PreparedQueryContext pContext); @Override void closePreparedQuery(QueryPrepareHandle handle); @Override LensResultSet execute(QueryContext context); @Override void executeAsync(QueryContext context); @Override void updateStatus(QueryContext context); @Override void closeResultSet(QueryHandle handle); @Override boolean cancelQuery(QueryHandle handle); @Override void closeQuery(QueryHandle handle); @Override void close(); @Override void registerDriverEventListener(LensEventListener<DriverEvent> driverEventListener); @Override void readExternal(ObjectInput arg0); @Override void writeExternal(ObjectOutput arg0); @Override StatusUpdateMethod getStatusUpdateMethod(); }
JDBCDriver extends AbstractLensDriver { protected final Configuration getEstimateConnectionConf() { if (estimateConf == null) { Configuration tmpConf = new Configuration(getConf()); for (String key : asList(JDBC_CONNECTION_PROPERTIES, JDBC_DB_URI, JDBC_DRIVER_CLASS, JDBC_USER, JDBC_PASSWORD, JDBC_POOL_MAX_SIZE.getConfigKey(), JDBC_POOL_IDLE_TIME.getConfigKey(), JDBC_MAX_IDLE_TIME_EXCESS_CONNECTIONS.getConfigKey(), JDBC_MAX_STATEMENTS_PER_CONNECTION.getConfigKey(), JDBC_GET_CONNECTION_TIMEOUT.getConfigKey())) { String val = getKeyOrFallBack(tmpConf, getEstimateKey(key), key); if (val != null) { tmpConf.set(key, val); } } if (tmpConf.get(JDBC_PASSWORD) == null) { tmpConf.set(JDBC_PASSWORD, ""); } estimateConf = tmpConf; } return estimateConf; }  @Override void configure(Configuration conf, String driverType, String driverName); void init(); QueryCost calculateQueryCost(AbstractQueryContext qctx); @Override QueryCost estimate(AbstractQueryContext qctx); @Override DriverQueryPlan explain(AbstractQueryContext explainCtx); void validate(AbstractQueryContext pContext); @Override void prepare(PreparedQueryContext pContext); @Override DriverQueryPlan explainAndPrepare(PreparedQueryContext pContext); @Override void closePreparedQuery(QueryPrepareHandle handle); @Override LensResultSet execute(QueryContext context); @Override void executeAsync(QueryContext context); @Override void updateStatus(QueryContext context); @Override void closeResultSet(QueryHandle handle); @Override boolean cancelQuery(QueryHandle handle); @Override void closeQuery(QueryHandle handle); @Override void close(); @Override void registerDriverEventListener(LensEventListener<DriverEvent> driverEventListener); @Override void readExternal(ObjectInput arg0); @Override void writeExternal(ObjectOutput arg0); @Override StatusUpdateMethod getStatusUpdateMethod(); static final AtomicInteger THID; }