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

MCOL-1160 Track and flush dictionary blocks

When bulk write API is used dictionary blocks that are written to needs
flushing in PrimProc. This patch tracks the blocks and flushes them.
This commit is contained in:
Andrew Hutchings
2018-01-23 21:17:33 +00:00
parent 4f1684c609
commit 6211372f61
3 changed files with 66 additions and 0 deletions

View File

@ -85,6 +85,7 @@ struct TxnLBIDRec
};
typedef boost::shared_ptr<TxnLBIDRec> SP_TxnLBIDRec_t;
typedef std::set<BRM::LBID_t> dictLBIDRec_t;
/** Class WriteEngineWrapper */
class WriteEngineWrapper : public WEObj
@ -408,6 +409,10 @@ public:
return m_txnLBIDMap;
};
std::tr1::unordered_map<TxnID, dictLBIDRec_t>& getDictMap()
{
return m_dictLBIDMap;
};
/**
* @brief Flush the ChunkManagers.
*/
@ -686,6 +691,9 @@ private:
const RID filesPerColumnPartition, const RID extentsPerSegmentFile,
const RID extentRows, uint16_t startDBRoot, unsigned dbrootCnt);
void AddDictToList(const TxnID txnid, std::vector<BRM::LBID_t>& lbids);
void RemoveTxnFromDictMap(const TxnID txnid);
// Bug 4312: We use a hash set to hold the set of starting LBIDS for a given
// txn so that we don't waste time marking the same extent as invalid. This
// list should be trimmed if it gets too big.
@ -703,6 +711,10 @@ private:
// This is a Map of sets of LBIDS for each transaction. A Transaction's list will be removed upon commit or rollback.
std::tr1::unordered_map<TxnID, SP_TxnLBIDRec_t> m_txnLBIDMap;
// MCOL-1160: We need to track dictionary LBIDs so we can tell PrimProc
// to flush the blocks after an API bulk-write.
std::tr1::unordered_map<TxnID, dictLBIDRec_t> m_dictLBIDMap;
ColumnOp* m_colOp[TOTAL_COMPRESS_OP]; // column operations
Dctnry* m_dctnry[TOTAL_COMPRESS_OP]; // dictionary operations
OpType m_opType; // operation type