You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-29 08:21:15 +03:00
[MCOL-5265] Change boost:shared_ptr to std::shared_ptr.
This is attempt to make some part of the code more stable. For some reason we can get a spurious nullptr for boost::shared_ptr which cause an assert and abort.
This commit is contained in:
@ -1362,7 +1362,7 @@ void BatchPrimitiveProcessorJL::destroyBPP(ByteStream& bs) const
|
|||||||
bs << uniqueID;
|
bs << uniqueID;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BatchPrimitiveProcessorJL::useJoiners(const vector<boost::shared_ptr<joiner::TupleJoiner> >& j)
|
void BatchPrimitiveProcessorJL::useJoiners(const vector<std::shared_ptr<joiner::TupleJoiner> >& j)
|
||||||
{
|
{
|
||||||
pos = 0;
|
pos = 0;
|
||||||
joinerNum = 0;
|
joinerNum = 0;
|
||||||
|
@ -209,7 +209,7 @@ class BatchPrimitiveProcessorJL
|
|||||||
void setJoinedRowGroup(const rowgroup::RowGroup& rg);
|
void setJoinedRowGroup(const rowgroup::RowGroup& rg);
|
||||||
|
|
||||||
/* Tuple hashjoin */
|
/* Tuple hashjoin */
|
||||||
void useJoiners(const std::vector<boost::shared_ptr<joiner::TupleJoiner> >&);
|
void useJoiners(const std::vector<std::shared_ptr<joiner::TupleJoiner> >&);
|
||||||
bool nextTupleJoinerMsg(messageqcpp::ByteStream&);
|
bool nextTupleJoinerMsg(messageqcpp::ByteStream&);
|
||||||
// void setSmallSideKeyColumn(uint32_t col);
|
// void setSmallSideKeyColumn(uint32_t col);
|
||||||
|
|
||||||
@ -348,7 +348,7 @@ class BatchPrimitiveProcessorJL
|
|||||||
rowgroup::RowGroup aggregateRGPM;
|
rowgroup::RowGroup aggregateRGPM;
|
||||||
|
|
||||||
/* UM portion of the PM join alg */
|
/* UM portion of the PM join alg */
|
||||||
std::vector<boost::shared_ptr<joiner::TupleJoiner> > tJoiners;
|
std::vector<std::shared_ptr<joiner::TupleJoiner> > tJoiners;
|
||||||
std::vector<rowgroup::RowGroup> smallSideRGs;
|
std::vector<rowgroup::RowGroup> smallSideRGs;
|
||||||
rowgroup::RowGroup largeSideRG;
|
rowgroup::RowGroup largeSideRG;
|
||||||
std::vector<std::vector<uint32_t> > smallSideKeys;
|
std::vector<std::vector<uint32_t> > smallSideKeys;
|
||||||
|
@ -360,7 +360,7 @@ void DiskJoinStep::joinFcn()
|
|||||||
Row l_joinFERow, l_outputRow, baseRow;
|
Row l_joinFERow, l_outputRow, baseRow;
|
||||||
vector<vector<Row::Pointer> > joinMatches;
|
vector<vector<Row::Pointer> > joinMatches;
|
||||||
boost::shared_array<Row> smallRowTemplates(new Row[1]);
|
boost::shared_array<Row> smallRowTemplates(new Row[1]);
|
||||||
vector<boost::shared_ptr<TupleJoiner> > joiners;
|
vector<std::shared_ptr<TupleJoiner>> joiners;
|
||||||
boost::shared_array<boost::shared_array<int> > colMappings, fergMappings;
|
boost::shared_array<boost::shared_array<int> > colMappings, fergMappings;
|
||||||
boost::scoped_array<boost::scoped_array<uint8_t> > smallNullMem;
|
boost::scoped_array<boost::scoped_array<uint8_t> > smallNullMem;
|
||||||
boost::scoped_array<uint8_t> joinFEMem;
|
boost::scoped_array<uint8_t> joinFEMem;
|
||||||
|
@ -55,7 +55,7 @@ class DiskJoinStep : public JobStep
|
|||||||
boost::shared_ptr<funcexp::FuncExpWrapper> fe;
|
boost::shared_ptr<funcexp::FuncExpWrapper> fe;
|
||||||
bool typeless;
|
bool typeless;
|
||||||
JoinType joinType;
|
JoinType joinType;
|
||||||
boost::shared_ptr<joiner::TupleJoiner> joiner; // the same instance THJS uses
|
std::shared_ptr<joiner::TupleJoiner> joiner; // the same instance THJS uses
|
||||||
|
|
||||||
/* main thread, started by JobStep::run() */
|
/* main thread, started by JobStep::run() */
|
||||||
void mainRunner();
|
void mainRunner();
|
||||||
@ -106,7 +106,7 @@ class DiskJoinStep : public JobStep
|
|||||||
/* Builder structs */
|
/* Builder structs */
|
||||||
struct BuilderOutput
|
struct BuilderOutput
|
||||||
{
|
{
|
||||||
boost::shared_ptr<joiner::TupleJoiner> tupleJoiner;
|
std::shared_ptr<joiner::TupleJoiner> tupleJoiner;
|
||||||
std::vector<rowgroup::RGData> smallData;
|
std::vector<rowgroup::RGData> smallData;
|
||||||
uint64_t partitionID;
|
uint64_t partitionID;
|
||||||
joiner::JoinPartition* jp;
|
joiner::JoinPartition* jp;
|
||||||
|
@ -1101,8 +1101,8 @@ class TupleBPS : public BatchPrimitive, public TupleDeliveryStep
|
|||||||
{
|
{
|
||||||
return uniqueID;
|
return uniqueID;
|
||||||
}
|
}
|
||||||
void useJoiner(boost::shared_ptr<joiner::TupleJoiner>);
|
void useJoiner(std::shared_ptr<joiner::TupleJoiner>);
|
||||||
void useJoiners(const std::vector<boost::shared_ptr<joiner::TupleJoiner>>&);
|
void useJoiners(const std::vector<std::shared_ptr<joiner::TupleJoiner>>&);
|
||||||
bool wasStepRun() const
|
bool wasStepRun() const
|
||||||
{
|
{
|
||||||
return fRunExecuted;
|
return fRunExecuted;
|
||||||
@ -1298,7 +1298,7 @@ class TupleBPS : public BatchPrimitive, public TupleDeliveryStep
|
|||||||
void serializeJoiner();
|
void serializeJoiner();
|
||||||
void serializeJoiner(uint32_t connectionNumber);
|
void serializeJoiner(uint32_t connectionNumber);
|
||||||
|
|
||||||
std::vector<boost::shared_ptr<joiner::TupleJoiner>> tjoiners;
|
std::vector<std::shared_ptr<joiner::TupleJoiner>> tjoiners;
|
||||||
bool doJoin, hasPMJoin, hasUMJoin;
|
bool doJoin, hasPMJoin, hasUMJoin;
|
||||||
std::vector<rowgroup::RowGroup> joinerMatchesRGs; // parses the small-side matches from joiner
|
std::vector<rowgroup::RowGroup> joinerMatchesRGs; // parses the small-side matches from joiner
|
||||||
|
|
||||||
@ -1361,7 +1361,7 @@ class TupleBPS : public BatchPrimitive, public TupleDeliveryStep
|
|||||||
JoinLocalData(TupleBPS* pTupleBPS, rowgroup::RowGroup& primRowGroup, rowgroup::RowGroup& outputRowGroup,
|
JoinLocalData(TupleBPS* pTupleBPS, rowgroup::RowGroup& primRowGroup, rowgroup::RowGroup& outputRowGroup,
|
||||||
boost::shared_ptr<funcexp::FuncExpWrapper>& fe2, rowgroup::RowGroup& fe2Output,
|
boost::shared_ptr<funcexp::FuncExpWrapper>& fe2, rowgroup::RowGroup& fe2Output,
|
||||||
std::vector<rowgroup::RowGroup>& joinerMatchesRGs, rowgroup::RowGroup& joinFERG,
|
std::vector<rowgroup::RowGroup>& joinerMatchesRGs, rowgroup::RowGroup& joinFERG,
|
||||||
std::vector<boost::shared_ptr<joiner::TupleJoiner>>& tjoiners, uint32_t smallSideCount,
|
std::vector<std::shared_ptr<joiner::TupleJoiner>>& tjoiners, uint32_t smallSideCount,
|
||||||
bool doJoin);
|
bool doJoin);
|
||||||
|
|
||||||
friend class TupleBPS;
|
friend class TupleBPS;
|
||||||
@ -1385,7 +1385,7 @@ class TupleBPS : public BatchPrimitive, public TupleDeliveryStep
|
|||||||
rowgroup::RowGroup fe2Output;
|
rowgroup::RowGroup fe2Output;
|
||||||
std::vector<rowgroup::RowGroup> joinerMatchesRGs;
|
std::vector<rowgroup::RowGroup> joinerMatchesRGs;
|
||||||
rowgroup::RowGroup joinFERG;
|
rowgroup::RowGroup joinFERG;
|
||||||
std::vector<boost::shared_ptr<joiner::TupleJoiner>> tjoiners;
|
std::vector<std::shared_ptr<joiner::TupleJoiner>> tjoiners;
|
||||||
|
|
||||||
uint32_t smallSideCount;
|
uint32_t smallSideCount;
|
||||||
bool doJoin;
|
bool doJoin;
|
||||||
|
@ -161,7 +161,7 @@ TupleBPS::JoinLocalData::JoinLocalData(TupleBPS* pTupleBPS, RowGroup& primRowGro
|
|||||||
rowgroup::RowGroup& fe2Output,
|
rowgroup::RowGroup& fe2Output,
|
||||||
std::vector<rowgroup::RowGroup>& joinerMatchesRGs,
|
std::vector<rowgroup::RowGroup>& joinerMatchesRGs,
|
||||||
rowgroup::RowGroup& joinFERG,
|
rowgroup::RowGroup& joinFERG,
|
||||||
std::vector<boost::shared_ptr<joiner::TupleJoiner>>& tjoiners,
|
std::vector<std::shared_ptr<joiner::TupleJoiner>>& tjoiners,
|
||||||
uint32_t smallSideCount, bool doJoin)
|
uint32_t smallSideCount, bool doJoin)
|
||||||
: tbps(pTupleBPS)
|
: tbps(pTupleBPS)
|
||||||
, local_primRG(primRowGroup)
|
, local_primRG(primRowGroup)
|
||||||
@ -2915,14 +2915,14 @@ uint64_t TupleBPS::getFBO(uint64_t lbid)
|
|||||||
throw logic_error("TupleBPS: didn't find the FBO?");
|
throw logic_error("TupleBPS: didn't find the FBO?");
|
||||||
}
|
}
|
||||||
|
|
||||||
void TupleBPS::useJoiner(boost::shared_ptr<joiner::TupleJoiner> tj)
|
void TupleBPS::useJoiner(std::shared_ptr<joiner::TupleJoiner> tj)
|
||||||
{
|
{
|
||||||
vector<boost::shared_ptr<joiner::TupleJoiner>> v;
|
vector<std::shared_ptr<joiner::TupleJoiner>> v;
|
||||||
v.push_back(tj);
|
v.push_back(tj);
|
||||||
useJoiners(v);
|
useJoiners(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TupleBPS::useJoiners(const vector<boost::shared_ptr<joiner::TupleJoiner>>& joiners)
|
void TupleBPS::useJoiners(const vector<std::shared_ptr<joiner::TupleJoiner>>& joiners)
|
||||||
{
|
{
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
|
|
||||||
|
@ -214,7 +214,7 @@ void TupleHashJoinStep::join()
|
|||||||
// the threads inserting into Joiner.
|
// the threads inserting into Joiner.
|
||||||
void TupleHashJoinStep::trackMem(uint index)
|
void TupleHashJoinStep::trackMem(uint index)
|
||||||
{
|
{
|
||||||
boost::shared_ptr<TupleJoiner> joiner = joiners[index];
|
auto joiner = joiners[index];
|
||||||
ssize_t memBefore = 0, memAfter = 0;
|
ssize_t memBefore = 0, memAfter = 0;
|
||||||
bool gotMem;
|
bool gotMem;
|
||||||
|
|
||||||
@ -268,7 +268,7 @@ void TupleHashJoinStep::startSmallRunners(uint index)
|
|||||||
utils::setThreadName("HJSStartSmall");
|
utils::setThreadName("HJSStartSmall");
|
||||||
string extendedInfo;
|
string extendedInfo;
|
||||||
JoinType jt;
|
JoinType jt;
|
||||||
boost::shared_ptr<TupleJoiner> joiner;
|
std::shared_ptr<TupleJoiner> joiner;
|
||||||
|
|
||||||
jt = joinTypes[index];
|
jt = joinTypes[index];
|
||||||
extendedInfo += toString();
|
extendedInfo += toString();
|
||||||
@ -391,7 +391,7 @@ void TupleHashJoinStep::smallRunnerFcn(uint32_t index, uint threadID, uint64_t*
|
|||||||
RowGroupDL* smallDL;
|
RowGroupDL* smallDL;
|
||||||
uint32_t smallIt;
|
uint32_t smallIt;
|
||||||
RowGroup smallRG;
|
RowGroup smallRG;
|
||||||
boost::shared_ptr<TupleJoiner> joiner = joiners[index];
|
auto joiner = joiners[index];
|
||||||
|
|
||||||
smallDL = smallDLs[index];
|
smallDL = smallDLs[index];
|
||||||
smallIt = smallIts[index];
|
smallIt = smallIts[index];
|
||||||
@ -1708,7 +1708,7 @@ void TupleHashJoinStep::joinOneRG(
|
|||||||
Row& joinFERow, Row& joinedRow, Row& baseRow, vector<vector<Row::Pointer> >& joinMatches,
|
Row& joinFERow, Row& joinedRow, Row& baseRow, vector<vector<Row::Pointer> >& joinMatches,
|
||||||
shared_array<Row>& smallRowTemplates, RowGroupDL* outputDL,
|
shared_array<Row>& smallRowTemplates, RowGroupDL* outputDL,
|
||||||
// disk-join support vars. This param list is insane; refactor attempt would be nice at some point.
|
// disk-join support vars. This param list is insane; refactor attempt would be nice at some point.
|
||||||
vector<boost::shared_ptr<joiner::TupleJoiner> >* tjoiners,
|
vector<std::shared_ptr<joiner::TupleJoiner> >* tjoiners,
|
||||||
boost::shared_array<boost::shared_array<int> >* rgMappings,
|
boost::shared_array<boost::shared_array<int> >* rgMappings,
|
||||||
boost::shared_array<boost::shared_array<int> >* feMappings,
|
boost::shared_array<boost::shared_array<int> >* feMappings,
|
||||||
boost::scoped_array<boost::scoped_array<uint8_t> >* smallNullMem)
|
boost::scoped_array<boost::scoped_array<uint8_t> >* smallNullMem)
|
||||||
|
@ -442,13 +442,13 @@ class TupleHashJoinStep : public JobStep, public TupleDeliveryStep
|
|||||||
|
|
||||||
struct JoinerSorter
|
struct JoinerSorter
|
||||||
{
|
{
|
||||||
inline bool operator()(const boost::shared_ptr<joiner::TupleJoiner>& j1,
|
inline bool operator()(const std::shared_ptr<joiner::TupleJoiner>& j1,
|
||||||
const boost::shared_ptr<joiner::TupleJoiner>& j2) const
|
const std::shared_ptr<joiner::TupleJoiner>& j2) const
|
||||||
{
|
{
|
||||||
return *j1 < *j2;
|
return *j1 < *j2;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
std::vector<boost::shared_ptr<joiner::TupleJoiner> > joiners;
|
std::vector<std::shared_ptr<joiner::TupleJoiner> > joiners;
|
||||||
boost::scoped_array<std::vector<rowgroup::RGData> > rgData;
|
boost::scoped_array<std::vector<rowgroup::RGData> > rgData;
|
||||||
TupleBPS* largeBPS;
|
TupleBPS* largeBPS;
|
||||||
rowgroup::RowGroup largeRG, outputRG;
|
rowgroup::RowGroup largeRG, outputRG;
|
||||||
@ -551,7 +551,7 @@ class TupleHashJoinStep : public JobStep, public TupleDeliveryStep
|
|||||||
rowgroup::Row& joinedRow, rowgroup::Row& baseRow,
|
rowgroup::Row& joinedRow, rowgroup::Row& baseRow,
|
||||||
std::vector<std::vector<rowgroup::Row::Pointer> >& joinMatches,
|
std::vector<std::vector<rowgroup::Row::Pointer> >& joinMatches,
|
||||||
boost::shared_array<rowgroup::Row>& smallRowTemplates, RowGroupDL* outputDL,
|
boost::shared_array<rowgroup::Row>& smallRowTemplates, RowGroupDL* outputDL,
|
||||||
std::vector<boost::shared_ptr<joiner::TupleJoiner> >* joiners = NULL,
|
std::vector<std::shared_ptr<joiner::TupleJoiner> >* joiners = NULL,
|
||||||
boost::shared_array<boost::shared_array<int> >* rgMappings = NULL,
|
boost::shared_array<boost::shared_array<int> >* rgMappings = NULL,
|
||||||
boost::shared_array<boost::shared_array<int> >* feMappings = NULL,
|
boost::shared_array<boost::shared_array<int> >* feMappings = NULL,
|
||||||
boost::scoped_array<boost::scoped_array<uint8_t> >* smallNullMem = NULL);
|
boost::scoped_array<boost::scoped_array<uint8_t> >* smallNullMem = NULL);
|
||||||
@ -631,8 +631,8 @@ class TupleHashJoinStep : public JobStep, public TupleDeliveryStep
|
|||||||
bool ownsOutputDL;
|
bool ownsOutputDL;
|
||||||
|
|
||||||
void segregateJoiners();
|
void segregateJoiners();
|
||||||
std::vector<boost::shared_ptr<joiner::TupleJoiner> > tbpsJoiners;
|
std::vector<std::shared_ptr<joiner::TupleJoiner> > tbpsJoiners;
|
||||||
std::vector<boost::shared_ptr<joiner::TupleJoiner> > djsJoiners;
|
std::vector<std::shared_ptr<joiner::TupleJoiner> > djsJoiners;
|
||||||
std::vector<int> djsJoinerMap;
|
std::vector<int> djsJoinerMap;
|
||||||
boost::scoped_array<ssize_t> memUsedByEachJoin;
|
boost::scoped_array<ssize_t> memUsedByEachJoin;
|
||||||
boost::mutex djsLock;
|
boost::mutex djsLock;
|
||||||
|
@ -1819,9 +1819,9 @@ void TupleJoiner::clearData()
|
|||||||
finished = false;
|
finished = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::shared_ptr<TupleJoiner> TupleJoiner::copyForDiskJoin()
|
std::shared_ptr<TupleJoiner> TupleJoiner::copyForDiskJoin()
|
||||||
{
|
{
|
||||||
boost::shared_ptr<TupleJoiner> ret(new TupleJoiner());
|
std::shared_ptr<TupleJoiner> ret(new TupleJoiner());
|
||||||
|
|
||||||
ret->smallRG = smallRG;
|
ret->smallRG = smallRG;
|
||||||
ret->largeRG = largeRG;
|
ret->largeRG = largeRG;
|
||||||
|
@ -460,7 +460,7 @@ class TupleJoiner
|
|||||||
}
|
}
|
||||||
// Disk-based join support
|
// Disk-based join support
|
||||||
void clearData();
|
void clearData();
|
||||||
boost::shared_ptr<TupleJoiner> copyForDiskJoin();
|
std::shared_ptr<TupleJoiner> copyForDiskJoin();
|
||||||
bool isFinished()
|
bool isFinished()
|
||||||
{
|
{
|
||||||
return finished;
|
return finished;
|
||||||
|
Reference in New Issue
Block a user