Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
d95318e6
提交
d95318e6
authored
12 年前
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
MVStore: statement processing
上级
9e57e479
全部展开
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
1042 行增加
和
13 行删除
+1042
-13
TransactionStore2.java
h2/src/main/org/h2/mvstore/db/TransactionStore2.java
+1029
-0
TestTransactionStore.java
h2/src/test/org/h2/test/store/TestTransactionStore.java
+13
-13
没有找到文件。
h2/src/main/org/h2/mvstore/db/TransactionStore2.java
0 → 100644
浏览文件 @
d95318e6
差异被折叠。
点击展开。
h2/src/test/org/h2/test/store/TestTransactionStore.java
浏览文件 @
d95318e6
...
@@ -16,9 +16,9 @@ import java.util.List;
...
@@ -16,9 +16,9 @@ import java.util.List;
import
java.util.Random
;
import
java.util.Random
;
import
org.h2.mvstore.MVStore
;
import
org.h2.mvstore.MVStore
;
import
org.h2.mvstore.db.TransactionStore
;
import
org.h2.mvstore.db.TransactionStore
2
;
import
org.h2.mvstore.db.TransactionStore.Transaction
;
import
org.h2.mvstore.db.TransactionStore
2
.Transaction
;
import
org.h2.mvstore.db.TransactionStore.TransactionMap
;
import
org.h2.mvstore.db.TransactionStore
2
.TransactionMap
;
import
org.h2.store.fs.FileUtils
;
import
org.h2.store.fs.FileUtils
;
import
org.h2.test.TestBase
;
import
org.h2.test.TestBase
;
import
org.h2.util.New
;
import
org.h2.util.New
;
...
@@ -60,7 +60,7 @@ public class TestTransactionStore extends TestBase {
...
@@ -60,7 +60,7 @@ public class TestTransactionStore extends TestBase {
*/
*/
private
void
testMultiStatement
()
{
private
void
testMultiStatement
()
{
MVStore
s
=
MVStore
.
open
(
null
);
MVStore
s
=
MVStore
.
open
(
null
);
TransactionStore
ts
=
new
TransactionStore
(
s
);
TransactionStore
2
ts
=
new
TransactionStore2
(
s
);
Transaction
tx
;
Transaction
tx
;
TransactionMap
<
String
,
String
>
m
;
TransactionMap
<
String
,
String
>
m
;
long
startUpdate
;
long
startUpdate
;
...
@@ -146,14 +146,14 @@ public class TestTransactionStore extends TestBase {
...
@@ -146,14 +146,14 @@ public class TestTransactionStore extends TestBase {
FileUtils
.
delete
(
fileName
);
FileUtils
.
delete
(
fileName
);
MVStore
s
;
MVStore
s
;
TransactionStore
ts
;
TransactionStore
2
ts
;
Transaction
tx
;
Transaction
tx
;
Transaction
txOld
;
Transaction
txOld
;
TransactionMap
<
String
,
String
>
m
;
TransactionMap
<
String
,
String
>
m
;
List
<
Transaction
>
list
;
List
<
Transaction
>
list
;
s
=
MVStore
.
open
(
fileName
);
s
=
MVStore
.
open
(
fileName
);
ts
=
new
TransactionStore
(
s
);
ts
=
new
TransactionStore
2
(
s
);
tx
=
ts
.
begin
();
tx
=
ts
.
begin
();
assertEquals
(
null
,
tx
.
getName
());
assertEquals
(
null
,
tx
.
getName
());
tx
.
setName
(
"first transaction"
);
tx
.
setName
(
"first transaction"
);
...
@@ -171,7 +171,7 @@ public class TestTransactionStore extends TestBase {
...
@@ -171,7 +171,7 @@ public class TestTransactionStore extends TestBase {
s
.
close
();
s
.
close
();
s
=
MVStore
.
open
(
fileName
);
s
=
MVStore
.
open
(
fileName
);
ts
=
new
TransactionStore
(
s
);
ts
=
new
TransactionStore
2
(
s
);
tx
=
ts
.
begin
();
tx
=
ts
.
begin
();
assertEquals
(
1
,
tx
.
getId
());
assertEquals
(
1
,
tx
.
getId
());
m
=
tx
.
openMap
(
"test"
);
m
=
tx
.
openMap
(
"test"
);
...
@@ -189,7 +189,7 @@ public class TestTransactionStore extends TestBase {
...
@@ -189,7 +189,7 @@ public class TestTransactionStore extends TestBase {
s
.
close
();
s
.
close
();
s
=
MVStore
.
open
(
fileName
);
s
=
MVStore
.
open
(
fileName
);
ts
=
new
TransactionStore
(
s
);
ts
=
new
TransactionStore
2
(
s
);
tx
=
ts
.
begin
();
tx
=
ts
.
begin
();
m
=
tx
.
openMap
(
"test"
);
m
=
tx
.
openMap
(
"test"
);
// TransactionStore was not closed, so we lost some ids
// TransactionStore was not closed, so we lost some ids
...
@@ -214,7 +214,7 @@ public class TestTransactionStore extends TestBase {
...
@@ -214,7 +214,7 @@ public class TestTransactionStore extends TestBase {
private
void
testSavepoint
()
throws
Exception
{
private
void
testSavepoint
()
throws
Exception
{
MVStore
s
=
MVStore
.
open
(
null
);
MVStore
s
=
MVStore
.
open
(
null
);
TransactionStore
ts
=
new
TransactionStore
(
s
);
TransactionStore
2
ts
=
new
TransactionStore2
(
s
);
Transaction
tx
;
Transaction
tx
;
TransactionMap
<
String
,
String
>
m
;
TransactionMap
<
String
,
String
>
m
;
...
@@ -267,7 +267,7 @@ public class TestTransactionStore extends TestBase {
...
@@ -267,7 +267,7 @@ public class TestTransactionStore extends TestBase {
"create table test(id int primary key, name varchar(255))"
);
"create table test(id int primary key, name varchar(255))"
);
MVStore
s
=
MVStore
.
open
(
null
);
MVStore
s
=
MVStore
.
open
(
null
);
TransactionStore
ts
=
new
TransactionStore
(
s
);
TransactionStore
2
ts
=
new
TransactionStore2
(
s
);
for
(
int
i
=
0
;
i
<
connectionCount
;
i
++)
{
for
(
int
i
=
0
;
i
<
connectionCount
;
i
++)
{
Statement
stat
=
statements
.
get
(
i
);
Statement
stat
=
statements
.
get
(
i
);
// 100 ms to avoid blocking (the test is single threaded)
// 100 ms to avoid blocking (the test is single threaded)
...
@@ -400,7 +400,7 @@ public class TestTransactionStore extends TestBase {
...
@@ -400,7 +400,7 @@ public class TestTransactionStore extends TestBase {
private
void
testConcurrentTransactionsReadCommitted
()
{
private
void
testConcurrentTransactionsReadCommitted
()
{
MVStore
s
=
MVStore
.
open
(
null
);
MVStore
s
=
MVStore
.
open
(
null
);
TransactionStore
ts
=
new
TransactionStore
(
s
);
TransactionStore
2
ts
=
new
TransactionStore2
(
s
);
Transaction
tx1
,
tx2
;
Transaction
tx1
,
tx2
;
TransactionMap
<
String
,
String
>
m1
,
m2
;
TransactionMap
<
String
,
String
>
m1
,
m2
;
...
@@ -472,7 +472,7 @@ public class TestTransactionStore extends TestBase {
...
@@ -472,7 +472,7 @@ public class TestTransactionStore extends TestBase {
private
void
testSingleConnection
()
{
private
void
testSingleConnection
()
{
MVStore
s
=
MVStore
.
open
(
null
);
MVStore
s
=
MVStore
.
open
(
null
);
TransactionStore
ts
=
new
TransactionStore
(
s
);
TransactionStore
2
ts
=
new
TransactionStore2
(
s
);
Transaction
tx
;
Transaction
tx
;
TransactionMap
<
String
,
String
>
m
;
TransactionMap
<
String
,
String
>
m
;
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论