ClickHouse/src/Interpreters/MergeTreeTransaction.h

36 lines
633 B
C++
Raw Normal View History

2021-03-31 17:55:04 +00:00
#pragma once
#include <Common/TransactionMetadata.h>
namespace DB
{
class MergeTreeTransaction
{
friend class TransactionLog;
public:
enum State
{
RUNNING,
COMMITTED,
ROLLED_BACK,
};
Snapshot getSnapshot() const { return snapshot; }
State getState() const { return state; }
const TransactionID tid;
MergeTreeTransaction() = delete;
MergeTreeTransaction(Snapshot snapshot_, LocalTID local_tid_, UUID host_id);
private:
Snapshot snapshot;
State state;
CSN csn = Tx::UnknownCSN;
};
using MergeTreeTransactionPtr = std::shared_ptr<MergeTreeTransaction>;
}