1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

feat(): propagate long strings SP type change

This commit is contained in:
drrtuy
2024-12-04 23:45:05 +00:00
parent 789a382be2
commit 937d09768b
7 changed files with 71 additions and 30 deletions

View File

@ -180,17 +180,17 @@ void ByteStream::growBuf(uint32_t toSize)
}
}
std::vector<std::shared_ptr<uint8_t[]>>& ByteStream::getLongStrings()
std::vector<rowgroup::StringStoreBufSPType>& ByteStream::getLongStrings()
{
return longStrings;
}
const std::vector<std::shared_ptr<uint8_t[]>>& ByteStream::getLongStrings() const
const std::vector<rowgroup::StringStoreBufSPType>& ByteStream::getLongStrings() const
{
return longStrings;
}
void ByteStream::setLongStrings(const std::vector<std::shared_ptr<uint8_t[]>>& other)
void ByteStream::setLongStrings(const std::vector<rowgroup::StringStoreBufSPType>& other)
{
longStrings = other;
}

View File

@ -37,6 +37,7 @@
#include "serializeable.h"
#include "any.hpp"
#include "countingallocator.h"
#include "buffertypes.h"
class ByteStreamTestSuite;
@ -437,9 +438,9 @@ class ByteStream : public Serializeable
3 * sizeof(uint32_t); // space for the BS magic & length & number of long strings.
// Methods to get and set `long strings`.
EXPORT std::vector<std::shared_ptr<uint8_t[]>>& getLongStrings();
EXPORT const std::vector<std::shared_ptr<uint8_t[]>>& getLongStrings() const;
EXPORT void setLongStrings(const std::vector<std::shared_ptr<uint8_t[]>>& other);
EXPORT std::vector<rowgroup::StringStoreBufSPType>& getLongStrings();
EXPORT const std::vector<rowgroup::StringStoreBufSPType>& getLongStrings() const;
EXPORT void setLongStrings(const std::vector<rowgroup::StringStoreBufSPType>& other);
friend class ::ByteStreamTestSuite;
@ -474,7 +475,7 @@ class ByteStream : public Serializeable
BSBufType* fCurOutPtr; // the point in fBuf where data is extracted from next
uint32_t fMaxLen; // how big fBuf is currently
// Stores `long strings`.
std::vector<std::shared_ptr<uint8_t[]>> longStrings;
std::vector<rowgroup::StringStoreBufSPType> longStrings;
allocators::CountingAllocator<BSBufType>* allocator = nullptr;
};

View File

@ -515,7 +515,7 @@ const SBS InetStreamSocket::read(const struct ::timespec* timeout, bool* isTimeO
return SBS(new ByteStream(0U));
res->advanceInputPtr(msglen);
std::vector<std::shared_ptr<uint8_t[]>> longStrings;
std::vector<rowgroup::StringStoreBufSPType> longStrings;
try
{
for (uint32_t i = 0; i < longStringSize; ++i)
@ -527,7 +527,8 @@ const SBS InetStreamSocket::read(const struct ::timespec* timeout, bool* isTimeO
return SBS(new ByteStream(0U));
// Allocate new memory for the `long string`.
std::shared_ptr<uint8_t[]> longString(
// WIP must account this allocation also.
rowgroup::StringStoreBufSPType longString(
new uint8_t[sizeof(rowgroup::StringStore::MemChunk) + memChunk.currentSize]);
uint8_t* longStringData = longString.get();