Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
f29c64a2
提交
f29c64a2
authored
11月 19, 2015
作者:
S.Vladykin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wip
上级
459ed158
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
17 行增加
和
24 行删除
+17
-24
JoinBatch.java
h2/src/main/org/h2/table/JoinBatch.java
+17
-24
没有找到文件。
h2/src/main/org/h2/table/JoinBatch.java
浏览文件 @
f29c64a2
...
@@ -19,6 +19,7 @@ import org.h2.message.DbException;
...
@@ -19,6 +19,7 @@ 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
;
import
org.h2.util.DoneFuture
;
import
org.h2.util.DoneFuture
;
import
org.h2.util.IntArray
;
import
org.h2.util.New
;
import
org.h2.util.New
;
import
org.h2.value.Value
;
import
org.h2.value.Value
;
import
org.h2.value.ValueLong
;
import
org.h2.value.ValueLong
;
...
@@ -157,12 +158,10 @@ public final class JoinBatch {
...
@@ -157,12 +158,10 @@ public final class JoinBatch {
// initialize current row
// initialize current row
current
=
new
JoinRow
(
new
Object
[
filters
.
length
]);
current
=
new
JoinRow
(
new
Object
[
filters
.
length
]);
if
(
viewIndexLookupBatch
==
null
)
{
if
(
viewIndexLookupBatch
==
null
)
{
current
.
updateRow
(
top
.
id
,
top
.
filter
.
getIndexCursor
(),
JoinRow
.
S_NULL
,
JoinRow
.
S_CURSOR
);
// initialize top cursor
// initialize top cursor
top
.
filter
.
getIndexCursor
().
find
(
top
.
filter
.
getSession
(),
top
.
filter
.
getIndexConditions
());
IndexCursor
indexCursor
=
top
.
filter
.
getIndexCursor
();
}
else
{
current
.
updateRow
(
top
.
id
,
indexCursor
,
JoinRow
.
S_NULL
,
JoinRow
.
S_CURSOR
);
// we are sub-query and joined to upper level query
indexCursor
.
find
(
top
.
filter
.
getSession
(),
top
.
filter
.
getIndexConditions
());
// TODO setup
}
}
// we need fake first row because batchedNext always will move to the next row
// we need fake first row because batchedNext always will move to the next row
JoinRow
fake
=
new
JoinRow
(
null
);
JoinRow
fake
=
new
JoinRow
(
null
);
...
@@ -683,9 +682,7 @@ public final class JoinBatch {
...
@@ -683,9 +682,7 @@ public final class JoinBatch {
*/
*/
private
final
class
ViewIndexLookupBatch
implements
IndexLookupBatch
{
private
final
class
ViewIndexLookupBatch
implements
IndexLookupBatch
{
private
final
ViewIndex
viewIndex
;
private
final
ViewIndex
viewIndex
;
private
final
ArrayList
<
Future
<
Cursor
>>
result
=
New
.
arrayList
();
private
final
IntArray
counts
=
new
IntArray
();
private
boolean
findCalled
;
private
boolean
full
;
private
ViewIndexLookupBatch
(
ViewIndex
viewIndex
)
{
private
ViewIndexLookupBatch
(
ViewIndex
viewIndex
)
{
this
.
viewIndex
=
viewIndex
;
this
.
viewIndex
=
viewIndex
;
...
@@ -693,50 +690,46 @@ public final class JoinBatch {
...
@@ -693,50 +690,46 @@ public final class JoinBatch {
@Override
@Override
public
void
addSearchRows
(
SearchRow
first
,
SearchRow
last
)
{
public
void
addSearchRows
(
SearchRow
first
,
SearchRow
last
)
{
if
(
findCalled
)
{
result
.
clear
();
findCalled
=
false
;
}
viewIndex
.
setupQueryParameters
(
viewIndex
.
getSession
(),
first
,
last
,
null
);
viewIndex
.
setupQueryParameters
(
viewIndex
.
getSession
(),
first
,
last
,
null
);
if
(
top
.
collectSearchRows
())
{
if
(
top
.
collectSearchRows
())
{
result
.
add
(
PLACEHOLDER
);
if
(
top
.
isBatchFull
())
{
if
(
top
.
isBatchFull
())
{
// TODO
fetch
();
}
}
}
else
{
result
.
add
(
null
);
}
}
}
}
private
void
fetch
()
{
private
void
fetch
()
{
// TODO
}
private
void
onNextCursorStart
()
{
}
}
@Override
@Override
public
boolean
isBatchFull
()
{
public
boolean
isBatchFull
()
{
assert
!
findCalled
;
return
top
.
isBatchFull
();
}
}
@Override
@Override
public
List
<
Future
<
Cursor
>>
find
()
{
public
List
<
Future
<
Cursor
>>
find
()
{
findCalled
=
true
;
state
=
State
.
FIND_CALLED
;
return
result
;
return
result
;
}
}
@Override
@Override
public
void
reset
()
{
public
void
reset
()
{
findCalled
=
false
;
state
=
State
.
COLLECTING
;
result
.
clear
();
result
.
clear
();
JoinBatch
.
this
.
reset
();
JoinBatch
.
this
.
reset
();
}
}
}
}
/**
/**
* State of the
* State of the
ViewIndexLookupBatch
*/
*/
enum
State
{
enum
State
{
COLLECTING
,
FULL
,
FIND_CALLED
}
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论