Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
6db8da82
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,发现更多精彩内容 >>
提交
6db8da82
编写于
5月 31, 2017
作者:
V
Vitaliy Lyudvichenko
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add requested changes. [#CLICKHOUSE-5]
上级
73e2aab9
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
20 addition
and
15 deletion
+20
-15
dbms/src/Common/Exception.cpp
dbms/src/Common/Exception.cpp
+2
-2
dbms/src/Common/Exception.h
dbms/src/Common/Exception.h
+1
-1
dbms/src/Interpreters/DDLWorker.cpp
dbms/src/Interpreters/DDLWorker.cpp
+10
-4
dbms/src/Interpreters/DDLWorker.h
dbms/src/Interpreters/DDLWorker.h
+7
-4
dbms/src/Parsers/IAST.h
dbms/src/Parsers/IAST.h
+0
-4
未找到文件。
dbms/src/Common/Exception.cpp
浏览文件 @
6db8da82
...
...
@@ -259,7 +259,7 @@ std::string ExecutionStatus::serializeText() const
std
::
string
res
;
{
WriteBufferFromString
wb
(
res
);
wb
<<
code
<<
"
\n
"
<<
message
;
wb
<<
code
<<
"
\n
"
<<
escape
<<
message
;
}
return
res
;
}
...
...
@@ -267,7 +267,7 @@ std::string ExecutionStatus::serializeText() const
void
ExecutionStatus
::
deserializeText
(
const
std
::
string
&
data
)
{
ReadBufferFromString
rb
(
data
);
rb
>>
code
>>
"
\n
"
>>
message
;
rb
>>
code
>>
"
\n
"
>>
escape
>>
message
;
}
ExecutionStatus
ExecutionStatus
::
fromCurrentException
(
const
std
::
string
&
start_of_message
)
...
...
dbms/src/Common/Exception.h
浏览文件 @
6db8da82
...
...
@@ -91,7 +91,7 @@ std::string getCurrentExceptionMessage(bool with_stacktrace, bool check_embedded
int
getCurrentExceptionCode
();
/// An execution status of any piece of code
/// An execution status of any piece of code
, contains return code and optional error
struct
ExecutionStatus
{
int
code
=
0
;
...
...
dbms/src/Interpreters/DDLWorker.cpp
浏览文件 @
6db8da82
...
...
@@ -50,6 +50,10 @@ namespace ErrorCodes
}
const
size_t
DDLWorker
::
node_max_lifetime_seconds
=
7
*
24
*
60
*
60
;
// week
const
size_t
DDLWorker
::
cleanup_min_period_seconds
=
60
;
// minute
struct
DDLLogEntry
{
String
query
;
...
...
@@ -65,7 +69,7 @@ struct DDLLogEntry
WriteBufferFromString
wb
(
res
);
wb
<<
"version: "
<<
CURRENT_VERSION
<<
"
\n
"
;
wb
<<
"query: "
<<
query
<<
"
\n
"
;
wb
<<
"query: "
<<
escape
<<
query
<<
"
\n
"
;
wb
<<
"hosts: "
<<
hosts
<<
"
\n
"
;
wb
<<
"initiator: "
<<
initiator
<<
"
\n
"
;
}
...
...
@@ -83,7 +87,7 @@ struct DDLLogEntry
if
(
version
!=
CURRENT_VERSION
)
throw
Exception
(
"Unknown DDLLogEntry format version: "
+
version
,
ErrorCodes
::
UNKNOWN_FORMAT_VERSION
);
rb
>>
"query: "
>>
query
>>
"
\n
"
;
rb
>>
"query: "
>>
escape
>>
query
>>
"
\n
"
;
rb
>>
"hosts: "
>>
hosts
>>
"
\n
"
;
if
(
!
rb
.
eof
())
...
...
@@ -128,7 +132,7 @@ static bool isSupportedAlterType(int type)
DDLWorker
::
DDLWorker
(
const
std
::
string
&
zk_root_dir
,
Context
&
context_
)
:
context
(
context_
)
,
stop_flag
(
false
)
:
context
(
context_
)
{
queue_dir
=
zk_root_dir
;
if
(
queue_dir
.
back
()
==
'/'
)
...
...
@@ -169,7 +173,9 @@ void DDLWorker::processTasks()
for
(
auto
it
=
begin_node
;
it
!=
queue_nodes
.
end
();
++
it
)
{
String
node_data
,
node_name
=
*
it
,
node_path
=
queue_dir
+
"/"
+
node_name
;
const
String
&
node_name
=
*
it
;
String
node_path
=
queue_dir
+
"/"
+
node_name
;
String
node_data
;
if
(
!
zookeeper
->
tryGet
(
node_path
,
node_data
))
{
...
...
dbms/src/Interpreters/DDLWorker.h
浏览文件 @
6db8da82
...
...
@@ -65,7 +65,7 @@ private:
std
::
string
queue_dir
;
/// dir with queue of queries
std
::
string
master_dir
;
/// dir with queries was initiated by the server
/// Used to omit already processed nodes
;
/// Used to omit already processed nodes
. Maybe usage of set is more obvious.
std
::
string
last_processed_node_name
;
std
::
shared_ptr
<
zkutil
::
ZooKeeper
>
zookeeper
;
...
...
@@ -76,12 +76,15 @@ private:
ExecutionStatus
current_node_execution_status
;
std
::
shared_ptr
<
Poco
::
Event
>
event_queue_updated
;
std
::
atomic
<
bool
>
stop_flag
;
std
::
atomic
<
bool
>
stop_flag
{
false
}
;
std
::
thread
thread
;
size_t
last_cleanup_time_seconds
=
0
;
static
constexpr
size_t
node_max_lifetime_seconds
=
60
;
// 7 * 24 * 60 * 60;
static
constexpr
size_t
cleanup_min_period_seconds
=
60
;
/// Delete node if its age is greater than that
static
const
size_t
node_max_lifetime_seconds
;
/// Cleaning starts after new node event is received if the last cleaning wasn't made sooner than N seconds ago
static
const
size_t
cleanup_min_period_seconds
;
friend
class
DDLQueryStatusInputSream
;
};
...
...
dbms/src/Parsers/IAST.h
浏览文件 @
6db8da82
...
...
@@ -177,11 +177,7 @@ private:
};
<<<<<<<
HEAD
/// Quota the identifier with backquotes, if required.
=======
/// Surrounds an identifier by back quotes if it is necessary.
>>>>>>>
Parsers
refactoring
.
[
#
CLICKHOUSE
-
5
]
String
backQuoteIfNeed
(
const
String
&
x
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录