deneme
This commit is contained in:
@@ -65,6 +65,32 @@ public class AkkaTreeLoader {
|
||||
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) {
|
||||
|
||||
|
||||
|
||||
@@ -11,7 +11,8 @@ import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
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.
|
||||
@@ -54,16 +55,17 @@ public class ImportPairs2DB {
|
||||
Integer portInt = Integer.valueOf(portInner);
|
||||
|
||||
for (File pj : pjs) {
|
||||
log.info(String.valueOf(portInt));
|
||||
|
||||
String cmd = "bash "+dbDir + "/" + "startServer.sh" +" %s %s %s";
|
||||
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 = String.format(cmd, pj.getPath(), portInt);
|
||||
log.info(cmd);
|
||||
loadRedis(cmd,serverWait);
|
||||
loadRedisWait(cmd);
|
||||
|
||||
portInt++;
|
||||
|
||||
@@ -72,4 +74,6 @@ public class ImportPairs2DB {
|
||||
|
||||
log.info(parameters);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user