10class SequenceCatalogEntry;
11struct SequenceRollbackData;
22struct VectorUpdateInfo;
23class ChunkedNodeGroup;
24class VersionRecordHandler;
26namespace transaction {
27class TransactionManager;
63 forceCheckpoint =
true;
79 return maxCommittedNodeOffsets.contains(tableID);
82 maxCommittedNodeOffsets[tableID] = offset;
100 return minUncommittedNodeOffsets.contains(tableID) ? minUncommittedNodeOffsets.at(tableID) :
104 KU_ASSERT(maxCommittedNodeOffsets.contains(tableID));
105 return maxCommittedNodeOffsets.at(tableID);
109 KU_ASSERT(maxCommittedNodeOffsets.contains(tableID));
110 return maxCommittedNodeOffsets.at(tableID) +
getLocalRowIdx(tableID, uncommittedOffset);
113 void pushCatalogEntry(catalog::CatalogSet& catalogSet, catalog::CatalogEntry& catalogEntry,
114 bool skipLoggingToWAL =
false)
const;
116 const catalog::SequenceRollbackData& data)
const;
118 common::row_idx_t numRows,
const storage::VersionRecordHandler* versionRecordHandler)
const;
120 common::row_idx_t numRows,
const storage::VersionRecordHandler* versionRecordHandler)
const;
122 storage::VectorUpdateInfo& vectorUpdateInfo)
const;
129 std::unordered_map<common::table_id_t, common::offset_t> minUncommittedNodeOffsets,
130 std::unordered_map<common::table_id_t, common::offset_t> maxCommittedNodeOffsets);
139 std::unique_ptr<storage::LocalStorage> localStorage;
140 std::unique_ptr<storage::UndoBuffer> undoBuffer;
141 bool forceCheckpoint;
146 std::unordered_map<common::table_id_t, common::offset_t> minUncommittedNodeOffsets;
150 std::unordered_map<common::table_id_t, common::offset_t> maxCommittedNodeOffsets;
#define KUZU_API
Definition api.h:25
#define KU_ASSERT(condition)
Definition assert.h:19
Contain client side configuration. We make profiler associated per query, so profiler is not maintain...
Definition client_context.h:61
Definition transaction.h:31
bool shouldForceCheckpoint() const
storage::LocalStorage * getLocalStorage() const
Definition transaction.h:77
void checkForceCheckpoint(common::StatementType statementType)
Definition transaction.h:60
common::transaction_t getStartTS() const
Definition transaction.h:55
void setMaxCommittedNodeOffset(common::table_id_t tableID, common::offset_t offset)
Definition transaction.h:81
common::row_idx_t getLocalRowIdx(common::table_id_t tableID, common::offset_t nodeOffset) const
Definition transaction.h:87
Transaction(TransactionType transactionType) noexcept
Transaction(main::ClientContext &clientContext, TransactionType transactionType, common::transaction_t transactionID, common::transaction_t startTS)
bool hasNewlyInsertedNodes(common::table_id_t tableID) const
Definition transaction.h:78
bool isRecovery() const
Definition transaction.h:53
Transaction(TransactionType transactionType, common::transaction_t ID, common::transaction_t startTS) noexcept
common::offset_t getMinUncommittedNodeOffset(common::table_id_t tableID) const
Definition transaction.h:96
bool isUnCommitted(common::table_id_t tableID, common::offset_t nodeOffset) const
Definition transaction.h:84
common::transaction_t getCommitTS() const
Definition transaction.h:56
void pushCatalogEntry(catalog::CatalogSet &catalogSet, catalog::CatalogEntry &catalogEntry, bool skipLoggingToWAL=false) const
bool shouldAppendToUndoBuffer() const
Definition transaction.h:66
bool isWriteTransaction() const
Definition transaction.h:51
bool shouldLogToWAL() const
static constexpr common::transaction_t DUMMY_TRANSACTION_ID
Definition transaction.h:35
TransactionType getType() const
Definition transaction.h:49
common::offset_t getUncommittedOffset(common::table_id_t tableID, common::row_idx_t localRowIdx) const
Definition transaction.h:92
void pushVectorUpdateInfo(storage::UpdateInfo &updateInfo, common::idx_t vectorIdx, storage::VectorUpdateInfo &vectorUpdateInfo) const
void pushInsertInfo(common::node_group_idx_t nodeGroupIdx, common::row_idx_t startRow, common::row_idx_t numRows, const storage::VersionRecordHandler *versionRecordHandler) const
common::offset_t getCommittedOffsetFromUncommitted(common::table_id_t tableID, common::offset_t uncommittedOffset) const
Definition transaction.h:107
static constexpr common::transaction_t DUMMY_START_TIMESTAMP
Definition transaction.h:36
main::ClientContext * getClientContext() const
Definition transaction.h:58
common::transaction_t getID() const
Definition transaction.h:54
void pushSequenceChange(catalog::SequenceCatalogEntry *sequenceEntry, int64_t kCount, const catalog::SequenceRollbackData &data) const
friend class TransactionManager
Definition transaction.h:32
bool isReadOnly() const
Definition transaction.h:50
void rollback(storage::WAL *wal) const
static constexpr common::transaction_t START_TRANSACTION_ID
Definition transaction.h:37
static Transaction getDummyTransactionFromExistingOne(const Transaction &other)
KUZU_API void commit(storage::WAL *wal) const
void pushDeleteInfo(common::node_group_idx_t nodeGroupIdx, common::row_idx_t startRow, common::row_idx_t numRows, const storage::VersionRecordHandler *versionRecordHandler) const
int64_t getCurrentTS() const
Definition transaction.h:57
bool isDummy() const
Definition transaction.h:52
common::offset_t getMaxCommittedNodeOffset(common::table_id_t tableID) const
Definition transaction.h:103
uint64_t getEstimatedMemUsage() const
uint32_t idx_t
Definition types.h:44
uint64_t node_group_idx_t
Definition types.h:54
uint64_t transaction_t
Definition types.h:64
oid_t table_id_t
Definition types.h:70
uint64_t offset_t
Definition types.h:77
uint64_t row_idx_t
Definition types.h:51
StatementType
Definition statement_type.h:8
TransactionType
Definition transaction.h:29
KUZU_API Transaction DUMMY_CHECKPOINT_TRANSACTION
KUZU_API Transaction DUMMY_TRANSACTION
Definition array_utils.h:7