|
|
|
@ -70,7 +70,7 @@ const std::string kDummyValue(10000, 'o'); |
|
|
|
|
// DummyPropertiesCollector used to test BlockBasedTableProperties
|
|
|
|
|
class DummyPropertiesCollector : public TablePropertiesCollector { |
|
|
|
|
public: |
|
|
|
|
const char* Name() const override { return ""; } |
|
|
|
|
const char* Name() const override { return "DummyPropertiesCollector"; } |
|
|
|
|
|
|
|
|
|
Status Finish(UserCollectedProperties* /*properties*/) override { |
|
|
|
|
return Status::OK(); |
|
|
|
@ -92,7 +92,9 @@ class DummyPropertiesCollectorFactory1 |
|
|
|
|
TablePropertiesCollectorFactory::Context /*context*/) override { |
|
|
|
|
return new DummyPropertiesCollector(); |
|
|
|
|
} |
|
|
|
|
const char* Name() const override { return "DummyPropertiesCollector1"; } |
|
|
|
|
const char* Name() const override { |
|
|
|
|
return "DummyPropertiesCollectorFactory1"; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class DummyPropertiesCollectorFactory2 |
|
|
|
@ -102,7 +104,9 @@ class DummyPropertiesCollectorFactory2 |
|
|
|
|
TablePropertiesCollectorFactory::Context /*context*/) override { |
|
|
|
|
return new DummyPropertiesCollector(); |
|
|
|
|
} |
|
|
|
|
const char* Name() const override { return "DummyPropertiesCollector2"; } |
|
|
|
|
const char* Name() const override { |
|
|
|
|
return "DummyPropertiesCollectorFactory2"; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// Return reverse of "key".
|
|
|
|
@ -1498,7 +1502,8 @@ TEST_P(BlockBasedTableTest, BlockBasedTableProperties2) { |
|
|
|
|
ASSERT_EQ("rocksdb.ReverseBytewiseComparator", props.comparator_name); |
|
|
|
|
ASSERT_EQ("UInt64AddOperator", props.merge_operator_name); |
|
|
|
|
ASSERT_EQ("rocksdb.Noop", props.prefix_extractor_name); |
|
|
|
|
ASSERT_EQ("[DummyPropertiesCollector1,DummyPropertiesCollector2]", |
|
|
|
|
ASSERT_EQ( |
|
|
|
|
"[DummyPropertiesCollectorFactory1,DummyPropertiesCollectorFactory2]", |
|
|
|
|
props.property_collectors_names); |
|
|
|
|
ASSERT_EQ("", props.filter_policy_name); // no filter policy is used
|
|
|
|
|
c.ResetTableReader(); |
|
|
|
@ -2186,7 +2191,8 @@ class CustomFlushBlockPolicy : public FlushBlockPolicyFactory, |
|
|
|
|
explicit CustomFlushBlockPolicy(std::vector<int> keys_per_block) |
|
|
|
|
: keys_per_block_(keys_per_block) {} |
|
|
|
|
|
|
|
|
|
const char* Name() const override { return "table_test"; } |
|
|
|
|
const char* Name() const override { return "CustomFlushBlockPolicy"; } |
|
|
|
|
|
|
|
|
|
FlushBlockPolicy* NewFlushBlockPolicy(const BlockBasedTableOptions&, |
|
|
|
|
const BlockBuilder&) const override { |
|
|
|
|
return new CustomFlushBlockPolicy(keys_per_block_); |
|
|
|
|