Fix clang error in PartitionedFilterBlockBuilder

Summary: Closes https://github.com/facebook/rocksdb/pull/2536

Differential Revision: D5371271

Pulled By: maysamyabandeh

fbshipit-source-id: f1355ac658a79c9982a24986f0925c9e24fc39d5
main
Maysam Yabandeh 8 years ago committed by Facebook Github Bot
parent 45b9bb0331
commit f6b9d9355e
  1. 6
      table/block_based_table_builder.cc
  2. 10
      table/partitioned_filter_block_test.cc

@ -81,9 +81,9 @@ FilterBlockBuilder* CreateFilterBlockBuilder(
// as partition size.
assert(table_opt.block_size_deviation <= 100);
auto partition_size =
(const uint32_t)(table_opt.metadata_block_size *
(100 - table_opt.block_size_deviation));
partition_size = std::max(partition_size, (const uint32_t)1);
static_cast<const uint32_t>(table_opt.metadata_block_size *
(100 - table_opt.block_size_deviation));
partition_size = std::max(partition_size, static_cast<const uint32_t>(1));
return new PartitionedFilterBlockBuilder(
opt.prefix_extractor, table_opt.whole_key_filtering,
filter_bits_builder, table_opt.index_block_restart_interval,

@ -89,12 +89,10 @@ class PartitionedFilterBlockTest : public testing::Test {
PartitionedFilterBlockBuilder* NewBuilder(
PartitionedIndexBuilder* const p_index_builder) {
uint32_t partition_size =
table_options_.metadata_block_size >
(uint64_t)table_options_.block_size_deviation
? table_options_.metadata_block_size -
table_options_.block_size_deviation
: 1;
assert(table_opt.block_size_deviation <= 100);
auto partition_size = static_cast<const uint32_t>(
table_opt.metadata_block_size * (100 - table_opt.block_size_deviation));
partition_size = std::max(partition_size, static_cast<const uint32_t>(1));
return new PartitionedFilterBlockBuilder(
nullptr, table_options_.whole_key_filtering,
table_options_.filter_policy->GetFilterBitsBuilder(),

Loading…
Cancel
Save