Make the use RequestRouter more restricted
This commit is contained in:
parent
b4ae8aea95
commit
3bc9c571a0
@ -296,7 +296,10 @@ class Interpreter final {
|
||||
*/
|
||||
void Abort();
|
||||
|
||||
RequestRouterInterface *GetRequestRouter() { return request_router_.get(); }
|
||||
const RequestRouterInterface *GetRequestRouter() const { return request_router_.get(); }
|
||||
void InstallSimulatorTicker(std::function<bool()> &&tick_simulator) {
|
||||
request_router_->InstallSimulatorTicker(tick_simulator);
|
||||
}
|
||||
|
||||
private:
|
||||
struct QueryExecution {
|
||||
|
@ -12,7 +12,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <algorithm>
|
||||
#include <boost/uuid/uuid.hpp>
|
||||
#include <chrono>
|
||||
#include <deque>
|
||||
#include <iostream>
|
||||
@ -28,6 +27,7 @@
|
||||
#include <variant>
|
||||
#include <vector>
|
||||
|
||||
#include "boost/uuid/uuid.hpp"
|
||||
#include "coordinator/coordinator.hpp"
|
||||
#include "coordinator/coordinator_client.hpp"
|
||||
#include "coordinator/coordinator_rsm.hpp"
|
||||
|
@ -43,9 +43,7 @@ class SimulatedInterpreter {
|
||||
~SimulatedInterpreter() = default;
|
||||
|
||||
void InstallSimulatorTicker(Simulator &simulator) {
|
||||
std::function<bool()> tick_simulator = simulator.GetSimulatorTickClosure();
|
||||
auto *request_router = interpreter_->GetRequestRouter();
|
||||
request_router->InstallSimulatorTicker(tick_simulator);
|
||||
interpreter_->InstallSimulatorTicker(simulator.GetSimulatorTickClosure());
|
||||
}
|
||||
|
||||
std::vector<ResultStream> RunQueries(const std::vector<std::string> &queries) {
|
||||
@ -65,14 +63,8 @@ class SimulatedInterpreter {
|
||||
std::map<std::string, memgraph::storage::v3::PropertyValue> params;
|
||||
const std::string *username = nullptr;
|
||||
|
||||
interpreter_->BeginTransaction();
|
||||
|
||||
auto *rr = interpreter_->GetRequestRouter();
|
||||
rr->StartTransaction();
|
||||
|
||||
interpreter_->Prepare(query, params, username);
|
||||
interpreter_->PullAll(&stream);
|
||||
interpreter_->CommitTransaction();
|
||||
|
||||
return stream;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user