Apply formatter to some recent commits (#6138)
Summary: Formatter somehow complains some recent lines changed. Apply them to make the formatter happy. Pull Request resolved: https://github.com/facebook/rocksdb/pull/6138 Test Plan: See CI passes. Differential Revision: D18895950 fbshipit-source-id: 7d1696cf3e3a682bc10a30cdca748a23c6565255
This commit is contained in:
parent
a960287dee
commit
a68dff5c35
2
db/c.cc
2
db/c.cc
@ -3057,7 +3057,7 @@ rocksdb_filterpolicy_t* rocksdb_filterpolicy_create_bloom_format(int bits_per_ke
|
|||||||
const Slice& contents) const override {
|
const Slice& contents) const override {
|
||||||
return rep_->GetFilterBitsReader(contents);
|
return rep_->GetFilterBitsReader(contents);
|
||||||
}
|
}
|
||||||
static void DoNothing(void*) { }
|
static void DoNothing(void*) {}
|
||||||
};
|
};
|
||||||
Wrapper* wrapper = new Wrapper;
|
Wrapper* wrapper = new Wrapper;
|
||||||
wrapper->rep_ = NewBloomFilterPolicy(bits_per_key, original_format);
|
wrapper->rep_ = NewBloomFilterPolicy(bits_per_key, original_format);
|
||||||
|
@ -1058,8 +1058,8 @@ int main(int argc, char** argv) {
|
|||||||
CheckNoError(err);
|
CheckNoError(err);
|
||||||
rocksdb_filterpolicy_t* policy;
|
rocksdb_filterpolicy_t* policy;
|
||||||
if (run == 0) {
|
if (run == 0) {
|
||||||
policy = rocksdb_filterpolicy_create(
|
policy = rocksdb_filterpolicy_create(NULL, FilterDestroy, FilterCreate,
|
||||||
NULL, FilterDestroy, FilterCreate, FilterKeyMatch, NULL, FilterName);
|
FilterKeyMatch, NULL, FilterName);
|
||||||
} else if (run == 1) {
|
} else if (run == 1) {
|
||||||
policy = rocksdb_filterpolicy_create_bloom(8);
|
policy = rocksdb_filterpolicy_create_bloom(8);
|
||||||
} else {
|
} else {
|
||||||
|
@ -2082,16 +2082,18 @@ TEST_P(DBBasicTestWithTimestampWithParam, PutAndGet) {
|
|||||||
std::vector<Slice> read_ts_list;
|
std::vector<Slice> read_ts_list;
|
||||||
|
|
||||||
for (size_t i = 0; i != kNumTimestamps; ++i) {
|
for (size_t i = 0; i != kNumTimestamps; ++i) {
|
||||||
write_ts_list.emplace_back(EncodeTimestamp(i * 2, 0, &write_ts_strs[i]));
|
write_ts_list.emplace_back(
|
||||||
read_ts_list.emplace_back(EncodeTimestamp(1 + i * 2, 0, &read_ts_strs[i]));
|
EncodeTimestamp(i * 2, 0, &write_ts_strs[i]));
|
||||||
|
read_ts_list.emplace_back(
|
||||||
|
EncodeTimestamp(1 + i * 2, 0, &read_ts_strs[i]));
|
||||||
const Slice& write_ts = write_ts_list.back();
|
const Slice& write_ts = write_ts_list.back();
|
||||||
WriteOptions wopts;
|
WriteOptions wopts;
|
||||||
wopts.timestamp = &write_ts;
|
wopts.timestamp = &write_ts;
|
||||||
for (int cf = 0; cf != static_cast<int>(num_cfs); ++cf) {
|
for (int cf = 0; cf != static_cast<int>(num_cfs); ++cf) {
|
||||||
for (size_t j = 0; j != (kNumKeysPerFile - 1) / kNumTimestamps; ++j) {
|
for (size_t j = 0; j != (kNumKeysPerFile - 1) / kNumTimestamps; ++j) {
|
||||||
ASSERT_OK(Put(cf, "key" + std::to_string(j),
|
ASSERT_OK(Put(
|
||||||
"value_" + std::to_string(j) + "_" + std::to_string(i),
|
cf, "key" + std::to_string(j),
|
||||||
wopts));
|
"value_" + std::to_string(j) + "_" + std::to_string(i), wopts));
|
||||||
}
|
}
|
||||||
if (!memtable_only) {
|
if (!memtable_only) {
|
||||||
ASSERT_OK(Flush(cf));
|
ASSERT_OK(Flush(cf));
|
||||||
@ -2104,9 +2106,11 @@ TEST_P(DBBasicTestWithTimestampWithParam, PutAndGet) {
|
|||||||
ropts.timestamp = &read_ts_list[i];
|
ropts.timestamp = &read_ts_list[i];
|
||||||
for (int cf = 0; cf != static_cast<int>(num_cfs); ++cf) {
|
for (int cf = 0; cf != static_cast<int>(num_cfs); ++cf) {
|
||||||
ColumnFamilyHandle* cfh = handles_[cf];
|
ColumnFamilyHandle* cfh = handles_[cf];
|
||||||
for (size_t j = 0; j != (kNumKeysPerFile - 1) / kNumTimestamps; ++j) {
|
for (size_t j = 0; j != (kNumKeysPerFile - 1) / kNumTimestamps;
|
||||||
|
++j) {
|
||||||
std::string value;
|
std::string value;
|
||||||
ASSERT_OK(db_->Get(ropts, cfh, "key" + std::to_string(j), &value));
|
ASSERT_OK(
|
||||||
|
db_->Get(ropts, cfh, "key" + std::to_string(j), &value));
|
||||||
ASSERT_EQ("value_" + std::to_string(j) + "_" + std::to_string(i),
|
ASSERT_EQ("value_" + std::to_string(j) + "_" + std::to_string(i),
|
||||||
value);
|
value);
|
||||||
}
|
}
|
||||||
|
@ -1108,7 +1108,8 @@ void BlockBasedTableBuilder::EnterUnbuffered() {
|
|||||||
|
|
||||||
for (const auto& key : keys) {
|
for (const auto& key : keys) {
|
||||||
if (r->filter_builder != nullptr) {
|
if (r->filter_builder != nullptr) {
|
||||||
size_t ts_sz = r->internal_comparator.user_comparator()->timestamp_size();
|
size_t ts_sz =
|
||||||
|
r->internal_comparator.user_comparator()->timestamp_size();
|
||||||
r->filter_builder->Add(ExtractUserKeyAndStripTimestamp(key, ts_sz));
|
r->filter_builder->Add(ExtractUserKeyAndStripTimestamp(key, ts_sz));
|
||||||
}
|
}
|
||||||
r->index_builder->OnKeyAdded(key);
|
r->index_builder->OnKeyAdded(key);
|
||||||
|
Loading…
Reference in New Issue
Block a user