Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
0d7d379b
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,发现更多精彩内容 >>
提交
0d7d379b
编写于
6月 06, 2017
作者:
A
Alexey Milovidov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Removed duplicate code [#CLICKHOUSE-2].
上级
2799fbf9
变更
81
隐藏空白更改
内联
并排
Showing
81 changed file
with
106 addition
and
581 deletion
+106
-581
dbms/src/Analyzers/tests/analyze_columns.cpp
dbms/src/Analyzers/tests/analyze_columns.cpp
+1
-1
dbms/src/Analyzers/tests/analyze_result_of_query.cpp
dbms/src/Analyzers/tests/analyze_result_of_query.cpp
+1
-1
dbms/src/Analyzers/tests/collect_tables.cpp
dbms/src/Analyzers/tests/collect_tables.cpp
+1
-1
dbms/src/Analyzers/tests/optimize_group_order_limit_by.cpp
dbms/src/Analyzers/tests/optimize_group_order_limit_by.cpp
+1
-1
dbms/src/Analyzers/tests/type_and_constant_inference.cpp
dbms/src/Analyzers/tests/type_and_constant_inference.cpp
+1
-1
dbms/src/DataStreams/tests/expression_stream.cpp
dbms/src/DataStreams/tests/expression_stream.cpp
+1
-1
dbms/src/DataStreams/tests/filter_stream.cpp
dbms/src/DataStreams/tests/filter_stream.cpp
+1
-1
dbms/src/DataStreams/tests/fork_streams.cpp
dbms/src/DataStreams/tests/fork_streams.cpp
+1
-1
dbms/src/DataStreams/tests/union_stream.cpp
dbms/src/DataStreams/tests/union_stream.cpp
+2
-2
dbms/src/Interpreters/tests/in_join_subqueries_preprocessor.cpp
...rc/Interpreters/tests/in_join_subqueries_preprocessor.cpp
+1
-6
dbms/src/Interpreters/tests/select_query.cpp
dbms/src/Interpreters/tests/select_query.cpp
+1
-1
dbms/src/Storages/StorageBuffer.cpp
dbms/src/Storages/StorageBuffer.cpp
+0
-14
dbms/src/Storages/StorageBuffer.h
dbms/src/Storages/StorageBuffer.h
+4
-12
dbms/src/Storages/StorageCloud.cpp
dbms/src/Storages/StorageCloud.cpp
+0
-13
dbms/src/Storages/StorageCloud.h
dbms/src/Storages/StorageCloud.h
+1
-9
dbms/src/Storages/StorageDistributed.h
dbms/src/Storages/StorageDistributed.h
+1
-1
dbms/src/Storages/StorageFactory.cpp
dbms/src/Storages/StorageFactory.cpp
+5
-2
dbms/src/Storages/StorageJoin.h
dbms/src/Storages/StorageJoin.h
+1
-1
dbms/src/Storages/StorageLog.cpp
dbms/src/Storages/StorageLog.cpp
+0
-29
dbms/src/Storages/StorageLog.h
dbms/src/Storages/StorageLog.h
+5
-20
dbms/src/Storages/StorageMaterializedView.h
dbms/src/Storages/StorageMaterializedView.h
+1
-1
dbms/src/Storages/StorageMemory.cpp
dbms/src/Storages/StorageMemory.cpp
+0
-18
dbms/src/Storages/StorageMemory.h
dbms/src/Storages/StorageMemory.h
+1
-12
dbms/src/Storages/StorageMerge.cpp
dbms/src/Storages/StorageMerge.cpp
+0
-29
dbms/src/Storages/StorageMerge.h
dbms/src/Storages/StorageMerge.h
+6
-23
dbms/src/Storages/StorageMergeTree.cpp
dbms/src/Storages/StorageMergeTree.cpp
+0
-24
dbms/src/Storages/StorageMergeTree.h
dbms/src/Storages/StorageMergeTree.h
+9
-27
dbms/src/Storages/StorageNull.h
dbms/src/Storages/StorageNull.h
+1
-11
dbms/src/Storages/StorageReplicatedMergeTree.h
dbms/src/Storages/StorageReplicatedMergeTree.h
+1
-1
dbms/src/Storages/StorageSet.h
dbms/src/Storages/StorageSet.h
+2
-2
dbms/src/Storages/StorageStripeLog.cpp
dbms/src/Storages/StorageStripeLog.cpp
+0
-17
dbms/src/Storages/StorageStripeLog.h
dbms/src/Storages/StorageStripeLog.h
+2
-17
dbms/src/Storages/StorageTinyLog.cpp
dbms/src/Storages/StorageTinyLog.cpp
+0
-18
dbms/src/Storages/StorageTinyLog.h
dbms/src/Storages/StorageTinyLog.h
+2
-17
dbms/src/Storages/StorageTrivialBuffer.cpp
dbms/src/Storages/StorageTrivialBuffer.cpp
+0
-17
dbms/src/Storages/StorageTrivialBuffer.h
dbms/src/Storages/StorageTrivialBuffer.h
+1
-10
dbms/src/Storages/StorageView.cpp
dbms/src/Storages/StorageView.cpp
+0
-17
dbms/src/Storages/StorageView.h
dbms/src/Storages/StorageView.h
+1
-11
dbms/src/Storages/System/StorageSystemAsynchronousMetrics.cpp
.../src/Storages/System/StorageSystemAsynchronousMetrics.cpp
+0
-5
dbms/src/Storages/System/StorageSystemAsynchronousMetrics.h
dbms/src/Storages/System/StorageSystemAsynchronousMetrics.h
+1
-3
dbms/src/Storages/System/StorageSystemBuildOptions.cpp
dbms/src/Storages/System/StorageSystemBuildOptions.cpp
+0
-5
dbms/src/Storages/System/StorageSystemBuildOptions.h
dbms/src/Storages/System/StorageSystemBuildOptions.h
+1
-3
dbms/src/Storages/System/StorageSystemClusters.cpp
dbms/src/Storages/System/StorageSystemClusters.cpp
+0
-4
dbms/src/Storages/System/StorageSystemClusters.h
dbms/src/Storages/System/StorageSystemClusters.h
+1
-2
dbms/src/Storages/System/StorageSystemColumns.cpp
dbms/src/Storages/System/StorageSystemColumns.cpp
+0
-4
dbms/src/Storages/System/StorageSystemColumns.h
dbms/src/Storages/System/StorageSystemColumns.h
+1
-3
dbms/src/Storages/System/StorageSystemDatabases.cpp
dbms/src/Storages/System/StorageSystemDatabases.cpp
+0
-5
dbms/src/Storages/System/StorageSystemDatabases.h
dbms/src/Storages/System/StorageSystemDatabases.h
+1
-4
dbms/src/Storages/System/StorageSystemDictionaries.cpp
dbms/src/Storages/System/StorageSystemDictionaries.cpp
+0
-4
dbms/src/Storages/System/StorageSystemDictionaries.h
dbms/src/Storages/System/StorageSystemDictionaries.h
+1
-4
dbms/src/Storages/System/StorageSystemEvents.cpp
dbms/src/Storages/System/StorageSystemEvents.cpp
+0
-5
dbms/src/Storages/System/StorageSystemEvents.h
dbms/src/Storages/System/StorageSystemEvents.h
+1
-4
dbms/src/Storages/System/StorageSystemFunctions.cpp
dbms/src/Storages/System/StorageSystemFunctions.cpp
+0
-4
dbms/src/Storages/System/StorageSystemFunctions.h
dbms/src/Storages/System/StorageSystemFunctions.h
+1
-4
dbms/src/Storages/System/StorageSystemGraphite.cpp
dbms/src/Storages/System/StorageSystemGraphite.cpp
+0
-4
dbms/src/Storages/System/StorageSystemGraphite.h
dbms/src/Storages/System/StorageSystemGraphite.h
+3
-8
dbms/src/Storages/System/StorageSystemMerges.cpp
dbms/src/Storages/System/StorageSystemMerges.cpp
+0
-4
dbms/src/Storages/System/StorageSystemMerges.h
dbms/src/Storages/System/StorageSystemMerges.h
+1
-4
dbms/src/Storages/System/StorageSystemMetrics.cpp
dbms/src/Storages/System/StorageSystemMetrics.cpp
+0
-5
dbms/src/Storages/System/StorageSystemMetrics.h
dbms/src/Storages/System/StorageSystemMetrics.h
+2
-5
dbms/src/Storages/System/StorageSystemNumbers.cpp
dbms/src/Storages/System/StorageSystemNumbers.cpp
+0
-5
dbms/src/Storages/System/StorageSystemNumbers.h
dbms/src/Storages/System/StorageSystemNumbers.h
+1
-4
dbms/src/Storages/System/StorageSystemOne.cpp
dbms/src/Storages/System/StorageSystemOne.cpp
+0
-5
dbms/src/Storages/System/StorageSystemOne.h
dbms/src/Storages/System/StorageSystemOne.h
+1
-4
dbms/src/Storages/System/StorageSystemParts.cpp
dbms/src/Storages/System/StorageSystemParts.cpp
+0
-5
dbms/src/Storages/System/StorageSystemParts.h
dbms/src/Storages/System/StorageSystemParts.h
+1
-3
dbms/src/Storages/System/StorageSystemProcesses.cpp
dbms/src/Storages/System/StorageSystemProcesses.cpp
+0
-5
dbms/src/Storages/System/StorageSystemProcesses.h
dbms/src/Storages/System/StorageSystemProcesses.h
+1
-4
dbms/src/Storages/System/StorageSystemReplicas.cpp
dbms/src/Storages/System/StorageSystemReplicas.cpp
+0
-5
dbms/src/Storages/System/StorageSystemReplicas.h
dbms/src/Storages/System/StorageSystemReplicas.h
+1
-4
dbms/src/Storages/System/StorageSystemReplicationQueue.cpp
dbms/src/Storages/System/StorageSystemReplicationQueue.cpp
+0
-5
dbms/src/Storages/System/StorageSystemReplicationQueue.h
dbms/src/Storages/System/StorageSystemReplicationQueue.h
+1
-4
dbms/src/Storages/System/StorageSystemSettings.cpp
dbms/src/Storages/System/StorageSystemSettings.cpp
+0
-5
dbms/src/Storages/System/StorageSystemSettings.h
dbms/src/Storages/System/StorageSystemSettings.h
+1
-4
dbms/src/Storages/System/StorageSystemTables.cpp
dbms/src/Storages/System/StorageSystemTables.cpp
+0
-5
dbms/src/Storages/System/StorageSystemTables.h
dbms/src/Storages/System/StorageSystemTables.h
+1
-4
dbms/src/Storages/System/StorageSystemZooKeeper.cpp
dbms/src/Storages/System/StorageSystemZooKeeper.cpp
+14
-19
dbms/src/Storages/System/StorageSystemZooKeeper.h
dbms/src/Storages/System/StorageSystemZooKeeper.h
+1
-4
dbms/src/Storages/System/attachSystemTables.cpp
dbms/src/Storages/System/attachSystemTables.cpp
+1
-1
dbms/src/Storages/tests/system_numbers.cpp
dbms/src/Storages/tests/system_numbers.cpp
+1
-1
libs/libcommon/include/ext/shared_ptr_helper.h
libs/libcommon/include/ext/shared_ptr_helper.h
+11
-2
未找到文件。
dbms/src/Analyzers/tests/analyze_columns.cpp
浏览文件 @
0d7d379b
...
...
@@ -36,7 +36,7 @@ try
auto
system_database
=
std
::
make_shared
<
DatabaseMemory
>
(
"system"
);
context
.
addDatabase
(
"system"
,
system_database
);
system_database
->
attachTable
(
"one"
,
StorageSystemOne
::
create
(
"one"
));
system_database
->
attachTable
(
"numbers"
,
StorageSystemNumbers
::
create
(
"numbers"
));
system_database
->
attachTable
(
"numbers"
,
StorageSystemNumbers
::
create
(
"numbers"
,
false
));
context
.
setCurrentDatabase
(
"system"
);
AnalyzeLambdas
analyze_lambdas
;
...
...
dbms/src/Analyzers/tests/analyze_result_of_query.cpp
浏览文件 @
0d7d379b
...
...
@@ -33,7 +33,7 @@ try
context
.
addDatabase
(
"system"
,
system_database
);
context
.
setCurrentDatabase
(
"system"
);
system_database
->
attachTable
(
"one"
,
StorageSystemOne
::
create
(
"one"
));
system_database
->
attachTable
(
"numbers"
,
StorageSystemNumbers
::
create
(
"numbers"
));
system_database
->
attachTable
(
"numbers"
,
StorageSystemNumbers
::
create
(
"numbers"
,
false
));
AnalyzeResultOfQuery
analyzer
;
analyzer
.
process
(
ast
,
context
);
...
...
dbms/src/Analyzers/tests/collect_tables.cpp
浏览文件 @
0d7d379b
...
...
@@ -34,7 +34,7 @@ try
context
.
addDatabase
(
"system"
,
system_database
);
context
.
setCurrentDatabase
(
"system"
);
system_database
->
attachTable
(
"one"
,
StorageSystemOne
::
create
(
"one"
));
system_database
->
attachTable
(
"numbers"
,
StorageSystemNumbers
::
create
(
"numbers"
));
system_database
->
attachTable
(
"numbers"
,
StorageSystemNumbers
::
create
(
"numbers"
,
false
));
CollectAliases
collect_aliases
;
collect_aliases
.
process
(
ast
);
...
...
dbms/src/Analyzers/tests/optimize_group_order_limit_by.cpp
浏览文件 @
0d7d379b
...
...
@@ -39,7 +39,7 @@ try
auto
system_database
=
std
::
make_shared
<
DatabaseMemory
>
(
"system"
);
context
.
addDatabase
(
"system"
,
system_database
);
system_database
->
attachTable
(
"one"
,
StorageSystemOne
::
create
(
"one"
));
system_database
->
attachTable
(
"numbers"
,
StorageSystemNumbers
::
create
(
"numbers"
));
system_database
->
attachTable
(
"numbers"
,
StorageSystemNumbers
::
create
(
"numbers"
,
false
));
context
.
setCurrentDatabase
(
"system"
);
AnalyzeLambdas
analyze_lambdas
;
...
...
dbms/src/Analyzers/tests/type_and_constant_inference.cpp
浏览文件 @
0d7d379b
...
...
@@ -40,7 +40,7 @@ try
auto
system_database
=
std
::
make_shared
<
DatabaseMemory
>
(
"system"
);
context
.
addDatabase
(
"system"
,
system_database
);
system_database
->
attachTable
(
"one"
,
StorageSystemOne
::
create
(
"one"
));
system_database
->
attachTable
(
"numbers"
,
StorageSystemNumbers
::
create
(
"numbers"
));
system_database
->
attachTable
(
"numbers"
,
StorageSystemNumbers
::
create
(
"numbers"
,
false
));
context
.
setCurrentDatabase
(
"system"
);
AnalyzeLambdas
analyze_lambdas
;
...
...
dbms/src/DataStreams/tests/expression_stream.cpp
浏览文件 @
0d7d379b
...
...
@@ -42,7 +42,7 @@ try
chain
.
finalize
();
ExpressionActionsPtr
expression
=
chain
.
getLastActions
();
StoragePtr
table
=
StorageSystemNumbers
::
create
(
"
Numbers"
);
StoragePtr
table
=
StorageSystemNumbers
::
create
(
"
numbers"
,
false
);
Names
column_names
;
column_names
.
push_back
(
"number"
);
...
...
dbms/src/DataStreams/tests/filter_stream.cpp
浏览文件 @
0d7d379b
...
...
@@ -48,7 +48,7 @@ try
chain
.
finalize
();
ExpressionActionsPtr
expression
=
chain
.
getLastActions
();
StoragePtr
table
=
StorageSystemNumbers
::
create
(
"
Numbers"
);
StoragePtr
table
=
StorageSystemNumbers
::
create
(
"
numbers"
,
false
);
Names
column_names
;
column_names
.
push_back
(
"number"
);
...
...
dbms/src/DataStreams/tests/fork_streams.cpp
浏览文件 @
0d7d379b
...
...
@@ -65,7 +65,7 @@ try
chain
.
finalize
();
ExpressionActionsPtr
expression
=
chain
.
getLastActions
();
StoragePtr
table
=
StorageSystemNumbers
::
create
(
"
Numbers"
);
StoragePtr
table
=
StorageSystemNumbers
::
create
(
"
numbers"
,
false
);
Names
column_names
;
column_names
.
push_back
(
"number"
);
...
...
dbms/src/DataStreams/tests/union_stream.cpp
浏览文件 @
0d7d379b
...
...
@@ -25,7 +25,7 @@ using namespace DB;
void
test1
()
{
Context
context
;
StoragePtr
table
=
StorageSystemNumbers
::
create
(
"numbers"
);
StoragePtr
table
=
StorageSystemNumbers
::
create
(
"numbers"
,
false
);
Names
column_names
;
column_names
.
push_back
(
"number"
);
...
...
@@ -55,7 +55,7 @@ void test1()
void
test2
()
{
Context
context
;
StoragePtr
table
=
StorageSystemNumbers
::
create
(
"numbers"
);
StoragePtr
table
=
StorageSystemNumbers
::
create
(
"numbers"
,
false
);
Names
column_names
;
column_names
.
push_back
(
"number"
);
...
...
dbms/src/Interpreters/tests/in_join_subqueries_preprocessor.cpp
浏览文件 @
0d7d379b
...
...
@@ -27,16 +27,11 @@ namespace DB
/// Simplified version of the StorageDistributed class.
class
StorageDistributedFake
:
p
rivate
ext
::
shared_ptr_helper
<
StorageDistributedFake
>
,
public
DB
::
IStorage
class
StorageDistributedFake
:
p
ublic
ext
::
shared_ptr_helper
<
StorageDistributedFake
>
,
public
DB
::
IStorage
{
friend
class
ext
::
shared_ptr_helper
<
StorageDistributedFake
>
;
public:
static
DB
::
StoragePtr
create
(
const
std
::
string
&
remote_database_
,
const
std
::
string
&
remote_table_
,
size_t
shard_count_
)
{
return
make_shared
(
remote_database_
,
remote_table_
,
shard_count_
);
}
std
::
string
getName
()
const
override
{
return
"DistributedFake"
;
}
bool
isRemote
()
const
override
{
return
true
;
}
size_t
getShardCount
()
const
{
return
shard_count
;
}
...
...
dbms/src/Interpreters/tests/select_query.cpp
浏览文件 @
0d7d379b
...
...
@@ -41,7 +41,7 @@ try
context
.
addDatabase
(
"system"
,
system
);
system
->
loadTables
(
context
,
nullptr
,
false
);
system
->
attachTable
(
"one"
,
StorageSystemOne
::
create
(
"one"
));
system
->
attachTable
(
"numbers"
,
StorageSystemNumbers
::
create
(
"numbers"
));
system
->
attachTable
(
"numbers"
,
StorageSystemNumbers
::
create
(
"numbers"
,
false
));
context
.
setCurrentDatabase
(
"default"
);
ReadBufferFromIStream
in
(
std
::
cin
);
...
...
dbms/src/Storages/StorageBuffer.cpp
浏览文件 @
0d7d379b
...
...
@@ -43,20 +43,6 @@ namespace ErrorCodes
}
StoragePtr
StorageBuffer
::
create
(
const
std
::
string
&
name_
,
NamesAndTypesListPtr
columns_
,
const
NamesAndTypesList
&
materialized_columns_
,
const
NamesAndTypesList
&
alias_columns_
,
const
ColumnDefaults
&
column_defaults_
,
Context
&
context_
,
size_t
num_shards_
,
const
Thresholds
&
min_thresholds_
,
const
Thresholds
&
max_thresholds_
,
const
String
&
destination_database_
,
const
String
&
destination_table_
)
{
return
make_shared
(
name_
,
columns_
,
materialized_columns_
,
alias_columns_
,
column_defaults_
,
context_
,
num_shards_
,
min_thresholds_
,
max_thresholds_
,
destination_database_
,
destination_table_
);
}
StorageBuffer
::
StorageBuffer
(
const
std
::
string
&
name_
,
NamesAndTypesListPtr
columns_
,
const
NamesAndTypesList
&
materialized_columns_
,
const
NamesAndTypesList
&
alias_columns_
,
...
...
dbms/src/Storages/StorageBuffer.h
浏览文件 @
0d7d379b
...
...
@@ -36,7 +36,7 @@ class Context;
* When you destroy a Buffer table, all remaining data is flushed to the subordinate table.
* The data in the buffer is not replicated, not logged to disk, not indexed. With a rough restart of the server, the data is lost.
*/
class
StorageBuffer
:
p
rivate
ext
::
shared_ptr_helper
<
StorageBuffer
>
,
public
IStorage
class
StorageBuffer
:
p
ublic
ext
::
shared_ptr_helper
<
StorageBuffer
>
,
public
IStorage
{
friend
class
ext
::
shared_ptr_helper
<
StorageBuffer
>
;
friend
class
BufferBlockInputStream
;
...
...
@@ -51,17 +51,6 @@ public:
size_t
bytes
;
/// The number of (uncompressed) bytes in the block.
};
/** num_shards - the level of internal parallelism (the number of independent buffers)
* The buffer is flushed if all minimum thresholds or at least one of the maximum thresholds are exceeded.
*/
static
StoragePtr
create
(
const
std
::
string
&
name_
,
NamesAndTypesListPtr
columns_
,
const
NamesAndTypesList
&
materialized_columns_
,
const
NamesAndTypesList
&
alias_columns_
,
const
ColumnDefaults
&
column_defaults_
,
Context
&
context_
,
size_t
num_shards_
,
const
Thresholds
&
min_thresholds_
,
const
Thresholds
&
max_thresholds_
,
const
String
&
destination_database_
,
const
String
&
destination_table_
);
std
::
string
getName
()
const
override
{
return
"Buffer"
;
}
std
::
string
getTableName
()
const
override
{
return
name
;
}
...
...
@@ -123,6 +112,9 @@ private:
/// Resets data by timeout.
std
::
thread
flush_thread
;
/** num_shards - the level of internal parallelism (the number of independent buffers)
* The buffer is flushed if all minimum thresholds or at least one of the maximum thresholds are exceeded.
*/
StorageBuffer
(
const
std
::
string
&
name_
,
NamesAndTypesListPtr
columns_
,
const
NamesAndTypesList
&
materialized_columns_
,
const
NamesAndTypesList
&
alias_columns_
,
...
...
dbms/src/Storages/StorageCloud.cpp
浏览文件 @
0d7d379b
...
...
@@ -28,17 +28,4 @@ StorageCloud::StorageCloud(
DatabaseCloud
&
db
=
static_cast
<
DatabaseCloud
&>
(
*
owned_db
);
}
StoragePtr
StorageCloud
::
create
(
DatabasePtr
&
database_ptr_
,
const
std
::
string
&
name_
,
NamesAndTypesListPtr
columns_
,
const
NamesAndTypesList
&
materialized_columns_
,
const
NamesAndTypesList
&
alias_columns_
,
const
ColumnDefaults
&
column_defaults_
)
{
return
make_shared
(
database_ptr_
,
name_
,
columns_
,
materialized_columns_
,
alias_columns_
,
column_defaults_
);
}
}
dbms/src/Storages/StorageCloud.h
浏览文件 @
0d7d379b
...
...
@@ -16,19 +16,11 @@ class Context;
/** Cloud table. It can only be in the cloud database.
* When writing to a table, data is written to local tables on multiple cloud servers.
*/
class
StorageCloud
:
p
rivate
ext
::
shared_ptr_helper
<
StorageCloud
>
,
public
IStorage
class
StorageCloud
:
p
ublic
ext
::
shared_ptr_helper
<
StorageCloud
>
,
public
IStorage
{
friend
class
ext
::
shared_ptr_helper
<
StorageCloud
>
;
public:
static
StoragePtr
create
(
DatabasePtr
&
database_ptr_
,
const
std
::
string
&
name_
,
NamesAndTypesListPtr
columns_
,
const
NamesAndTypesList
&
materialized_columns_
,
const
NamesAndTypesList
&
alias_columns_
,
const
ColumnDefaults
&
column_defaults_
);
std
::
string
getName
()
const
override
{
return
"Cloud"
;
}
std
::
string
getTableName
()
const
override
{
return
name
;
}
...
...
dbms/src/Storages/StorageDistributed.h
浏览文件 @
0d7d379b
...
...
@@ -25,7 +25,7 @@ class StorageDistributedDirectoryMonitor;
* You can pass one address, not several.
* In this case, the table can be considered remote, rather than distributed.
*/
class
StorageDistributed
:
p
rivate
ext
::
shared_ptr_helper
<
StorageDistributed
>
,
public
IStorage
class
StorageDistributed
:
p
ublic
ext
::
shared_ptr_helper
<
StorageDistributed
>
,
public
IStorage
{
friend
class
ext
::
shared_ptr_helper
<
StorageDistributed
>
;
friend
class
DistributedBlockOutputStream
;
...
...
dbms/src/Storages/StorageFactory.cpp
浏览文件 @
0d7d379b
...
...
@@ -554,7 +554,9 @@ StoragePtr StorageFactory::get(
table_name
,
columns
,
materialized_columns
,
alias_columns
,
column_defaults
,
context
,
num_buckets
,
{
min_time
,
min_rows
,
min_bytes
},
{
max_time
,
max_rows
,
max_bytes
},
num_buckets
,
StorageBuffer
::
Thresholds
{
min_time
,
min_rows
,
min_bytes
},
StorageBuffer
::
Thresholds
{
max_time
,
max_rows
,
max_bytes
},
destination_database
,
destination_table
);
}
else
if
(
name
==
"TrivialBuffer"
)
...
...
@@ -602,7 +604,8 @@ StoragePtr StorageFactory::get(
table_name
,
columns
,
materialized_columns
,
alias_columns
,
column_defaults
,
context
,
num_blocks_to_deduplicate
,
path_in_zk_for_deduplication
,
{
min_time
,
min_rows
,
min_bytes
},
{
max_time
,
max_rows
,
max_bytes
},
StorageTrivialBuffer
::
Thresholds
{
min_time
,
min_rows
,
min_bytes
},
StorageTrivialBuffer
::
Thresholds
{
max_time
,
max_rows
,
max_bytes
},
destination_database
,
destination_table
);
}
else
if
(
endsWith
(
name
,
"MergeTree"
))
...
...
dbms/src/Storages/StorageJoin.h
浏览文件 @
0d7d379b
...
...
@@ -20,7 +20,7 @@ using JoinPtr = std::shared_ptr<Join>;
*
* When using, JOIN must be of the appropriate type (ANY|ALL LEFT|INNER ...).
*/
class
StorageJoin
:
p
rivate
ext
::
shared_ptr_helper
<
StorageJoin
>
,
public
StorageSetOrJoinBase
class
StorageJoin
:
p
ublic
ext
::
shared_ptr_helper
<
StorageJoin
>
,
public
StorageSetOrJoinBase
{
friend
class
ext
::
shared_ptr_helper
<
StorageJoin
>
;
...
...
dbms/src/Storages/StorageLog.cpp
浏览文件 @
0d7d379b
...
...
@@ -589,35 +589,6 @@ StorageLog::StorageLog(
null_marks_file
=
Poco
::
File
(
path
+
escapeForFileName
(
name
)
+
'/'
+
DBMS_STORAGE_LOG_NULL_MARKS_FILE_NAME
);
}
StoragePtr
StorageLog
::
create
(
const
std
::
string
&
path_
,
const
std
::
string
&
name_
,
NamesAndTypesListPtr
columns_
,
const
NamesAndTypesList
&
materialized_columns_
,
const
NamesAndTypesList
&
alias_columns_
,
const
ColumnDefaults
&
column_defaults_
,
size_t
max_compress_block_size_
)
{
return
make_shared
(
path_
,
name_
,
columns_
,
materialized_columns_
,
alias_columns_
,
column_defaults_
,
max_compress_block_size_
);
}
StoragePtr
StorageLog
::
create
(
const
std
::
string
&
path_
,
const
std
::
string
&
name_
,
NamesAndTypesListPtr
columns_
,
size_t
max_compress_block_size_
)
{
return
make_shared
(
path_
,
name_
,
columns_
,
NamesAndTypesList
{},
NamesAndTypesList
{},
ColumnDefaults
{},
max_compress_block_size_
);
}
void
StorageLog
::
addFile
(
const
String
&
column_name
,
const
IDataType
&
type
,
size_t
level
)
{
...
...
dbms/src/Storages/StorageLog.h
浏览文件 @
0d7d379b
...
...
@@ -38,32 +38,13 @@ using Marks = std::vector<Mark>;
* Keys are not supported.
* The data is stored in a compressed form.
*/
class
StorageLog
:
p
rivate
ext
::
shared_ptr_helper
<
StorageLog
>
,
public
IStorage
class
StorageLog
:
p
ublic
ext
::
shared_ptr_helper
<
StorageLog
>
,
public
IStorage
{
friend
class
ext
::
shared_ptr_helper
<
StorageLog
>
;
friend
class
LogBlockInputStream
;
friend
class
LogBlockOutputStream
;
public:
/** hook the table with the appropriate name, along the appropriate path (with / at the end),
* (the correctness of names and paths is not verified)
* consisting of the specified columns; Create files if they do not exist.
*/
static
StoragePtr
create
(
const
std
::
string
&
path_
,
const
std
::
string
&
name_
,
NamesAndTypesListPtr
columns_
,
const
NamesAndTypesList
&
materialized_columns_
,
const
NamesAndTypesList
&
alias_columns_
,
const
ColumnDefaults
&
column_defaults_
,
size_t
max_compress_block_size_
=
DEFAULT_MAX_COMPRESS_BLOCK_SIZE
);
static
StoragePtr
create
(
const
std
::
string
&
path_
,
const
std
::
string
&
name_
,
NamesAndTypesListPtr
columns_
,
size_t
max_compress_block_size_
=
DEFAULT_MAX_COMPRESS_BLOCK_SIZE
);
std
::
string
getName
()
const
override
{
return
"Log"
;
}
std
::
string
getTableName
()
const
override
{
return
name
;
}
...
...
@@ -102,6 +83,10 @@ protected:
Poco
::
RWLock
rwlock
;
/** Attach the table with the appropriate name, along the appropriate path (with / at the end),
* (the correctness of names and paths is not verified)
* consisting of the specified columns; Create files if they do not exist.
*/
StorageLog
(
const
std
::
string
&
path_
,
const
std
::
string
&
name_
,
...
...
dbms/src/Storages/StorageMaterializedView.h
浏览文件 @
0d7d379b
...
...
@@ -8,7 +8,7 @@
namespace
DB
{
class
StorageMaterializedView
:
p
rivate
ext
::
shared_ptr_helper
<
StorageMaterializedView
>
,
public
StorageView
class
StorageMaterializedView
:
p
ublic
ext
::
shared_ptr_helper
<
StorageMaterializedView
>
,
public
StorageView
{
friend
class
ext
::
shared_ptr_helper
<
StorageMaterializedView
>
;
...
...
dbms/src/Storages/StorageMemory.cpp
浏览文件 @
0d7d379b
...
...
@@ -94,24 +94,6 @@ StorageMemory::StorageMemory(
}
StoragePtr
StorageMemory
::
create
(
const
std
::
string
&
name_
,
NamesAndTypesListPtr
columns_
)
{
return
make_shared
(
name_
,
columns_
);
}
StoragePtr
StorageMemory
::
create
(
const
std
::
string
&
name_
,
NamesAndTypesListPtr
columns_
,
const
NamesAndTypesList
&
materialized_columns_
,
const
NamesAndTypesList
&
alias_columns_
,
const
ColumnDefaults
&
column_defaults_
)
{
return
make_shared
(
name_
,
columns_
,
materialized_columns_
,
alias_columns_
,
column_defaults_
);
}
BlockInputStreams
StorageMemory
::
read
(
const
Names
&
column_names
,
const
ASTPtr
&
query
,
...
...
dbms/src/Storages/StorageMemory.h
浏览文件 @
0d7d379b
...
...
@@ -20,24 +20,13 @@ class StorageMemory;
* It does not support keys.
* Data is stored as a set of blocks and is not stored anywhere else.
*/
class
StorageMemory
:
p
rivate
ext
::
shared_ptr_helper
<
StorageMemory
>
,
public
IStorage
class
StorageMemory
:
p
ublic
ext
::
shared_ptr_helper
<
StorageMemory
>
,
public
IStorage
{
friend
class
ext
::
shared_ptr_helper
<
StorageMemory
>
;
friend
class
MemoryBlockInputStream
;
friend
class
MemoryBlockOutputStream
;
public:
static
StoragePtr
create
(
const
std
::
string
&
name_
,
NamesAndTypesListPtr
columns_
);
static
StoragePtr
create
(
const
std
::
string
&
name_
,
NamesAndTypesListPtr
columns_
,
const
NamesAndTypesList
&
materialized_columns_
,
const
NamesAndTypesList
&
alias_columns_
,
const
ColumnDefaults
&
column_defaults_
);
std
::
string
getName
()
const
override
{
return
"Memory"
;
}
std
::
string
getTableName
()
const
override
{
return
name
;
}
...
...
dbms/src/Storages/StorageMerge.cpp
浏览文件 @
0d7d379b
...
...
@@ -50,35 +50,6 @@ StorageMerge::StorageMerge(
{
}
StoragePtr
StorageMerge
::
create
(
const
std
::
string
&
name_
,
NamesAndTypesListPtr
columns_
,
const
String
&
source_database_
,
const
String
&
table_name_regexp_
,
const
Context
&
context_
)
{
return
make_shared
(
name_
,
columns_
,
source_database_
,
table_name_regexp_
,
context_
);
}
StoragePtr
StorageMerge
::
create
(
const
std
::
string
&
name_
,
NamesAndTypesListPtr
columns_
,
const
NamesAndTypesList
&
materialized_columns_
,
const
NamesAndTypesList
&
alias_columns_
,
const
ColumnDefaults
&
column_defaults_
,
const
String
&
source_database_
,
const
String
&
table_name_regexp_
,
const
Context
&
context_
)
{
return
make_shared
(
name_
,
columns_
,
materialized_columns_
,
alias_columns_
,
column_defaults_
,
source_database_
,
table_name_regexp_
,
context_
);
}
NameAndTypePair
StorageMerge
::
getColumn
(
const
String
&
column_name
)
const
{
auto
type
=
VirtualColumnFactory
::
tryGetType
(
column_name
);
...
...
dbms/src/Storages/StorageMerge.h
浏览文件 @
0d7d379b
...
...
@@ -12,28 +12,11 @@ namespace DB
/** A table that represents the union of an arbitrary number of other tables.
* All tables must have the same structure.
*/
class
StorageMerge
:
p
rivate
ext
::
shared_ptr_helper
<
StorageMerge
>
,
public
IStorage
class
StorageMerge
:
p
ublic
ext
::
shared_ptr_helper
<
StorageMerge
>
,
public
IStorage
{
friend
class
ext
::
shared_ptr_helper
<
StorageMerge
>
;
public:
static
StoragePtr
create
(
const
std
::
string
&
name_
,
/// The name of the table.
NamesAndTypesListPtr
columns_
,
/// List of columns.
const
String
&
source_database_
,
/// In which database to look for source tables.
const
String
&
table_name_regexp_
,
/// Regex names of source tables.
const
Context
&
context_
);
/// Known tables.
static
StoragePtr
create
(
const
std
::
string
&
name_
,
/// The name of the table.
NamesAndTypesListPtr
columns_
,
/// List of columns.
const
NamesAndTypesList
&
materialized_columns_
,
const
NamesAndTypesList
&
alias_columns_
,
const
ColumnDefaults
&
column_defaults_
,
const
String
&
source_database_
,
/// In which database to look for source tables.
const
String
&
table_name_regexp_
,
/// Regex names of source tables.
const
Context
&
context_
);
/// Known tables.
std
::
string
getName
()
const
override
{
return
"Merge"
;
}
std
::
string
getTableName
()
const
override
{
return
name
;
}
...
...
@@ -70,11 +53,11 @@ private:
const
Context
&
context
;
StorageMerge
(
const
std
::
string
&
name_
,
NamesAndTypesListPtr
columns_
,
const
String
&
source_database_
,
const
String
&
table_name_regexp_
,
const
Context
&
context_
);
const
std
::
string
&
name_
,
/// The name of the table.
NamesAndTypesListPtr
columns_
,
/// List of columns.
const
String
&
source_database_
,
/// In which database to look for source tables.
const
String
&
table_name_regexp_
,
/// Regex names of source tables.
const
Context
&
context_
);
/// Known tables.
StorageMerge
(
const
std
::
string
&
name_
,
...
...
dbms/src/Storages/StorageMergeTree.cpp
浏览文件 @
0d7d379b
...
...
@@ -65,30 +65,6 @@ StorageMergeTree::StorageMergeTree(
increment
.
set
(
data
.
getMaxDataPartIndex
());
}
StoragePtr
StorageMergeTree
::
create
(
const
String
&
path_
,
const
String
&
database_name_
,
const
String
&
table_name_
,
NamesAndTypesListPtr
columns_
,
const
NamesAndTypesList
&
materialized_columns_
,
const
NamesAndTypesList
&
alias_columns_
,
const
ColumnDefaults
&
column_defaults_
,
bool
attach
,
Context
&
context_
,
ASTPtr
&
primary_expr_ast_
,
const
String
&
date_column_name_
,
const
ASTPtr
&
sampling_expression_
,
size_t
index_granularity_
,
const
MergeTreeData
::
MergingParams
&
merging_params_
,
bool
has_force_restore_data_flag_
,
const
MergeTreeSettings
&
settings_
)
{
return
make_shared
(
path_
,
database_name_
,
table_name_
,
columns_
,
materialized_columns_
,
alias_columns_
,
column_defaults_
,
attach
,
context_
,
primary_expr_ast_
,
date_column_name_
,
sampling_expression_
,
index_granularity_
,
merging_params_
,
has_force_restore_data_flag_
,
settings_
);
}
void
StorageMergeTree
::
startup
()
{
...
...
dbms/src/Storages/StorageMergeTree.h
浏览文件 @
0d7d379b
...
...
@@ -16,38 +16,12 @@ namespace DB
/** See the description of the data structure in MergeTreeData.
*/
class
StorageMergeTree
:
p
rivate
ext
::
shared_ptr_helper
<
StorageMergeTree
>
,
public
IStorage
class
StorageMergeTree
:
p
ublic
ext
::
shared_ptr_helper
<
StorageMergeTree
>
,
public
IStorage
{
friend
class
ext
::
shared_ptr_helper
<
StorageMergeTree
>
;
friend
class
MergeTreeBlockOutputStream
;
public:
/** hook the table with the appropriate name, along the appropriate path (with / at the end),
* (correctness of names and paths are not checked)
* consisting of the specified columns.
*
* primary_expr_ast - expression for sorting;
* date_column_name - the name of the column with the date;
* index_granularity - fow how many rows one index value is written.
*/
static
StoragePtr
create
(
const
String
&
path_
,
const
String
&
database_name_
,
const
String
&
table_name_
,
NamesAndTypesListPtr
columns_
,
const
NamesAndTypesList
&
materialized_columns_
,
const
NamesAndTypesList
&
alias_columns_
,
const
ColumnDefaults
&
column_defaults_
,
bool
attach
,
Context
&
context_
,
ASTPtr
&
primary_expr_ast_
,
const
String
&
date_column_name_
,
const
ASTPtr
&
sampling_expression_
,
/// nullptr, if sampling is not supported.
size_t
index_granularity_
,
const
MergeTreeData
::
MergingParams
&
merging_params_
,
bool
has_force_restore_data_flag
,
const
MergeTreeSettings
&
settings_
);
void
startup
()
override
;
void
shutdown
()
override
;
~
StorageMergeTree
()
override
;
...
...
@@ -141,6 +115,14 @@ private:
friend
struct
CurrentlyMergingPartsTagger
;
/** Attach the table with the appropriate name, along the appropriate path (with / at the end),
* (correctness of names and paths are not checked)
* consisting of the specified columns.
*
* primary_expr_ast - expression for sorting;
* date_column_name - the name of the column with the date;
* index_granularity - fow how many rows one index value is written.
*/
StorageMergeTree
(
const
String
&
path_
,
const
String
&
database_name_
,
...
...
dbms/src/Storages/StorageNull.h
浏览文件 @
0d7d379b
...
...
@@ -14,21 +14,11 @@ namespace DB
/** When writing, does nothing.
* When reading, returns nothing.
*/
class
StorageNull
:
p
rivate
ext
::
shared_ptr_helper
<
StorageNull
>
,
public
IStorage
class
StorageNull
:
p
ublic
ext
::
shared_ptr_helper
<
StorageNull
>
,
public
IStorage
{
friend
class
ext
::
shared_ptr_helper
<
StorageNull
>
;
public:
static
StoragePtr
create
(
const
std
::
string
&
name_
,
NamesAndTypesListPtr
columns_
,
const
NamesAndTypesList
&
materialized_columns_
,
const
NamesAndTypesList
&
alias_columns_
,
const
ColumnDefaults
&
column_defaults_
)
{
return
make_shared
(
name_
,
columns_
,
materialized_columns_
,
alias_columns_
,
column_defaults_
);
}
std
::
string
getName
()
const
override
{
return
"Null"
;
}
std
::
string
getTableName
()
const
override
{
return
name
;
}
...
...
dbms/src/Storages/StorageReplicatedMergeTree.h
浏览文件 @
0d7d379b
...
...
@@ -69,7 +69,7 @@ namespace DB
* as the time will take the time of creation the appropriate part on any of the replicas.
*/
class
StorageReplicatedMergeTree
:
p
rivate
ext
::
shared_ptr_helper
<
StorageReplicatedMergeTree
>
,
public
IStorage
class
StorageReplicatedMergeTree
:
p
ublic
ext
::
shared_ptr_helper
<
StorageReplicatedMergeTree
>
,
public
IStorage
{
friend
class
ext
::
shared_ptr_helper
<
StorageReplicatedMergeTree
>
;
...
...
dbms/src/Storages/StorageSet.h
浏览文件 @
0d7d379b
...
...
@@ -14,7 +14,7 @@ using SetPtr = std::shared_ptr<Set>;
/** Common part of StorageSet and StorageJoin.
*/
class
StorageSetOrJoinBase
:
p
rivate
ext
::
shared_ptr_helper
<
StorageSetOrJoinBase
>
,
public
IStorage
class
StorageSetOrJoinBase
:
p
ublic
ext
::
shared_ptr_helper
<
StorageSetOrJoinBase
>
,
public
IStorage
{
friend
class
ext
::
shared_ptr_helper
<
StorageSetOrJoinBase
>
;
friend
class
SetOrJoinBlockOutputStream
;
...
...
@@ -59,7 +59,7 @@ private:
* and also written to a file-backup, for recovery after a restart.
* Reading from the table is not possible directly - it is possible to specify only the right part of the IN statement.
*/
class
StorageSet
:
p
rivate
ext
::
shared_ptr_helper
<
StorageSet
>
,
public
StorageSetOrJoinBase
class
StorageSet
:
p
ublic
ext
::
shared_ptr_helper
<
StorageSet
>
,
public
StorageSetOrJoinBase
{
friend
class
ext
::
shared_ptr_helper
<
StorageSet
>
;
...
...
dbms/src/Storages/StorageStripeLog.cpp
浏览文件 @
0d7d379b
...
...
@@ -206,23 +206,6 @@ StorageStripeLog::StorageStripeLog(
}
}
StoragePtr
StorageStripeLog
::
create
(
const
std
::
string
&
path_
,
const
std
::
string
&
name_
,
NamesAndTypesListPtr
columns_
,
const
NamesAndTypesList
&
materialized_columns_
,
const
NamesAndTypesList
&
alias_columns_
,
const
ColumnDefaults
&
column_defaults_
,
bool
attach
,
size_t
max_compress_block_size_
)
{
return
make_shared
(
path_
,
name_
,
columns_
,
materialized_columns_
,
alias_columns_
,
column_defaults_
,
attach
,
max_compress_block_size_
);
}
void
StorageStripeLog
::
rename
(
const
String
&
new_path_to_db
,
const
String
&
new_database_name
,
const
String
&
new_table_name
)
{
...
...
dbms/src/Storages/StorageStripeLog.h
浏览文件 @
0d7d379b
...
...
@@ -17,28 +17,13 @@ namespace DB
/** Implements a repository that is suitable for small pieces of the log.
* In doing so, stores all the columns in a single Native file, with a nearby index.
*/
class
StorageStripeLog
:
p
rivate
ext
::
shared_ptr_helper
<
StorageStripeLog
>
,
public
IStorage
class
StorageStripeLog
:
p
ublic
ext
::
shared_ptr_helper
<
StorageStripeLog
>
,
public
IStorage
{
friend
class
ext
::
shared_ptr_helper
<
StorageStripeLog
>
;
friend
class
StripeLogBlockInputStream
;
friend
class
StripeLogBlockOutputStream
;
public:
/** hook the table with the appropriate name, along the appropriate path (with / at the end),
* (the correctness of names and paths is not checked)
* consisting of the specified columns.
* If not specified `attach` - create a directory if it does not exist.
*/
static
StoragePtr
create
(
const
std
::
string
&
path_
,
const
std
::
string
&
name_
,
NamesAndTypesListPtr
columns_
,
const
NamesAndTypesList
&
materialized_columns_
,
const
NamesAndTypesList
&
alias_columns_
,
const
ColumnDefaults
&
column_defaults_
,
bool
attach
,
size_t
max_compress_block_size_
=
DEFAULT_MAX_COMPRESS_BLOCK_SIZE
);
std
::
string
getName
()
const
override
{
return
"StripeLog"
;
}
std
::
string
getTableName
()
const
override
{
return
name
;
}
...
...
@@ -87,7 +72,7 @@ private:
const
NamesAndTypesList
&
alias_columns_
,
const
ColumnDefaults
&
column_defaults_
,
bool
attach
,
size_t
max_compress_block_size_
);
size_t
max_compress_block_size_
=
DEFAULT_MAX_COMPRESS_BLOCK_SIZE
);
};
}
dbms/src/Storages/StorageTinyLog.cpp
浏览文件 @
0d7d379b
...
...
@@ -464,24 +464,6 @@ StorageTinyLog::StorageTinyLog(
}
StoragePtr
StorageTinyLog
::
create
(
const
std
::
string
&
path_
,
const
std
::
string
&
name_
,
NamesAndTypesListPtr
columns_
,
const
NamesAndTypesList
&
materialized_columns_
,
const
NamesAndTypesList
&
alias_columns_
,
const
ColumnDefaults
&
column_defaults_
,
bool
attach
,
size_t
max_compress_block_size_
)
{
return
make_shared
(
path_
,
name_
,
columns_
,
materialized_columns_
,
alias_columns_
,
column_defaults_
,
attach
,
max_compress_block_size_
);
}
void
StorageTinyLog
::
addFile
(
const
String
&
column_name
,
const
IDataType
&
type
,
size_t
level
)
{
if
(
files
.
end
()
!=
files
.
find
(
column_name
))
...
...
dbms/src/Storages/StorageTinyLog.h
浏览文件 @
0d7d379b
...
...
@@ -17,28 +17,13 @@ namespace DB
/** Implements a repository that is suitable for small pieces of the log.
* It differs from StorageLog in the absence of mark files.
*/
class
StorageTinyLog
:
p
rivate
ext
::
shared_ptr_helper
<
StorageTinyLog
>
,
public
IStorage
class
StorageTinyLog
:
p
ublic
ext
::
shared_ptr_helper
<
StorageTinyLog
>
,
public
IStorage
{
friend
class
ext
::
shared_ptr_helper
<
StorageTinyLog
>
;
friend
class
TinyLogBlockInputStream
;
friend
class
TinyLogBlockOutputStream
;
public:
/** hook the table with the appropriate name, along the appropriate path (with / at the end),
* (the correctness of names and paths is not verified)
* consisting of the specified columns.
* If not specified `attach` - create a directory if it does not exist.
*/
static
StoragePtr
create
(
const
std
::
string
&
path_
,
const
std
::
string
&
name_
,
NamesAndTypesListPtr
columns_
,
const
NamesAndTypesList
&
materialized_columns_
,
const
NamesAndTypesList
&
alias_columns_
,
const
ColumnDefaults
&
column_defaults_
,
bool
attach
,
size_t
max_compress_block_size_
=
DEFAULT_MAX_COMPRESS_BLOCK_SIZE
);
std
::
string
getName
()
const
override
{
return
"TinyLog"
;
}
std
::
string
getTableName
()
const
override
{
return
name
;
}
...
...
@@ -90,7 +75,7 @@ private:
const
NamesAndTypesList
&
alias_columns_
,
const
ColumnDefaults
&
column_defaults_
,
bool
attach
,
size_t
max_compress_block_size_
);
size_t
max_compress_block_size_
=
DEFAULT_MAX_COMPRESS_BLOCK_SIZE
);
void
addFile
(
const
String
&
column_name
,
const
IDataType
&
type
,
size_t
level
=
0
);
};
...
...
dbms/src/Storages/StorageTrivialBuffer.cpp
浏览文件 @
0d7d379b
...
...
@@ -43,23 +43,6 @@ namespace ErrorCodes
}
StoragePtr
StorageTrivialBuffer
::
create
(
const
std
::
string
&
name_
,
NamesAndTypesListPtr
columns_
,
const
NamesAndTypesList
&
materialized_columns_
,
const
NamesAndTypesList
&
alias_columns_
,
const
ColumnDefaults
&
column_defaults_
,
Context
&
context_
,
const
size_t
num_blocks_to_deduplicate_
,
const
String
&
path_in_zk_for_deduplication_
,
const
Thresholds
&
min_thresholds_
,
const
Thresholds
&
max_thresholds_
,
const
String
&
destination_database_
,
const
String
&
destination_table_
)
{
return
make_shared
(
name_
,
columns_
,
materialized_columns_
,
alias_columns_
,
column_defaults_
,
context_
,
num_blocks_to_deduplicate_
,
path_in_zk_for_deduplication_
,
min_thresholds_
,
max_thresholds_
,
destination_database_
,
destination_table_
);
}
StorageTrivialBuffer
::
StorageTrivialBuffer
(
const
std
::
string
&
name_
,
NamesAndTypesListPtr
columns_
,
const
NamesAndTypesList
&
materialized_columns_
,
const
NamesAndTypesList
&
alias_columns_
,
...
...
dbms/src/Storages/StorageTrivialBuffer.h
浏览文件 @
0d7d379b
...
...
@@ -31,7 +31,7 @@ class Context;
* The data in the buffer is not replicated, logged or stored. After hard reset of the
* server, the data is lost.
*/
class
StorageTrivialBuffer
:
p
rivate
ext
::
shared_ptr_helper
<
StorageTrivialBuffer
>
,
public
IStorage
class
StorageTrivialBuffer
:
p
ublic
ext
::
shared_ptr_helper
<
StorageTrivialBuffer
>
,
public
IStorage
{
friend
class
ext
::
shared_ptr_helper
<
StorageTrivialBuffer
>
;
friend
class
TrivialBufferBlockInputStream
;
...
...
@@ -45,15 +45,6 @@ public:
size_t
bytes
;
/// Number of bytes (incompressed) in buffer.
};
static
StoragePtr
create
(
const
std
::
string
&
name_
,
NamesAndTypesListPtr
columns_
,
const
NamesAndTypesList
&
materialized_columns_
,
const
NamesAndTypesList
&
alias_columns_
,
const
ColumnDefaults
&
column_defaults_
,
Context
&
context_
,
size_t
num_blocks_to_deduplicate_
,
const
String
&
path_in_zk_for_deduplication_
,
const
Thresholds
&
min_thresholds_
,
const
Thresholds
&
max_thresholds_
,
const
String
&
destination_database_
,
const
String
&
destination_table_
);
std
::
string
getName
()
const
override
{
return
"TrivialBuffer"
;
}
std
::
string
getTableName
()
const
override
{
return
name
;
}
...
...
dbms/src/Storages/StorageView.cpp
浏览文件 @
0d7d379b
...
...
@@ -15,23 +15,6 @@ namespace ErrorCodes
}
StoragePtr
StorageView
::
create
(
const
String
&
table_name_
,
const
String
&
database_name_
,
Context
&
context_
,
ASTPtr
&
query_
,
NamesAndTypesListPtr
columns_
,
const
NamesAndTypesList
&
materialized_columns_
,
const
NamesAndTypesList
&
alias_columns_
,
const
ColumnDefaults
&
column_defaults_
)
{
return
make_shared
(
table_name_
,
database_name_
,
context_
,
query_
,
columns_
,
materialized_columns_
,
alias_columns_
,
column_defaults_
);
}
StorageView
::
StorageView
(
const
String
&
table_name_
,
const
String
&
database_name_
,
...
...
dbms/src/Storages/StorageView.h
浏览文件 @
0d7d379b
...
...
@@ -9,21 +9,11 @@
namespace
DB
{
class
StorageView
:
p
rivate
ext
::
shared_ptr_helper
<
StorageView
>
,
public
IStorage
class
StorageView
:
p
ublic
ext
::
shared_ptr_helper
<
StorageView
>
,
public
IStorage
{
friend
class
ext
::
shared_ptr_helper
<
StorageView
>
;
public:
static
StoragePtr
create
(
const
String
&
table_name_
,
const
String
&
database_name_
,
Context
&
context_
,
ASTPtr
&
query_
,
NamesAndTypesListPtr
columns_
,
const
NamesAndTypesList
&
materialized_columns_
,
const
NamesAndTypesList
&
alias_columns_
,
const
ColumnDefaults
&
column_defaults_
);
std
::
string
getName
()
const
override
{
return
"View"
;
}
std
::
string
getTableName
()
const
override
{
return
table_name
;
}
const
NamesAndTypesList
&
getColumnsListImpl
()
const
override
{
return
*
columns
;
}
...
...
dbms/src/Storages/System/StorageSystemAsynchronousMetrics.cpp
浏览文件 @
0d7d379b
...
...
@@ -23,11 +23,6 @@ StorageSystemAsynchronousMetrics::StorageSystemAsynchronousMetrics(const std::st
{
}
StoragePtr
StorageSystemAsynchronousMetrics
::
create
(
const
std
::
string
&
name_
,
const
AsynchronousMetrics
&
async_metrics_
)
{
return
make_shared
(
name_
,
async_metrics_
);
}
BlockInputStreams
StorageSystemAsynchronousMetrics
::
read
(
const
Names
&
column_names
,
...
...
dbms/src/Storages/System/StorageSystemAsynchronousMetrics.h
浏览文件 @
0d7d379b
...
...
@@ -13,13 +13,11 @@ class Context;
/** Implements system table asynchronous_metrics, which allows to get values of periodically (asynchronously) updated metrics.
*/
class
StorageSystemAsynchronousMetrics
:
p
rivate
ext
::
shared_ptr_helper
<
StorageSystemAsynchronousMetrics
>
,
public
IStorage
class
StorageSystemAsynchronousMetrics
:
p
ublic
ext
::
shared_ptr_helper
<
StorageSystemAsynchronousMetrics
>
,
public
IStorage
{
friend
class
ext
::
shared_ptr_helper
<
StorageSystemAsynchronousMetrics
>
;
public:
static
StoragePtr
create
(
const
std
::
string
&
name_
,
const
AsynchronousMetrics
&
async_metrics_
);
std
::
string
getName
()
const
override
{
return
"SystemAsynchronousMetrics"
;
}
std
::
string
getTableName
()
const
override
{
return
name
;
}
...
...
dbms/src/Storages/System/StorageSystemBuildOptions.cpp
浏览文件 @
0d7d379b
...
...
@@ -19,11 +19,6 @@ StorageSystemBuildOptions::StorageSystemBuildOptions(const std::string & name_)
{
}
StoragePtr
StorageSystemBuildOptions
::
create
(
const
std
::
string
&
name_
)
{
return
make_shared
(
name_
);
}
BlockInputStreams
StorageSystemBuildOptions
::
read
(
const
Names
&
column_names
,
...
...
dbms/src/Storages/System/StorageSystemBuildOptions.h
浏览文件 @
0d7d379b
...
...
@@ -12,13 +12,11 @@ class Context;
/** System table "build_options" with many params used for clickhouse building
*/
class
StorageSystemBuildOptions
:
p
rivate
ext
::
shared_ptr_helper
<
StorageSystemBuildOptions
>
,
public
IStorage
class
StorageSystemBuildOptions
:
p
ublic
ext
::
shared_ptr_helper
<
StorageSystemBuildOptions
>
,
public
IStorage
{
friend
class
ext
::
shared_ptr_helper
<
StorageSystemBuildOptions
>
;
public:
static
StoragePtr
create
(
const
std
::
string
&
name_
);
std
::
string
getName
()
const
override
{
return
"SystemBuildOptions"
;
}
std
::
string
getTableName
()
const
override
{
return
name
;
}
...
...
dbms/src/Storages/System/StorageSystemClusters.cpp
浏览文件 @
0d7d379b
...
...
@@ -29,10 +29,6 @@ StorageSystemClusters::StorageSystemClusters(const std::string & name_, Context
{
}
StoragePtr
StorageSystemClusters
::
create
(
const
std
::
string
&
name_
,
Context
&
context_
)
{
return
make_shared
(
name_
,
context_
);
}
BlockInputStreams
StorageSystemClusters
::
read
(
const
Names
&
column_names
,
...
...
dbms/src/Storages/System/StorageSystemClusters.h
浏览文件 @
0d7d379b
...
...
@@ -13,13 +13,12 @@ class Context;
* that allows to obtain information about available clusters
* (which may be specified in Distributed tables).
*/
class
StorageSystemClusters
:
p
rivate
ext
::
shared_ptr_helper
<
StorageSystemClusters
>
,
public
IStorage
class
StorageSystemClusters
:
p
ublic
ext
::
shared_ptr_helper
<
StorageSystemClusters
>
,
public
IStorage
{
friend
class
ext
::
shared_ptr_helper
<
StorageSystemClusters
>
;
public:
StorageSystemClusters
(
const
std
::
string
&
name_
,
Context
&
context_
);
static
StoragePtr
create
(
const
std
::
string
&
name_
,
Context
&
context_
);
std
::
string
getName
()
const
override
{
return
"SystemClusters"
;
}
std
::
string
getTableName
()
const
override
{
return
name
;
}
...
...
dbms/src/Storages/System/StorageSystemColumns.cpp
浏览文件 @
0d7d379b
...
...
@@ -31,10 +31,6 @@ StorageSystemColumns::StorageSystemColumns(const std::string & name_)
{
}
StoragePtr
StorageSystemColumns
::
create
(
const
std
::
string
&
name_
)
{
return
make_shared
(
name_
);
}
BlockInputStreams
StorageSystemColumns
::
read
(
const
Names
&
column_names
,
...
...
dbms/src/Storages/System/StorageSystemColumns.h
浏览文件 @
0d7d379b
...
...
@@ -11,12 +11,10 @@ class Context;
/** Implements system table 'columns', that allows to get information about columns for every table.
*/
class
StorageSystemColumns
:
p
rivate
ext
::
shared_ptr_helper
<
StorageSystemColumns
>
,
public
IStorage
class
StorageSystemColumns
:
p
ublic
ext
::
shared_ptr_helper
<
StorageSystemColumns
>
,
public
IStorage
{
friend
class
ext
::
shared_ptr_helper
<
StorageSystemColumns
>
;
public:
static
StoragePtr
create
(
const
std
::
string
&
name_
);
std
::
string
getName
()
const
override
{
return
"SystemColumns"
;
}
std
::
string
getTableName
()
const
override
{
return
name
;
}
const
NamesAndTypesList
&
getColumnsListImpl
()
const
override
{
return
columns
;
}
...
...
dbms/src/Storages/System/StorageSystemDatabases.cpp
浏览文件 @
0d7d379b
...
...
@@ -20,11 +20,6 @@ StorageSystemDatabases::StorageSystemDatabases(const std::string & name_)
{
}
StoragePtr
StorageSystemDatabases
::
create
(
const
std
::
string
&
name_
)
{
return
make_shared
(
name_
);
}
BlockInputStreams
StorageSystemDatabases
::
read
(
const
Names
&
column_names
,
...
...
dbms/src/Storages/System/StorageSystemDatabases.h
浏览文件 @
0d7d379b
...
...
@@ -12,13 +12,10 @@ class Context;
/** Implements `databases` system table, which allows you to get information about all databases.
*/
class
StorageSystemDatabases
:
p
rivate
ext
::
shared_ptr_helper
<
StorageSystemDatabases
>
,
public
IStorage
class
StorageSystemDatabases
:
p
ublic
ext
::
shared_ptr_helper
<
StorageSystemDatabases
>
,
public
IStorage
{
friend
class
ext
::
shared_ptr_helper
<
StorageSystemDatabases
>
;
public:
static
StoragePtr
create
(
const
std
::
string
&
name_
);
std
::
string
getName
()
const
override
{
return
"SystemDatabases"
;
}
std
::
string
getTableName
()
const
override
{
return
name
;
}
...
...
dbms/src/Storages/System/StorageSystemDictionaries.cpp
浏览文件 @
0d7d379b
...
...
@@ -39,10 +39,6 @@ StorageSystemDictionaries::StorageSystemDictionaries(const std::string & name)
{
}
StoragePtr
StorageSystemDictionaries
::
create
(
const
std
::
string
&
name
)
{
return
make_shared
(
name
);
}
BlockInputStreams
StorageSystemDictionaries
::
read
(
const
Names
&
column_names
,
...
...
dbms/src/Storages/System/StorageSystemDictionaries.h
浏览文件 @
0d7d379b
...
...
@@ -10,13 +10,10 @@ namespace DB
class
Context
;
class
StorageSystemDictionaries
:
p
rivate
ext
::
shared_ptr_helper
<
StorageSystemDictionaries
>
,
public
IStorage
class
StorageSystemDictionaries
:
p
ublic
ext
::
shared_ptr_helper
<
StorageSystemDictionaries
>
,
public
IStorage
{
friend
class
ext
::
shared_ptr_helper
<
StorageSystemDictionaries
>
;
public:
static
StoragePtr
create
(
const
std
::
string
&
name
);
std
::
string
getName
()
const
override
{
return
"SystemDictionaries"
;
}
std
::
string
getTableName
()
const
override
{
return
name
;
}
...
...
dbms/src/Storages/System/StorageSystemEvents.cpp
浏览文件 @
0d7d379b
...
...
@@ -20,11 +20,6 @@ StorageSystemEvents::StorageSystemEvents(const std::string & name_)
{
}
StoragePtr
StorageSystemEvents
::
create
(
const
std
::
string
&
name_
)
{
return
make_shared
(
name_
);
}
BlockInputStreams
StorageSystemEvents
::
read
(
const
Names
&
column_names
,
...
...
dbms/src/Storages/System/StorageSystemEvents.h
浏览文件 @
0d7d379b
...
...
@@ -12,13 +12,10 @@ class Context;
/** Implements `events` system table, which allows you to obtain information for profiling.
*/
class
StorageSystemEvents
:
p
rivate
ext
::
shared_ptr_helper
<
StorageSystemEvents
>
,
public
IStorage
class
StorageSystemEvents
:
p
ublic
ext
::
shared_ptr_helper
<
StorageSystemEvents
>
,
public
IStorage
{
friend
class
ext
::
shared_ptr_helper
<
StorageSystemEvents
>
;
public:
static
StoragePtr
create
(
const
std
::
string
&
name_
);
std
::
string
getName
()
const
override
{
return
"SystemEvents"
;
}
std
::
string
getTableName
()
const
override
{
return
name
;
}
...
...
dbms/src/Storages/System/StorageSystemFunctions.cpp
浏览文件 @
0d7d379b
...
...
@@ -22,10 +22,6 @@ StorageSystemFunctions::StorageSystemFunctions(const std::string & name_)
{
}
StoragePtr
StorageSystemFunctions
::
create
(
const
std
::
string
&
name_
)
{
return
make_shared
(
name_
);
}
BlockInputStreams
StorageSystemFunctions
::
read
(
const
Names
&
column_names
,
...
...
dbms/src/Storages/System/StorageSystemFunctions.h
浏览文件 @
0d7d379b
...
...
@@ -13,13 +13,10 @@ class Context;
/** Implements `functions`system table, which allows you to get a list
* all normal and aggregate functions.
*/
class
StorageSystemFunctions
:
p
rivate
ext
::
shared_ptr_helper
<
StorageSystemFunctions
>
,
public
IStorage
class
StorageSystemFunctions
:
p
ublic
ext
::
shared_ptr_helper
<
StorageSystemFunctions
>
,
public
IStorage
{
friend
class
ext
::
shared_ptr_helper
<
StorageSystemFunctions
>
;
public:
static
StoragePtr
create
(
const
std
::
string
&
name_
);
std
::
string
getName
()
const
override
{
return
"SystemFunctions"
;
}
std
::
string
getTableName
()
const
override
{
return
name
;
}
const
NamesAndTypesList
&
getColumnsListImpl
()
const
override
{
return
columns
;
}
...
...
dbms/src/Storages/System/StorageSystemGraphite.cpp
浏览文件 @
0d7d379b
...
...
@@ -124,10 +124,6 @@ StorageSystemGraphite::StorageSystemGraphite(const std::string & name_)
{
}
StoragePtr
StorageSystemGraphite
::
create
(
const
std
::
string
&
name_
)
{
return
make_shared
(
name_
);
}
BlockInputStreams
StorageSystemGraphite
::
read
(
const
Names
&
column_names
,
...
...
dbms/src/Storages/System/StorageSystemGraphite.h
浏览文件 @
0d7d379b
...
...
@@ -6,16 +6,11 @@
namespace
DB
{
/// Provides information about graphite configuration.
class
StorageSystemGraphite
:
private
ext
::
shared_ptr_helper
<
StorageSystemGraphite
>
,
public
IStorage
/// Provides information about Graphite configuration.
class
StorageSystemGraphite
:
public
ext
::
shared_ptr_helper
<
StorageSystemGraphite
>
,
public
IStorage
{
friend
class
ext
::
shared_ptr_helper
<
StorageSystemGraphite
>
;
friend
class
ext
::
shared_ptr_helper
<
StorageSystemGraphite
>
;
public:
static
StoragePtr
create
(
const
std
::
string
&
name_
);
std
::
string
getName
()
const
override
{
return
"SystemGraphite"
;
}
std
::
string
getTableName
()
const
override
{
return
name
;
}
const
NamesAndTypesList
&
getColumnsListImpl
()
const
override
{
return
columns
;
}
...
...
dbms/src/Storages/System/StorageSystemMerges.cpp
浏览文件 @
0d7d379b
...
...
@@ -34,10 +34,6 @@ StorageSystemMerges::StorageSystemMerges(const std::string & name)
{
}
StoragePtr
StorageSystemMerges
::
create
(
const
std
::
string
&
name
)
{
return
make_shared
(
name
);
}
BlockInputStreams
StorageSystemMerges
::
read
(
const
Names
&
column_names
,
...
...
dbms/src/Storages/System/StorageSystemMerges.h
浏览文件 @
0d7d379b
...
...
@@ -10,13 +10,10 @@ namespace DB
class
Context
;
class
StorageSystemMerges
:
p
rivate
ext
::
shared_ptr_helper
<
StorageSystemMerges
>
,
public
IStorage
class
StorageSystemMerges
:
p
ublic
ext
::
shared_ptr_helper
<
StorageSystemMerges
>
,
public
IStorage
{
friend
class
ext
::
shared_ptr_helper
<
StorageSystemMerges
>
;
public:
static
StoragePtr
create
(
const
std
::
string
&
name
);
std
::
string
getName
()
const
override
{
return
"SystemMerges"
;
}
std
::
string
getTableName
()
const
override
{
return
name
;
}
...
...
dbms/src/Storages/System/StorageSystemMetrics.cpp
浏览文件 @
0d7d379b
...
...
@@ -21,11 +21,6 @@ StorageSystemMetrics::StorageSystemMetrics(const std::string & name_)
{
}
StoragePtr
StorageSystemMetrics
::
create
(
const
std
::
string
&
name_
)
{
return
make_shared
(
name_
);
}
BlockInputStreams
StorageSystemMetrics
::
read
(
const
Names
&
column_names
,
...
...
dbms/src/Storages/System/StorageSystemMetrics.h
浏览文件 @
0d7d379b
...
...
@@ -11,14 +11,11 @@ class Context;
/** Implements `metrics` system table, which provides information about the operation of the server.
*/
class
StorageSystemMetrics
:
p
rivate
ext
::
shared_ptr_helper
<
StorageSystemMetrics
>
,
public
IStorage
*/
class
StorageSystemMetrics
:
p
ublic
ext
::
shared_ptr_helper
<
StorageSystemMetrics
>
,
public
IStorage
{
friend
class
ext
::
shared_ptr_helper
<
StorageSystemMetrics
>
;
public:
static
StoragePtr
create
(
const
std
::
string
&
name_
);
std
::
string
getName
()
const
override
{
return
"SystemMetrics"
;
}
std
::
string
getTableName
()
const
override
{
return
name
;
}
...
...
dbms/src/Storages/System/StorageSystemNumbers.cpp
浏览文件 @
0d7d379b
...
...
@@ -53,11 +53,6 @@ StorageSystemNumbers::StorageSystemNumbers(const std::string & name_, bool multi
{
}
StoragePtr
StorageSystemNumbers
::
create
(
const
std
::
string
&
name_
,
bool
multithreaded_
)
{
return
make_shared
(
name_
,
multithreaded_
);
}
BlockInputStreams
StorageSystemNumbers
::
read
(
const
Names
&
column_names
,
...
...
dbms/src/Storages/System/StorageSystemNumbers.h
浏览文件 @
0d7d379b
...
...
@@ -14,13 +14,10 @@ class Context;
* The table contains the only column number UInt64.
* From this table, you can read all natural numbers, starting from 0 (to 2^64 - 1, and then again).
*/
class
StorageSystemNumbers
:
p
rivate
ext
::
shared_ptr_helper
<
StorageSystemNumbers
>
,
public
IStorage
class
StorageSystemNumbers
:
p
ublic
ext
::
shared_ptr_helper
<
StorageSystemNumbers
>
,
public
IStorage
{
friend
class
ext
::
shared_ptr_helper
<
StorageSystemNumbers
>
;
public:
static
StoragePtr
create
(
const
std
::
string
&
name_
,
bool
multithreaded_
=
false
);
std
::
string
getName
()
const
override
{
return
"SystemNumbers"
;
}
std
::
string
getTableName
()
const
override
{
return
name
;
}
...
...
dbms/src/Storages/System/StorageSystemOne.cpp
浏览文件 @
0d7d379b
...
...
@@ -15,11 +15,6 @@ StorageSystemOne::StorageSystemOne(const std::string & name_)
{
}
StoragePtr
StorageSystemOne
::
create
(
const
std
::
string
&
name_
)
{
return
make_shared
(
name_
);
}
BlockInputStreams
StorageSystemOne
::
read
(
const
Names
&
column_names
,
...
...
dbms/src/Storages/System/StorageSystemOne.h
浏览文件 @
0d7d379b
...
...
@@ -15,13 +15,10 @@ class Context;
* Used when the table is not specified in the query.
* Analog of the DUAL table in Oracle and MySQL.
*/
class
StorageSystemOne
:
p
rivate
ext
::
shared_ptr_helper
<
StorageSystemOne
>
,
public
IStorage
class
StorageSystemOne
:
p
ublic
ext
::
shared_ptr_helper
<
StorageSystemOne
>
,
public
IStorage
{
friend
class
ext
::
shared_ptr_helper
<
StorageSystemOne
>
;
public:
static
StoragePtr
create
(
const
std
::
string
&
name_
);
std
::
string
getName
()
const
override
{
return
"SystemOne"
;
}
std
::
string
getTableName
()
const
override
{
return
name
;
}
...
...
dbms/src/Storages/System/StorageSystemParts.cpp
浏览文件 @
0d7d379b
...
...
@@ -44,11 +44,6 @@ StorageSystemParts::StorageSystemParts(const std::string & name_)
{
}
StoragePtr
StorageSystemParts
::
create
(
const
std
::
string
&
name_
)
{
return
make_shared
(
name_
);
}
BlockInputStreams
StorageSystemParts
::
read
(
const
Names
&
column_names
,
...
...
dbms/src/Storages/System/StorageSystemParts.h
浏览文件 @
0d7d379b
...
...
@@ -12,12 +12,10 @@ class Context;
/** Implements system table 'parts' which allows to get information about data parts for tables of MergeTree family.
*/
class
StorageSystemParts
:
p
rivate
ext
::
shared_ptr_helper
<
StorageSystemParts
>
,
public
IStorage
class
StorageSystemParts
:
p
ublic
ext
::
shared_ptr_helper
<
StorageSystemParts
>
,
public
IStorage
{
friend
class
ext
::
shared_ptr_helper
<
StorageSystemParts
>
;
public:
static
StoragePtr
create
(
const
std
::
string
&
name_
);
std
::
string
getName
()
const
override
{
return
"SystemParts"
;
}
std
::
string
getTableName
()
const
override
{
return
name
;
}
...
...
dbms/src/Storages/System/StorageSystemProcesses.cpp
浏览文件 @
0d7d379b
...
...
@@ -52,11 +52,6 @@ StorageSystemProcesses::StorageSystemProcesses(const std::string & name_)
{
}
StoragePtr
StorageSystemProcesses
::
create
(
const
std
::
string
&
name_
)
{
return
make_shared
(
name_
);
}
BlockInputStreams
StorageSystemProcesses
::
read
(
const
Names
&
column_names
,
...
...
dbms/src/Storages/System/StorageSystemProcesses.h
浏览文件 @
0d7d379b
...
...
@@ -12,13 +12,10 @@ class Context;
/** Implements `processes` system table, which allows you to get information about the queries that are currently executing.
*/
class
StorageSystemProcesses
:
p
rivate
ext
::
shared_ptr_helper
<
StorageSystemProcesses
>
,
public
IStorage
class
StorageSystemProcesses
:
p
ublic
ext
::
shared_ptr_helper
<
StorageSystemProcesses
>
,
public
IStorage
{
friend
class
ext
::
shared_ptr_helper
<
StorageSystemProcesses
>
;
public:
static
StoragePtr
create
(
const
std
::
string
&
name_
);
std
::
string
getName
()
const
override
{
return
"SystemProcesses"
;
}
std
::
string
getTableName
()
const
override
{
return
name
;
}
...
...
dbms/src/Storages/System/StorageSystemReplicas.cpp
浏览文件 @
0d7d379b
...
...
@@ -46,11 +46,6 @@ StorageSystemReplicas::StorageSystemReplicas(const std::string & name_)
{
}
StoragePtr
StorageSystemReplicas
::
create
(
const
std
::
string
&
name_
)
{
return
make_shared
(
name_
);
}
BlockInputStreams
StorageSystemReplicas
::
read
(
const
Names
&
column_names
,
...
...
dbms/src/Storages/System/StorageSystemReplicas.h
浏览文件 @
0d7d379b
...
...
@@ -12,13 +12,10 @@ class Context;
/** Implements `replicas` system table, which provides information about the status of the replicated tables.
*/
class
StorageSystemReplicas
:
p
rivate
ext
::
shared_ptr_helper
<
StorageSystemReplicas
>
,
public
IStorage
class
StorageSystemReplicas
:
p
ublic
ext
::
shared_ptr_helper
<
StorageSystemReplicas
>
,
public
IStorage
{
friend
class
ext
::
shared_ptr_helper
<
StorageSystemReplicas
>
;
public:
static
StoragePtr
create
(
const
std
::
string
&
name_
);
std
::
string
getName
()
const
override
{
return
"SystemReplicas"
;
}
std
::
string
getTableName
()
const
override
{
return
name
;
}
...
...
dbms/src/Storages/System/StorageSystemReplicationQueue.cpp
浏览文件 @
0d7d379b
...
...
@@ -46,11 +46,6 @@ StorageSystemReplicationQueue::StorageSystemReplicationQueue(const std::string &
{
}
StoragePtr
StorageSystemReplicationQueue
::
create
(
const
std
::
string
&
name_
)
{
return
make_shared
(
name_
);
}
BlockInputStreams
StorageSystemReplicationQueue
::
read
(
const
Names
&
column_names
,
...
...
dbms/src/Storages/System/StorageSystemReplicationQueue.h
浏览文件 @
0d7d379b
...
...
@@ -12,13 +12,10 @@ class Context;
/** Implements the `replication_queue` system table, which allows you to view the replication queues for the replicated tables.
*/
class
StorageSystemReplicationQueue
:
p
rivate
ext
::
shared_ptr_helper
<
StorageSystemReplicationQueue
>
,
public
IStorage
class
StorageSystemReplicationQueue
:
p
ublic
ext
::
shared_ptr_helper
<
StorageSystemReplicationQueue
>
,
public
IStorage
{
friend
class
ext
::
shared_ptr_helper
<
StorageSystemReplicationQueue
>
;
public:
static
StoragePtr
create
(
const
std
::
string
&
name_
);
std
::
string
getName
()
const
override
{
return
"SystemReplicationQueue"
;
}
std
::
string
getTableName
()
const
override
{
return
name
;
}
...
...
dbms/src/Storages/System/StorageSystemSettings.cpp
浏览文件 @
0d7d379b
...
...
@@ -21,11 +21,6 @@ StorageSystemSettings::StorageSystemSettings(const std::string & name_)
{
}
StoragePtr
StorageSystemSettings
::
create
(
const
std
::
string
&
name_
)
{
return
make_shared
(
name_
);
}
BlockInputStreams
StorageSystemSettings
::
read
(
const
Names
&
column_names
,
...
...
dbms/src/Storages/System/StorageSystemSettings.h
浏览文件 @
0d7d379b
...
...
@@ -12,13 +12,10 @@ class Context;
/** implements system table "settings", which allows to get information about the current settings.
*/
class
StorageSystemSettings
:
p
rivate
ext
::
shared_ptr_helper
<
StorageSystemSettings
>
,
public
IStorage
class
StorageSystemSettings
:
p
ublic
ext
::
shared_ptr_helper
<
StorageSystemSettings
>
,
public
IStorage
{
friend
class
ext
::
shared_ptr_helper
<
StorageSystemSettings
>
;
public:
static
StoragePtr
create
(
const
std
::
string
&
name_
);
std
::
string
getName
()
const
override
{
return
"SystemSettings"
;
}
std
::
string
getTableName
()
const
override
{
return
name
;
}
...
...
dbms/src/Storages/System/StorageSystemTables.cpp
浏览文件 @
0d7d379b
...
...
@@ -30,11 +30,6 @@ StorageSystemTables::StorageSystemTables(const std::string & name_)
{
}
StoragePtr
StorageSystemTables
::
create
(
const
std
::
string
&
name_
)
{
return
make_shared
(
name_
);
}
static
ColumnWithTypeAndName
getFilteredDatabases
(
const
ASTPtr
&
query
,
const
Context
&
context
)
{
...
...
dbms/src/Storages/System/StorageSystemTables.h
浏览文件 @
0d7d379b
...
...
@@ -12,13 +12,10 @@ class Context;
/** Implements the system table `tables`, which allows you to get information about all tables.
*/
class
StorageSystemTables
:
p
rivate
ext
::
shared_ptr_helper
<
StorageSystemTables
>
,
public
IStorage
class
StorageSystemTables
:
p
ublic
ext
::
shared_ptr_helper
<
StorageSystemTables
>
,
public
IStorage
{
friend
class
ext
::
shared_ptr_helper
<
StorageSystemTables
>
;
public:
static
StoragePtr
create
(
const
std
::
string
&
name_
);
std
::
string
getName
()
const
override
{
return
"SystemTables"
;
}
std
::
string
getTableName
()
const
override
{
return
name
;
}
...
...
dbms/src/Storages/System/StorageSystemZooKeeper.cpp
浏览文件 @
0d7d379b
...
...
@@ -21,29 +21,24 @@ namespace DB
StorageSystemZooKeeper
::
StorageSystemZooKeeper
(
const
std
::
string
&
name_
)
:
name
(
name_
)
,
columns
{
{
"name"
,
std
::
make_shared
<
DataTypeString
>
()
},
{
"value"
,
std
::
make_shared
<
DataTypeString
>
()
},
{
"czxid"
,
std
::
make_shared
<
DataTypeInt64
>
()
},
{
"mzxid"
,
std
::
make_shared
<
DataTypeInt64
>
()
},
{
"ctime"
,
std
::
make_shared
<
DataTypeDateTime
>
()
},
{
"mtime"
,
std
::
make_shared
<
DataTypeDateTime
>
()
},
{
"version"
,
std
::
make_shared
<
DataTypeInt32
>
()
},
{
"cversion"
,
std
::
make_shared
<
DataTypeInt32
>
()
},
{
"aversion"
,
std
::
make_shared
<
DataTypeInt32
>
()
},
{
"ephemeralOwner"
,
std
::
make_shared
<
DataTypeInt64
>
()
},
{
"dataLength"
,
std
::
make_shared
<
DataTypeInt32
>
()
},
{
"numChildren"
,
std
::
make_shared
<
DataTypeInt32
>
()
},
{
"pzxid"
,
std
::
make_shared
<
DataTypeInt64
>
()
},
{
"path"
,
std
::
make_shared
<
DataTypeString
>
()
},
{
"name"
,
std
::
make_shared
<
DataTypeString
>
()
},
{
"value"
,
std
::
make_shared
<
DataTypeString
>
()
},
{
"czxid"
,
std
::
make_shared
<
DataTypeInt64
>
()
},
{
"mzxid"
,
std
::
make_shared
<
DataTypeInt64
>
()
},
{
"ctime"
,
std
::
make_shared
<
DataTypeDateTime
>
()
},
{
"mtime"
,
std
::
make_shared
<
DataTypeDateTime
>
()
},
{
"version"
,
std
::
make_shared
<
DataTypeInt32
>
()
},
{
"cversion"
,
std
::
make_shared
<
DataTypeInt32
>
()
},
{
"aversion"
,
std
::
make_shared
<
DataTypeInt32
>
()
},
{
"ephemeralOwner"
,
std
::
make_shared
<
DataTypeInt64
>
()
},
{
"dataLength"
,
std
::
make_shared
<
DataTypeInt32
>
()
},
{
"numChildren"
,
std
::
make_shared
<
DataTypeInt32
>
()
},
{
"pzxid"
,
std
::
make_shared
<
DataTypeInt64
>
()
},
{
"path"
,
std
::
make_shared
<
DataTypeString
>
()
},
}
{
}
StoragePtr
StorageSystemZooKeeper
::
create
(
const
std
::
string
&
name_
)
{
return
make_shared
(
name_
);
}
static
bool
extractPathImpl
(
const
IAST
&
elem
,
String
&
res
)
{
...
...
dbms/src/Storages/System/StorageSystemZooKeeper.h
浏览文件 @
0d7d379b
...
...
@@ -12,13 +12,10 @@ class Context;
/** Implements `zookeeper` system table, which allows you to view the data in ZooKeeper for debugging purposes.
*/
class
StorageSystemZooKeeper
:
p
rivate
ext
::
shared_ptr_helper
<
StorageSystemZooKeeper
>
,
public
IStorage
class
StorageSystemZooKeeper
:
p
ublic
ext
::
shared_ptr_helper
<
StorageSystemZooKeeper
>
,
public
IStorage
{
friend
class
ext
::
shared_ptr_helper
<
StorageSystemZooKeeper
>
;
public:
static
StoragePtr
create
(
const
std
::
string
&
name_
);
std
::
string
getName
()
const
override
{
return
"SystemZooKeeper"
;
}
std
::
string
getTableName
()
const
override
{
return
name
;
}
...
...
dbms/src/Storages/System/attachSystemTables.cpp
浏览文件 @
0d7d379b
...
...
@@ -26,7 +26,7 @@ namespace DB
void
attachSystemTablesLocal
(
DatabasePtr
system_database
)
{
system_database
->
attachTable
(
"one"
,
StorageSystemOne
::
create
(
"one"
));
system_database
->
attachTable
(
"numbers"
,
StorageSystemNumbers
::
create
(
"numbers"
));
system_database
->
attachTable
(
"numbers"
,
StorageSystemNumbers
::
create
(
"numbers"
,
false
));
system_database
->
attachTable
(
"numbers_mt"
,
StorageSystemNumbers
::
create
(
"numbers_mt"
,
true
));
system_database
->
attachTable
(
"databases"
,
StorageSystemDatabases
::
create
(
"databases"
));
system_database
->
attachTable
(
"tables"
,
StorageSystemTables
::
create
(
"tables"
));
...
...
dbms/src/Storages/tests/system_numbers.cpp
浏览文件 @
0d7d379b
...
...
@@ -15,7 +15,7 @@ try
{
using
namespace
DB
;
StoragePtr
table
=
StorageSystemNumbers
::
create
(
"
Numbers"
);
StoragePtr
table
=
StorageSystemNumbers
::
create
(
"
numbers"
,
false
);
Names
column_names
;
column_names
.
push_back
(
"number"
);
...
...
libs/libcommon/include/ext/shared_ptr_helper.h
浏览文件 @
0d7d379b
...
...
@@ -28,7 +28,7 @@ protected:
};
/// see std::allocate_shared
template
<
typename
TAlloc
,
typename
...
TArgs
>
template
<
typename
TAlloc
,
typename
...
TArgs
>
static
std
::
shared_ptr
<
T
>
allocate_shared
(
const
TAlloc
&
alloc
,
TArgs
&&
...
args
)
{
using
AllocTraits
=
std
::
allocator_traits
<
TAlloc
>
;
...
...
@@ -52,11 +52,20 @@ protected:
alloc_copy
);
}
template
<
typename
...
TArgs
>
template
<
typename
...
TArgs
>
static
std
::
shared_ptr
<
T
>
make_shared
(
TArgs
&&
...
args
)
{
return
allocate_shared
(
std
::
allocator
<
TNoConst
>
(),
std
::
forward
<
TArgs
>
(
args
)...);
}
public:
/// Default implementation of 'create' method just use make_shared.
template
<
typename
...
TArgs
>
static
std
::
shared_ptr
<
T
>
create
(
TArgs
&&
...
args
)
{
return
make_shared
(
std
::
forward
<
TArgs
>
(
args
)...);
}
};
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录