Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
e4738347
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,发现更多精彩内容 >>
提交
e4738347
编写于
12月 09, 2015
作者:
A
Alexey Milovidov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
dbms: StorageBuffer: write correct info about block flushed [#METR-19249].
上级
9e33ab55
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
7 deletion
+13
-7
dbms/src/Storages/StorageBuffer.cpp
dbms/src/Storages/StorageBuffer.cpp
+13
-7
未找到文件。
dbms/src/Storages/StorageBuffer.cpp
浏览文件 @
e4738347
...
...
@@ -306,14 +306,9 @@ bool StorageBuffer::checkThresholds(Buffer & buffer, time_t current_time, size_t
size_t
rows
=
buffer
.
data
.
rowsInFirstColumn
()
+
additional_rows
;
size_t
bytes
=
buffer
.
data
.
bytes
()
+
additional_bytes
;
bool
res
=
return
(
time_passed
>
min_thresholds
.
time
&&
rows
>
min_thresholds
.
rows
&&
bytes
>
min_thresholds
.
bytes
)
||
(
time_passed
>
max_thresholds
.
time
||
rows
>
max_thresholds
.
rows
||
bytes
>
max_thresholds
.
bytes
);
if
(
res
)
LOG_TRACE
(
log
,
"Flushing buffer with "
<<
rows
<<
" rows, "
<<
bytes
<<
" bytes, age "
<<
time_passed
<<
" seconds."
);
return
res
;
}
...
...
@@ -329,6 +324,10 @@ void StorageBuffer::flushBuffer(Buffer & buffer, bool check_thresholds)
Block
block_to_write
=
buffer
.
data
.
cloneEmpty
();
time_t
current_time
=
check_thresholds
?
time
(
0
)
:
0
;
size_t
rows
=
0
;
size_t
bytes
=
0
;
time_t
time_passed
=
0
;
/** Довольно много проблем из-за того, что хотим блокировать буфер лишь на короткое время.
* Под блокировкой, получаем из буфера блок, и заменяем в нём блок на новый пустой.
* Затем пытаемся записать полученный блок в подчинённую таблицу.
...
...
@@ -338,6 +337,11 @@ void StorageBuffer::flushBuffer(Buffer & buffer, bool check_thresholds)
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
buffer
.
mutex
);
rows
=
buffer
.
data
.
rowsInFirstColumn
();
bytes
=
buffer
.
data
.
bytes
();
if
(
buffer
.
first_write_time
)
time_passed
=
current_time
-
buffer
.
first_write_time
;
if
(
check_thresholds
)
{
if
(
!
checkThresholds
(
buffer
,
current_time
))
...
...
@@ -345,7 +349,7 @@ void StorageBuffer::flushBuffer(Buffer & buffer, bool check_thresholds)
}
else
{
if
(
buffer
.
data
.
rowsInFirstColumn
()
==
0
)
if
(
rows
==
0
)
return
;
}
...
...
@@ -353,6 +357,8 @@ void StorageBuffer::flushBuffer(Buffer & buffer, bool check_thresholds)
buffer
.
first_write_time
=
0
;
}
LOG_TRACE
(
log
,
"Flushing buffer with "
<<
rows
<<
" rows, "
<<
bytes
<<
" bytes, age "
<<
time_passed
<<
" seconds."
);
if
(
no_destination
)
return
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录