Package dev.frostlake.persistence
Class WalRecord
java.lang.Object
dev.frostlake.persistence.WalRecord
One record in the write-ahead log. A
WalRecordType.TRANSACTION record carries the mutating SQL
statements of a single committed transaction (replayed together, as a unit); a
WalRecordType.CHECKPOINT record carries the reference of a durable state snapshot that supersedes
every record written before it. See WriteAheadLog.-
Method Summary
Modifier and TypeMethodDescriptionstatic WalRecordcheckpoint(String checkpointRef) A checkpoint marker referencing a durable state snapshot.The snapshot reference (null for a transaction record).getStatementInstant(int index) What the statement atindexcalled "now", or null when the record predates v3 and carried no instants — those replay at the wall clock, exactly as they did before.The transaction's statements (empty for a checkpoint record).getType()static WalRecordtransaction(List<String> statements) A committed-transaction record holding the given statements (in execution order).static WalRecordtransaction(List<String> statements, List<Instant> statementInstants) A committed-transaction record that also remembers what EACH of its statements called "now".
-
Method Details
-
transaction
A committed-transaction record holding the given statements (in execution order). -
transaction
A committed-transaction record that also remembers what EACH of its statements called "now". Replay puts those instants back, so a re-executedCURRENT_TIMESTAMPresolves to the value the row was originally written with rather than to the recovery time.One instant per statement, not one per record: live, two statements inside a single BEGIN…COMMIT get different times, so a per-record instant would flatten them together.
-
checkpoint
A checkpoint marker referencing a durable state snapshot. -
getStatementInstant
What the statement atindexcalled "now", or null when the record predates v3 and carried no instants — those replay at the wall clock, exactly as they did before. -
getType
-
getStatements
The transaction's statements (empty for a checkpoint record). -
getCheckpointRef
The snapshot reference (null for a transaction record).
-