12class SequenceCatalogEntry;
13struct SequenceRollbackData;
23namespace transaction {
24class TransactionManager;
43 forceCheckpoint{
false} {
49 clientContext{
nullptr}, undoBuffer{
nullptr}, forceCheckpoint{
false} {
67 forceCheckpoint =
true;
77 void commit(storage::WAL* wal)
const;
83 return maxCommittedNodeOffsets.contains(tableID);
86 maxCommittedNodeOffsets[tableID] = offset;
89 KU_ASSERT(maxCommittedNodeOffsets.contains(tableID));
90 return maxCommittedNodeOffsets.at(tableID);
94 bool skipLoggingToWAL =
false)
const;
96 const catalog::SequenceRollbackData& data)
const;
111 std::unique_ptr<storage::LocalStorage> localStorage;
112 std::unique_ptr<storage::UndoBuffer> undoBuffer;
113 bool forceCheckpoint;
115 std::unordered_map<common::table_id_t, common::offset_t> maxCommittedNodeOffsets;
#define KU_ASSERT(condition)
Definition assert.h:19
Definition catalog_entry.h:18
Definition catalog_set.h:24
static KUZU_API timestamp_t getCurrentTimestamp()
Contain client side configuration. We make profiler associated per query, so profiler is not maintain...
Definition client_context.h:51
Definition local_storage.h:19
Definition update_info.h:46
Definition version_info.h:75
Definition transaction.h:28
bool shouldForceCheckpoint() const
storage::LocalStorage * getLocalStorage() const
Definition transaction.h:81
void checkForceCheckpoint(common::StatementType statementType)
Definition transaction.h:64
common::transaction_t getStartTS() const
Definition transaction.h:59
void setMaxCommittedNodeOffset(common::table_id_t tableID, common::offset_t offset)
Definition transaction.h:85
void pushVectorInsertInfo(storage::VersionInfo &versionInfo, common::idx_t vectorIdx, common::row_idx_t startRowInVector, common::row_idx_t numRows) const
Transaction(TransactionType transactionType) noexcept
Definition transaction.h:40
void pushVectorDeleteInfo(storage::VersionInfo &versionInfo, common::idx_t vectorIdx, common::row_idx_t startRowInVector, common::row_idx_t numRows) const
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:82
bool isRecovery() const
Definition transaction.h:57
Transaction(TransactionType transactionType, common::transaction_t ID, common::transaction_t startTS) noexcept
Definition transaction.h:46
common::transaction_t getCommitTS() const
Definition transaction.h:60
void pushCatalogEntry(catalog::CatalogSet &catalogSet, catalog::CatalogEntry &catalogEntry, bool skipLoggingToWAL=false) const
bool shouldAppendToUndoBuffer() const
Definition transaction.h:70
bool isWriteTransaction() const
Definition transaction.h:55
bool shouldLogToWAL() const
static constexpr common::transaction_t DUMMY_TRANSACTION_ID
Definition transaction.h:32
TransactionType getType() const
Definition transaction.h:53
common::offset_t getMaxNodeOffsetBeforeCommit(common::table_id_t tableID) const
Definition transaction.h:88
void pushVectorUpdateInfo(storage::UpdateInfo &updateInfo, common::idx_t vectorIdx, storage::VectorUpdateInfo &vectorUpdateInfo) const
static constexpr common::transaction_t DUMMY_START_TIMESTAMP
Definition transaction.h:33
main::ClientContext * getClientContext() const
Definition transaction.h:62
void commit(storage::WAL *wal) const
common::transaction_t getID() const
Definition transaction.h:58
void pushSequenceChange(catalog::SequenceCatalogEntry *sequenceEntry, int64_t kCount, const catalog::SequenceRollbackData &data) const
friend class TransactionManager
Definition transaction.h:29
bool isReadOnly() const
Definition transaction.h:54
void rollback(storage::WAL *wal) const
static constexpr common::transaction_t START_TRANSACTION_ID
Definition transaction.h:34
int64_t getCurrentTS() const
Definition transaction.h:61
bool isDummy() const
Definition transaction.h:56
uint64_t getEstimatedMemUsage() const
uint32_t idx_t
Definition types.h:39
constexpr transaction_t INVALID_TRANSACTION
Definition types.h:58
uint64_t transaction_t
Definition types.h:57
uint64_t table_id_t
Definition internal_id_t.h:14
uint64_t offset_t
Definition internal_id_t.h:22
uint64_t row_idx_t
Definition types.h:46
StatementType
Definition statement_type.h:8
TransactionType
Definition transaction.h:26
Definition alter_type.h:5
int64_t value
Definition timestamp_t.h:11
Definition update_info.h:21