Caching
describes a service that temporarily holds data and supports read and write operations. The default implementation of the Caching
is provided by the FileCacheService
, which cached items on the disk.
The following code snippet shows how to set/get a CacheEntry
to the local cache.
CacheEntry cacheEntry = new CacheEntry(inputStream, CacheExpiry.never(), metadata);
ServiceProvider.getInstance().getCacheService().set("cache_name", "key", cacheEntry);
val cacheEntry = CacheEntry(inputStream, CacheExpiry.never(), metadata)
ServiceProvider.getInstance().cacheService.set("cache_name", "key", cacheEntry)
For a full list of APIs provided by the CacheService
, see CacheService.java.