You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
feat(): zerocopy TNS case and JOIN results RGData with CountingAllocator
This commit is contained in:
@ -35,8 +35,8 @@ namespace allocators
|
||||
// When a sync op hits MemoryLimitLowerBound trying to allocate more memory, it throws.
|
||||
// SQL operators or TBPS runtime must catch the exception and act acordingly.
|
||||
|
||||
const constexpr std::int64_t MemoryLimitLowerBound = 500 * 1024 * 1024; // WIP
|
||||
const constexpr std::int64_t CheckPointStepSize = 100 * 1024 * 1024; // WIP
|
||||
const constexpr int64_t MemoryLimitLowerBound = 500 * 1024 * 1024; // WIP
|
||||
const constexpr int64_t CheckPointStepSize = 100 * 1024 * 1024; // WIP
|
||||
|
||||
// Custom Allocator that tracks allocated memory using an atomic counter
|
||||
template <typename T>
|
||||
@ -88,8 +88,8 @@ class CountingAllocator
|
||||
|
||||
// Constructor accepting a reference to an atomic counter
|
||||
explicit CountingAllocator(std::atomic<int64_t>* memoryLimit,
|
||||
const uint64_t lowerBound = MemoryLimitLowerBound,
|
||||
const uint64_t checkPointStepSize = CheckPointStepSize) noexcept
|
||||
const int64_t checkPointStepSize = CheckPointStepSize,
|
||||
const int64_t lowerBound = MemoryLimitLowerBound) noexcept
|
||||
: memoryLimit_(memoryLimit), memoryLimitLowerBound_(lowerBound), checkPointStepSize_(checkPointStepSize)
|
||||
{
|
||||
}
|
||||
|
@ -305,6 +305,12 @@ void UserDataStore::deserialize(ByteStream& bs)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
RGData::RGData(allocators::CountingAllocator<RGDataBufType>& _alloc) : RGData()
|
||||
{
|
||||
alloc = _alloc;
|
||||
}
|
||||
|
||||
RGData::RGData(const RowGroup& rg, uint32_t rowCount)
|
||||
{
|
||||
RGDataSizeType s = rg.getDataSize(rowCount);
|
||||
|
@ -262,6 +262,7 @@ class RGData
|
||||
{
|
||||
public:
|
||||
RGData() = default; // useless unless followed by an = or a deserialize operation
|
||||
RGData(allocators::CountingAllocator<RGDataBufType>&);
|
||||
RGData(const RowGroup& rg, uint32_t rowCount); // allocates memory for rowData
|
||||
explicit RGData(const RowGroup& rg);
|
||||
explicit RGData(const RowGroup& rg, allocators::CountingAllocator<RGDataBufType>& alloc);
|
||||
|
Reference in New Issue
Block a user