launcher all

This commit is contained in:
fixminer
2018-07-12 13:39:19 +02:00
parent 3649e7476a
commit de05e901be
+35 -16
View File
@@ -78,6 +78,33 @@ public class Launcher {
StoreFile.main(gumOutput, portInner, serverWait, dbDir, actionType+dumpsName,actionType); StoreFile.main(gumOutput, portInner, serverWait, dbDir, actionType+dumpsName,actionType);
break; break;
case "LEVEL1": case "LEVEL1":
level1(portInner, serverWait, port, pythonPath, datasetPath, pjName, actionType, threshold, dbDir, pairsPath, dumpsName, gumInput);
break;
//CALC python abstractPatch.py to from cluster folder
case "LEVEL2":
level2(serverWait, port, pythonPath, datasetPath, pjName, actionType, threshold, dbDir, dumpsName, gumInput);
break;
//CALC via python
case "LEVEL3":
level3(serverWait, port, pythonPath, datasetPath, pjName, actionType, threshold, dbDir, dumpsName, gumInput);
break;
case "ALL":
TestHunkParser.main(gumInput, gumOutput, numOfWorkers, pjName);
StoreFile.main(gumOutput, portInner, serverWait, dbDir, actionType+dumpsName,actionType);
level1(portInner, serverWait, port, pythonPath, datasetPath, pjName, actionType, threshold, dbDir, pairsPath, dumpsName, gumInput);
level2(serverWait, port, pythonPath, datasetPath, pjName, actionType, threshold, dbDir, dumpsName, gumInput);
level3(serverWait, port, pythonPath, datasetPath, pjName, actionType, threshold, dbDir, dumpsName, gumInput);
}
} catch (Exception e) {
e.printStackTrace();
}
}
private static void level1(String portInner, String serverWait, String port, String pythonPath, String datasetPath, String pjName, String actionType, String threshold, String dbDir, String pairsPath, String dumpsName, String gumInput) throws Exception {
CalculatePairs.main(serverWait, dbDir, actionType+dumpsName, portInner, pairsPath+actionType, pjName+actionType); CalculatePairs.main(serverWait, dbDir, actionType+dumpsName, portInner, pairsPath+actionType, pjName+actionType);
ImportPairs2DB.main(pairsPath+actionType, portInner, serverWait, dbDir,datasetPath); ImportPairs2DB.main(pairsPath+actionType, portInner, serverWait, dbDir,datasetPath);
@@ -97,10 +124,10 @@ public class Launcher {
String stopServer = "bash "+dbDir + "/" + "stopServer.sh" +" %s"; String stopServer = "bash "+dbDir + "/" + "stopServer.sh" +" %s";
stopServer = String.format(stopServer,Integer.valueOf(port)); stopServer = String.format(stopServer,Integer.valueOf(port));
cs1.runShell(stopServer,serverWait); cs1.runShell(stopServer,serverWait);
break; }
//CALC python abstractPatch.py to from cluster folder private static void level2(String serverWait, String port, String pythonPath, String datasetPath, String pjName, String actionType, String threshold, String dbDir, String dumpsName, String gumInput) throws Exception {
case "LEVEL2": String stopServer;
MultiThreadTreeLoaderCluster.calculatePairsOfClusters(datasetPath + "/cluster"+pjName+ actionType, datasetPath,actionType); MultiThreadTreeLoaderCluster.calculatePairsOfClusters(datasetPath + "/cluster"+pjName+ actionType, datasetPath,actionType);
MultiThreadTreeLoaderCluster.mainCompare("6300", datasetPath+"/pairs"+actionType, datasetPath + "/redisSingleImport.sh", dbDir, "clusterl1-"+pjName+actionType+".rdb", actionType+dumpsName, "6301",serverWait,actionType); MultiThreadTreeLoaderCluster.mainCompare("6300", datasetPath+"/pairs"+actionType, datasetPath + "/redisSingleImport.sh", dbDir, "clusterl1-"+pjName+actionType+".rdb", actionType+dumpsName, "6301",serverWait,actionType);
@@ -116,9 +143,10 @@ public class Launcher {
String stopServer1a = "bash "+dbDir + "/" + "stopServer.sh" +" %s"; String stopServer1a = "bash "+dbDir + "/" + "stopServer.sh" +" %s";
stopServer = String.format(stopServer1a,Integer.valueOf(port)); stopServer = String.format(stopServer1a,Integer.valueOf(port));
cs3.runShell(stopServer,serverWait); cs3.runShell(stopServer,serverWait);
break; }
//CALC via python
case "LEVEL3": private static void level3(String serverWait, String port, String pythonPath, String datasetPath, String pjName, String actionType, String threshold, String dbDir, String dumpsName, String gumInput) throws Exception {
String stopServer;
MultiThreadTreeLoaderCluster3.calculatePairsOfClusters(datasetPath + "/cluster-2l"+pjName+ actionType, datasetPath,actionType); MultiThreadTreeLoaderCluster3.calculatePairsOfClusters(datasetPath + "/cluster-2l"+pjName+ actionType, datasetPath,actionType);
MultiThreadTreeLoaderCluster3.mainCompare("6300", datasetPath+"/pairs-2l"+actionType, datasetPath + "/redisSingleImport.sh", dbDir, "clusterl2-"+pjName+actionType+".rdb", actionType+dumpsName, "6301",serverWait,actionType); MultiThreadTreeLoaderCluster3.mainCompare("6300", datasetPath+"/pairs-2l"+actionType, datasetPath + "/redisSingleImport.sh", dbDir, "clusterl2-"+pjName+actionType+".rdb", actionType+dumpsName, "6301",serverWait,actionType);
@@ -134,16 +162,7 @@ public class Launcher {
String stopServera = "bash "+dbDir + "/" + "stopServer.sh" +" %s"; String stopServera = "bash "+dbDir + "/" + "stopServer.sh" +" %s";
stopServer = String.format(stopServera,Integer.valueOf(port)); stopServer = String.format(stopServera,Integer.valueOf(port));
cs5.runShell(stopServer,serverWait); cs5.runShell(stopServer,serverWait);
break; return;
}
} catch (Exception e) {
e.printStackTrace();
}
} }
// System.exit(1); // System.exit(1);
} }