Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
e5a28ec6
Unverified
提交
e5a28ec6
authored
7月 02, 2018
作者:
Andrei Tokar
提交者:
GitHub
7月 02, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1256 from h2database/misc-tiny
misc tiny refactorings
上级
84341037
2ffc49dc
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
12 行增加
和
13 行删除
+12
-13
MVMap.java
h2/src/main/org/h2/mvstore/MVMap.java
+2
-1
MVStore.java
h2/src/main/org/h2/mvstore/MVStore.java
+0
-4
MVPrimaryIndex.java
h2/src/main/org/h2/mvstore/db/MVPrimaryIndex.java
+1
-0
MVSecondaryIndex.java
h2/src/main/org/h2/mvstore/db/MVSecondaryIndex.java
+1
-0
MVSpatialIndex.java
h2/src/main/org/h2/mvstore/db/MVSpatialIndex.java
+1
-0
TransactionStore.java
h2/src/main/org/h2/mvstore/tx/TransactionStore.java
+7
-8
没有找到文件。
h2/src/main/org/h2/mvstore/MVMap.java
浏览文件 @
e5a28ec6
...
...
@@ -1045,7 +1045,8 @@ public class MVMap<K, V> extends AbstractMap<K, V>
public
final
long
getVersion
()
{
RootReference
rootReference
=
getRoot
();
RootReference
previous
=
rootReference
.
previous
;
return
previous
==
null
||
previous
.
root
!=
rootReference
.
root
?
return
previous
==
null
||
previous
.
root
!=
rootReference
.
root
||
previous
.
appendCounter
!=
rootReference
.
appendCounter
?
rootReference
.
version
:
previous
.
version
;
}
...
...
h2/src/main/org/h2/mvstore/MVStore.java
浏览文件 @
e5a28ec6
...
...
@@ -1177,10 +1177,6 @@ public class MVStore {
c
.
mapId
=
lastMapId
.
get
();
c
.
next
=
Long
.
MAX_VALUE
;
chunks
.
put
(
c
.
id
,
c
);
// force a metadata update
meta
.
put
(
Chunk
.
getMetaKey
(
c
.
id
),
c
.
asString
());
meta
.
remove
(
Chunk
.
getMetaKey
(
c
.
id
));
markMetaChanged
();
ArrayList
<
Page
>
changed
=
new
ArrayList
<>();
for
(
Iterator
<
MVMap
<?,
?>>
iter
=
maps
.
values
().
iterator
();
iter
.
hasNext
();
)
{
MVMap
<?,
?>
map
=
iter
.
next
();
...
...
h2/src/main/org/h2/mvstore/db/MVPrimaryIndex.java
浏览文件 @
e5a28ec6
...
...
@@ -57,6 +57,7 @@ public class MVPrimaryIndex extends BaseIndex {
mapName
=
"table."
+
getId
();
Transaction
t
=
mvTable
.
getTransactionBegin
();
dataMap
=
t
.
openMap
(
mapName
,
keyType
,
valueType
);
dataMap
.
map
.
setVolatile
(!
indexType
.
isPersistent
());
t
.
commit
();
if
(!
table
.
isPersistData
()
||
!
indexType
.
isPersistent
())
{
dataMap
.
map
.
setVolatile
(
true
);
...
...
h2/src/main/org/h2/mvstore/db/MVSecondaryIndex.java
浏览文件 @
e5a28ec6
...
...
@@ -67,6 +67,7 @@ public final class MVSecondaryIndex extends BaseIndex implements MVIndex {
ValueDataType
valueType
=
new
ValueDataType
(
null
,
null
,
null
);
Transaction
t
=
mvTable
.
getTransactionBegin
();
dataMap
=
t
.
openMap
(
mapName
,
keyType
,
valueType
);
dataMap
.
map
.
setVolatile
(!
indexType
.
isPersistent
());
t
.
commit
();
if
(!
keyType
.
equals
(
dataMap
.
getKeyType
()))
{
throw
DbException
.
throwInternalError
(
...
...
h2/src/main/org/h2/mvstore/db/MVSpatialIndex.java
浏览文件 @
e5a28ec6
...
...
@@ -101,6 +101,7 @@ public class MVSpatialIndex extends BaseIndex implements SpatialIndex, MVIndex {
spatialMap
=
db
.
getMvStore
().
getStore
().
openMap
(
mapName
,
mapBuilder
);
Transaction
t
=
mvTable
.
getTransactionBegin
();
dataMap
=
t
.
openMap
(
spatialMap
);
dataMap
.
map
.
setVolatile
(!
indexType
.
isPersistent
());
t
.
commit
();
}
...
...
h2/src/main/org/h2/mvstore/tx/TransactionStore.java
浏览文件 @
e5a28ec6
...
...
@@ -56,7 +56,7 @@ public class TransactionStore {
final
MVMap
<
Long
,
Object
[]>
undoLogs
[]
=
new
MVMap
[
MAX_OPEN_TRANSACTIONS
];
private
final
MVMap
.
Builder
<
Long
,
Object
[]>
undoLogBuilder
;
private
final
DataType
dataType
;
private
final
MVMap
.
Builder
<
Object
,
VersionedValue
>
mapBuilder
;
/**
* This BitSet is used as vacancy indicator for transaction slots in transactions[].
...
...
@@ -125,7 +125,6 @@ public class TransactionStore {
*/
public
TransactionStore
(
MVStore
store
,
DataType
dataType
,
int
timeoutMillis
)
{
this
.
store
=
store
;
this
.
dataType
=
dataType
;
this
.
timeoutMillis
=
timeoutMillis
;
preparedTransactions
=
store
.
openMap
(
"openTransactions"
,
new
MVMap
.
Builder
<
Integer
,
Object
[]>());
...
...
@@ -136,6 +135,9 @@ public class TransactionStore {
undoLogBuilder
=
new
MVMap
.
Builder
<
Long
,
Object
[]>()
.
singleWriter
()
.
valueType
(
undoLogValueType
);
DataType
vt
=
new
VersionedValue
.
Type
(
dataType
);
mapBuilder
=
new
MVMap
.
Builder
<
Object
,
VersionedValue
>()
.
keyType
(
dataType
).
valueType
(
vt
);
}
/**
...
...
@@ -198,9 +200,10 @@ public class TransactionStore {
public
void
endLeftoverTransactions
()
{
List
<
Transaction
>
list
=
getOpenTransactions
();
for
(
Transaction
t
:
list
)
{
if
(
t
.
getStatus
()
==
Transaction
.
STATUS_COMMITTED
)
{
int
status
=
t
.
getStatus
();
if
(
status
==
Transaction
.
STATUS_COMMITTED
)
{
t
.
commit
();
}
else
if
(
t
.
getStatus
()
!=
Transaction
.
STATUS_PREPARED
)
{
}
else
if
(
status
!=
Transaction
.
STATUS_PREPARED
)
{
t
.
rollback
();
}
}
...
...
@@ -512,10 +515,6 @@ public class TransactionStore {
// the map was removed later on
return
null
;
}
DataType
vt
=
new
VersionedValue
.
Type
(
dataType
);
MVMap
.
Builder
<
Object
,
VersionedValue
>
mapBuilder
=
new
MVMap
.
Builder
<
Object
,
VersionedValue
>().
keyType
(
dataType
).
valueType
(
vt
);
map
=
store
.
openMap
(
mapName
,
mapBuilder
);
}
return
map
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论