Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
indiff7643
Terarkdb
提交
239ac9d2
T
Terarkdb
项目概览
indiff7643
/
Terarkdb
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Terarkdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
239ac9d2
编写于
2月 02, 2012
作者:
S
Sanjay Ghemawat
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
avoid very large compactions; fix build on Linux
上级
3c8be108
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
15 addition
and
4 deletion
+15
-4
build_detect_platform
build_detect_platform
+1
-1
db/version_set.cc
db/version_set.cc
+14
-3
未找到文件。
build_detect_platform
浏览文件 @
239ac9d2
...
...
@@ -27,7 +27,7 @@ case `uname -s` in
Linux
)
PLATFORM
=
OS_LINUX
echo
"PLATFORM_CFLAGS=-pthread -DOS_LINUX"
>>
build_config.mk
echo
"PLATFORM_LDFLAGS=-
l
pthread"
>>
build_config.mk
echo
"PLATFORM_LDFLAGS=-pthread"
>>
build_config.mk
;;
SunOS
)
PLATFORM
=
OS_SOLARIS
...
...
db/version_set.cc
浏览文件 @
239ac9d2
...
...
@@ -26,6 +26,11 @@ static const int kTargetFileSize = 2 * 1048576;
// stop building a single file in a level->level+1 compaction.
static
const
int64_t
kMaxGrandParentOverlapBytes
=
10
*
kTargetFileSize
;
// Maximum number of bytes in all compacted files. We avoid expanding
// the lower level file set of a compaction if it would make the
// total compaction cover more than this many bytes.
static
const
int64_t
kExpandedCompactionByteSizeLimit
=
25
*
kTargetFileSize
;
static
double
MaxBytesForLevel
(
int
level
)
{
// Note: the result for level zero is not really used since we set
// the level-0 compaction threshold based on number of files.
...
...
@@ -1223,7 +1228,11 @@ void VersionSet::SetupOtherInputs(Compaction* c) {
if
(
!
c
->
inputs_
[
1
].
empty
())
{
std
::
vector
<
FileMetaData
*>
expanded0
;
current_
->
GetOverlappingInputs
(
level
,
&
all_start
,
&
all_limit
,
&
expanded0
);
if
(
expanded0
.
size
()
>
c
->
inputs_
[
0
].
size
())
{
const
int64_t
inputs0_size
=
TotalFileSize
(
c
->
inputs_
[
0
]);
const
int64_t
inputs1_size
=
TotalFileSize
(
c
->
inputs_
[
1
]);
const
int64_t
expanded0_size
=
TotalFileSize
(
expanded0
);
if
(
expanded0
.
size
()
>
c
->
inputs_
[
0
].
size
()
&&
inputs1_size
+
expanded0_size
<
kExpandedCompactionByteSizeLimit
)
{
InternalKey
new_start
,
new_limit
;
GetRange
(
expanded0
,
&
new_start
,
&
new_limit
);
std
::
vector
<
FileMetaData
*>
expanded1
;
...
...
@@ -1231,12 +1240,14 @@ void VersionSet::SetupOtherInputs(Compaction* c) {
&
expanded1
);
if
(
expanded1
.
size
()
==
c
->
inputs_
[
1
].
size
())
{
Log
(
options_
->
info_log
,
"Expanding@%d %d+%d
to %d+%d
\n
"
,
"Expanding@%d %d+%d
(%ld+%ld bytes) to %d+%d (%ld+%ld bytes)
\n
"
,
level
,
int
(
c
->
inputs_
[
0
].
size
()),
int
(
c
->
inputs_
[
1
].
size
()),
long
(
inputs0_size
),
long
(
inputs1_size
),
int
(
expanded0
.
size
()),
int
(
expanded1
.
size
()));
int
(
expanded1
.
size
()),
long
(
expanded0_size
),
long
(
inputs1_size
));
smallest
=
new_start
;
largest
=
new_limit
;
c
->
inputs_
[
0
]
=
expanded0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录