Class CacheUtil
- java.lang.Object
-
- org.linuxforhealth.fhir.persistence.jdbc.util.CacheUtil
-
public class CacheUtil extends java.lang.Object
Encapsulates a group of utility methods for managing and diagnosing the in-memory caches used by the JDBC PL.
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
NEWLINE
-
Constructor Summary
Constructors Constructor Description CacheUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
dumpCacheContents(java.lang.String cacheName, java.util.concurrent.ConcurrentHashMap<java.lang.String,java.util.concurrent.ConcurrentHashMap<java.lang.String,java.lang.Integer>> mapOfMaps)
Takes the contents of one of the JDBC PL caches and represents the contents in a format suitable for logging.static java.lang.String
reportCacheDiscrepancies(java.lang.String cacheName, java.util.concurrent.ConcurrentHashMap<java.lang.String,java.lang.Integer> cachedMap, java.util.Map<java.lang.String,java.lang.Integer> dbMap)
Reports on content discrepancies a JDBC PL cache and DB data that backs it.
-
-
-
Method Detail
-
dumpCacheContents
public static java.lang.String dumpCacheContents(java.lang.String cacheName, java.util.concurrent.ConcurrentHashMap<java.lang.String,java.util.concurrent.ConcurrentHashMap<java.lang.String,java.lang.Integer>> mapOfMaps)
Takes the contents of one of the JDBC PL caches and represents the contents in a format suitable for logging.- Parameters:
cacheName
- - The name of the JDBC PL cache to be dumped.mapOfMaps
- - The contents of the multi-datastore cache.- Returns:
- String - A formatted representation of the cache contents.
-
reportCacheDiscrepancies
public static java.lang.String reportCacheDiscrepancies(java.lang.String cacheName, java.util.concurrent.ConcurrentHashMap<java.lang.String,java.lang.Integer> cachedMap, java.util.Map<java.lang.String,java.lang.Integer> dbMap)
Reports on content discrepancies a JDBC PL cache and DB data that backs it.- Parameters:
cacheName
- - The name of the JDBC PL cache to be examined.cachedMap
- - The contents of the cache for a single tenantid/datastoreid combination.dbMap
- - The contents of the DB table that back the passed cachedMap.- Returns:
- String - A report of the discrepancies between the passed maps.
-
-