Fact.WriteAheadLog.Entry (Fact v0.3.1)

View Source

Represents a WAL entry. Serialized using :erlang.term_to_binary.

Summary

Functions

Creates a new WAL entry and computes the CRC (IEEE).

Deserialize from binary and validate CRC.

Serialize entry to binary.

Types

t()

@type t() :: %Fact.WriteAheadLog.Entry{
  crc: non_neg_integer(),
  data: binary(),
  is_checkpoint: boolean(),
  lsn: non_neg_integer()
}

Functions

create(lsn, data, is_checkpoint \\ false)

Creates a new WAL entry and computes the CRC (IEEE).

deserialize(bin)

Deserialize from binary and validate CRC.

serialize(entry)

Serialize entry to binary.