From f9044dc6d1fbc5f36bbb3703b694a644fe7f2c03 Mon Sep 17 00:00:00 2001
From: gvolfing <gabor.volfinger@memgraph.io>
Date: Fri, 19 Aug 2022 10:11:46 +0200
Subject: [PATCH] Move RsmMap from the Thrift directory into storage

---
 src/io/thrift/thrift_handle.hpp                              | 5 +++++
 .../thrift/rsm_map.hpp => storage/v3/storage_rsm_map.hpp}    | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)
 rename src/{io/thrift/rsm_map.hpp => storage/v3/storage_rsm_map.hpp} (95%)

diff --git a/src/io/thrift/thrift_handle.hpp b/src/io/thrift/thrift_handle.hpp
index 0d7e4fd8d..2694e9cce 100644
--- a/src/io/thrift/thrift_handle.hpp
+++ b/src/io/thrift/thrift_handle.hpp
@@ -80,6 +80,11 @@ class ThriftHandle {
       auto destination_port = rsm_map_.at(destination_id);
 
       // Send it to the port of the destination -how?
+      // TODO(tyler) search for item in can_receive_ that matches the desired types, rather
+      // than asserting that the last item in can_rx matches.
+      auto m_opt = std::move(current_message).Take<Ms...>();
+
+      return (std::move(m_opt));
     }
   }
 
diff --git a/src/io/thrift/rsm_map.hpp b/src/storage/v3/storage_rsm_map.hpp
similarity index 95%
rename from src/io/thrift/rsm_map.hpp
rename to src/storage/v3/storage_rsm_map.hpp
index 155bd1844..7c9a1db05 100644
--- a/src/io/thrift/rsm_map.hpp
+++ b/src/storage/v3/storage_rsm_map.hpp
@@ -16,7 +16,7 @@
 #include <boost/uuid/uuid.hpp>
 #include <boost/uuid/uuid_io.hpp>
 
-#include "../rsm/shard_rsm.hpp"
+#include "src/io/rsm/shard_rsm.hpp"
 
 namespace memgraph::io {