SqliteAtCommitLog class
SQLite-backed AtCommitLog. One row per atKey, newest-wins, with a
dense/gapless commit_id allocated from the counters table in the
same transaction as the keystore write (see commitSync).
- Inheritance
-
- Object
- AtCommitLog
- SqliteAtCommitLog
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
close(
) → Future< void> -
Close the underlying storage handle.
override
-
commit(
String key, CommitOp operation) → Future< int?> -
Append a new entry for
key/operation. Returns the assignedcommitId, or-1for keys that bypass the commit log (private:,privatekey:,public:_,local:, ...).override -
commitSync(
String atKey, CommitOp operation) → int? -
Synchronous commit used inside a keystore write's transaction so
the value row and its commit entry are one atomic unit. Returns the
allocated commit id, or
-1for an elided key. Re-entrant via SqliteDatabase.runInTransaction: joins the caller's transaction when there is one, else opens its own. -
compact(
bool dryRun) → Stream< int> -
Compact the commit log. If
dryRunistrue, yields each commit-id that WOULD be removed without performing the deletion. Iffalse, performs the compaction and yields each commit-id as it is removed.override -
entriesCount(
) → int -
Total entry count. Used by operators / metrics; not on any
hot path.
override
-
firstCommittedSequenceNumber(
) → int? -
Smallest
commitIdstill retained in the log, ornullif the log is empty. Pairs with lastCommittedSequenceNumber to expose the log's[floor, ceiling]to sync clients.override -
getLatestCommitEntry(
String key) → CommitEntry? -
The latest CommitEntry for
key, ornullifkeyhas never been committed.override -
getSize(
) → int -
Approximate on-disk size in bytes.
override
-
iterate(
{int? fromCommitId, bool where(CommitEntry)?}) → Stream< CommitEntry> -
Iterate every commit entry in
commitIdorder. IffromCommitIdis provided, yields only entries withcommitId >= fromCommitId. Ifwhereis provided, only entries for whichwhere(entry)returns true are yielded; the rest are silently skipped. Used by sync, by migration, and by anything that needs full-log traversal.override -
lastCommittedSequenceNumber(
) → int? -
Latest assigned
commitId, ornullif the log is empty.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
purgeSync(
String atKey) → void -
Delete the commit-log row for
atKey(expiry / skipCommit path). No counter bump. Re-entrant. An expired key must not be resurrectable by a sync client replaying an old commit entry. -
replay(
CommitEntry entry) → Future< void> -
Replay
entryunder its existingcommitIdWITHOUT firing change-event listeners. Used by the persistence migrator to copy commit-log content from one backend to another while preserving sync identity. Idempotent on(commitId, atKey, operation).override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited