Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
f66a645a
提交
f66a645a
authored
6 年前
作者:
Andrei Tokar
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
subclass Value from VersionedValue and eliminate wrapping of committed values
上级
a7a36189
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
11 行增加
和
11 行删除
+11
-11
TransactionMap.java
h2/src/main/org/h2/mvstore/tx/TransactionMap.java
+1
-1
TransactionStore.java
h2/src/main/org/h2/mvstore/tx/TransactionStore.java
+1
-1
VersionedValue.java
h2/src/main/org/h2/mvstore/tx/VersionedValue.java
+7
-8
Value.java
h2/src/main/org/h2/value/Value.java
+2
-1
没有找到文件。
h2/src/main/org/h2/mvstore/tx/TransactionMap.java
浏览文件 @
f66a645a
...
...
@@ -290,7 +290,7 @@ public class TransactionMap<K, V> extends AbstractMap<K, V> {
// and any non-null value will do
@SuppressWarnings
(
"unchecked"
)
K
k
=
(
K
)
key
;
result
=
map
.
put
(
k
,
VersionedValue
.
VV_NULL
,
decisionMaker
);
result
=
map
.
put
(
k
,
VersionedValue
.
DUMMY
,
decisionMaker
);
MVMap
.
Decision
decision
=
decisionMaker
.
getDecision
();
assert
decision
!=
null
;
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/mvstore/tx/TransactionStore.java
浏览文件 @
f66a645a
...
...
@@ -453,7 +453,7 @@ public class TransactionStore {
// used by CommitDecisionMaker, MVRTreeMap has weird
// traversal logic based on it, and any non-null
// value will do, to signify update, not removal
map
.
operate
(
key
,
VersionedValue
.
VV_NULL
,
commitDecisionMaker
);
map
.
operate
(
key
,
VersionedValue
.
DUMMY
,
commitDecisionMaker
);
}
}
undoLog
.
clear
();
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/mvstore/tx/VersionedValue.java
浏览文件 @
f66a645a
...
...
@@ -9,7 +9,6 @@ import org.h2.engine.Constants;
import
org.h2.mvstore.DataUtils
;
import
org.h2.mvstore.WriteBuffer
;
import
org.h2.mvstore.type.DataType
;
import
org.h2.value.ValueNull
;
import
java.nio.ByteBuffer
;
/**
...
...
@@ -20,18 +19,18 @@ import java.nio.ByteBuffer;
*/
public
class
VersionedValue
{
static
final
VersionedValue
VV_NULL
=
new
VersionedValue
();
static
final
VersionedValue
DUMMY
=
new
VersionedValue
();
static
VersionedValue
getInstance
(
Object
value
)
{
assert
value
!=
null
;
return
value
==
ValueNull
.
INSTANCE
?
VV_NULL
:
new
Committed
(
value
);
return
value
instanceof
VersionedValue
?
(
VersionedValue
)
value
:
new
Committed
(
value
);
}
public
static
VersionedValue
getInstance
(
long
operationId
,
Object
value
,
Object
committedValue
)
{
return
new
Uncommitted
(
operationId
,
value
,
committedValue
);
}
pr
ivate
VersionedValue
()
{}
pr
otected
VersionedValue
()
{}
public
boolean
isCommitted
()
{
return
true
;
...
...
@@ -42,11 +41,11 @@ public class VersionedValue {
}
public
Object
getCurrentValue
()
{
return
ValueNull
.
INSTANCE
;
return
this
;
}
public
Object
getCommittedValue
()
{
return
ValueNull
.
INSTANCE
;
return
this
;
}
private
static
class
Committed
extends
VersionedValue
...
...
@@ -159,7 +158,7 @@ public class VersionedValue {
if
(
buff
.
get
()
==
0
)
{
// fast path (no op ids or null entries)
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
obj
[
i
]
=
new
Committed
(
valueType
.
read
(
buff
));
obj
[
i
]
=
getInstance
(
valueType
.
read
(
buff
));
}
}
else
{
// slow path (some entries may be null)
...
...
@@ -173,7 +172,7 @@ public class VersionedValue {
public
Object
read
(
ByteBuffer
buff
)
{
long
operationId
=
DataUtils
.
readVarLong
(
buff
);
if
(
operationId
==
0
)
{
return
new
Committed
(
valueType
.
read
(
buff
));
return
getInstance
(
valueType
.
read
(
buff
));
}
else
{
byte
flags
=
buff
.
get
();
Object
value
=
(
flags
&
1
)
!=
0
?
valueType
.
read
(
buff
)
:
null
;
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/value/Value.java
浏览文件 @
f66a645a
...
...
@@ -23,6 +23,7 @@ import org.h2.api.IntervalQualifier;
import
org.h2.engine.Mode
;
import
org.h2.engine.SysProperties
;
import
org.h2.message.DbException
;
import
org.h2.mvstore.tx.VersionedValue
;
import
org.h2.result.ResultInterface
;
import
org.h2.result.SimpleResult
;
import
org.h2.store.DataHandler
;
...
...
@@ -40,7 +41,7 @@ import org.h2.util.StringUtils;
* @author Noel Grandin
* @author Nicolas Fortin, Atelier SIG, IRSTV FR CNRS 24888
*/
public
abstract
class
Value
{
public
abstract
class
Value
extends
VersionedValue
{
/**
* The data type is unknown at this time.
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论