(cached-entries conn k-loads)Polls foreign-load status without returning cached values.
Returns the original request tuples for completed or abandoned foreign loads.
Polls foreign-load status without returning cached values. Returns the original request tuples for completed or abandoned foreign loads.
(complete-load conn key-list values)Finalize a claimed load in Redis. Kept separate from LoaderSupport so race tests can gate the interval between Redis publication and local waiter release.
Finalize a claimed load in Redis. Kept separate from LoaderSupport so race tests can gate the interval between Redis publication and local waiter release.
(fetch conn
k
epoch-key
active-invalidation-records-key
entry-indexes-key
load-marker
load-ms
fade-ms)Fetch a value. See doc/secondary-index-invalidation.md for response shapes.
Under the wire protocol, 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. See doc/secondary-index-invalidation.md for response shapes. Under the wire protocol, `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.
(invalidation-statuses conn active-records-key record-keys id-keys)One atomic domain observation, with record flags followed by secondary-ID flags.
One atomic domain observation, with record flags followed by secondary-ID flags.
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.
Map of conn to map of key to promise.
For each connection the submap contains Redis keys to a Load object. In Load object:
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. - Maintenance waits signal the local owner to retry; only that owner delivers the result.
(maintain-conn-loads conn loads-map refresh-load-markers?)Signals owners waiting for foreign loads and optionally refreshes our load markers. Status observations never complete result promises or remove loads.
This should be only called from one thread.
Signals owners waiting for foreign loads and optionally refreshes our load markers. Status observations never complete result promises or remove loads. This should be only called from one thread.
(maintain-invalidation-waits conn loads-map)Deduplicate watched records and IDs per domain. Only signal the observed wait; the owner remains responsible for marker cleanup and result-promise release.
Deduplicate watched records and IDs per domain. Only signal the observed wait; the owner remains responsible for marker cleanup and result-promise release.
(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.
(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.
(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.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |