提交 a9115701 authored 作者: Thomas Mueller's avatar Thomas Mueller

MVTableEngine

上级 4c470ed9
...@@ -102,6 +102,11 @@ public class RecoverTester implements Recorder { ...@@ -102,6 +102,11 @@ public class RecoverTester implements Recorder {
out.println("+ write #" + writeCount + " verify #" + verifyCount); out.println("+ write #" + writeCount + " verify #" + verifyCount);
try { try {
IOUtils.copyFiles(fileName, testDatabase + Constants.SUFFIX_PAGE_FILE); IOUtils.copyFiles(fileName, testDatabase + Constants.SUFFIX_PAGE_FILE);
String mvFileName = fileName.substring(0, fileName.length() - Constants.SUFFIX_PAGE_FILE.length()) +
Constants.SUFFIX_MV_FILE;
if (FileUtils.exists(mvFileName)) {
IOUtils.copyFiles(mvFileName, testDatabase + Constants.SUFFIX_MV_FILE);
}
verifyCount++; verifyCount++;
// avoid using the Engine class to avoid deadlocks // avoid using the Engine class to avoid deadlocks
Properties p = new Properties(); Properties p = new Properties();
......
...@@ -250,7 +250,7 @@ public class Recover extends Tool implements DataHandler { ...@@ -250,7 +250,7 @@ public class Recover extends Tool implements DataHandler {
} }
for (String fileName : list) { for (String fileName : list) {
if (fileName.endsWith(Constants.SUFFIX_PAGE_FILE)) { if (fileName.endsWith(Constants.SUFFIX_PAGE_FILE)) {
String mvFile = fileName.substring(0, fileName.length() - String mvFile = fileName.substring(0, fileName.length() -
Constants.SUFFIX_PAGE_FILE.length()) + Constants.SUFFIX_MV_FILE; Constants.SUFFIX_PAGE_FILE.length()) + Constants.SUFFIX_MV_FILE;
if (list.contains(mvFile)) { if (list.contains(mvFile)) {
this.mvFile = mvFile; this.mvFile = mvFile;
...@@ -259,7 +259,7 @@ public class Recover extends Tool implements DataHandler { ...@@ -259,7 +259,7 @@ public class Recover extends Tool implements DataHandler {
} else if (fileName.endsWith(Constants.SUFFIX_LOB_FILE)) { } else if (fileName.endsWith(Constants.SUFFIX_LOB_FILE)) {
dumpLob(fileName, false); dumpLob(fileName, false);
} else if (fileName.endsWith(Constants.SUFFIX_MV_FILE)) { } else if (fileName.endsWith(Constants.SUFFIX_MV_FILE)) {
PrintWriter writer = getWriter(fileName, ".mv.txt"); PrintWriter writer = getWriter(fileName, ".txt");
MVStoreTool.dump(fileName, writer); MVStoreTool.dump(fileName, writer);
writer.close(); writer.close();
} }
...@@ -485,7 +485,7 @@ public class Recover extends Tool implements DataHandler { ...@@ -485,7 +485,7 @@ public class Recover extends Tool implements DataHandler {
closeSilently(store); closeSilently(store);
} }
} }
private void dumpMVStoreFile(PrintWriter writer, String fileName) { private void dumpMVStoreFile(PrintWriter writer, String fileName) {
writer.println("-- mvstore"); writer.println("-- mvstore");
setDatabaseName(fileName.substring(0, fileName.length() - Constants.SUFFIX_MV_FILE.length())); setDatabaseName(fileName.substring(0, fileName.length() - Constants.SUFFIX_MV_FILE.length()));
...@@ -544,7 +544,7 @@ public class Recover extends Tool implements DataHandler { ...@@ -544,7 +544,7 @@ public class Recover extends Tool implements DataHandler {
} finally { } finally {
mv.close(); mv.close();
} }
} }
private static String getPageType(int type) { private static String getPageType(int type) {
switch (type) { switch (type) {
......
...@@ -116,7 +116,7 @@ int test; ...@@ -116,7 +116,7 @@ int test;
//System.out.println(prof.getTop(10)); //System.out.println(prof.getTop(10));
System.out.println((System.currentTimeMillis() - time) + " " + dbName + " after"); System.out.println((System.currentTimeMillis() - time) + " " + dbName + " after");
} }
private void testRecover() throws Exception { private void testRecover() throws Exception {
FileUtils.deleteRecursive(getBaseDir(), true); FileUtils.deleteRecursive(getBaseDir(), true);
Connection conn; Connection conn;
...@@ -130,7 +130,7 @@ int test; ...@@ -130,7 +130,7 @@ int test;
stat.execute("create table test2(name varchar)"); stat.execute("create table test2(name varchar)");
stat.execute("insert into test2 values('Hello World')"); stat.execute("insert into test2 values('Hello World')");
conn.close(); conn.close();
Recover.execute(getBaseDir(), "mvstore"); Recover.execute(getBaseDir(), "mvstore");
DeleteDbFiles.execute(getBaseDir(), "mvstore", true); DeleteDbFiles.execute(getBaseDir(), "mvstore", true);
conn = getConnection(url); conn = getConnection(url);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论