Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
9862f17a
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,发现更多精彩内容 >>
提交
9862f17a
编写于
3月 14, 2018
作者:
A
Alexey Milovidov
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of github.com:yandex/ClickHouse
上级
57279a87
fd4c0403
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
13 addition
and
6 deletion
+13
-6
dbms/src/Storages/MergeTree/MergeTreeDataPart.h
dbms/src/Storages/MergeTree/MergeTreeDataPart.h
+2
-1
dbms/src/Storages/System/StorageSystemParts.cpp
dbms/src/Storages/System/StorageSystemParts.cpp
+3
-1
libs/libcommon/include/common/DateLUTImpl.h
libs/libcommon/include/common/DateLUTImpl.h
+4
-1
libs/libcommon/src/DateLUTImpl.cpp
libs/libcommon/src/DateLUTImpl.cpp
+1
-1
libs/libcommon/src/tests/CMakeLists.txt
libs/libcommon/src/tests/CMakeLists.txt
+1
-0
libs/libcommon/src/tests/multi_version.cpp
libs/libcommon/src/tests/multi_version.cpp
+2
-2
未找到文件。
dbms/src/Storages/MergeTree/MergeTreeDataPart.h
浏览文件 @
9862f17a
...
...
@@ -139,7 +139,8 @@ struct MergeTreeDataPart
std
::
atomic
<
UInt64
>
size_in_bytes
{
0
};
/// size in bytes, 0 - if not counted;
/// is used from several threads without locks (it is changed with ALTER).
time_t
modification_time
=
0
;
mutable
std
::
atomic
<
time_t
>
remove_time
{
std
::
numeric_limits
<
time_t
>::
max
()
};
/// When the part is removed from the working set. Changes once.
/// When the part is removed from the working set. Changes once.
mutable
std
::
atomic
<
time_t
>
remove_time
{
std
::
numeric_limits
<
time_t
>::
max
()
};
/// If true, the destructor will delete the directory with the part.
bool
is_temp
=
false
;
...
...
dbms/src/Storages/System/StorageSystemParts.cpp
浏览文件 @
9862f17a
...
...
@@ -66,7 +66,9 @@ void StorageSystemParts::processNextStorage(MutableColumns & columns, const Stor
columns
[
i
++
]
->
insert
(
static_cast
<
UInt64
>
(
part
->
rows_count
));
columns
[
i
++
]
->
insert
(
static_cast
<
UInt64
>
(
part
->
size_in_bytes
));
columns
[
i
++
]
->
insert
(
static_cast
<
UInt64
>
(
part
->
modification_time
));
columns
[
i
++
]
->
insert
(
static_cast
<
UInt64
>
(
part
->
remove_time
.
load
(
std
::
memory_order_relaxed
)));
time_t
remove_time
=
part
->
remove_time
.
load
(
std
::
memory_order_relaxed
);
columns
[
i
++
]
->
insert
(
static_cast
<
UInt64
>
(
remove_time
==
std
::
numeric_limits
<
time_t
>::
max
()
?
0
:
remove_time
));
/// For convenience, in returned refcount, don't add references that was due to local variables in this method: all_parts, active_parts.
columns
[
i
++
]
->
insert
(
static_cast
<
UInt64
>
(
part
.
use_count
()
-
1
));
...
...
libs/libcommon/include/common/DateLUTImpl.h
浏览文件 @
9862f17a
...
...
@@ -70,6 +70,7 @@ private:
std
::
string
time_zone
;
/// We can correctly process only timestamps that less DATE_LUT_MAX (i.e. up to 2105 year inclusively)
inline
size_t
findIndex
(
time_t
t
)
const
{
/// First guess.
...
...
@@ -242,8 +243,10 @@ public:
{
size_t
index
=
findIndex
(
t
);
/// If it is not 1970 year (findIndex found nothing appropriate),
/// than limit number of hours to avoid insane results like 1970-01-01 89:28:15
if
(
unlikely
(
index
==
0
))
return
(
t
+
offset_at_start_of_epoch
)
/
3600
;
return
static_cast
<
unsigned
>
((
t
+
offset_at_start_of_epoch
)
/
3600
)
%
24
;
time_t
res
=
t
-
lut
[
index
].
date
;
...
...
libs/libcommon/src/DateLUTImpl.cpp
浏览文件 @
9862f17a
...
...
@@ -64,7 +64,7 @@ DateLUTImpl::DateLUTImpl(const std::string & time_zone_)
{
cctz
::
time_zone
::
civil_lookup
lookup
=
cctz_time_zone
.
lookup
(
date
);
start_of_day
=
std
::
chrono
::
system_clock
::
to_time_t
(
lookup
.
pre
);
/// Ambigu
ou
ty is possible.
start_of_day
=
std
::
chrono
::
system_clock
::
to_time_t
(
lookup
.
pre
);
/// Ambigu
i
ty is possible.
Values
&
values
=
lut
[
i
];
values
.
year
=
date
.
year
();
...
...
libs/libcommon/src/tests/CMakeLists.txt
浏览文件 @
9862f17a
...
...
@@ -15,6 +15,7 @@ target_link_libraries (date_lut3 common ${PLATFORM_LIBS})
target_link_libraries
(
date_lut4 common
${
PLATFORM_LIBS
}
)
target_link_libraries
(
date_lut_default_timezone common
${
PLATFORM_LIBS
}
)
target_link_libraries
(
multi_version common
)
add_check
(
multi_version
)
add_executable
(
unit_tests_libcommon gtest_json_test.cpp gtest_strong_typedef.cpp
)
target_link_libraries
(
unit_tests_libcommon gtest_main common
)
...
...
libs/libcommon/src/tests/multi_version.cpp
浏览文件 @
9862f17a
...
...
@@ -19,7 +19,7 @@ void thread1(MV & x, T & result)
void
thread2
(
MV
&
x
,
const
char
*
result
)
{
x
.
set
(
std
::
make_
shared
<
T
>
(
result
));
x
.
set
(
std
::
make_
unique
<
T
>
(
result
));
}
...
...
@@ -31,7 +31,7 @@ int main(int argc, char ** argv)
const
char
*
s2
=
"Goodbye!"
;
size_t
n
=
1000
;
MV
x
(
std
::
make_
shared
<
T
>
(
s1
));
MV
x
(
std
::
make_
unique
<
T
>
(
s1
));
Results
results
(
n
);
ThreadPool
tp
(
8
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录