Liking cljdoc? Tell your friends :D

kala.eid

Entity ids: one positive long packing a partition, a block, and an index. Partition 0 holds the bootstrap schema (attributes and their enums), partition 1 holds transacted entities, partition 2 holds transaction entities, which pack t into the payload bits.

This namespace is a pure-arithmetic leaf: it requires nothing and never sees a db value. Callers own the allocation counter — kala.tx keeps ::core/next-idx in the db value and advances it through alloc-user-eid, and replay restores that counter with user-alloc-index. tx entity ids are monotonic in t: kala.time-travel's since compares them as packed longs and relies on it.

Entity ids: one positive long packing a partition, a block, and an index.
Partition 0 holds the bootstrap schema (attributes and their enums),
partition 1 holds transacted entities, partition 2 holds transaction
entities, which pack t into the payload bits.

This namespace is a pure-arithmetic leaf: it requires nothing and never
sees a db value. Callers own the allocation counter — kala.tx keeps
::core/next-idx in the db value and advances it through alloc-user-eid,
and replay restores that counter with user-alloc-index. tx entity ids are
monotonic in t: kala.time-travel's since compares them as packed longs
and relies on it.
raw docstring

alloc-user-eidclj

(alloc-user-eid n)

The user entity id of allocation counter n: block (quot n block-count), index (rem n block-count). Total and injective in n.

The user entity id of allocation counter n: block (quot n block-count),
index (rem n block-count). Total and injective in n.
raw docstring

bootstrap-eidclj

(bootstrap-eid idx)

The entity id of bootstrap-schema placement idx: block 0 of partition 0.

The entity id of bootstrap-schema placement idx: block 0 of partition 0.
raw docstring

bootstrap-eid?clj

(bootstrap-eid? x)

Is x a partition-0 (bootstrap schema) entity id?

Is x a partition-0 (bootstrap schema) entity id?
raw docstring

eid->tclj

(eid->t e)

Extract the transaction counter from a tx entity id.

Extract the transaction counter from a tx entity id.
raw docstring

tx-eidclj

(tx-eid t)

The transaction entity id of t. Monotonic in t — the since view compares tx entity ids as packed longs and relies on it.

The transaction entity id of t. Monotonic in t — the since view compares
tx entity ids as packed longs and relies on it.
raw docstring

tx-eid?clj

(tx-eid? x)

Is x a partition-2 (transaction entity) id?

Is x a partition-2 (transaction entity) id?
raw docstring

user-alloc-indexclj

(user-alloc-index x)

The allocation counter one past user entity id x — the inverse of alloc-user-eid — or nil if x is not a user entity id. Replay restores ::core/next-idx by taking the max of this over every datom's entity slot.

The allocation counter one past user entity id x — the inverse of
alloc-user-eid — or nil if x is not a user entity id. Replay restores
::core/next-idx by taking the max of this over every datom's entity slot.
raw docstring

user-eid?clj

(user-eid? x)

Is x a partition-1 (transacted entity) id?

Is x a partition-1 (transacted entity) id?
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close