diff --git a/src/coordinator/coordinator.hpp b/src/coordinator/coordinator.hpp index 76bd7027f..787248f5d 100644 --- a/src/coordinator/coordinator.hpp +++ b/src/coordinator/coordinator.hpp @@ -90,8 +90,6 @@ class Coordinator { using StandbySotrageEnginePool = std::unordered_set
; ShardMap shard_map_; - // StandbySotrageEnginePool storage_engine_pool_; - /// The highest reserved timestamp / highest allocated timestamp /// is a way for minimizing communication involved in query engines /// reserving Hlc's for their transaction processing. @@ -158,9 +156,6 @@ class Coordinator { WriteResponses Apply(RegisterStorageEngineRequest &®ister_storage_engine_request) { RegisterStorageEngineResponse res{}; // TODO - // const Address &address = register_storage_engine_request.address; - // storage_engine_pool_.insert(address); - // res.success = true; return res; } diff --git a/src/coordinator/shard_map.hpp b/src/coordinator/shard_map.hpp index 68c387eec..7e20da565 100644 --- a/src/coordinator/shard_map.hpp +++ b/src/coordinator/shard_map.hpp @@ -33,6 +33,8 @@ struct AddressAndStatus { Status status; }; +using memgraph::io::Address; + using CompoundKey = std::vector; using Shard = std::vector; using Shards = std::map; @@ -65,7 +67,7 @@ struct ShardMap { // Finding the Shard that the new CompoundKey should map to. Shard shard_to_map_to; - auto &prev_key = (*shards_in_map.begin()).first; + CompoundKey prev_key = ((*shards_in_map.begin()).first); for (auto iter = std::next(shards_in_map.begin()); iter != shards_in_map.end(); ++iter) { const auto ¤t_key = (*iter).first; @@ -84,6 +86,10 @@ struct ShardMap { return false; } + void AddServer(Address server_address) { + // Find a random place for the server to plug in + } + Shards GetShardsForRange(Label label, CompoundKey start, CompoundKey end); Shard GetShardForKey(Label label, CompoundKey key); diff --git a/tests/simulation/CMakeLists.txt b/tests/simulation/CMakeLists.txt index 15c426e8c..b44dacb36 100644 --- a/tests/simulation/CMakeLists.txt +++ b/tests/simulation/CMakeLists.txt @@ -31,4 +31,4 @@ add_simulation_test(raft.cpp address) add_simulation_test(trial_query_storage/query_storage_test.cpp address) -#add_simulation_test(sharded_map.cpp address) +add_simulation_test(sharded_map.cpp address)