// public void completeTestRun(boolean completeSetup, String runName, int numOfRegionServers, int // numOfViewManager, String distribution, List<String> viewTableTypes, int numOfViews, long // numOfOperations, long numOfRecords, int numOfBaseTableRegions, int numOfViewTableRegions, int // numOfAggKeys, boolean useDeletes, boolean useUpdates, long readDelay){ public void completeTestRun(Experiment experiment) { String datestring = new SimpleDateFormat("dd-MM-yyyy,HH-mm").format(new Date()); String directoryName = "testresults/testrun," + datestring + "," + experiment.getNumOfRegionServers() + "," + experiment.getNumOfViewManagers() + "," + experiment.getNumOfClients(); File dir = new File(directoryName); dir.mkdir(); dir = new File(directoryName + "/regionserverStatistics"); dir.mkdir(); dir = new File(directoryName + "/regionserverLogs"); dir.mkdir(); dir = new File(directoryName + "/viewmanagerStatistics"); dir.mkdir(); dir = new File(directoryName + "/viewmanagerLogs"); dir.mkdir(); dir = new File(directoryName + "/masterLogs"); dir.mkdir(); log = new Log("experiment.log"); svmHBase = new SVMHBase(log); // log.info(this.getClass(), "setting hbase config"); // setRegionServersHbase(experiment.getNumOfRegionServers(), directoryName); try { Thread.sleep(20000); } catch (InterruptedException e) { e.printStackTrace(); } try { log.info(this.getClass(), "configuring and starting database"); svmHBase.configureAndStart(experiment.numOfRegionServers, directoryName); } catch (Exception e) { log.error(this.getClass(), e); } try { Thread.sleep(35000); } catch (InterruptedException e) { e.printStackTrace(); } ViewDefinitions viewDefinitions = new ViewDefinitions(log, "viewdefinitions"); try { viewDefinitions.generateTable(); viewDefinitions.generateViewDefinitions(experiment.getCreateViewTables()); viewDefinitions.loadViewDefinitions(); } catch (Exception e) { log.error(this.getClass(), e); } log.info(this.getClass(), "creating view tables, setting process flag...."); log.info(this.getClass(), "view tables " + experiment.getCreateViewTables()); createTables(experiment.getNumOfClients(), experiment.getCreateViewTables()); if (experiment.getCreateBaseTables().size() > 0) { log.info(TestClient.class, "creating base tables, setting process flag...."); log.info(TestClient.class, "base tables " + experiment.getCreateBaseTables()); // createTables(experiment.getNumOfClients(),experiment.getCreateBaseTables()); List<ICreateTable> baseTables = new ArrayList<ICreateTable>(); for (ICreateTable iCreateTable : experiment.getCreateBaseTables()) { baseTables.add(iCreateTable); // CreateBaseTable createBaseTable = iCreateTable.copy(); // createBaseTable.setName(createBaseTable.getName()+"_commit"); // baseTables.add(createBaseTable); } createTables(experiment.getNumOfClients(), baseTables); } try { Thread.sleep(10000); } catch (InterruptedException e) { e.printStackTrace(); } log.info(this.getClass(), "starting components...."); startMaster(); try { Thread.sleep(8000); } catch (InterruptedException e) { e.printStackTrace(); } startRegionServers(experiment.getNumOfRegionServers()); startViewManagers(experiment.getNumOfViewManagers()); try { Thread.sleep(10000); } catch (InterruptedException e) { e.printStackTrace(); } // // if(createAndFillBaseTables && EvaluationConfig.getCreateBaseTables().size() > 0){ // log.info(TestClient.class, "filling base tables...."); log.info(TestClient.class, "base tables " + experiment.getCreateBaseTablesAsBaseTables()); long start = new Date().getTime(); startClients( experiment.getNumOfClients(), (List<CreateBaseTable>) experiment.getCreateBaseTablesAsBaseTables()); log.info(this.getClass(), "clients started in " + (new Date().getTime() - start) + " ms"); // // // }else{ // log.info(this.getClass(), "base table already filled"); // } // Killing View Managers boolean viewManagerKilled = false; start = new Date().getTime(); log.info(this.getClass(), "checking if base table filled...."); while (true) { if (experiment.getNumOfKilledViewManagers() > 0 && ((new Date().getTime() - start) > EvaluationConfig.VIEWMANAGER_KILLDELAY) && !viewManagerKilled) { killViewManagers(experiment.getNumOfKilledViewManagers()); viewManagerKilled = true; } if (checkDatabaseFilled(experiment.getNumOfClients())) { log.info(this.getClass(), "base table filled in " + (new Date().getTime() - start) + " ms"); queueMarkers((List<CreateBaseTable>) experiment.getCreateBaseTablesAsBaseTables()); break; } try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } } log.info(this.getClass(), "checking if update process is finished...."); long lastMeasure = new Date().getTime(); long currentTime2; while (true) { if (experiment.getNumOfKilledViewManagers() > 0 && ((new Date().getTime() - start) > EvaluationConfig.VIEWMANAGER_KILLDELAY) && !viewManagerKilled) { killViewManagers(experiment.getNumOfKilledViewManagers()); viewManagerKilled = true; } currentTime2 = new Date().getTime(); if (EvaluationConfig.UPDATEPROCESSTIMEOUT != 0 && (currentTime2 - lastMeasure) > EvaluationConfig.UPDATEPROCESSTIMEOUT) { log.info(this.getClass(), "update process failed...."); break; } if (checkProcessFinished( (List<CreateBaseTable>) experiment.getCreateBaseTablesAsBaseTables())) { log.info(this.getClass(), "view table filled in " + (currentTime2 - lastMeasure) + " ms"); log.info(this.getClass(), "update process is finished, cleaning up...."); break; } try { Thread.sleep(5000); } catch (InterruptedException e) { e.printStackTrace(); } } try { getTable().close(); setTable(null); } catch (IOException e1) { log.error(this.getClass(), e1); } stopVMSystem(false, experiment); // if(stopDatabase){ // } log.info(this.getClass(), "checking view tables...."); TableService tableService = new TableService(log); for (ICreateTable createTable : experiment.getCreateViewTables()) { log.info( this.getClass(), "checking view table:" + createTable.getName() + ", basetable: " + createTable.getControlTables()); if (createTable.getControlTables() != null && !createTable.getControlTables().equals("")) { log.info(this.getClass(), "checking table: " + createTable.getName()); ICreateView cAV = (ICreateView) createTable; ViewTester viewTester = new ViewTester(log, new TableService(log)); viewTester.check( createTable.getControlTables(), createTable.getName(), cAV.getViewDefinition()); } } tableService.close(); log.info(this.getClass(), "collecting statistics...."); readStatisticsLogMaster(directoryName); readStatisticsLogsRegionServers(experiment.getNumOfRegionServers(), directoryName); readStatisticsLogsViewManagers(experiment.getNumOfViewManagers(), directoryName); readStatisticsLogsClients( experiment.getNumOfClients(), experiment.getCreateBaseTables(), directoryName); log.info(this.getClass(), "exiting...."); log.info(this.getClass(), "stopping database...."); try { Thread.sleep(10000); } catch (InterruptedException e) { e.printStackTrace(); } // StatisticLog.close(); svmHBase.stopAll(); readStatisticsLogExperiment(directoryName, experiment); SSHService.closeSessions(); log.close(); // try { // Thread.sleep(30000); // } catch (InterruptedException e) { // // e.printStackTrace(); // } // }
public void onlyBaseTables(Experiment experiment) { String datestring = new SimpleDateFormat("dd-MM-yyyy,HH-mm").format(new Date()); String directoryName = "testresults/testrun," + datestring + "," + experiment.getNumOfRegionServers() + "," + experiment.getNumOfViewManagers() + "," + experiment.getNumOfClients(); File dir = new File(directoryName); dir.mkdir(); log = new Log("experiment.log"); svmHBase = new SVMHBase(log); try { Thread.sleep(20000); } catch (InterruptedException e) { e.printStackTrace(); } log.info(this.getClass(), "configuring and starting database"); svmHBase.configureAndStart(experiment.numOfRegionServers, directoryName); try { Thread.sleep(35000); } catch (InterruptedException e) { e.printStackTrace(); } ViewDefinitions viewDefinitions = new ViewDefinitions(log, "viewdefinitions"); try { viewDefinitions.generateTable(); } catch (Exception e) { log.error(this.getClass(), e); } if (experiment.getCreateBaseTables().size() > 0) { log.info(TestClient.class, "creating base tables, setting process flag...."); log.info(TestClient.class, "base tables " + experiment.getCreateBaseTables()); List<ICreateTable> baseTables = new ArrayList<ICreateTable>(); for (ICreateTable iCreateTable : experiment.getCreateBaseTables()) { baseTables.add(iCreateTable); // CreateBaseTable createBaseTable = iCreateTable.copy(); // createBaseTable.setName(createBaseTable.getName()+"_commit"); // baseTables.add(createBaseTable); } createTables(experiment.getNumOfClients(), baseTables); } try { Thread.sleep(20000); } catch (InterruptedException e) { e.printStackTrace(); } log.info(TestClient.class, "filling base tables...."); log.info(TestClient.class, "base tables " + experiment.getCreateBaseTables()); long start = new Date().getTime(); startClients( experiment.getNumOfClients(), (List<CreateBaseTable>) experiment.getCreateBaseTablesAsBaseTables()); log.info(this.getClass(), "clients started in " + (new Date().getTime() - start) + " ms"); log.info(this.getClass(), "checking if base table filled...."); start = new Date().getTime(); while (true) { if (checkDatabaseFilled(experiment.getNumOfClients())) { log.info(this.getClass(), "base table filled in " + (new Date().getTime() - start) + " ms"); queueMarkers((List<CreateBaseTable>) experiment.getCreateBaseTablesAsBaseTables()); break; } try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } } try { getTable().close(); setTable(null); } catch (IOException e1) { log.error(this.getClass(), e1); } log.info(this.getClass(), "collecting statistics...."); readStatisticsLogsClients( experiment.getNumOfClients(), experiment.getCreateBaseTables(), directoryName); log.info(this.getClass(), "exiting...."); log.info(this.getClass(), "stopping database...."); svmHBase.stopAll(); readStatisticsLogExperiment(directoryName, experiment); SSHService.closeSessions(); log.close(); }