Package io.rtr.alchemy.db
Interface ExperimentsCache
public interface ExperimentsCache
An interface for retrieving active experiments and treatments information, real-time. Must be
optimized and fast as this will be called many times, ideally caching internally as needed.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks whether any experiments are stalebooleancheckIfStale(String experimentName) Checks whether a given experiment is stalevoidUpdates the cache with a recently deleted experimentReturn active experimentsvoidinvalidate(String experimentName, Experiment.Builder builder) Forces cache to reload a specific experiment from storagevoidinvalidateAll(Experiment.BuilderFactory factory) Forces cache to reload all data from storagevoidupdate(Experiment experiment) Updates the cache with a newly loaded experiment
-
Method Details
-
getActiveExperiments
Map<String,Experiment> getActiveExperiments()Return active experiments- Returns:
- all active experiments
-
invalidateAll
Forces cache to reload all data from storage -
invalidate
Forces cache to reload a specific experiment from storage -
update
Updates the cache with a newly loaded experiment -
delete
Updates the cache with a recently deleted experiment -
checkIfAnyStale
boolean checkIfAnyStale()Checks whether any experiments are stale -
checkIfStale
Checks whether a given experiment is stale
-