Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
101d72e0
提交
101d72e0
authored
8月 12, 2013
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
MVStore: rename pageSize to pageSplitSize
上级
5d9a00a9
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
46 行增加
和
13 行删除
+46
-13
TestConcurrent.java
h2/src/test/org/h2/test/store/TestConcurrent.java
+1
-1
TestMVStore.java
h2/src/test/org/h2/test/store/TestMVStore.java
+40
-12
TestMVTableEngine.java
h2/src/test/org/h2/test/store/TestMVTableEngine.java
+5
-0
没有找到文件。
h2/src/test/org/h2/test/store/TestConcurrent.java
浏览文件 @
101d72e0
...
@@ -174,7 +174,7 @@ public class TestConcurrent extends TestMVStore {
...
@@ -174,7 +174,7 @@ public class TestConcurrent extends TestMVStore {
}
}
private
void
testConcurrentIterate
()
{
private
void
testConcurrentIterate
()
{
MVStore
s
=
new
MVStore
.
Builder
().
pageSize
(
3
).
open
();
MVStore
s
=
new
MVStore
.
Builder
().
pageS
plitS
ize
(
3
).
open
();
final
MVMap
<
Integer
,
Integer
>
map
=
s
.
openMap
(
"test"
);
final
MVMap
<
Integer
,
Integer
>
map
=
s
.
openMap
(
"test"
);
final
int
len
=
10
;
final
int
len
=
10
;
final
Random
r
=
new
Random
();
final
Random
r
=
new
Random
();
...
...
h2/src/test/org/h2/test/store/TestMVStore.java
浏览文件 @
101d72e0
...
@@ -47,7 +47,8 @@ public class TestMVStore extends TestBase {
...
@@ -47,7 +47,8 @@ public class TestMVStore extends TestBase {
public
void
test
()
throws
Exception
{
public
void
test
()
throws
Exception
{
FileUtils
.
deleteRecursive
(
getBaseDir
(),
true
);
FileUtils
.
deleteRecursive
(
getBaseDir
(),
true
);
FileUtils
.
createDirectories
(
getBaseDir
());
FileUtils
.
createDirectories
(
getBaseDir
());
testPerformanceCompareWithTreeMapHashMap
();
testMemoryUsage
();
testBackgroundExceptionListener
();
testBackgroundExceptionListener
();
testOldVersion
();
testOldVersion
();
testAtomicOperations
();
testAtomicOperations
();
...
@@ -68,6 +69,7 @@ public class TestMVStore extends TestBase {
...
@@ -68,6 +69,7 @@ public class TestMVStore extends TestBase {
testIterateOldVersion
();
testIterateOldVersion
();
testObjects
();
testObjects
();
testExample
();
testExample
();
testExampleMvcc
();
testOpenStoreCloseLoop
();
testOpenStoreCloseLoop
();
testVersion
();
testVersion
();
testTruncateFile
();
testTruncateFile
();
...
@@ -91,6 +93,14 @@ public class TestMVStore extends TestBase {
...
@@ -91,6 +93,14 @@ public class TestMVStore extends TestBase {
testLargerThan2G
();
testLargerThan2G
();
}
}
private
void
testPerformanceCompareWithTreeMapHashMap
()
{
int
todo
;
}
private
void
testMemoryUsage
()
{
int
todo
;
}
private
void
testBackgroundExceptionListener
()
throws
Exception
{
private
void
testBackgroundExceptionListener
()
throws
Exception
{
String
fileName
=
getBaseDir
()
+
"/testBackgroundExceptionListener.h3"
;
String
fileName
=
getBaseDir
()
+
"/testBackgroundExceptionListener.h3"
;
FileUtils
.
delete
(
fileName
);
FileUtils
.
delete
(
fileName
);
...
@@ -722,6 +732,27 @@ public class TestMVStore extends TestBase {
...
@@ -722,6 +732,27 @@ public class TestMVStore extends TestBase {
// create/get the map named "data"
// create/get the map named "data"
MVMap
<
Integer
,
String
>
map
=
s
.
openMap
(
"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
// add some data
map
.
put
(
1
,
"Hello"
);
map
.
put
(
1
,
"Hello"
);
map
.
put
(
2
,
"World"
);
map
.
put
(
2
,
"World"
);
...
@@ -742,9 +773,6 @@ public class TestMVStore extends TestBase {
...
@@ -742,9 +773,6 @@ public class TestMVStore extends TestBase {
MVMap
<
Integer
,
String
>
oldMap
=
MVMap
<
Integer
,
String
>
oldMap
=
map
.
openVersion
(
oldVersion
);
map
.
openVersion
(
oldVersion
);
// mark the changes as committed
s
.
commit
();
// print the old version (can be done
// print the old version (can be done
// concurrently with further modifications)
// concurrently with further modifications)
// this will print "Hello" and "World":
// this will print "Hello" and "World":
...
@@ -758,7 +786,7 @@ public class TestMVStore extends TestBase {
...
@@ -758,7 +786,7 @@ public class TestMVStore extends TestBase {
// System.out.println(map.get(1));
// System.out.println(map.get(1));
assertEquals
(
"Hi"
,
map
.
get
(
1
));
assertEquals
(
"Hi"
,
map
.
get
(
1
));
// close the store
- this doesn't write to disk
// close the store
s
.
close
();
s
.
close
();
}
}
...
@@ -1482,12 +1510,12 @@ public class TestMVStore extends TestBase {
...
@@ -1482,12 +1510,12 @@ public class TestMVStore extends TestBase {
* Open a store for the given file name, using a small page size.
* Open a store for the given file name, using a small page size.
*
*
* @param fileName the file name (null for in-memory)
* @param fileName the file name (null for in-memory)
* @param pageS
ize the page
size
* @param pageS
plitSize the page split
size
* @return the store
* @return the store
*/
*/
protected
static
MVStore
openStore
(
String
fileName
,
int
pageSize
)
{
protected
static
MVStore
openStore
(
String
fileName
,
int
pageS
plitS
ize
)
{
MVStore
store
=
new
MVStore
.
Builder
().
MVStore
store
=
new
MVStore
.
Builder
().
fileName
(
fileName
).
pageS
ize
(
page
Size
).
open
();
fileName
(
fileName
).
pageS
plitSize
(
pageSplit
Size
).
open
();
return
store
;
return
store
;
}
}
...
...
h2/src/test/org/h2/test/store/TestMVTableEngine.java
浏览文件 @
101d72e0
...
@@ -46,6 +46,7 @@ public class TestMVTableEngine extends TestBase {
...
@@ -46,6 +46,7 @@ public class TestMVTableEngine extends TestBase {
@Override
@Override
public
void
test
()
throws
Exception
{
public
void
test
()
throws
Exception
{
// testShrinkDatabaseFile();
// testShrinkDatabaseFile();
testTransactionLogUsuallyNotStored
();
testTwoPhaseCommit
();
testTwoPhaseCommit
();
testRecover
();
testRecover
();
testSeparateKey
();
testSeparateKey
();
...
@@ -91,6 +92,10 @@ public class TestMVTableEngine extends TestBase {
...
@@ -91,6 +92,10 @@ public class TestMVTableEngine extends TestBase {
}
}
}
}
private
void
testTransactionLogUsuallyNotStored
()
{
int
todo
;
}
private
void
testTwoPhaseCommit
()
throws
Exception
{
private
void
testTwoPhaseCommit
()
throws
Exception
{
FileUtils
.
deleteRecursive
(
getBaseDir
(),
true
);
FileUtils
.
deleteRecursive
(
getBaseDir
(),
true
);
Connection
conn
;
Connection
conn
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论