6363#include " engine/homeds/btree/btree.hpp"
6464#include " engine/index/indx_mgr.hpp"
6565#include " homeblks/home_blks.hpp"
66+ #include " homeblks/volume/mapping.hpp"
6667#include " test_common/homestore_test_common.hpp"
6768
68- // Reuse the key/value types already used by test_load's SSDBtreeTest
69- #include " homeds/tests/loadgen_tests/keyspecs/simple_key_spec.hpp"
70- #include " homeds/tests/loadgen_tests/valuespecs/fixedbyte_value_spec.hpp"
71-
7269SISL_LOGGING_INIT (HOMESTORE_LOG_MODS )
7370SISL_OPTIONS_ENABLE (logging)
7471
7572RCU_REGISTER_INIT
7673
7774using namespace homestore ;
7875using namespace homeds ::btree;
79- using namespace homeds ::loadgen;
8076
8177namespace fs = std::filesystem;
8278
8379// ============================================================================
8480// Types
8581// ============================================================================
8682
87- using WbTestKey = SimpleNumberKey;
88- using WbTestVal = FixedBytesValue< 64 >;
89- using WbTestBtree = Btree< btree_store_type::SSD_BTREE , WbTestKey, WbTestVal ,
90- btree_node_type::SIMPLE , btree_node_type::SIMPLE >;
83+ // Must match BLKSTORE_BUFFER_TYPE used by the index blkstore so that
84+ // dynamic_pointer_cast in blkstore's process_completions succeeds.
85+ using WbTestBtree = Btree< btree_store_type::SSD_BTREE , MappingKey, MappingValue ,
86+ btree_node_type::VAR_VALUE , btree_node_type::VAR_VALUE >;
9187
9288static constexpr uint64_t DISK_SIZE {2 * 1024 * 1024 * 1024ULL }; // 2 GiB
9389static const std::string DISK_FILE {" wbcache_integration_test_disk" };
@@ -147,8 +143,8 @@ class WbCacheIntegrationTest : public ::testing::Test {
147143 // directly in TearDown to drain dirty wb_cache buffers.
148144 BtreeConfig cfg{4096 };
149145 cfg.set_max_objs (100000 );
150- cfg.set_max_key_size (WbTestKey::get_max_size ( ));
151- cfg.set_max_value_size (WbTestVal::get_max_size () );
146+ cfg.set_max_key_size (sizeof ( uint32_t ));
147+ cfg.set_max_value_size (4096 );
152148 cfg.blkstore = HomeBlks::instance ()->get_index_blkstore ();
153149 m_btree = std::unique_ptr< WbTestBtree >(WbTestBtree::create_btree (cfg));
154150 m_bcp = m_btree->attach_prepare_cp (nullptr , false , false );
@@ -169,8 +165,8 @@ class WbCacheIntegrationTest : public ::testing::Test {
169165 }
170166
171167 void btree_put (uint64_t key_id) {
172- WbTestKey k{key_id};
173- WbTestVal v;
168+ MappingKey k{static_cast < lba_t >( key_id), 1 };
169+ MappingValue v;
174170 m_btree->put (k, v, btree_put_type::REPLACE_IF_EXISTS_ELSE_INSERT , &v, m_bcp);
175171 }
176172
0 commit comments