/** * Main setUp method for test cases. Given the ProjectType we will populate the static catalog * field members The full_catalog flag is a hack to work around OutofMemory issues with TPC-E * * @param type * @param fkeys * @param full_catalog * @throws Exception */ protected void setUp(ProjectType type, boolean fkeys, boolean full_catalog) throws Exception { super.setUp(); is_first = (is_first == null ? true : false); this.last_type = type; catalog = project_catalogs.get(type); catalog_db = project_databases.get(type); p_estimator = project_p_estimators.get(type); if (catalog == null) { AbstractProjectBuilder projectBuilder = AbstractProjectBuilder.getProjectBuilder(type); if (ENABLE_JAR_REUSE) { File jar_path = projectBuilder.getJarPath(true); if (jar_path.exists()) { LOG.debug("LOAD CACHE JAR: " + jar_path.getAbsolutePath()); catalog = CatalogUtil.loadCatalogFromJar(jar_path.getAbsolutePath()); } else { LOG.debug("MISSING JAR: " + jar_path.getAbsolutePath()); } } if (catalog == null) { switch (type) { case TPCC: catalog = TPCCProjectBuilder.getTPCCSchemaCatalog(true); // Update the ProcParameter mapping used in the catalogs // // ParametersUtil.populateCatalog(CatalogUtil.getDatabase(catalog), // ParametersUtil.getParameterMapping(type)); break; case TPCE: catalog = projectBuilder.createCatalog(fkeys, full_catalog); break; case TM1: case SEATS: case AUCTIONMARK: case MARKOV: case LOCALITY: case MAPREDUCE: catalog = projectBuilder.getFullCatalog(fkeys); break; default: assert (false) : "Invalid project type - " + type; } // SWITCH } if (type == ProjectType.TPCC) ParametersUtil.populateCatalog( CatalogUtil.getDatabase(catalog), ParametersUtil.getParameterMapping(type)); this.init(type, catalog); } }
protected void applyCatalogCorrelations(ProjectType type) throws Exception { // We need the correlations file in order to make sure the parameters // get mapped properly File correlations_path = this.getParameterMappingsFile(type); if (correlations_path != null) { ParameterMappingsSet correlations = new ParameterMappingsSet(); correlations.load(correlations_path.getAbsolutePath(), catalog_db); ParametersUtil.applyParameterMappings(catalog_db, correlations); } }