Skip to content

Commit

Permalink
Remove unused Operator::memoryPool (facebookincubator#294)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: facebookincubator#294

Reviewed By: amitkdutta

Differential Revision: D31170377

Pulled By: mbasmanova

fbshipit-source-id: 0f67789fe7ed05ebf8573a6eea5782c60013cc16
  • Loading branch information
mbasmanova authored and facebook-github-bot committed Sep 24, 2021
1 parent 79c395d commit 10de4e4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
13 changes: 1 addition & 12 deletions velox/exec/Driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,22 +82,11 @@ struct DriverCtx {
int _pipelineId,
int32_t numDrivers);

velox::memory::MemoryPool* FOLLY_NONNULL addOperatorUserPool() {
velox::memory::MemoryPool* FOLLY_NONNULL addOperatorPool() {
opMemPools_.push_back(execCtx->pool()->addScopedChild("operator_ctx"));
return opMemPools_.back().get();
}

velox::memory::MemoryPool* FOLLY_NONNULL
addOperatorSystemPool(velox::memory::MemoryPool* FOLLY_NONNULL userPool) {
auto poolPtr = userPool->addScopedChild("operator_ctx");
poolPtr->setMemoryUsageTracker(
userPool->getMemoryUsageTracker()->addChild(true));
auto pool = poolPtr.get();
opMemPools_.push_back(std::move(poolPtr));

return pool;
}

std::unique_ptr<connector::ConnectorQueryCtx> createConnectorQueryCtx(
const std::string& connectorId) const;

Expand Down
11 changes: 1 addition & 10 deletions velox/exec/Operator.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,19 +154,12 @@ struct OperatorStats {
class OperatorCtx {
public:
explicit OperatorCtx(DriverCtx* driverCtx)
: driverCtx_(driverCtx), pool_(driverCtx_->addOperatorUserPool()) {}
: driverCtx_(driverCtx), pool_(driverCtx_->addOperatorPool()) {}

velox::memory::MemoryPool* pool() const {
return pool_;
}

velox::memory::MemoryPool* systemPool() const {
if (!systemMemPool_) {
systemMemPool_ = driverCtx_->addOperatorSystemPool(pool_);
}
return systemMemPool_;
}

memory::MappedMemory* mappedMemory() const;

const std::shared_ptr<Task>& task() const {
Expand Down Expand Up @@ -196,9 +189,7 @@ class OperatorCtx {
velox::memory::MemoryPool* pool_;

// These members are created on demand.
mutable velox::memory::MemoryPool* systemMemPool_{nullptr};
mutable std::shared_ptr<memory::MappedMemory> mappedMemory_;
mutable std::shared_ptr<memory::MappedMemory> recoverableMappedMemory_;
};

// Query operator
Expand Down

0 comments on commit 10de4e4

Please sign in to comment.