Skip to content

Commit

Permalink
feat(remote-function): Allow passing memory pool (#12147)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #12147

Sending this in separate since this needs to be synced with Github.

Reviewed By: pedroerp

Differential Revision: D68510130

fbshipit-source-id: 98b382a43ed5bdbd5548e4e8f4e8c19101ae3692
  • Loading branch information
Guilherme Kunigami authored and facebook-github-bot committed Jan 24, 2025
1 parent b0a5ef8 commit 292ea9d
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions velox/functions/remote/server/RemoteFunctionService.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,14 @@ class RemoteFunctionServiceHandler
: virtual public apache::thrift::ServiceHandler<
remote::RemoteFunctionService> {
public:
RemoteFunctionServiceHandler(const std::string& functionPrefix = "")
: functionPrefix_(functionPrefix) {}
RemoteFunctionServiceHandler(
const std::string& functionPrefix = "",
std::shared_ptr<memory::MemoryPool> pool = nullptr)
: functionPrefix_(functionPrefix), pool_(std::move(pool)) {
if (pool_ == nullptr) {
pool_ = memory::memoryManager()->addLeafPool();
}
}

void invokeFunction(
remote::RemoteFunctionResponse& response,
Expand All @@ -47,9 +53,8 @@ class RemoteFunctionServiceHandler
exec::EvalErrors* evalErrors,
const std::unique_ptr<VectorSerde>& serde) const;

std::shared_ptr<memory::MemoryPool> pool_{
memory::memoryManager()->addLeafPool()};
const std::string functionPrefix_;
std::shared_ptr<memory::MemoryPool> pool_;
};

} // namespace facebook::velox::functions

0 comments on commit 292ea9d

Please sign in to comment.