AccessLog

org.sigilaris.core.application.state.AccessLog
See theAccessLog companion object
final case class AccessLog(reads: Map[ByteVector, Set[ByteVector]], writes: Map[ByteVector, Set[ByteVector]])

Access log for tracking transaction reads and writes.

Phase 8: AccessLog accumulates all read and write operations performed by a transaction, enabling efficient conflict detection between concurrent transactions.

The log maps table identifiers (byte prefixes) to sets of accessed keys (full byte keys including prefix). This byte-level approach ensures correct conflict detection across different table types.

ADR-0009 Phase 8 requirements:

  • Store table identifier (path + table name encoded as bytes)
  • Store accessed keys (full key bytes including table prefix)
  • Support conflict detection predicates (W∩W, R∩W)
  • Provide size control options for memory management

Value parameters

reads

map from table prefix to set of read key bytes

writes

map from table prefix to set of written key bytes

Attributes

Companion
object
Source
AccessLog.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def combine(other: AccessLog): AccessLog

Combine this log with another, preserving all accesses.

Combine this log with another, preserving all accesses.

Attributes

Source
AccessLog.scala
def conflictsWith(other: AccessLog): Boolean

Check if this log conflicts with another.

Check if this log conflicts with another.

Conflict detection (ADR-0009 Phase 8):

  • W∩W conflict: both logs write to the same key
  • R∩W conflict: one reads while the other writes to the same key

Value parameters

other

the other access log

Attributes

Returns

true if there is a conflict, false otherwise

Source
AccessLog.scala
def exceedsLimits(maxReads: Int, maxWrites: Int): Boolean

Check if this log exceeds size limits.

Check if this log exceeds size limits.

Phase 8 size control: prevent unbounded memory growth by capping the number of tracked operations.

Value parameters

maxReads

maximum allowed read operations

maxWrites

maximum allowed write operations

Attributes

Returns

true if limits are exceeded

Source
AccessLog.scala
def readCount: Int

Get total number of read operations across all tables.

Get total number of read operations across all tables.

Attributes

Source
AccessLog.scala
def recordRead(tablePrefix: ByteVector, key: ByteVector): AccessLog

Record a read operation.

Record a read operation.

Value parameters

key

the full key bytes (tablePrefix ++ encodeKey(k))

tablePrefix

the table's byte prefix (encodePath(Path) ++ encodeSegment(Name))

Attributes

Source
AccessLog.scala
def recordWrite(tablePrefix: ByteVector, key: ByteVector): AccessLog

Record a write operation.

Record a write operation.

Value parameters

key

the full key bytes (tablePrefix ++ encodeKey(k))

tablePrefix

the table's byte prefix (encodePath(Path) ++ encodeSegment(Name))

Attributes

Source
AccessLog.scala
def writeCount: Int

Get total number of write operations across all tables.

Get total number of write operations across all tables.

Attributes

Source
AccessLog.scala

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product