Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
648bb0ec
提交
648bb0ec
authored
6月 17, 2018
作者:
Evgenij Ryazanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove MVCC code from cursors and pages in PageStore
上级
931d3924
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
13 行增加
和
34 行删除
+13
-34
PageData.java
h2/src/main/org/h2/index/PageData.java
+1
-3
PageDataCursor.java
h2/src/main/org/h2/index/PageDataCursor.java
+2
-19
PageDataIndex.java
h2/src/main/org/h2/index/PageDataIndex.java
+3
-4
PageDataLeaf.java
h2/src/main/org/h2/index/PageDataLeaf.java
+2
-2
PageDataNode.java
h2/src/main/org/h2/index/PageDataNode.java
+2
-3
PageDelegateIndex.java
h2/src/main/org/h2/index/PageDelegateIndex.java
+3
-3
没有找到文件。
h2/src/main/org/h2/index/PageData.java
浏览文件 @
648bb0ec
...
@@ -131,11 +131,9 @@ abstract class PageData extends Page {
...
@@ -131,11 +131,9 @@ abstract class PageData extends Page {
* @param session the session
* @param session the session
* @param minKey the smallest key
* @param minKey the smallest key
* @param maxKey the largest key
* @param maxKey the largest key
* @param multiVersion if the delta should be used
* @return the cursor
* @return the cursor
*/
*/
abstract
Cursor
find
(
Session
session
,
long
minKey
,
long
maxKey
,
abstract
Cursor
find
(
Session
session
,
long
minKey
,
long
maxKey
);
boolean
multiVersion
);
/**
/**
* Get the key at this position.
* Get the key at this position.
...
...
h2/src/main/org/h2/index/PageDataCursor.java
浏览文件 @
648bb0ec
...
@@ -5,7 +5,6 @@
...
@@ -5,7 +5,6 @@
*/
*/
package
org
.
h2
.
index
;
package
org
.
h2
.
index
;
import
org.h2.engine.Session
;
import
org.h2.message.DbException
;
import
org.h2.message.DbException
;
import
org.h2.result.Row
;
import
org.h2.result.Row
;
import
org.h2.result.SearchRow
;
import
org.h2.result.SearchRow
;
...
@@ -19,16 +18,11 @@ class PageDataCursor implements Cursor {
...
@@ -19,16 +18,11 @@ class PageDataCursor implements Cursor {
private
int
idx
;
private
int
idx
;
private
final
long
maxKey
;
private
final
long
maxKey
;
private
Row
row
;
private
Row
row
;
private
final
boolean
multiVersion
;
private
final
Session
session
;
PageDataCursor
(
Session
session
,
PageDataLeaf
current
,
int
idx
,
long
maxKey
,
PageDataCursor
(
PageDataLeaf
current
,
int
idx
,
long
maxKey
)
{
boolean
multiVersion
)
{
this
.
current
=
current
;
this
.
current
=
current
;
this
.
idx
=
idx
;
this
.
idx
=
idx
;
this
.
maxKey
=
maxKey
;
this
.
maxKey
=
maxKey
;
this
.
multiVersion
=
multiVersion
;
this
.
session
=
session
;
}
}
@Override
@Override
...
@@ -43,20 +37,9 @@ class PageDataCursor implements Cursor {
...
@@ -43,20 +37,9 @@ class PageDataCursor implements Cursor {
@Override
@Override
public
boolean
next
()
{
public
boolean
next
()
{
if
(!
multiVersion
)
{
nextRow
();
nextRow
();
return
checkMax
();
return
checkMax
();
}
}
while
(
true
)
{
nextRow
();
if
(
row
!=
null
&&
row
.
getSessionId
()
!=
0
&&
row
.
getSessionId
()
!=
session
.
getId
())
{
continue
;
}
break
;
}
return
checkMax
();
}
private
boolean
checkMax
()
{
private
boolean
checkMax
()
{
if
(
row
!=
null
)
{
if
(
row
!=
null
)
{
...
...
h2/src/main/org/h2/index/PageDataIndex.java
浏览文件 @
648bb0ec
...
@@ -252,7 +252,7 @@ public class PageDataIndex extends PageIndex {
...
@@ -252,7 +252,7 @@ public class PageDataIndex extends PageIndex {
long
from
=
first
==
null
?
Long
.
MIN_VALUE
:
first
.
getKey
();
long
from
=
first
==
null
?
Long
.
MIN_VALUE
:
first
.
getKey
();
long
to
=
last
==
null
?
Long
.
MAX_VALUE
:
last
.
getKey
();
long
to
=
last
==
null
?
Long
.
MAX_VALUE
:
last
.
getKey
();
PageData
root
=
getPage
(
rootPageId
,
0
);
PageData
root
=
getPage
(
rootPageId
,
0
);
return
root
.
find
(
session
,
from
,
to
,
isMultiVersion
);
return
root
.
find
(
session
,
from
,
to
);
}
}
...
@@ -262,12 +262,11 @@ public class PageDataIndex extends PageIndex {
...
@@ -262,12 +262,11 @@ public class PageDataIndex extends PageIndex {
* @param session the session
* @param session the session
* @param first the key of the first row
* @param first the key of the first row
* @param last the key of the last row
* @param last the key of the last row
* @param multiVersion if mvcc should be used
* @return the cursor
* @return the cursor
*/
*/
Cursor
find
(
Session
session
,
long
first
,
long
last
,
boolean
multiVersion
)
{
Cursor
find
(
Session
session
,
long
first
,
long
last
)
{
PageData
root
=
getPage
(
rootPageId
,
0
);
PageData
root
=
getPage
(
rootPageId
,
0
);
return
root
.
find
(
session
,
first
,
last
,
multiVersion
);
return
root
.
find
(
session
,
first
,
last
);
}
}
@Override
@Override
...
...
h2/src/main/org/h2/index/PageDataLeaf.java
浏览文件 @
648bb0ec
...
@@ -315,9 +315,9 @@ public class PageDataLeaf extends PageData {
...
@@ -315,9 +315,9 @@ public class PageDataLeaf extends PageData {
}
}
@Override
@Override
Cursor
find
(
Session
session
,
long
minKey
,
long
maxKey
,
boolean
multiVersion
)
{
Cursor
find
(
Session
session
,
long
minKey
,
long
maxKey
)
{
int
x
=
find
(
minKey
);
int
x
=
find
(
minKey
);
return
new
PageDataCursor
(
session
,
this
,
x
,
maxKey
,
multiVersion
);
return
new
PageDataCursor
(
this
,
x
,
maxKey
);
}
}
/**
/**
...
...
h2/src/main/org/h2/index/PageDataNode.java
浏览文件 @
648bb0ec
...
@@ -160,11 +160,10 @@ public class PageDataNode extends PageData {
...
@@ -160,11 +160,10 @@ public class PageDataNode extends PageData {
}
}
@Override
@Override
Cursor
find
(
Session
session
,
long
minKey
,
long
maxKey
,
boolean
multiVersion
)
{
Cursor
find
(
Session
session
,
long
minKey
,
long
maxKey
)
{
int
x
=
find
(
minKey
);
int
x
=
find
(
minKey
);
int
child
=
childPageIds
[
x
];
int
child
=
childPageIds
[
x
];
return
index
.
getPage
(
child
,
getPos
()).
find
(
session
,
minKey
,
maxKey
,
return
index
.
getPage
(
child
,
getPos
()).
find
(
session
,
minKey
,
maxKey
);
multiVersion
);
}
}
@Override
@Override
...
...
h2/src/main/org/h2/index/PageDelegateIndex.java
浏览文件 @
648bb0ec
...
@@ -67,17 +67,17 @@ public class PageDelegateIndex extends PageIndex {
...
@@ -67,17 +67,17 @@ public class PageDelegateIndex extends PageIndex {
// ifNull is MIN_VALUE as well, because the column is never NULL
// ifNull is MIN_VALUE as well, because the column is never NULL
// so avoid returning all rows (returning one row is OK)
// so avoid returning all rows (returning one row is OK)
long
max
=
mainIndex
.
getKey
(
last
,
Long
.
MAX_VALUE
,
Long
.
MIN_VALUE
);
long
max
=
mainIndex
.
getKey
(
last
,
Long
.
MAX_VALUE
,
Long
.
MIN_VALUE
);
return
mainIndex
.
find
(
session
,
min
,
max
,
false
);
return
mainIndex
.
find
(
session
,
min
,
max
);
}
}
@Override
@Override
public
Cursor
findFirstOrLast
(
Session
session
,
boolean
first
)
{
public
Cursor
findFirstOrLast
(
Session
session
,
boolean
first
)
{
Cursor
cursor
;
Cursor
cursor
;
if
(
first
)
{
if
(
first
)
{
cursor
=
mainIndex
.
find
(
session
,
Long
.
MIN_VALUE
,
Long
.
MAX_VALUE
,
false
);
cursor
=
mainIndex
.
find
(
session
,
Long
.
MIN_VALUE
,
Long
.
MAX_VALUE
);
}
else
{
}
else
{
long
x
=
mainIndex
.
getLastKey
();
long
x
=
mainIndex
.
getLastKey
();
cursor
=
mainIndex
.
find
(
session
,
x
,
x
,
false
);
cursor
=
mainIndex
.
find
(
session
,
x
,
x
);
}
}
cursor
.
next
();
cursor
.
next
();
return
cursor
;
return
cursor
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论