deneme
This commit is contained in:
@@ -65,6 +65,32 @@ public class AkkaTreeLoader {
|
|||||||
log.info("Load done");
|
log.info("Load done");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void loadRedisWait(String cmd){
|
||||||
|
Process process;
|
||||||
|
|
||||||
|
try {
|
||||||
|
// String comd = String.format(cmd, f.getAbsoluteFile());
|
||||||
|
process = Runtime.getRuntime()
|
||||||
|
|
||||||
|
.exec(cmd);
|
||||||
|
|
||||||
|
|
||||||
|
StreamGobbler streamGobbler =
|
||||||
|
new StreamGobbler(process.getInputStream(), System.out::println);
|
||||||
|
Executors.newSingleThreadExecutor().submit(streamGobbler);
|
||||||
|
int exitCode = process.waitFor();
|
||||||
|
assert exitCode == 0;
|
||||||
|
|
||||||
|
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
log.info("Load done");
|
||||||
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,8 @@ import java.util.stream.Collectors;
|
|||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
import static edu.lu.uni.serval.FixPatternParser.cluster.AkkaTreeLoader.loadRedis;
|
import static edu.lu.uni.serval.FixPatternParser.cluster.AkkaTreeLoader.loadRedis;
|
||||||
import static jdk.nashorn.internal.runtime.regexp.joni.Config.log;
|
import static edu.lu.uni.serval.FixPatternParser.cluster.AkkaTreeLoader.loadRedisWait;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by anilkoyuncu on 05/04/2018.
|
* Created by anilkoyuncu on 05/04/2018.
|
||||||
@@ -54,16 +55,17 @@ public class ImportPairs2DB {
|
|||||||
Integer portInt = Integer.valueOf(portInner);
|
Integer portInt = Integer.valueOf(portInner);
|
||||||
|
|
||||||
for (File pj : pjs) {
|
for (File pj : pjs) {
|
||||||
log.info(String.valueOf(portInt));
|
|
||||||
String cmd = "bash "+dbDir + "/" + "startServer.sh" +" %s %s %s";
|
String cmd = "bash "+dbDir + "/" + "startServer.sh" +" %s %s %s";
|
||||||
cmd = String.format(cmd, dbDir,pj.getName() +".rdb", portInt);
|
cmd = String.format(cmd, dbDir,pj.getName() +".rdb", portInt);
|
||||||
loadRedis(cmd,serverWait);
|
log.info(cmd);
|
||||||
|
loadRedisWait(cmd);
|
||||||
|
|
||||||
cmd = "bash "+dbDir + "redisImportSingle.sh" +" %s %s";
|
cmd = "bash "+dbDir + "redisImportSingle.sh" +" %s %s";
|
||||||
|
|
||||||
cmd = String.format(cmd, pj.getPath(), portInt);
|
cmd = String.format(cmd, pj.getPath(), portInt);
|
||||||
log.info(cmd);
|
log.info(cmd);
|
||||||
loadRedis(cmd,serverWait);
|
loadRedisWait(cmd);
|
||||||
|
|
||||||
portInt++;
|
portInt++;
|
||||||
|
|
||||||
@@ -72,4 +74,6 @@ public class ImportPairs2DB {
|
|||||||
|
|
||||||
log.info(parameters);
|
log.info(parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user