(cached-entries conn ks)
Fetches keys, to retrieve values entered/calculated by a foreign cache (other JVM).
If load marker is still there, the key is not returned. If a value is there, we return a [key value] pair. If the value is not there, then the marker has expired, the foreign loader is dead or stalled. In that case the script returns the special our load marker, and this function returns [key, b/absent].
Fetches keys, to retrieve values entered/calculated by a foreign cache (other JVM). If load marker is still there, the key is not returned. If a value is there, we return a [key value] pair. If the value is not there, then the marker has expired, the foreign loader is dead or stalled. In that case the script returns the special *our* load marker, and this function returns [key, b/absent].
(cval v)
Carmine saves Numbers and Keywords as Strings, so when you fetch them, they are just left as strings, so we force Nippy serialization. We also force Strings to nippy so we can get the benefit of automatic LZ4 compression on big strings (like people dumping whole JSONs and HTML responses into our DB).
Carmine saves Numbers and Keywords as Strings, so when you fetch them, they are just left as strings, so we force Nippy serialization. We also force Strings to nippy so we can get the benefit of automatic LZ4 compression on big strings (like people dumping whole JSONs and HTML responses into our DB).
(fetch conn k load-marker load-ms fade-ms)
Fetch a value, returns [present? val]. If load-ms is positive, insert a loader marker with the specified expiry. Also refreshes expiry if fade is used.
load-ms is load marker liveness in ms load-marker must always be provided, even if not setting it, as it's used as type template in an IF
fade-ms is fade setting for entries in ms if any
Fetch a value, returns [present? val]. If load-ms is positive, insert a loader marker with the specified expiry. Also refreshes expiry if fade is used. load-ms is load marker liveness in ms load-marker must always be provided, even if not setting it, as it's used as type template in an IF fade-ms is fade setting for entries in ms if any
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. - If not, a foreign JVM is going to deliver to Redis, and we must scan redis for it.
(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.
(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.
Refresh expire of load markers under keys ks, if they are still the same as we expect.
(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 is a website building & hosting documentation for Clojure/Script libraries
× close