Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
17d6dcba
提交
17d6dcba
authored
7月 07, 2018
作者:
Andrei Tokar
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bug with allocating redundant array elements
comments and formatting
上级
eb9faf52
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
14 行增加
和
8 行删除
+14
-8
MVMap.java
h2/src/main/org/h2/mvstore/MVMap.java
+14
-8
没有找到文件。
h2/src/main/org/h2/mvstore/MVMap.java
浏览文件 @
17d6dcba
...
@@ -1038,7 +1038,7 @@ public class MVMap<K, V> extends AbstractMap<K, V>
...
@@ -1038,7 +1038,7 @@ public class MVMap<K, V> extends AbstractMap<K, V>
/**
/**
* Get version of the map, which is the version of the store,
* Get version of the map, which is the version of the store,
* at
which
map was modified last time.
* at
the moment when
map was modified last time.
*
*
* @return version
* @return version
*/
*/
...
@@ -1136,10 +1136,10 @@ public class MVMap<K, V> extends AbstractMap<K, V>
...
@@ -1136,10 +1136,10 @@ public class MVMap<K, V> extends AbstractMap<K, V>
*/
*/
final
void
copyFrom
(
MVMap
<
K
,
V
>
sourceMap
)
{
final
void
copyFrom
(
MVMap
<
K
,
V
>
sourceMap
)
{
// We are going to cheat a little bit in the copy()
// We are going to cheat a little bit in the copy()
// by
setting map's root to an arbitrary nodes
// by
temporary setting map's root to some arbitrary nodes.
//
to allow for just
created ones to be saved.
//
This will allow for newly
created ones to be saved.
// That's why it's important to preserve all chunks
// That's why it's important to preserve all chunks
// created in the process, especially i
t
retention time
// created in the process, especially i
f
retention time
// is set to a lower value, or even 0.
// is set to a lower value, or even 0.
MVStore
.
TxCounter
txCounter
=
store
.
registerVersionUsage
();
MVStore
.
TxCounter
txCounter
=
store
.
registerVersionUsage
();
try
{
try
{
...
@@ -1170,6 +1170,11 @@ public class MVMap<K, V> extends AbstractMap<K, V>
...
@@ -1170,6 +1170,11 @@ public class MVMap<K, V> extends AbstractMap<K, V>
return
target
;
return
target
;
}
}
/**
* If map was used in append mode, this method will ensure that append buffer
* is flushed - emptied with all entries inserted into map as a new leaf.
* @return potentially updated RootReference
*/
public
RootReference
flushAppendBuffer
()
{
public
RootReference
flushAppendBuffer
()
{
return
flushAppendBuffer
(
null
);
return
flushAppendBuffer
(
null
);
}
}
...
@@ -1216,9 +1221,9 @@ public class MVMap<K, V> extends AbstractMap<K, V>
...
@@ -1216,9 +1221,9 @@ public class MVMap<K, V> extends AbstractMap<K, V>
p
=
split
;
p
=
split
;
}
else
{
}
else
{
Object
keys
[]
=
new
Object
[]
{
key
};
Object
keys
[]
=
new
Object
[]
{
key
};
Page
.
PageReference
children
[]
=
new
Page
.
PageReference
[
store
.
getKeysPerPage
()
+
1
];
Page
.
PageReference
children
[]
=
new
Page
.
PageReference
[
]
{
children
[
0
]
=
new
Page
.
PageReference
(
p
);
new
Page
.
PageReference
(
p
),
children
[
1
]
=
new
Page
.
PageReference
(
split
)
;
new
Page
.
PageReference
(
split
)}
;
p
=
Page
.
create
(
this
,
keys
,
null
,
children
,
p
.
getTotalCount
()
+
split
.
getTotalCount
(),
0
);
p
=
Page
.
create
(
this
,
keys
,
null
,
children
,
p
.
getTotalCount
()
+
split
.
getTotalCount
(),
0
);
}
}
break
;
break
;
...
@@ -1231,7 +1236,8 @@ public class MVMap<K, V> extends AbstractMap<K, V>
...
@@ -1231,7 +1236,8 @@ public class MVMap<K, V> extends AbstractMap<K, V>
p
.
setChild
(
index
,
split
);
p
.
setChild
(
index
,
split
);
p
.
insertNode
(
index
,
key
,
c
);
p
.
insertNode
(
index
,
key
,
c
);
int
keyCount
;
int
keyCount
;
if
((
keyCount
=
p
.
getKeyCount
())
<=
store
.
getKeysPerPage
()
&&
(
p
.
getMemory
()
<
store
.
getMaxPageSize
()
||
keyCount
<=
(
p
.
isLeaf
()
?
1
:
2
)))
{
if
((
keyCount
=
p
.
getKeyCount
())
<=
store
.
getKeysPerPage
()
&&
(
p
.
getMemory
()
<
store
.
getMaxPageSize
()
||
keyCount
<=
(
p
.
isLeaf
()
?
1
:
2
)))
{
break
;
break
;
}
}
int
at
=
keyCount
-
2
;
int
at
=
keyCount
-
2
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论