提交 101d72e0 authored 作者: Thomas Mueller's avatar Thomas Mueller

MVStore: rename pageSize to pageSplitSize

上级 5d9a00a9
......@@ -174,7 +174,7 @@ public class TestConcurrent extends TestMVStore {
}
private void testConcurrentIterate() {
MVStore s = new MVStore.Builder().pageSize(3).open();
MVStore s = new MVStore.Builder().pageSplitSize(3).open();
final MVMap<Integer, Integer> map = s.openMap("test");
final int len = 10;
final Random r = new Random();
......
......@@ -47,7 +47,8 @@ public class TestMVStore extends TestBase {
public void test() throws Exception {
FileUtils.deleteRecursive(getBaseDir(), true);
FileUtils.createDirectories(getBaseDir());
testPerformanceCompareWithTreeMapHashMap();
testMemoryUsage();
testBackgroundExceptionListener();
testOldVersion();
testAtomicOperations();
......@@ -68,6 +69,7 @@ public class TestMVStore extends TestBase {
testIterateOldVersion();
testObjects();
testExample();
testExampleMvcc();
testOpenStoreCloseLoop();
testVersion();
testTruncateFile();
......@@ -91,6 +93,14 @@ public class TestMVStore extends TestBase {
testLargerThan2G();
}
private void testPerformanceCompareWithTreeMapHashMap() {
int todo;
}
private void testMemoryUsage() {
int todo;
}
private void testBackgroundExceptionListener() throws Exception {
String fileName = getBaseDir() + "/testBackgroundExceptionListener.h3";
FileUtils.delete(fileName);
......@@ -722,6 +732,27 @@ public class TestMVStore extends TestBase {
// create/get the map named "data"
MVMap<Integer, String> map = s.openMap("data");
// add and read some data
map.put(1, "Hello World");
// System.out.println(map.get(1));
// mark the changes as committed
s.commit();
// close the store
s.close();
}
private void testExampleMvcc() {
String fileName = getBaseDir() + "/testExampleMvcc.h3";
FileUtils.delete(fileName);
// open the store (in-memory if fileName is null)
MVStore s = MVStore.open(fileName);
// create/get the map named "data"
MVMap<Integer, String> map = s.openMap("data");
// add some data
map.put(1, "Hello");
map.put(2, "World");
......@@ -742,9 +773,6 @@ public class TestMVStore extends TestBase {
MVMap<Integer, String> oldMap =
map.openVersion(oldVersion);
// mark the changes as committed
s.commit();
// print the old version (can be done
// concurrently with further modifications)
// this will print "Hello" and "World":
......@@ -758,7 +786,7 @@ public class TestMVStore extends TestBase {
// System.out.println(map.get(1));
assertEquals("Hi", map.get(1));
// close the store - this doesn't write to disk
// close the store
s.close();
}
......@@ -1482,12 +1510,12 @@ public class TestMVStore extends TestBase {
* Open a store for the given file name, using a small page size.
*
* @param fileName the file name (null for in-memory)
* @param pageSize the page size
* @param pageSplitSize the page split size
* @return the store
*/
protected static MVStore openStore(String fileName, int pageSize) {
protected static MVStore openStore(String fileName, int pageSplitSize) {
MVStore store = new MVStore.Builder().
fileName(fileName).pageSize(pageSize).open();
fileName(fileName).pageSplitSize(pageSplitSize).open();
return store;
}
......
......@@ -46,6 +46,7 @@ public class TestMVTableEngine extends TestBase {
@Override
public void test() throws Exception {
// testShrinkDatabaseFile();
testTransactionLogUsuallyNotStored();
testTwoPhaseCommit();
testRecover();
testSeparateKey();
......@@ -91,6 +92,10 @@ public class TestMVTableEngine extends TestBase {
}
}
private void testTransactionLogUsuallyNotStored() {
int todo;
}
private void testTwoPhaseCommit() throws Exception {
FileUtils.deleteRecursive(getBaseDir(), true);
Connection conn;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论