Liking cljdoc? Tell your friends :D

memento.redis.loader


abandon-load-scriptclj

source

bulk-setclj

source

cached-entriesclj

(cached-entries conn k-loads)

Fetches keys to retrieve values stored by foreign JVMs.

Returns a list of [key load-obj delivery-value] triples where delivery-value is one of:

  • :load-marker → status 0: still a foreign load marker, keep waiting
  • b/absent → status 2: key missing entirely (foreign loader died)
  • EntryMeta → status 1: real value envelope, decoded

See doc/future-tag-invalidation.md §5.9 for the cross-JVM joiner path semantics.

Fetches keys to retrieve values stored by foreign JVMs.

Returns a list of [key load-obj delivery-value] triples where delivery-value
is one of:
  - :load-marker            → status 0: still a foreign load marker, keep waiting
  - b/absent                → status 2: key missing entirely (foreign loader died)
  - EntryMeta               → status 1: real value envelope, decoded

See doc/future-tag-invalidation.md §5.9 for the cross-JVM joiner path semantics.
sourceraw docstring

cached-entries-scriptclj

source

fetchclj

(fetch conn k epoch-key load-marker load-ms fade-ms)

Fetch a value, returns [present? val validation-epoch].

Under the wire protocol (§5.1), val comes back as raw bytes (envelope bytes for cached values, 17-byte load-marker bytes for foreign / our load markers, nil for missing keys when load-ms is non-positive).

load-marker is a UUID; it is serialized to its 17-byte wire shape via (car/raw (Load/loadMarkerBytes load-marker)) at the Lua call boundary so byte-equality inside abandon-load.lua / refresh-load-markers.lua / finish-load*.lua works.

load-ms is load marker liveness in ms; if 0 or negative, no load marker is inserted (used by Loader.ifCached).

fade-ms is fade setting for entries in ms if any.

Fetch a value, returns [present? val validation-epoch].

Under the wire protocol (§5.1), `val` comes back as raw bytes (envelope
bytes for cached values, 17-byte load-marker bytes for foreign / our load
markers, nil for missing keys when load-ms is non-positive).

load-marker is a UUID; it is serialized to its 17-byte wire
shape via (car/raw (Load/loadMarkerBytes load-marker)) at the Lua call boundary
so byte-equality inside abandon-load.lua / refresh-load-markers.lua /
finish-load*.lua works.

load-ms is load marker liveness in ms; if 0 or negative, no load marker is
inserted (used by Loader.ifCached).

fade-ms is fade setting for entries in ms if any.
sourceraw docstring

fetch-scriptclj

source

finish-load-scriptclj

source

for-confclj

(for-conf conf keygen)
source

latest-tag-invalidationclj

(latest-tag-invalidation v)

Compute the latest tag-invalidation epoch for a value about to be delivered.

Compute the latest tag-invalidation epoch for a value about to be delivered.
sourceraw docstring

load-marker-fade-secclj

How long before a load marker fades. This is to prevent JVM exiting or dying from leaving LoadMarkers in Redis indefinitely, causing everyone to block on that key forever. This time is refreshed every second by a daemon thread, however a long GC will cause LoadMarkers to fade when they shouldn't.

Adjust this setting appropriately via memento.redis.load_marker_fade system property.

How long before a load marker fades. This is to prevent JVM exiting or dying from leaving LoadMarkers
in Redis indefinitely, causing everyone to block on that key forever. This time is refreshed every
second by a daemon thread, however a long GC will cause LoadMarkers to fade when they shouldn't.

Adjust this setting appropriately via memento.redis.load_marker_fade system property.
sourceraw docstring

maintclj

Map of conn to map of key to promise.

For each connection the submap contains Redis keys to a Load object. In Load object:

  • If marker is present, then it's our load, and we must deliver to redis.
  • If not, a foreign JVM is going to deliver to Redis, and we must scan redis for it.
Map of conn to map of key to promise.

For each connection the submap contains Redis keys to a Load object. In Load object:
- If marker is present, then it's our load, and we must deliver to redis.
- If not, a foreign JVM is going to deliver to Redis, and we must scan redis for it.
sourceraw docstring

maintain-conn-loadsclj

(maintain-conn-loads conn loads-map refresh-load-markers?)

Maintains the list of ongoing loads. It will fetch and fill promises for entries that were completed by other processes. If refresh-load-markers is true, it will also extends load markers this JVM owns.

This should be only called from one thread.

Maintains the list of ongoing loads. It will fetch and fill promises for entries that were
completed by other processes. If refresh-load-markers is true, it will also extends load markers
this JVM owns.

This should be only called from one thread.
sourceraw docstring

maintenance-stepclj

(maintenance-step maint refresh-load-markers?)

Perform maintenance multithreaded, one future per each connection after the first.

Perform maintenance multithreaded, one future per each connection after the first.
sourceraw docstring

put-value-scriptclj

source

put-value-w-sec-scriptclj

source

refresh-load-markersclj

(refresh-load-markers conn ks markers marker-fade)

Refresh expire of load markers under keys ks, if they are still the same as we expect. markers must contain raw [0x03][16B UUID] byte arrays.

Refresh expire of load markers under keys ks, if they are still the same as we
expect. markers must contain raw [0x03][16B UUID] byte arrays.
sourceraw docstring

refresh-load-markers-scriptclj

source

remove-load-markersclj

(remove-load-markers maint-map)

Remove all load markers owned by us from Redis. Useful when JVM is shutting down and we want any foreign JVMs on same cache to stop waiting for values that ain't happening.

Remove all load markers owned by us from Redis. Useful when JVM is shutting down
and we want any foreign JVMs on same cache to stop waiting for values that ain't happening.
sourceraw docstring

supportclj

source

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