Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
kvdb
rocksdb
提交
93ab1473
R
rocksdb
项目概览
kvdb
/
rocksdb
12 个月 前同步成功
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rocksdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
93ab1473
编写于
4月 25, 2015
作者:
I
Igor Canadi
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #593 from charsyam/feature/type-1
fix typos
上级
3d1af4ae
6ede020d
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
29 addition
and
29 deletion
+29
-29
db/column_family.cc
db/column_family.cc
+1
-1
db/column_family_test.cc
db/column_family_test.cc
+1
-1
db/compaction_picker.cc
db/compaction_picker.cc
+7
-7
db/corruption_test.cc
db/corruption_test.cc
+1
-1
db/db_iter.cc
db/db_iter.cc
+1
-1
db/db_test.cc
db/db_test.cc
+3
-3
db/memtable_list.cc
db/memtable_list.cc
+3
-3
db/version_set.cc
db/version_set.cc
+1
-1
table/block_based_table_builder.cc
table/block_based_table_builder.cc
+2
-2
table/block_based_table_reader.cc
table/block_based_table_reader.cc
+2
-2
table/block_hash_index.cc
table/block_hash_index.cc
+1
-1
tools/db_stress.cc
tools/db_stress.cc
+1
-1
util/bloom.cc
util/bloom.cc
+1
-1
util/env_hdfs.cc
util/env_hdfs.cc
+1
-1
util/histogram.cc
util/histogram.cc
+1
-1
util/histogram_test.cc
util/histogram_test.cc
+1
-1
utilities/backupable/backupable_db.cc
utilities/backupable/backupable_db.cc
+1
-1
未找到文件。
db/column_family.cc
浏览文件 @
93ab1473
...
...
@@ -614,7 +614,7 @@ bool ColumnFamilyData::ReturnThreadLocalSuperVersion(SuperVersion* sv) {
void
*
expected
=
SuperVersion
::
kSVInUse
;
if
(
local_sv_
->
CompareAndSwap
(
static_cast
<
void
*>
(
sv
),
expected
))
{
// When we see kSVInUse in the ThreadLocal, we are sure ThreadLocal
// storage has not been altered and no Scrape has happend. The
// storage has not been altered and no Scrape has happen
e
d. The
// SuperVersion is still current.
return
true
;
}
else
{
...
...
db/column_family_test.cc
浏览文件 @
93ab1473
...
...
@@ -268,7 +268,7 @@ class ColumnFamilyTest : public testing::Test {
VectorLogPtr
wal_files
;
Status
s
;
// GetSortedWalFiles is a flakey function -- it gets all the wal_dir
// children files and then later checks for their exist
a
nce. if some of the
// children files and then later checks for their exist
e
nce. if some of the
// log files doesn't exist anymore, it reports an error. it does all of this
// without DB mutex held, so if a background process deletes the log file
// while the function is being executed, it returns an error. We retry the
...
...
db/compaction_picker.cc
浏览文件 @
93ab1473
...
...
@@ -1248,12 +1248,12 @@ Compaction* UniversalCompactionPicker::PickCompactionUniversalReadAmp(
cf_name
.
c_str
(),
file_num_buf
,
loop
);
}
// Check if the suceeding files need compaction.
// Check if the suc
c
eeding files need compaction.
for
(
unsigned
int
i
=
loop
+
1
;
candidate_count
<
max_files_to_compact
&&
i
<
sorted_runs
.
size
();
i
++
)
{
const
SortedRun
*
suceeding_sr
=
&
sorted_runs
[
i
];
if
(
suceeding_sr
->
being_compacted
)
{
const
SortedRun
*
suc
c
eeding_sr
=
&
sorted_runs
[
i
];
if
(
suc
c
eeding_sr
->
being_compacted
)
{
break
;
}
// Pick files if the total/last candidate file size (increased by the
...
...
@@ -1263,14 +1263,14 @@ Compaction* UniversalCompactionPicker::PickCompactionUniversalReadAmp(
// kCompactionStopStyleSimilarSize, it's simply the size of the last
// picked file.
double
sz
=
candidate_size
*
(
100.0
+
ratio
)
/
100.0
;
if
(
sz
<
static_cast
<
double
>
(
suceeding_sr
->
size
))
{
if
(
sz
<
static_cast
<
double
>
(
suc
c
eeding_sr
->
size
))
{
break
;
}
if
(
ioptions_
.
compaction_options_universal
.
stop_style
==
kCompactionStopStyleSimilarSize
)
{
// Similar-size stopping rule: also check the last picked file isn't
// far larger than the next candidate file.
sz
=
(
suceeding_sr
->
size
*
(
100.0
+
ratio
))
/
100.0
;
sz
=
(
suc
c
eeding_sr
->
size
*
(
100.0
+
ratio
))
/
100.0
;
if
(
sz
<
static_cast
<
double
>
(
candidate_size
))
{
// If the small file we've encountered begins a run of similar-size
// files, we'll pick them up on a future iteration of the outer
...
...
@@ -1278,9 +1278,9 @@ Compaction* UniversalCompactionPicker::PickCompactionUniversalReadAmp(
// by the last-resort read amp strategy which disregards size ratios.
break
;
}
candidate_size
=
suceeding_sr
->
compensated_file_size
;
candidate_size
=
suc
c
eeding_sr
->
compensated_file_size
;
}
else
{
// default kCompactionStopStyleTotalSize
candidate_size
+=
suceeding_sr
->
compensated_file_size
;
candidate_size
+=
suc
c
eeding_sr
->
compensated_file_size
;
}
candidate_count
++
;
}
...
...
db/corruption_test.cc
浏览文件 @
93ab1473
...
...
@@ -103,7 +103,7 @@ class CorruptionTest : public testing::Test {
// db itself will raise errors because data is corrupted.
// Instead, we want the reads to be successful and this test
// will detect whether the appropriate corruptions have
// occured.
// occur
r
ed.
Iterator
*
iter
=
db_
->
NewIterator
(
ReadOptions
(
false
,
true
));
for
(
iter
->
SeekToFirst
();
iter
->
Valid
();
iter
->
Next
())
{
uint64_t
key
;
...
...
db/db_iter.cc
浏览文件 @
93ab1473
...
...
@@ -254,7 +254,7 @@ void DBIter::FindNextUserEntryInternal(bool skipping) {
}
// If we have sequentially iterated via numerous keys and still not
// found the next user-key, then it is better to seek so that we can
// avoid too many key comparisons. We seek to the last occurence of
// avoid too many key comparisons. We seek to the last occur
r
ence of
// our current key by looking for sequence number 0.
if
(
skipping
&&
num_skipped
>
max_skip_
)
{
num_skipped
=
0
;
...
...
db/db_test.cc
浏览文件 @
93ab1473
...
...
@@ -1295,7 +1295,7 @@ static long TestGetTickerCount(const Options& options, Tickers ticker_type) {
// A helper function that ensures the table properties returned in
// `GetPropertiesOfAllTablesTest` is correct.
// This test assumes entries size is differnt for each of the tables.
// This test assumes entries size is differ
e
nt for each of the tables.
namespace
{
void
VerifyTableProperties
(
DB
*
db
,
uint64_t
expected_entries_size
)
{
TablePropertiesCollection
props
;
...
...
@@ -1955,7 +1955,7 @@ TEST_F(DBTest, GetEncountersEmptyLevel) {
// * sstable B in level 2
// Then do enough Get() calls to arrange for an automatic compaction
// of sstable A. A bug would cause the compaction to be marked as
// occuring at level 1 (instead of the correct level 0).
// occur
r
ing at level 1 (instead of the correct level 0).
// Step 1: First place sstables in levels 0 and 2
int
compaction_count
=
0
;
...
...
@@ -11648,7 +11648,7 @@ TEST_F(DBTest, DynamicCompactionOptions) {
// Test max_mem_compaction_level.
// Dest
or
y DB and start from scratch
// Dest
ro
y DB and start from scratch
options
.
max_background_compactions
=
1
;
options
.
max_background_flushes
=
0
;
options
.
max_mem_compaction_level
=
2
;
...
...
db/memtable_list.cc
浏览文件 @
93ab1473
...
...
@@ -161,7 +161,7 @@ void MemTableList::RollbackMemtableFlush(const autovector<MemTable*>& mems,
assert
(
!
mems
.
empty
());
// If the flush was not successful, then just reset state.
// Maybe a suceeding attempt to flush will be successful.
// Maybe a suc
c
eeding attempt to flush will be successful.
for
(
MemTable
*
m
:
mems
)
{
assert
(
m
->
flush_in_progress_
);
assert
(
m
->
file_number_
==
0
);
...
...
@@ -184,7 +184,7 @@ Status MemTableList::InstallMemtableFlushResults(
ThreadStatus
::
STAGE_MEMTABLE_INSTALL_FLUSH_RESULTS
);
mu
->
AssertHeld
();
// flush was sucessful
// flush was suc
c
essful
for
(
size_t
i
=
0
;
i
<
mems
.
size
();
++
i
)
{
// All the edits are associated with the first memtable of this batch.
assert
(
i
==
0
||
mems
[
i
]
->
GetEdits
()
->
NumEntries
()
==
0
);
...
...
@@ -193,7 +193,7 @@ Status MemTableList::InstallMemtableFlushResults(
mems
[
i
]
->
file_number_
=
file_number
;
}
// if some other thread is already commiting, then return
// if some other thread is already commit
t
ing, then return
Status
s
;
if
(
commit_in_progress_
)
{
return
s
;
...
...
db/version_set.cc
浏览文件 @
93ab1473
...
...
@@ -275,7 +275,7 @@ class FilePicker {
static_cast
<
uint32_t
>
(
search_right_bound_
));
}
else
{
// search_left_bound > search_right_bound, key does not exist in
// this level. Since no comparis
i
on is done in this level, it will
// this level. Since no comparison is done in this level, it will
// need to search all files in the next level.
search_left_bound_
=
0
;
search_right_bound_
=
FileIndexer
::
kLevelMaxIndex
;
...
...
table/block_based_table_builder.cc
浏览文件 @
93ab1473
...
...
@@ -208,7 +208,7 @@ class HashIndexBuilder : public IndexBuilder {
pending_entry_index_
=
static_cast
<
uint32_t
>
(
current_restart_index_
);
}
else
{
// entry number increments when keys share the prefix reside in
// differnt data blocks.
// differ
e
nt data blocks.
auto
last_restart_index
=
pending_entry_index_
+
pending_block_num_
-
1
;
assert
(
last_restart_index
<=
current_restart_index_
);
if
(
last_restart_index
!=
current_restart_index_
)
{
...
...
@@ -383,7 +383,7 @@ extern const uint64_t kLegacyBlockBasedTableMagicNumber = 0xdb4775248b80fb57ull;
// A collector that collects properties of interest to block-based table.
// For now this class looks heavy-weight since we only write one additional
// property.
// But in the forseeable future, we will add more and more properties that are
// But in the for
e
seeable future, we will add more and more properties that are
// specific to block-based table.
class
BlockBasedTableBuilder
::
BlockBasedTablePropertiesCollector
:
public
IntTblPropCollector
{
...
...
table/block_based_table_reader.cc
浏览文件 @
93ab1473
...
...
@@ -1347,7 +1347,7 @@ Status BlockBasedTable::CreateIndexReader(IndexReader** index_reader,
Log
(
InfoLogLevel
::
WARN_LEVEL
,
rep_
->
ioptions
.
info_log
,
"BlockBasedTableOptions::kHashSearch requires "
"options.prefix_extractor to be set."
" Fall back to binary seach index."
);
" Fall back to binary sea
r
ch index."
);
index_type_on_file
=
BlockBasedTableOptions
::
kBinarySearch
;
}
...
...
@@ -1367,7 +1367,7 @@ Status BlockBasedTable::CreateIndexReader(IndexReader** index_reader,
// problem with prefix hash index loading.
Log
(
InfoLogLevel
::
WARN_LEVEL
,
rep_
->
ioptions
.
info_log
,
"Unable to read the metaindex block."
" Fall back to binary seach index."
);
" Fall back to binary sea
r
ch index."
);
return
BinarySearchIndexReader
::
Create
(
file
,
footer
,
footer
.
index_handle
(),
env
,
comparator
,
index_reader
);
}
...
...
table/block_hash_index.cc
浏览文件 @
93ab1473
...
...
@@ -98,7 +98,7 @@ BlockHashIndex* CreateBlockHashIndexOnTheFly(
pending_entry_index
=
current_restart_index
;
}
else
{
// entry number increments when keys share the prefix reside in
// differnt data blocks.
// differ
e
nt data blocks.
auto
last_restart_index
=
pending_entry_index
+
pending_block_num
-
1
;
assert
(
last_restart_index
<=
current_restart_index
);
if
(
last_restart_index
!=
current_restart_index
)
{
...
...
tools/db_stress.cc
浏览文件 @
93ab1473
...
...
@@ -174,7 +174,7 @@ DEFINE_int32(compaction_thread_pool_adjust_interval, 0,
"The interval (in milliseconds) to adjust compaction thread pool "
"size. Don't change it periodically if the value is 0."
);
DEFINE_int32
(
compaction_thread_pool_varations
,
2
,
DEFINE_int32
(
compaction_thread_pool_var
i
ations
,
2
,
"Range of bakground thread pool size variations when adjusted "
"periodically."
);
...
...
util/bloom.cc
浏览文件 @
93ab1473
...
...
@@ -43,7 +43,7 @@ class FullFilterBitsBuilder : public FilterBitsBuilder {
// When creating filter, it is ensured that
// total_bits = num_lines * CACHE_LINE_SIZE * 8
// dst len is >= 5, 1 for num_probes, 4 for num_lines
// Then total_bits = (len - 5) * 8, and cache_line_size could be calulated
// Then total_bits = (len - 5) * 8, and cache_line_size could be cal
c
ulated
// +----------------------------------------------------------------+
// | filter data with length total_bits/8 |
// +----------------------------------------------------------------+
...
...
util/env_hdfs.cc
浏览文件 @
93ab1473
...
...
@@ -562,7 +562,7 @@ Status HdfsEnv::GetFileModificationTime(const std::string& fname,
}
// The rename is not atomic. HDFS does not allow a renaming if the
// target already exists. So, we delete the target before attemting the
// target already exists. So, we delete the target before attem
p
ting the
// rename.
Status
HdfsEnv
::
RenameFile
(
const
std
::
string
&
src
,
const
std
::
string
&
target
)
{
hdfsDelete
(
fileSys_
,
target
.
c_str
(),
1
);
...
...
util/histogram.cc
浏览文件 @
93ab1473
...
...
@@ -19,7 +19,7 @@ namespace rocksdb {
HistogramBucketMapper
::
HistogramBucketMapper
()
:
// Add newer bucket index here.
// Should be alw
ya
s added in sorted order.
// Should be alw
ay
s added in sorted order.
// If you change this, you also need to change
// size of array buckets_ in HistogramImpl
bucketValues_
(
...
...
util/histogram_test.cc
浏览文件 @
93ab1473
...
...
@@ -33,7 +33,7 @@ TEST_F(HistogramTest, BasicOperation) {
ASSERT_TRUE
(
percentile99
>=
percentile85
);
}
ASSERT_EQ
(
histogram
.
Average
(),
50.5
);
// avg is acurately cal
uc
lated.
ASSERT_EQ
(
histogram
.
Average
(),
50.5
);
// avg is acurately cal
cu
lated.
}
TEST_F
(
HistogramTest
,
EmptyHistogram
)
{
...
...
utilities/backupable/backupable_db.cc
浏览文件 @
93ab1473
...
...
@@ -419,7 +419,7 @@ BackupEngineImpl::BackupEngineImpl(Env* db_env,
&
backuped_file_infos_
,
backup_env_
)))));
}
if
(
options_
.
destroy_old_data
)
{
// Dest
or
y old data
if
(
options_
.
destroy_old_data
)
{
// Dest
ro
y old data
assert
(
!
read_only_
);
Log
(
options_
.
info_log
,
"Backup Engine started with destroy_old_data == true, deleting all "
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录