Class CacheWarmer
java.lang.Object
com.loomcache.server.cache.CacheWarmer
Warms cache from various sources for fast startup.
Supports snapshot-based warming, peer-based warming, and external loader warming.
Uses virtual threads via StructuredTaskScope for parallel warming.
-
Constructor Summary
ConstructorsConstructorDescriptionCacheWarmer(DataStructureRegistry registry, @Nullable WarmingConfig config, @Nullable WarmingListener listener, @Nullable AccessTracker accessTracker) Create a CacheWarmer with the given configuration. -
Method Summary
Modifier and TypeMethodDescriptionpreload(PreloadPolicy policy, CacheLoader loader) Preload cache based on a preload policy.warmFromLoader(CacheLoader loader, List<String> keys) Warm cache from an external loader using parallel virtual threads.warmFromPeer(String peerAddress) Warm cache from a running peer node.warmFromSnapshot(byte[] snapshotData) Warm cache from a saved snapshot (byte array).
-
Constructor Details
-
CacheWarmer
public CacheWarmer(DataStructureRegistry registry, @Nullable WarmingConfig config, @Nullable WarmingListener listener, @Nullable AccessTracker accessTracker) Create a CacheWarmer with the given configuration.
-
-
Method Details
-
warmFromSnapshot
Warm cache from a saved snapshot (byte array).- Throws:
Exception
-
warmFromPeer
Warm cache from a running peer node. Makes a request to another cluster node to retrieve state.- Throws:
Exception
-
warmFromLoader
Warm cache from an external loader using parallel virtual threads.- Throws:
Exception
-
preload
Preload cache based on a preload policy.- Throws:
Exception
-