Class CacheUtil
- java.lang.Object
-
- com.ibm.fhir.persistence.jdbc.util.CacheUtil
-
public class CacheUtil extends Object
Encapsulates a group of utility methods for managing and diagnosing the in-memory caches used by the JDBC PL.
-
-
Constructor Summary
Constructors Constructor Description CacheUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
dumpCacheContents(String cacheName, ConcurrentHashMap<String,ConcurrentHashMap<String,Integer>> mapOfMaps)
Takes the contents of one of the JDBC PL caches and represents the contents in a format suitable for logging.static String
reportCacheDiscrepancies(String cacheName, ConcurrentHashMap<String,Integer> cachedMap, Map<String,Integer> dbMap)
Reports on content discrepancies a JDBC PL cache and DB data that backs it.
-
-
-
Field Detail
-
NEWLINE
protected static final String NEWLINE
-
-
Method Detail
-
dumpCacheContents
public static String dumpCacheContents(String cacheName, ConcurrentHashMap<String,ConcurrentHashMap<String,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 String reportCacheDiscrepancies(String cacheName, ConcurrentHashMap<String,Integer> cachedMap, Map<String,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.
-
-