Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
c388e57a
C
ClickHouse
项目概览
2dot5
/
ClickHouse
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
ClickHouse
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c388e57a
编写于
3月 01, 2019
作者:
N
Nikolai Kochetov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix MergingSortedTransform. Update PipelineExecutor.
上级
49d1899a
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
15 addition
and
16 deletion
+15
-16
dbms/src/Processors/Executors/PipelineExecutor.cpp
dbms/src/Processors/Executors/PipelineExecutor.cpp
+4
-3
dbms/src/Processors/Executors/PipelineExecutor.h
dbms/src/Processors/Executors/PipelineExecutor.h
+2
-1
dbms/src/Processors/ISink.h
dbms/src/Processors/ISink.h
+1
-1
dbms/src/Processors/LimitTransform.cpp
dbms/src/Processors/LimitTransform.cpp
+1
-1
dbms/src/Processors/Transforms/MergingSortedTransform.cpp
dbms/src/Processors/Transforms/MergingSortedTransform.cpp
+2
-5
dbms/src/Processors/tests/processors_test_merging_sorted_transform.cpp
...essors/tests/processors_test_merging_sorted_transform.cpp
+5
-5
未找到文件。
dbms/src/Processors/Executors/PipelineExecutor.cpp
浏览文件 @
c388e57a
...
...
@@ -119,14 +119,15 @@ void PipelineExecutor::processFinishedExecutionQueueSafe()
bool
PipelineExecutor
::
addProcessorToPrepareQueueIfUpdated
(
Edge
&
edge
)
{
auto
&
node
=
graph
[
edge
.
to
];
/// Don't add processor if nothing was read from port.
if
(
edge
.
version
==
edge
.
prev_version
)
if
(
node
.
status
!=
ExecStatus
::
New
&&
edge
.
version
==
edge
.
prev_version
)
return
false
;
edge
.
prev_version
=
edge
.
version
;
auto
&
node
=
graph
[
edge
.
to
];
if
(
node
.
status
==
ExecStatus
::
Idle
)
if
(
node
.
status
==
ExecStatus
::
Idle
||
node
.
status
==
ExecStatus
::
New
)
{
prepare_queue
.
push
(
edge
.
to
);
node
.
status
=
ExecStatus
::
Preparing
;
...
...
dbms/src/Processors/Executors/PipelineExecutor.h
浏览文件 @
c388e57a
...
...
@@ -26,6 +26,7 @@ private:
enum
class
ExecStatus
{
New
,
Idle
,
Preparing
,
Executing
,
...
...
@@ -39,7 +40,7 @@ private:
Edges
directEdges
;
Edges
backEdges
;
ExecStatus
status
=
ExecStatus
::
Idle
;
ExecStatus
status
=
ExecStatus
::
New
;
IProcessor
::
Status
last_processor_status
;
};
...
...
dbms/src/Processors/ISink.h
浏览文件 @
c388e57a
...
...
@@ -11,7 +11,7 @@ class ISink : public IProcessor
protected:
InputPort
&
input
;
Chunk
current_chunk
;
bool
has_input
;
bool
has_input
=
false
;
virtual
void
consume
(
Chunk
block
)
=
0
;
...
...
dbms/src/Processors/LimitTransform.cpp
浏览文件 @
c388e57a
...
...
@@ -29,7 +29,7 @@ LimitTransform::Status LimitTransform::prepare()
}
/// Push block if can.
if
(
block_processed
)
if
(
has_block
&&
block_processed
)
{
output
.
push
(
std
::
move
(
current_chunk
));
has_block
=
false
;
...
...
dbms/src/Processors/Transforms/MergingSortedTransform.cpp
浏览文件 @
c388e57a
...
...
@@ -80,10 +80,7 @@ IProcessor::Status MergingSortedTransform::prepare()
/// Push if has data.
if
(
merged_data
.
mergedRows
())
{
output
.
push
(
merged_data
.
pull
());
return
Status
::
PortFull
;
}
if
(
!
is_initialized
)
{
...
...
@@ -185,7 +182,7 @@ void MergingSortedTransform::merge(std::priority_queue<TSortCursor> & queue)
return
false
;
}
if
(
merged_data
.
totalM
ergedRows
()
>=
max_block_size
)
if
(
merged_data
.
m
ergedRows
()
>=
max_block_size
)
{
//std::cerr << "max_block_size reached\n";
return
false
;
...
...
@@ -251,7 +248,7 @@ void MergingSortedTransform::merge(std::priority_queue<TSortCursor> & queue)
need_data
=
true
;
next_input_to_read
=
current
.
impl
->
order
;
if
(
merged_data
.
totalMergedRows
()
>=
limit
)
if
(
limit
&&
merged_data
.
totalMergedRows
()
>=
limit
)
is_finished
=
true
;
return
;
...
...
dbms/src/Processors/tests/processors_test_merging_sorted_transform.cpp
浏览文件 @
c388e57a
...
...
@@ -46,7 +46,7 @@ private:
usleep
(
sleep_useconds
);
MutableColumns
columns
;
columns
.
emplace_back
(
ColumnUInt64
::
create
(
block_size
));
columns
.
emplace_back
(
ColumnUInt64
::
create
());
for
(
UInt64
i
=
0
;
i
<
block_size
;
++
i
,
current_number
+=
step
)
columns
.
back
()
->
insert
(
Field
(
current_number
));
...
...
@@ -144,13 +144,13 @@ try
auto
transform2
=
std
::
make_shared
<
SleepyTransform
>
(
100000
);
auto
transform3
=
std
::
make_shared
<
SleepyTransform
>
(
100000
);
auto
limit1
=
std
::
make_shared
<
LimitTransform
>
(
source1
->
getPort
().
getHeader
(),
1
0
,
0
);
auto
limit2
=
std
::
make_shared
<
LimitTransform
>
(
source2
->
getPort
().
getHeader
(),
1
0
,
0
);
auto
limit3
=
std
::
make_shared
<
LimitTransform
>
(
source3
->
getPort
().
getHeader
(),
1
0
,
0
);
auto
limit1
=
std
::
make_shared
<
LimitTransform
>
(
source1
->
getPort
().
getHeader
(),
2
0
,
0
);
auto
limit2
=
std
::
make_shared
<
LimitTransform
>
(
source2
->
getPort
().
getHeader
(),
2
0
,
0
);
auto
limit3
=
std
::
make_shared
<
LimitTransform
>
(
source3
->
getPort
().
getHeader
(),
2
0
,
0
);
SortDescription
description
=
{{
0
,
1
,
1
}};
auto
merge
=
std
::
make_shared
<
MergingSortedTransform
>
(
source1
->
getPort
().
getHeader
(),
3
,
description
,
2
);
auto
limit_fin
=
std
::
make_shared
<
LimitTransform
>
(
source1
->
getPort
().
getHeader
(),
27
,
0
);
auto
limit_fin
=
std
::
make_shared
<
LimitTransform
>
(
source1
->
getPort
().
getHeader
(),
54
,
0
);
auto
sink
=
std
::
make_shared
<
PrintSink
>
(
""
);
connect
(
source1
->
getPort
(),
transform1
->
getInputPort
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录