Implementation of an append-only immutable vector in secondary storage. This implementation should behave correctly and safely under concurrent attempts to read and write. Writing to the end of the vector and reading from any position in the vector should be O(1). This data structure is intended to support the immutable write-ahead transaction log backing an Eva database.
Implementation of an append-only immutable vector in secondary storage. This implementation should behave correctly and safely under concurrent attempts to read and write. Writing to the end of the vector and reading from any position in the vector should be O(1). This data structure is intended to support the immutable write-ahead transaction log backing an Eva database.
(chunked-map f batch-size coll)
Maps f over coll lazily in chunks of size batch-size
Maps f over coll lazily in chunks of size batch-size
(lazy-read-range v x y)
(lazy-read-range v x y batch-size read-ahead)
Realizes elements [x..y], exclusive on y, from the persisted vector
lazily. Will realize in chunks of size batch-size' and asynchronously will attempt to stay
read-ahead' chunks ahead of the last-read chunk
Realizes elements [x..y], exclusive on y, from the persisted vector lazily. Will realize in chunks of size `batch-size' and asynchronously will attempt to stay `read-ahead' chunks ahead of the last-read chunk
(read-range v x y)
Realizes elements [x..y], exclusive on y,from the persisted vector in batch
Realizes elements [x..y], exclusive on y,from the persisted vector in batch
(repair-vector-head pv store)
Given the current vector cons, it's possible for a new key / entry to be created but the cas process on the head fails afterwards, leaving the vector in an unusable state, where the head is one value behind the true length of the vector. This function will attempt to repair that state.
We do the following:
Refresh the persisted vector to head state.
Confirm that the key beyond the end of the head state does exist. --> someone has repaired in the meantime, warn that this happened, return the refreshed vector.
Attempt to cas the head state manually. --> cas fails : throw an exception, concurrent attempts to repair.
Return the rebuilt vector.
Given the current vector cons, it's possible for a new key / entry to be created but the cas process on the head fails afterwards, leaving the vector in an unusable state, where the head is one value behind the true length of the vector. This function will attempt to repair that state. We do the following: 1. Refresh the persisted vector to head state. 2. Confirm that the key beyond the end of the head state does exist. --> someone has repaired in the meantime, warn that this happened, return the refreshed vector. 3. Attempt to cas the head state manually. --> cas fails : throw an exception, concurrent attempts to repair. 4. Return the rebuilt vector.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close