Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
39b31907
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,发现更多精彩内容 >>
提交
39b31907
编写于
2月 02, 2020
作者:
A
Alexey Milovidov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename function #7477
上级
f9eb4e79
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
38 addition
and
22 deletion
+38
-22
dbms/src/Common/CurrentThread.cpp
dbms/src/Common/CurrentThread.cpp
+2
-2
dbms/src/Common/ThreadStatus.cpp
dbms/src/Common/ThreadStatus.cpp
+2
-2
dbms/src/Interpreters/tests/internal_iotop.cpp
dbms/src/Interpreters/tests/internal_iotop.cpp
+3
-3
dbms/src/Storages/MergeTree/MergeList.cpp
dbms/src/Storages/MergeTree/MergeList.cpp
+2
-2
dbms/src/Storages/StorageBuffer.cpp
dbms/src/Storages/StorageBuffer.cpp
+2
-2
dbms/src/Storages/System/StorageSystemStackTrace.cpp
dbms/src/Storages/System/StorageSystemStackTrace.cpp
+1
-1
libs/libcommon/include/common/getThreadId.h
libs/libcommon/include/common/getThreadId.h
+4
-0
libs/libcommon/include/common/iostream_debug_helpers.h
libs/libcommon/include/common/iostream_debug_helpers.h
+2
-2
libs/libcommon/src/getThreadId.cpp
libs/libcommon/src/getThreadId.cpp
+12
-0
libs/libdaemon/include/daemon/BaseDaemon.h
libs/libdaemon/include/daemon/BaseDaemon.h
+1
-1
libs/libdaemon/src/BaseDaemon.cpp
libs/libdaemon/src/BaseDaemon.cpp
+3
-3
libs/libloggers/loggers/ExtendedLogChannel.cpp
libs/libloggers/loggers/ExtendedLogChannel.cpp
+2
-2
libs/libloggers/loggers/OwnPatternFormatter.cpp
libs/libloggers/loggers/OwnPatternFormatter.cpp
+1
-1
libs/libloggers/loggers/OwnSplitChannel.cpp
libs/libloggers/loggers/OwnSplitChannel.cpp
+1
-1
未找到文件。
dbms/src/Common/CurrentThread.cpp
浏览文件 @
39b31907
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
#include <Common/TaskStatsInfoGetter.h>
#include <Common/TaskStatsInfoGetter.h>
#include <Interpreters/ProcessList.h>
#include <Interpreters/ProcessList.h>
#include <Interpreters/Context.h>
#include <Interpreters/Context.h>
#include <common/getThread
Number
.h>
#include <common/getThread
Id
.h>
#include <Poco/Logger.h>
#include <Poco/Logger.h>
...
@@ -34,7 +34,7 @@ bool CurrentThread::isInitialized()
...
@@ -34,7 +34,7 @@ bool CurrentThread::isInitialized()
ThreadStatus
&
CurrentThread
::
get
()
ThreadStatus
&
CurrentThread
::
get
()
{
{
if
(
unlikely
(
!
current_thread
))
if
(
unlikely
(
!
current_thread
))
throw
Exception
(
"Thread #"
+
std
::
to_string
(
getThread
Number
())
+
" status was not initialized"
,
ErrorCodes
::
LOGICAL_ERROR
);
throw
Exception
(
"Thread #"
+
std
::
to_string
(
getThread
Id
())
+
" status was not initialized"
,
ErrorCodes
::
LOGICAL_ERROR
);
return
*
current_thread
;
return
*
current_thread
;
}
}
...
...
dbms/src/Common/ThreadStatus.cpp
浏览文件 @
39b31907
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
#include <Common/ThreadStatus.h>
#include <Common/ThreadStatus.h>
#include <Poco/Logger.h>
#include <Poco/Logger.h>
#include <common/getThread
Number
.h>
#include <common/getThread
Id
.h>
namespace
DB
namespace
DB
...
@@ -34,7 +34,7 @@ TasksStatsCounters TasksStatsCounters::current()
...
@@ -34,7 +34,7 @@ TasksStatsCounters TasksStatsCounters::current()
ThreadStatus
::
ThreadStatus
()
ThreadStatus
::
ThreadStatus
()
{
{
thread_id
=
getThread
Number
();
thread_id
=
getThread
Id
();
last_rusage
=
std
::
make_unique
<
RUsageCounters
>
();
last_rusage
=
std
::
make_unique
<
RUsageCounters
>
();
last_taskstats
=
std
::
make_unique
<
TasksStatsCounters
>
();
last_taskstats
=
std
::
make_unique
<
TasksStatsCounters
>
();
...
...
dbms/src/Interpreters/tests/internal_iotop.cpp
浏览文件 @
39b31907
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
#include <Common/TaskStatsInfoGetter.h>
#include <Common/TaskStatsInfoGetter.h>
#include <Poco/File.h>
#include <Poco/File.h>
#include <Common/Stopwatch.h>
#include <Common/Stopwatch.h>
#include <common/getThread
Number
.h>
#include <common/getThread
Id
.h>
#include <IO/WriteBufferFromString.h>
#include <IO/WriteBufferFromString.h>
#include <linux/taskstats.h>
#include <linux/taskstats.h>
#include <sys/time.h>
#include <sys/time.h>
...
@@ -48,7 +48,7 @@ using namespace DB;
...
@@ -48,7 +48,7 @@ using namespace DB;
static
void
do_io
(
size_t
id
)
static
void
do_io
(
size_t
id
)
{
{
::
taskstats
stat
;
::
taskstats
stat
;
int
tid
=
getThread
Number
();
int
tid
=
getThread
Id
();
TaskStatsInfoGetter
get_info
;
TaskStatsInfoGetter
get_info
;
get_info
.
getStat
(
stat
,
tid
);
get_info
.
getStat
(
stat
,
tid
);
...
@@ -104,7 +104,7 @@ static void test_perf()
...
@@ -104,7 +104,7 @@ static void test_perf()
{
{
::
taskstats
stat
;
::
taskstats
stat
;
int
tid
=
getThread
Number
();
int
tid
=
getThread
Id
();
TaskStatsInfoGetter
get_info
;
TaskStatsInfoGetter
get_info
;
rusage
rusage
;
rusage
rusage
;
...
...
dbms/src/Storages/MergeTree/MergeList.cpp
浏览文件 @
39b31907
#include <Storages/MergeTree/MergeList.h>
#include <Storages/MergeTree/MergeList.h>
#include <Storages/MergeTree/MergeTreeDataMergerMutator.h>
#include <Storages/MergeTree/MergeTreeDataMergerMutator.h>
#include <Common/CurrentMetrics.h>
#include <Common/CurrentMetrics.h>
#include <common/getThread
Number
.h>
#include <common/getThread
Id
.h>
#include <Common/CurrentThread.h>
#include <Common/CurrentThread.h>
...
@@ -20,7 +20,7 @@ MergeListElement::MergeListElement(const std::string & database_, const std::str
...
@@ -20,7 +20,7 @@ MergeListElement::MergeListElement(const std::string & database_, const std::str
,
result_part_path
{
future_part
.
path
}
,
result_part_path
{
future_part
.
path
}
,
result_data_version
{
future_part
.
part_info
.
getDataVersion
()}
,
result_data_version
{
future_part
.
part_info
.
getDataVersion
()}
,
num_parts
{
future_part
.
parts
.
size
()}
,
num_parts
{
future_part
.
parts
.
size
()}
,
thread_id
{
getThread
Number
()}
,
thread_id
{
getThread
Id
()}
{
{
for
(
const
auto
&
source_part
:
future_part
.
parts
)
for
(
const
auto
&
source_part
:
future_part
.
parts
)
{
{
...
...
dbms/src/Storages/StorageBuffer.cpp
浏览文件 @
39b31907
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
#include <Common/typeid_cast.h>
#include <Common/typeid_cast.h>
#include <Common/ProfileEvents.h>
#include <Common/ProfileEvents.h>
#include <common/logger_useful.h>
#include <common/logger_useful.h>
#include <common/getThread
Number
.h>
#include <common/getThread
Id
.h>
#include <ext/range.h>
#include <ext/range.h>
#include <DataStreams/FilterBlockInputStream.h>
#include <DataStreams/FilterBlockInputStream.h>
#include <DataStreams/ExpressionBlockInputStream.h>
#include <DataStreams/ExpressionBlockInputStream.h>
...
@@ -387,7 +387,7 @@ public:
...
@@ -387,7 +387,7 @@ public:
}
}
/// We distribute the load on the shards by the stream number.
/// We distribute the load on the shards by the stream number.
const
auto
start_shard_num
=
getThread
Number
()
%
storage
.
num_shards
;
const
auto
start_shard_num
=
getThread
Id
()
%
storage
.
num_shards
;
/// We loop through the buffers, trying to lock mutex. No more than one lap.
/// We loop through the buffers, trying to lock mutex. No more than one lap.
auto
shard_num
=
start_shard_num
;
auto
shard_num
=
start_shard_num
;
...
...
dbms/src/Storages/System/StorageSystemStackTrace.cpp
浏览文件 @
39b31907
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
#include <DataTypes/DataTypeArray.h>
#include <DataTypes/DataTypeArray.h>
#include <IO/ReadHelpers.h>
#include <IO/ReadHelpers.h>
#include <Common/PipeFDs.h>
#include <Common/PipeFDs.h>
#include <common/getThread
Number
.h>
#include <common/getThread
Id
.h>
namespace
DB
namespace
DB
...
...
libs/libcommon/include/common/getThreadId.h
0 → 100644
浏览文件 @
39b31907
#pragma once
/// Obtain thread id from OS. The value is cached in thread local variable.
unsigned
getThreadId
();
libs/libcommon/include/common/iostream_debug_helpers.h
浏览文件 @
39b31907
#pragma once
#pragma once
#include "demangle.h"
#include "demangle.h"
#include "getThread
Number
.h"
#include "getThread
Id
.h"
#include <type_traits>
#include <type_traits>
#include <tuple>
#include <tuple>
#include <iomanip>
#include <iomanip>
...
@@ -141,7 +141,7 @@ Out & dump(Out & out, const char * name, T && x)
...
@@ -141,7 +141,7 @@ Out & dump(Out & out, const char * name, T && x)
#endif
#endif
#define DUMPVAR(VAR) ::dump(std::cerr, #VAR, (VAR)); std::cerr << "; ";
#define DUMPVAR(VAR) ::dump(std::cerr, #VAR, (VAR)); std::cerr << "; ";
#define DUMPHEAD std::cerr << __FILE__ << ':' << __LINE__ << " [ " << getThread
Number
() << " ] ";
#define DUMPHEAD std::cerr << __FILE__ << ':' << __LINE__ << " [ " << getThread
Id
() << " ] ";
#define DUMPTAIL std::cerr << '\n';
#define DUMPTAIL std::cerr << '\n';
#define DUMP1(V1) do { DUMPHEAD DUMPVAR(V1) DUMPTAIL } while(0)
#define DUMP1(V1) do { DUMPHEAD DUMPVAR(V1) DUMPTAIL } while(0)
...
...
libs/libcommon/src/getThreadId.cpp
0 → 100644
浏览文件 @
39b31907
#include <unistd.h>
#include <syscall.h>
static
thread_local
unsigned
current_tid
=
0
;
unsigned
getThreadId
()
{
if
(
!
current_tid
)
current_tid
=
syscall
(
SYS_gettid
);
/// This call is always successful. - man gettid
return
current_tid
;
}
libs/libdaemon/include/daemon/BaseDaemon.h
浏览文件 @
39b31907
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
#include <Poco/Version.h>
#include <Poco/Version.h>
#include <common/Types.h>
#include <common/Types.h>
#include <common/logger_useful.h>
#include <common/logger_useful.h>
#include <common/getThread
Number
.h>
#include <common/getThread
Id
.h>
#include <daemon/GraphiteWriter.h>
#include <daemon/GraphiteWriter.h>
#include <Common/Config/ConfigProcessor.h>
#include <Common/Config/ConfigProcessor.h>
#include <loggers/Loggers.h>
#include <loggers/Loggers.h>
...
...
libs/libdaemon/src/BaseDaemon.cpp
浏览文件 @
39b31907
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
#include <common/logger_useful.h>
#include <common/logger_useful.h>
#include <common/ErrorHandlers.h>
#include <common/ErrorHandlers.h>
#include <common/argsToConfig.h>
#include <common/argsToConfig.h>
#include <common/getThread
Number
.h>
#include <common/getThread
Id
.h>
#include <common/coverage.h>
#include <common/coverage.h>
#include <IO/WriteBufferFromFile.h>
#include <IO/WriteBufferFromFile.h>
...
@@ -123,7 +123,7 @@ static void signalHandler(int sig, siginfo_t * info, void * context)
...
@@ -123,7 +123,7 @@ static void signalHandler(int sig, siginfo_t * info, void * context)
DB
::
writePODBinary
(
*
info
,
out
);
DB
::
writePODBinary
(
*
info
,
out
);
DB
::
writePODBinary
(
signal_context
,
out
);
DB
::
writePODBinary
(
signal_context
,
out
);
DB
::
writePODBinary
(
stack_trace
,
out
);
DB
::
writePODBinary
(
stack_trace
,
out
);
DB
::
writeBinary
(
UInt32
(
getThread
Number
()),
out
);
DB
::
writeBinary
(
UInt32
(
getThread
Id
()),
out
);
DB
::
writeStringBinary
(
query_id
,
out
);
DB
::
writeStringBinary
(
query_id
,
out
);
out
.
next
();
out
.
next
();
...
@@ -301,7 +301,7 @@ static void terminate_handler()
...
@@ -301,7 +301,7 @@ static void terminate_handler()
DB
::
WriteBufferFromFileDescriptor
out
(
signal_pipe
.
fds_rw
[
1
],
buf_size
,
buf
);
DB
::
WriteBufferFromFileDescriptor
out
(
signal_pipe
.
fds_rw
[
1
],
buf_size
,
buf
);
DB
::
writeBinary
(
static_cast
<
int
>
(
SignalListener
::
StdTerminate
),
out
);
DB
::
writeBinary
(
static_cast
<
int
>
(
SignalListener
::
StdTerminate
),
out
);
DB
::
writeBinary
(
UInt32
(
getThread
Number
()),
out
);
DB
::
writeBinary
(
UInt32
(
getThread
Id
()),
out
);
DB
::
writeBinary
(
log_message
,
out
);
DB
::
writeBinary
(
log_message
,
out
);
out
.
next
();
out
.
next
();
...
...
libs/libloggers/loggers/ExtendedLogChannel.cpp
浏览文件 @
39b31907
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
#include <sys/time.h>
#include <sys/time.h>
#include <Common/CurrentThread.h>
#include <Common/CurrentThread.h>
#include <Common/Exception.h>
#include <Common/Exception.h>
#include <common/getThread
Number
.h>
#include <common/getThread
Id
.h>
namespace
DB
namespace
DB
...
@@ -31,7 +31,7 @@ ExtendedLogMessage ExtendedLogMessage::getFrom(const Poco::Message & base)
...
@@ -31,7 +31,7 @@ ExtendedLogMessage ExtendedLogMessage::getFrom(const Poco::Message & base)
msg_ext
.
query_id
.
assign
(
query_id_ref
.
data
,
query_id_ref
.
size
);
msg_ext
.
query_id
.
assign
(
query_id_ref
.
data
,
query_id_ref
.
size
);
}
}
msg_ext
.
thread_id
=
getThread
Number
();
msg_ext
.
thread_id
=
getThread
Id
();
return
msg_ext
;
return
msg_ext
;
}
}
...
...
libs/libloggers/loggers/OwnPatternFormatter.cpp
浏览文件 @
39b31907
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
#include <Interpreters/InternalTextLogsQueue.h>
#include <Interpreters/InternalTextLogsQueue.h>
#include <sys/time.h>
#include <sys/time.h>
#include <Common/CurrentThread.h>
#include <Common/CurrentThread.h>
#include <common/getThread
Number
.h>
#include <common/getThread
Id
.h>
#include "Loggers.h"
#include "Loggers.h"
...
...
libs/libloggers/loggers/OwnSplitChannel.cpp
浏览文件 @
39b31907
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
#include <Poco/Message.h>
#include <Poco/Message.h>
#include <Common/CurrentThread.h>
#include <Common/CurrentThread.h>
#include <Common/DNSResolver.h>
#include <Common/DNSResolver.h>
#include <common/getThread
Number
.h>
#include <common/getThread
Id
.h>
#include <Common/SensitiveDataMasker.h>
#include <Common/SensitiveDataMasker.h>
namespace
DB
namespace
DB
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录