Skip to content

class KeyRec

Represents a record for a key in the keydir index.

Attributes:

Name Type Description
file_id int

The identifier of the storage file containing the value.

value_sz int

The size of the value in bytes.

value_pos int

The position of the value in the storage file.

tstamp UUID

The timestamp associated with the key record as uuid7.

Source code in src/py_bitcask/bitcask.py
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
@dataclass
class KeyRec:
    """
    Represents a record for a key in the keydir index.

    Attributes:
        file_id (int): The identifier of the storage file containing the value.
        value_sz (int): The size of the value in bytes.
        value_pos (int): The position of the value in the storage file.
        tstamp (uuid.UUID): The timestamp associated with the key record as uuid7.
    """

    file_id: int
    value_sz: int
    value_pos: int
    tstamp: Union[uuid.UUID, str, int, bytes]