1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use crate::TxnId;

pub enum IntentKind {
    OwnershipChange,
    UserTransactionExecution,
}

pub enum IntentLogEntryStatus {
    // Used only for initialization
    Unknown,
    // set before sending top-level transaction to nando scheduler
    Start,
    // successful commit response from scheduler
    Success,
    // abort notification from scheduler, with reason for abort
    Aborted(String),
}

pub struct IntentLogEntry {
    kind: IntentKind,
    txn_id: TxnId,
    status: IntentLogEntryStatus,
    // TODO
    // timestamp: PersistableTimestamp,
}

impl IntentLogEntry {
    pub fn new(txn_id: TxnId, kind: IntentKind, status: IntentLogEntryStatus) -> Self {
        Self {
            txn_id,
            kind,
            status,
        }
    }
}