Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
1f2e867c
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,发现更多精彩内容 >>
未验证
提交
1f2e867c
编写于
10月 06, 2020
作者:
N
Nikolai Kochetov
提交者:
GitHub
10月 06, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #15645 from ClickHouse/read-from-storage-step-field-order
Ensure resource destruction order in ReadFromStorageStep.
上级
9594e463
3564ba1c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
17 addition
and
43 deletion
+17
-43
src/Processors/Pipe.h
src/Processors/Pipe.h
+1
-1
src/Processors/QueryPipeline.h
src/Processors/QueryPipeline.h
+1
-1
src/Processors/QueryPlan/ReadFromStorageStep.cpp
src/Processors/QueryPlan/ReadFromStorageStep.cpp
+15
-27
src/Processors/QueryPlan/ReadFromStorageStep.h
src/Processors/QueryPlan/ReadFromStorageStep.h
+0
-14
未找到文件。
src/Processors/Pipe.h
浏览文件 @
1f2e867c
...
...
@@ -101,7 +101,7 @@ public:
void
setQuota
(
const
std
::
shared_ptr
<
const
EnabledQuota
>
&
quota
);
/// Do not allow to change the table while the processors of pipe are alive.
void
addTableLock
(
const
TableLockHolder
&
lock
)
{
holder
.
table_locks
.
push_back
(
lock
);
}
void
addTableLock
(
TableLockHolder
lock
)
{
holder
.
table_locks
.
emplace_back
(
std
::
move
(
lock
)
);
}
/// This methods are from QueryPipeline. Needed to make conversion from pipeline to pipe possible.
void
addInterpreterContext
(
std
::
shared_ptr
<
Context
>
context
)
{
holder
.
interpreter_context
.
emplace_back
(
std
::
move
(
context
));
}
void
addStorageHolder
(
StoragePtr
storage
)
{
holder
.
storage_holders
.
emplace_back
(
std
::
move
(
storage
));
}
...
...
src/Processors/QueryPipeline.h
浏览文件 @
1f2e867c
...
...
@@ -101,7 +101,7 @@ public:
const
Block
&
getHeader
()
const
{
return
pipe
.
getHeader
();
}
void
addTableLock
(
const
TableLockHolder
&
lock
)
{
pipe
.
addTableLock
(
lock
);
}
void
addTableLock
(
TableLockHolder
lock
)
{
pipe
.
addTableLock
(
std
::
move
(
lock
)
);
}
void
addInterpreterContext
(
std
::
shared_ptr
<
Context
>
context
)
{
pipe
.
addInterpreterContext
(
std
::
move
(
context
));
}
void
addStorageHolder
(
StoragePtr
storage
)
{
pipe
.
addStorageHolder
(
std
::
move
(
storage
));
}
void
addQueryPlan
(
std
::
unique_ptr
<
QueryPlan
>
plan
)
{
pipe
.
addQueryPlan
(
std
::
move
(
plan
));
}
...
...
src/Processors/QueryPlan/ReadFromStorageStep.cpp
浏览文件 @
1f2e867c
...
...
@@ -12,30 +12,18 @@ namespace DB
{
ReadFromStorageStep
::
ReadFromStorageStep
(
TableLockHolder
table_lock_
,
StorageMetadataPtr
metadata_snapshot_
,
StreamLocalLimits
&
limits_
,
SizeLimits
&
leaf_limits_
,
std
::
shared_ptr
<
const
EnabledQuota
>
quota_
,
StoragePtr
storage_
,
const
Names
&
required_columns_
,
const
SelectQueryInfo
&
query_info_
,
std
::
shared_ptr
<
Context
>
context_
,
QueryProcessingStage
::
Enum
processing_stage_
,
size_t
max_block_size_
,
size_t
max_streams_
)
:
table_lock
(
std
::
move
(
table_lock_
))
,
metadata_snapshot
(
std
::
move
(
metadata_snapshot_
))
,
limits
(
limits_
)
,
leaf_limits
(
leaf_limits_
)
,
quota
(
std
::
move
(
quota_
))
,
storage
(
std
::
move
(
storage_
))
,
required_columns
(
required_columns_
)
,
query_info
(
query_info_
)
,
context
(
std
::
move
(
context_
))
,
processing_stage
(
processing_stage_
)
,
max_block_size
(
max_block_size_
)
,
max_streams
(
max_streams_
)
TableLockHolder
table_lock
,
StorageMetadataPtr
metadata_snapshot
,
StreamLocalLimits
&
limits
,
SizeLimits
&
leaf_limits
,
std
::
shared_ptr
<
const
EnabledQuota
>
quota
,
StoragePtr
storage
,
const
Names
&
required_columns
,
const
SelectQueryInfo
&
query_info
,
std
::
shared_ptr
<
Context
>
context
,
QueryProcessingStage
::
Enum
processing_stage
,
size_t
max_block_size
,
size_t
max_streams
)
{
/// Note: we read from storage in constructor of step because we don't know real header before reading.
/// It will be fixed when storage return QueryPlanStep itself.
...
...
@@ -83,9 +71,6 @@ ReadFromStorageStep::ReadFromStorageStep(
pipeline
=
std
::
make_unique
<
QueryPipeline
>
();
QueryPipelineProcessorsCollector
collector
(
*
pipeline
,
this
);
/// Table lock is stored inside pipeline here.
pipeline
->
addTableLock
(
table_lock
);
pipe
.
setLimits
(
limits
);
/**
...
...
@@ -103,8 +88,11 @@ ReadFromStorageStep::ReadFromStorageStep(
pipeline
->
init
(
std
::
move
(
pipe
));
/// Add resources to pipeline. The order is important.
/// Add in reverse order of destruction. Pipeline will be destroyed at the end in case of exception.
pipeline
->
addInterpreterContext
(
std
::
move
(
context
));
pipeline
->
addStorageHolder
(
std
::
move
(
storage
));
pipeline
->
addTableLock
(
std
::
move
(
table_lock
));
processors
=
collector
.
detachProcessors
();
...
...
src/Processors/QueryPlan/ReadFromStorageStep.h
浏览文件 @
1f2e867c
...
...
@@ -45,20 +45,6 @@ public:
void
describePipeline
(
FormatSettings
&
settings
)
const
override
;
private:
TableLockHolder
table_lock
;
StorageMetadataPtr
metadata_snapshot
;
StreamLocalLimits
limits
;
SizeLimits
leaf_limits
;
std
::
shared_ptr
<
const
EnabledQuota
>
quota
;
StoragePtr
storage
;
const
Names
&
required_columns
;
const
SelectQueryInfo
&
query_info
;
std
::
shared_ptr
<
Context
>
context
;
QueryProcessingStage
::
Enum
processing_stage
;
size_t
max_block_size
;
size_t
max_streams
;
QueryPipelinePtr
pipeline
;
Processors
processors
;
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录