diff --git a/cpp/velox/memory/VeloxMemoryManager.cc b/cpp/velox/memory/VeloxMemoryManager.cc index 0a57d6a997d8..6b5606dd228e 100644 --- a/cpp/velox/memory/VeloxMemoryManager.cc +++ b/cpp/velox/memory/VeloxMemoryManager.cc @@ -63,11 +63,18 @@ class ListenableArbitrator : public velox::memory::MemoryArbitrator { ListenableArbitrator(const Config& config, AllocationListener* listener) : MemoryArbitrator(config), listener_(listener), - memoryPoolInitialCapacity_( - getConfig(config.extraConfigs, kMemoryPoolInitialCapacity, kDefaultMemoryPoolInitialCapacity)), - memoryPoolTransferCapacity_( - getConfig(config.extraConfigs, kMemoryPoolTransferCapacity, kDefaultMemoryPoolTransferCapacity)) { - } + memoryPoolInitialCapacity_(velox::config::toCapacity( + getConfig( + config.extraConfigs, + kMemoryPoolInitialCapacity, + std::to_string(kDefaultMemoryPoolInitialCapacity)), + velox::config::CapacityUnit::BYTE)), + memoryPoolTransferCapacity_(velox::config::toCapacity( + getConfig( + config.extraConfigs, + kMemoryPoolTransferCapacity, + std::to_string(kDefaultMemoryPoolTransferCapacity)), + velox::config::CapacityUnit::BYTE)) {} std::string kind() const override { return kind_; } diff --git a/cpp/velox/shuffle/GlutenByteStream.h b/cpp/velox/shuffle/GlutenByteStream.h index 2458581d56d7..78ea7b905adc 100644 --- a/cpp/velox/shuffle/GlutenByteStream.h +++ b/cpp/velox/shuffle/GlutenByteStream.h @@ -25,7 +25,8 @@ class GlutenByteInputStream : public ByteInputStream { GlutenByteInputStream() {} public: - explicit GlutenByteInputStream(std::vector ranges) : ranges_{std::move(ranges)} { + explicit GlutenByteInputStream(std::vector ranges) { + ranges_ = std::move(ranges); VELOX_CHECK(!ranges_.empty()); current_ = &ranges_[0]; } @@ -37,8 +38,7 @@ class GlutenByteInputStream : public ByteInputStream { GlutenByteInputStream& operator=(const GlutenByteInputStream& other) = delete; /// Enable move constructor. - GlutenByteInputStream(GlutenByteInputStream&& other) noexcept - : ranges_{std::move(other.ranges_)}, current_{other.current_} {} + GlutenByteInputStream(GlutenByteInputStream&& other) noexcept = delete; /// Enable move assignment operator. GlutenByteInputStream& operator=(GlutenByteInputStream&& other) noexcept { @@ -249,12 +249,6 @@ class GlutenByteInputStream : public ByteInputStream { ranges_[0] = range; current_ = ranges_.data(); } - - private: - std::vector ranges_; - - // Pointer to the current element of 'ranges_'. - ByteRange* current_{nullptr}; }; template <> diff --git a/cpp/velox/tests/MemoryManagerTest.cc b/cpp/velox/tests/MemoryManagerTest.cc index bb102dc2d8c3..d768c9690aae 100644 --- a/cpp/velox/tests/MemoryManagerTest.cc +++ b/cpp/velox/tests/MemoryManagerTest.cc @@ -331,7 +331,9 @@ class MultiMemoryManagerTest : public ::testing::Test { std::unordered_map conf = { {kMemoryReservationBlockSize, std::to_string(kMemoryReservationBlockSizeDefault)}, {kVeloxMemInitCapacity, std::to_string(kVeloxMemInitCapacityDefault)}}; + std::cout << "create the velox backend" << std::endl; gluten::VeloxBackend::create(conf); + std::cout << "created the velox backend" << std::endl; } std::unique_ptr newVeloxMemoryManager(std::unique_ptr listener) {