flushdb
This commit is contained in:
+9
-5
@@ -92,7 +92,7 @@ public class MultiThreadTreeLoader {
|
|||||||
|
|
||||||
|
|
||||||
Process process;
|
Process process;
|
||||||
|
log.info(f.getName());
|
||||||
try {
|
try {
|
||||||
String comd = String.format(cmd, f.getAbsoluteFile());
|
String comd = String.format(cmd, f.getAbsoluteFile());
|
||||||
process = Runtime.getRuntime()
|
process = Runtime.getRuntime()
|
||||||
@@ -110,7 +110,7 @@ public class MultiThreadTreeLoader {
|
|||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
log.info("Load done");
|
||||||
|
|
||||||
try (Jedis jedis = jedisPool.getResource()) {
|
try (Jedis jedis = jedisPool.getResource()) {
|
||||||
// do operations with jedis resource
|
// do operations with jedis resource
|
||||||
@@ -118,10 +118,10 @@ public class MultiThreadTreeLoader {
|
|||||||
ScanParams sc = new ScanParams();
|
ScanParams sc = new ScanParams();
|
||||||
sc.count(150000000);
|
sc.count(150000000);
|
||||||
sc.match("pair_*");
|
sc.match("pair_*");
|
||||||
jedis.configSet("dbfilename",f.getName());
|
// jedis.configSet("dbfilename",f.getName());
|
||||||
|
log.info("Scanning");
|
||||||
ScanResult<String> scan = jedis.scan("0",sc);
|
ScanResult<String> scan = jedis.scan("0",sc);
|
||||||
|
log.info("Scanning " + String.valueOf(scan.getResult().size()));
|
||||||
// java.util.Iterator<String> it = names.iterator();
|
// java.util.Iterator<String> it = names.iterator();
|
||||||
// while(it.hasNext()) {
|
// while(it.hasNext()) {
|
||||||
// String s = it.next();
|
// String s = it.next();
|
||||||
@@ -130,7 +130,11 @@ public class MultiThreadTreeLoader {
|
|||||||
scan.getResult().parallelStream()
|
scan.getResult().parallelStream()
|
||||||
.forEach(m -> coreCompare(m, inputPath, jedisPool));
|
.forEach(m -> coreCompare(m, inputPath, jedisPool));
|
||||||
|
|
||||||
|
jedis.select(0);
|
||||||
|
jedis.flushDB();
|
||||||
|
|
||||||
jedis.save();
|
jedis.save();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user