/** * Run the optimization against live a table. * <p> * @throws Exception */ public void testBasicOptimizationUnknownTable() throws Exception { // SETUP MySQLDiskCacheAttributes attributes = new MySQLDiskCacheAttributes(); attributes.setUserName( "java" ); attributes.setPassword( "letmein" ); attributes.setUrl( "jdbc:mysql://10.19.98.43:3306/flight_option_cache" ); attributes.setDriverClassName( "com.mysql.jdbc.Driver" ); String tableName = "DOESNTEXIST"; attributes.setTableName( tableName ); TableState tableState = new TableState( tableName ); MySQLTableOptimizer optimizer = new MySQLTableOptimizer( attributes, tableState, JDBCDiskCachePoolAccessManager .createPoolAccess( attributes ) ); // DO WORK optimizer.optimizeTable(); } }
/** * Run the optimization against live a table. * <p> * @throws Exception */ public void testBasicOptimization() throws Exception { // SETUP MySQLDiskCacheAttributes attributes = new MySQLDiskCacheAttributes(); attributes.setUserName( "java" ); attributes.setPassword( "letmein" ); attributes.setUrl( "jdbc:mysql://10.19.98.43:3306/flight_option_cache" ); attributes.setDriverClassName( "com.mysql.jdbc.Driver" ); String tableName = "JCS_STORE_FLIGHT_OPTION_ITINERARY"; attributes.setTableName( tableName ); TableState tableState = new TableState( tableName ); MySQLTableOptimizer optimizer = new MySQLTableOptimizer( attributes, tableState, JDBCDiskCachePoolAccessManager .createPoolAccess( attributes ) ); // DO WORK optimizer.optimizeTable(); }
attributes.setTableName( tableName ); attributes.setBalkDuringOptimization( true );
attributes.setTableName( tableName ); attributes.setBalkDuringOptimization( true ); SharedPoolDataSourceFactory dsFactory = new SharedPoolDataSourceFactory();