Liking cljdoc? Tell your friends :D

jepsen.generator.translation-table

We burn a lot of time in hashcode and map manipulation for thread names, which are mostly integers 0...n, but sometimes non-integer names like :nemesis. It's nice to be able to represent thread state internally as purely integers. To do this, we compute a one-time translation table which lets us map those names to integers and vice-versa.

We burn a lot of time in hashcode and map manipulation for thread names,
which are mostly integers 0...n, but sometimes non-integer names like
:nemesis. It's nice to be able to represent thread state internally as purely
integers. To do this, we compute a one-time translation table which lets us
map those names to integers and vice-versa.
raw docstring

all-namesclj

(all-names translation-table)

A sequence of all names in the translation table, in the exact order of thread indices. Index 0's name comes first, then 1, and so on.

A sequence of all names in the translation table, in the exact order of
thread indices. Index 0's name comes first, then 1, and so on.
raw docstring

index->nameclj

(index->name translation-table thread-index)

Turns a thread index (an int) into a thread name (e.g. 0, 5, or :nemesis).

Turns a thread index (an int) into a thread name (e.g. 0, 5, or :nemesis).
raw docstring

indices->namesclj

(indices->names translation-table indices)

Takes a translation table and a BitSet of thread indices. Constructs a Bifurcan ISet out of those threads.

Takes a translation table and a BitSet of thread indices. Constructs a
Bifurcan ISet out of those threads.
raw docstring

name->indexclj

(name->index translation-table thread-name)

Turns a thread name (e.g. 0, 5, or :nemesis) into a primitive int.

Turns a thread name (e.g. 0, 5, or :nemesis) into a primitive int.
raw docstring

names->indicesclj

(names->indices translation-table names)

Takes a translation table and a collection of thread names. Constructs a BitSet of those thread indices.

Takes a translation table and a collection of thread names. Constructs a
BitSet of those thread indices.
raw docstring

thread-countclj

(thread-count translation-table)

How many threads in a translation table in all?

How many threads in a translation table in all?
raw docstring

translation-tableclj

(translation-table int-thread-count named-threads)

Takes a number of integer threads and a collection of named threads, and computes a translation table.

Takes a number of integer threads and a collection of named threads, and
computes a translation table.
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