Skip to content
This repository was archived by the owner on May 9, 2024. It is now read-only.

Commit 6445b15

Browse files
committed
Move CalciteMgr::get impl into cpp file
Prevent python code from seeing static instance variable.
1 parent f8e5004 commit 6445b15

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

omniscidb/Calcite/CalciteJNI.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,14 @@ CalciteMgr::~CalciteMgr() {
572572
worker_.join();
573573
}
574574

575+
CalciteMgr* CalciteMgr::get(const std::string& udf_filename, size_t calcite_max_mem_mb) {
576+
std::call_once(instance_init_flag_, [=] {
577+
instance_ =
578+
std::unique_ptr<CalciteMgr>(new CalciteMgr(udf_filename, calcite_max_mem_mb));
579+
});
580+
return instance_.get();
581+
}
582+
575583
std::string CalciteMgr::process(
576584
const std::string& db_name,
577585
const std::string& sql_string,

omniscidb/Calcite/CalciteJNI.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,7 @@ class CalciteMgr {
4343
~CalciteMgr();
4444

4545
static CalciteMgr* get(const std::string& udf_filename = "",
46-
size_t calcite_max_mem_mb = 1024) {
47-
std::call_once(instance_init_flag_, [=] {
48-
instance_ =
49-
std::unique_ptr<CalciteMgr>(new CalciteMgr(udf_filename, calcite_max_mem_mb));
50-
});
51-
return instance_.get();
52-
}
46+
size_t calcite_max_mem_mb = 1024);
5347

5448
std::string process(const std::string& db_name,
5549
const std::string& sql_string,

0 commit comments

Comments
 (0)