1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

replace boost::shared_array<T> to std::shared_ptr<T[]>

This commit is contained in:
Leonid Fedorov
2023-04-14 10:33:27 +00:00
parent a508b86091
commit c2d0fa24da
54 changed files with 190 additions and 200 deletions

View File

@ -312,11 +312,11 @@ void BatchPrimitiveProcessor::initBPP(ByteStream& bs)
// cout << "joinerCount = " << joinerCount << endl;
joinTypes.reset(new JoinType[joinerCount]);
tJoiners.reset(new boost::shared_array<boost::shared_ptr<TJoiner> >[joinerCount]);
tJoiners.reset(new std::shared_ptr<boost::shared_ptr<TJoiner>[]>[joinerCount]);
for (uint j = 0; j < joinerCount; ++j)
tJoiners[j].reset(new boost::shared_ptr<TJoiner>[processorThreads]);
tlJoiners.reset(new boost::shared_array<boost::shared_ptr<TLJoiner> >[joinerCount]);
tlJoiners.reset(new std::shared_ptr<boost::shared_ptr<TLJoiner>[]>[joinerCount]);
for (uint j = 0; j < joinerCount; ++j)
tlJoiners[j].reset(new boost::shared_ptr<TLJoiner>[processorThreads]);
@ -716,7 +716,7 @@ void BatchPrimitiveProcessor::addToJoiner(ByteStream& bs)
}
else
{
boost::shared_array<boost::shared_ptr<TJoiner> > tJoiner = tJoiners[joinerNum];
std::shared_ptr<boost::shared_ptr<TJoiner>[]> tJoiner = tJoiners[joinerNum];
uint64_t nullValue = joinNullValues[joinerNum];
bool& l_doMatchNulls = doMatchNulls[joinerNum];
joblist::JoinType joinType = joinTypes[joinerNum];
@ -997,7 +997,7 @@ void BatchPrimitiveProcessor::initProcessor()
joinFERG->initRow(&joinFERow, true);
joinFERowData.reset(new uint8_t[joinFERow.getSize()]);
joinFERow.setData(rowgroup::Row::Pointer(joinFERowData.get()));
joinFEMappings.reset(new shared_array<int>[joinerCount + 1]);
joinFEMappings.reset(new std::shared_ptr<int[]>[joinerCount + 1]);
for (i = 0; i < joinerCount; i++)
joinFEMappings[i] = makeMapping(smallSideRGs[i], *joinFERG);
@ -1059,7 +1059,7 @@ void BatchPrimitiveProcessor::initProcessor()
baseJRowMem.reset(new uint8_t[baseJRow.getSize()]);
baseJRow.setData(rowgroup::Row::Pointer(baseJRowMem.get()));
gjrgMappings.reset(new shared_array<int>[joinerCount + 1]);
gjrgMappings.reset(new std::shared_ptr<int[]>[joinerCount + 1]);
for (i = 0; i < joinerCount; i++)
gjrgMappings[i] = makeMapping(smallSideRGs[i], joinedRG);

View File

@ -304,8 +304,8 @@ class BatchPrimitiveProcessor
/* RowGroup support */
rowgroup::RowGroup outputRG;
boost::scoped_ptr<rowgroup::RGData> outRowGroupData;
boost::shared_array<int> rgMap; // maps input cols to output cols
boost::shared_array<int> projectionMap; // maps the projection steps to the output RG
std::shared_ptr<int[]> rgMap; // maps input cols to output cols
std::shared_ptr<int[]> projectionMap; // maps the projection steps to the output RG
bool hasRowGroup;
/* Rowgroups + join */
@ -331,40 +331,40 @@ class BatchPrimitiveProcessor
boost::scoped_array<uint8_t> baseJRowMem;
boost::scoped_ptr<rowgroup::RGData> joinedRGMem;
boost::scoped_array<rowgroup::Row> smallRows;
boost::shared_array<boost::shared_array<int>> gjrgMappings;
std::shared_ptr<std::shared_ptr<int[]>[]> gjrgMappings;
boost::shared_array<boost::shared_array<boost::shared_ptr<TJoiner>>> tJoiners;
std::shared_ptr<std::shared_ptr<boost::shared_ptr<TJoiner>[]>[]> tJoiners;
typedef std::vector<uint32_t> MatchedData[LOGICAL_BLOCK_RIDS];
boost::shared_array<MatchedData> tSmallSideMatches;
std::shared_ptr<MatchedData[]> tSmallSideMatches;
uint32_t executeTupleJoin(uint32_t startRid);
bool getTupleJoinRowGroupData;
std::vector<rowgroup::RowGroup> smallSideRGs;
rowgroup::RowGroup largeSideRG;
boost::shared_array<rowgroup::RGData> smallSideRowData;
boost::shared_array<rowgroup::RGData> smallNullRowData;
boost::shared_array<rowgroup::Row::Pointer> smallNullPointers;
boost::shared_array<uint64_t> ssrdPos; // this keeps track of position when building smallSideRowData
boost::shared_array<uint32_t> smallSideRowLengths;
boost::shared_array<joblist::JoinType> joinTypes;
std::shared_ptr<rowgroup::RGData[]> smallSideRowData;
std::shared_ptr<rowgroup::RGData[]> smallNullRowData;
std::shared_ptr<rowgroup::Row::Pointer[]> smallNullPointers;
std::shared_ptr<uint64_t[]> ssrdPos; // this keeps track of position when building smallSideRowData
std::shared_ptr<uint32_t[]> smallSideRowLengths;
std::shared_ptr<joblist::JoinType[]> joinTypes;
uint32_t joinerCount;
boost::shared_array<std::atomic<uint32_t>> tJoinerSizes;
std::shared_ptr<std::atomic<uint32_t>[]> tJoinerSizes;
// LSKC[i] = the column in outputRG joiner i uses as its key column
boost::shared_array<uint32_t> largeSideKeyColumns;
std::shared_ptr<uint32_t[]> largeSideKeyColumns;
// KCPP[i] = true means a joiner uses projection step i as a key column
boost::shared_array<bool> keyColumnProj;
std::shared_ptr<bool[]> keyColumnProj;
rowgroup::Row oldRow, newRow; // used by executeTupleJoin()
boost::shared_array<uint64_t> joinNullValues;
boost::shared_array<bool> doMatchNulls;
std::shared_ptr<uint64_t[]> joinNullValues;
std::shared_ptr<bool[]> doMatchNulls;
boost::scoped_array<boost::scoped_ptr<funcexp::FuncExpWrapper>> joinFEFilters;
bool hasJoinFEFilters;
bool hasSmallOuterJoin;
/* extra typeless join vars & fcns*/
boost::shared_array<bool> typelessJoin;
boost::shared_array<std::vector<uint32_t>> tlLargeSideKeyColumns;
std::shared_ptr<bool[]> typelessJoin;
std::shared_ptr<std::vector<uint32_t>[]> tlLargeSideKeyColumns;
std::shared_ptr<std::vector<uint32_t>> tlSmallSideKeyColumns;
boost::shared_array<boost::shared_array<boost::shared_ptr<TLJoiner>>> tlJoiners;
boost::shared_array<uint32_t> tlSmallSideKeyLengths;
std::shared_ptr<std::shared_ptr<boost::shared_ptr<TLJoiner>[]>[]> tlJoiners;
std::shared_ptr<uint32_t[]> tlSmallSideKeyLengths;
// True if smallSide and largeSide TypelessData key column differs,e.g BIGINT vs DECIMAL(38).
bool mJOINHasSkewedKeyColumn;
const rowgroup::RowGroup* mSmallSideRGPtr;
@ -372,7 +372,7 @@ class BatchPrimitiveProcessor
inline void getJoinResults(const rowgroup::Row& r, uint32_t jIndex, std::vector<uint32_t>& v);
// these allocators hold the memory for the keys stored in tlJoiners
boost::shared_array<utils::PoolAllocator> storedKeyAllocators;
std::shared_ptr<utils::PoolAllocator[]> storedKeyAllocators;
/* PM Aggregation */
rowgroup::RowGroup joinedRG; // if there's a join, the rows are formatted with this
@ -393,9 +393,9 @@ class BatchPrimitiveProcessor
boost::scoped_array<uint8_t> joinFERowData;
boost::scoped_ptr<rowgroup::RGData> fe1Data,
fe2Data; // can probably make these RGDatas not pointers to RGDatas
boost::shared_array<int> projectForFE1;
boost::shared_array<int> fe1ToProjection, fe2Mapping; // RG mappings
boost::scoped_array<boost::shared_array<int>> joinFEMappings;
std::shared_ptr<int[]> projectForFE1;
std::shared_ptr<int[]> fe1ToProjection, fe2Mapping; // RG mappings
boost::scoped_array<std::shared_ptr<int[]>> joinFEMappings;
rowgroup::Row fe1In, fe1Out, fe2In, fe2Out, joinFERow;
bool hasDictStep;