Skip to content

Commit

Permalink
Avoid RuntimeParameters() in header
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinTF committed Feb 10, 2025
1 parent 1722daa commit 229f7f6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ add_library(engine
CartesianProductJoin.cpp TextIndexScanForWord.cpp TextIndexScanForEntity.cpp
TextLimit.cpp LazyGroupBy.cpp GroupByHashMapOptimization.cpp SpatialJoin.cpp
CountConnectedSubgraphs.cpp SpatialJoinAlgorithms.cpp PathSearch.cpp ExecuteUpdate.cpp
Describe.cpp GraphStoreProtocol.cpp)
Describe.cpp GraphStoreProtocol.cpp
QueryExecutionContext.cpp)
qlever_target_link_libraries(engine util index parser sparqlExpressions http SortPerformanceEstimator Boost::iostreams s2)
11 changes: 11 additions & 0 deletions src/engine/QueryExecutionContext.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright 2025, University of Freiburg,
// Chair of Algorithms and Data Structures.
// Author: Robin Textor-Falconi <[email protected]>

#include "engine/QueryExecutionContext.h"

#include "global/RuntimeParameters.h"

bool QueryExecutionContext::areWebSocketUpdatesEnabled() {
return RuntimeParameters().get<"websocket-updates-enabled">();
}
7 changes: 4 additions & 3 deletions src/engine/QueryExecutionContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "engine/RuntimeInformation.h"
#include "engine/SortPerformanceEstimator.h"
#include "global/Id.h"
#include "global/RuntimeParameters.h"
#include "index/DeltaTriples.h"
#include "index/Index.h"
#include "util/Cache.h"
Expand Down Expand Up @@ -149,6 +148,9 @@ class QueryExecutionContext {
return areWebsocketUpdatesEnabled_;
}

private:
static bool areWebSocketUpdatesEnabled();

private:
const Index& _index;

Expand All @@ -166,6 +168,5 @@ class QueryExecutionContext {
std::function<void(std::string)> updateCallback_;
// Cache the state of that runtime parameter to reduce the contention of the
// mutex.
bool areWebsocketUpdatesEnabled_ =
RuntimeParameters().get<"websocket-updates-enabled">();
bool areWebsocketUpdatesEnabled_ = areWebSocketUpdatesEnabled();
};
2 changes: 1 addition & 1 deletion src/engine/QueryExecutionTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <vector>

#include "engine/Sort.h"
#include "parser/RdfEscaping.h"
#include "global/RuntimeParameters.h"

using std::string;

Expand Down

0 comments on commit 229f7f6

Please sign in to comment.