-
Notifications
You must be signed in to change notification settings - Fork 4k
GH-41329: [C++][Gandiva] Fix gandiva cache size env var #41330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
73f3603
156bb1d
7f712fd
78e7640
915d731
064bb78
fdca72d
77a71a7
032169e
869945e
d3aa5e9
0b491bc
eaaa659
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,14 +20,27 @@ | |
| #include <cstdlib> | ||
| #include <mutex> | ||
|
|
||
| #include "arrow/util/macros.h" | ||
| #include "gandiva/lru_cache.h" | ||
| #include "gandiva/visibility.h" | ||
|
|
||
| namespace gandiva { | ||
|
|
||
| namespace internal { | ||
| // Only called once by GetCacheCapacity(). | ||
| // Do the actual work of getting the cache capacity from env var. | ||
| // Also makes the testing easier. | ||
|
||
| GANDIVA_EXPORT | ||
| int GetCacheCapacityFromEnvVar(); | ||
| } // namespace internal | ||
|
|
||
| ARROW_DEPRECATED("Deprecated in 17.0.0. Use GetCacheCapacity instead.") | ||
| GANDIVA_EXPORT | ||
| int GetCapacity(); | ||
|
||
|
|
||
| GANDIVA_EXPORT | ||
| int GetCacheCapacity(); | ||
|
|
||
| GANDIVA_EXPORT | ||
| void LogCacheSize(size_t capacity); | ||
|
|
||
|
|
@@ -36,7 +49,7 @@ class Cache { | |
| public: | ||
| explicit Cache(size_t capacity) : cache_(capacity) { LogCacheSize(capacity); } | ||
|
|
||
| Cache() : Cache(GetCapacity()) {} | ||
| Cache() : Cache(GetCacheCapacity()) {} | ||
|
|
||
| ValueType GetObjectCode(const KeyType& cache_key) { | ||
| std::optional<ValueType> result; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the parsing according to the recommendation from #41335 (comment)