1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-08 14:22:09 +03:00

chore(): cleanup.

This commit is contained in:
drrtuy
2025-04-29 19:18:13 +00:00
parent 828d1dc4f7
commit 42ab6201f8
8 changed files with 22 additions and 110 deletions

View File

@@ -25,8 +25,6 @@
#include <boost/smart_ptr/allocate_shared_array.hpp>
#include <boost/smart_ptr/make_shared_array.hpp>
#include <iostream>
#include "poolallocator.h"
using namespace std;
@@ -36,7 +34,6 @@ namespace utils
{
PoolAllocator& PoolAllocator::operator=(const PoolAllocator& v)
{
std::cout << "PoolAllocator copy assignment" << std::endl;
allocSize = v.allocSize;
tmpSpace = v.tmpSpace;
useLock = v.useLock;
@@ -61,7 +58,6 @@ void PoolAllocator::newBlock()
{
if (alloc)
{
mem.emplace_back(boost::allocate_shared<PoolAllocatorBufType>(*alloc, allocSize));
}
else

View File

@@ -33,8 +33,6 @@
#include <map>
#include <memory>
#include <iostream>
#include <boost/smart_ptr/allocate_shared_array.hpp>

View File

@@ -43,19 +43,13 @@ constexpr const size_t DEFAULT_BUCKET_COUNT = 10;
template <typename HashTable>
std::unique_ptr<HashTable> makeHashMap(size_t bucketCount, ResourceManager* resourceManager)
{
// auto alloc = resourceManager->getAllocator<T>();
// return std::unique_ptr<T>(new T(bucketCount, TupleJoiner::hasher(), typename T::key_equal(), alloc));
// std::cout << " makeHashMap " << std::endl;
return std::unique_ptr<HashTable>(new HashTable(bucketCount, TupleJoiner::hasher(),
typename HashTable::key_equal(),
// resourceManager->getAllocator<typename HashTable::value_type>()));
utils::STLPoolAllocator<typename HashTable::value_type>(resourceManager)));
}
void TupleJoiner::initRowsVector()
{
// auto alloc = resourceManager_->getAllocator<rowgroup::Row::Pointer>();
// rows.reset(new RowPointersVec(alloc));
rows.reset(new RowPointersVec(resourceManager_->getAllocator<rowgroup::Row::Pointer>()));
}
@@ -65,9 +59,6 @@ void TupleJoiner::initHashMaps(uint32_t& smallJoinColumn)
{
for (size_t i = 0; i < bucketCount; i++)
{
// auto alloc = resourceManager_->getAllocator<pair<const TypelessData, Row::Pointer>>();
// ht.emplace_back(std::unique_ptr<typelesshash_t>(
// new typelesshash_t(DEFAULT_BUCKET_COUNT, hasher(), typelesshash_t::key_equal(), alloc)));
ht.emplace_back(makeHashMap<typelesshash_t>(DEFAULT_BUCKET_COUNT, resourceManager_));
}
}
@@ -75,9 +66,6 @@ void TupleJoiner::initHashMaps(uint32_t& smallJoinColumn)
{
for (size_t i = 0; i < bucketCount; i++)
{
// auto alloc = resourceManager_->getAllocator<pair<const long double, Row::Pointer>>();
// ld.emplace_back(std::unique_ptr<ldhash_t>(
// new ldhash_t(DEFAULT_BUCKET_COUNT, hasher(), ldhash_t::key_equal(), alloc)));
ld.emplace_back(makeHashMap<ldhash_t>(DEFAULT_BUCKET_COUNT, resourceManager_));
}
}
@@ -85,9 +73,6 @@ void TupleJoiner::initHashMaps(uint32_t& smallJoinColumn)
{
for (size_t i = 0; i < bucketCount; i++)
{
// auto alloc = resourceManager_->getAllocator<pair<const int64_t, Row::Pointer>>();
// sth.emplace_back(std::unique_ptr<sthash_t>(
// new sthash_t(DEFAULT_BUCKET_COUNT, hasher(), sthash_t::key_equal(), alloc)));
sth.emplace_back(makeHashMap<sthash_t>(DEFAULT_BUCKET_COUNT, resourceManager_));
}
}
@@ -95,9 +80,6 @@ void TupleJoiner::initHashMaps(uint32_t& smallJoinColumn)
{
for (size_t i = 0; i < bucketCount; i++)
{
// auto alloc = resourceManager_->getAllocator<pair<const int64_t, uint8_t*>>();
// h.emplace_back(
// std::unique_ptr<hash_t>(new hash_t(DEFAULT_BUCKET_COUNT, hasher(), hash_t::key_equal(), alloc)));
h.emplace_back(makeHashMap<hash_t>(DEFAULT_BUCKET_COUNT, resourceManager_));
}
}

View File

@@ -476,50 +476,13 @@ class TupleJoiner
void initHashMaps(uint32_t& smallJoinColumn);
void clearHashMaps();
private:
// typedef std::unordered_multimap<int64_t, uint8_t*, hasher, std::equal_to<int64_t>,
// allocators::CountingAllocator<std::pair<const int64_t, uint8_t*>>>
// hash_t;
// typedef std::unordered_multimap<
// int64_t, rowgroup::Row::Pointer, hasher, std::equal_to<int64_t>,
// allocators::CountingAllocator<std::pair<const int64_t, rowgroup::Row::Pointer>>>
// sthash_t;
// typedef std::unordered_multimap<
// TypelessData, rowgroup::Row::Pointer, hasher, std::equal_to<TypelessData>,
// allocators::CountingAllocator<std::pair<const TypelessData, rowgroup::Row::Pointer>>>
// typelesshash_t;
// // MCOL-1822 Add support for Long Double AVG/SUM small side
// typedef std::unordered_multimap<
// long double, rowgroup::Row::Pointer, hasher, LongDoubleEq,
// allocators::CountingAllocator<std::pair<const long double, rowgroup::Row::Pointer>>>
// ldhash_t;
template<typename K, typename V>
using HashMapTemplate = std::unordered_multimap<K, V, hasher, std::equal_to<K>,
utils::STLPoolAllocator<std::pair<const K, V>>>;
// template<typename K, typename V>
// using HashMapTemplate = std::unordered_multimap<K, V, hasher, std::equal_to<K>,
// allocators::CountingAllocator<std::pair<const K, V>>>;
using hash_t = HashMapTemplate<int64_t, uint8_t*>;
using sthash_t = HashMapTemplate<int64_t, rowgroup::Row::Pointer>;
using typelesshash_t = HashMapTemplate<TypelessData, rowgroup::Row::Pointer>;
using ldhash_t = HashMapTemplate<long double, rowgroup::Row::Pointer>;
// typedef std::unordered_multimap<int64_t, uint8_t*, hasher,td::equal_to<int64_t>,
// utils::STLPoolAllocator<std::pair<const int64_t, uint8_t*>>>
// hash_t;
// typedef std::unordered_multimap<
// int64_t, rowgroup::Row::Pointer, hasher, std::equal_to<int64_t>,
// utils::STLPoolAllocator<std::pair<const int64_t, rowgroup::Row::Pointer>>>
// sthash_t;
// typedef std::unordered_multimap<
// TypelessData, rowgroup::Row::Pointer, hasher, std::equal_to<TypelessData>,
// utils::STLPoolAllocator<std::pair<const TypelessData, rowgroup::Row::Pointer>>>
// typelesshash_t;
// MCOL-1822 Add support for Long Double AVG/SUM small side
// typedef std::unordered_multimap<
// long double, rowgroup::Row::Pointer, hasher, LongDoubleEq,
// utils::STLPoolAllocator<std::pair<const long double, rowgroup::Row::Pointer>>>
// ldhash_t;
typedef hash_t::iterator iterator;
typedef typelesshash_t::iterator thIterator;

View File

@@ -776,12 +776,11 @@ void IdbOrderBy::initialize(const RowGroup& rg)
// These two blocks contain structs with memory accounting.
fOrderByQueue.reset(new SortingPQ(rowgroup::rgCommonSize, fRm->getAllocator<OrderByRow>()));
// WIP
// if (fDistinct)
// {
// fDistinctMap.reset(new DistinctMap_t(10, Hasher(this, getKeyLength()), Eq(this, getKeyLength()),
// utils::STLPoolAllocator<rowgroup::Row::Pointer>(fRm)));
// }
if (fDistinct)
{
fDistinctMap.reset(new DistinctMap_t(10, Hasher(this, getKeyLength()), Eq(this, getKeyLength()),
utils::STLPoolAllocator<rowgroup::Row::Pointer>(fRm)));
}
}
bool IdbOrderBy::getData(RGData& data)