diff --git a/src/main/java/org/breedinginsight/daos/cache/ProgramCache.java b/src/main/java/org/breedinginsight/daos/cache/ProgramCache.java index cb28fb67f..d231116ae 100644 --- a/src/main/java/org/breedinginsight/daos/cache/ProgramCache.java +++ b/src/main/java/org/breedinginsight/daos/cache/ProgramCache.java @@ -56,6 +56,7 @@ public void populate(List keys) { public void populate(@NotNull UUID key) { String cacheKey = generateCacheKey(key); + log.debug("populate(UUID key) method called with key: " + cacheKey); RSemaphore semaphore = connection.getSemaphore(cacheKey+":semaphore"); semaphore.trySetPermits(1); @@ -72,7 +73,7 @@ public void populate(@NotNull UUID key) { next refresh will pick up data persisted by this thread */ if(queueSemaphore.tryAcquire()) { - log.debug("Attempting to refresh"); + log.debug("Attempting to refresh for: " + cacheKey); try { // block until we get the green light to refresh the cache semaphore.acquire(); @@ -110,6 +111,8 @@ public void populate(@NotNull UUID key) { RMap map = connection.getMap(cacheKey); map.clear(); map.putAll(entryMap); + } else { + log.debug("No values to cache for key: " + cacheKey); } log.debug("cache loading complete for key: " + cacheKey); } catch (Exception e) { @@ -139,11 +142,11 @@ public Map get(UUID key) throws ApiException { if (!connection.getBucket(cacheKey).isExists()) { RSemaphore semaphore = connection.getSemaphore(cacheKey + ":semaphore"); try { - log.debug("cache miss, populating"); + log.debug("cache miss, populating for key: " + cacheKey); populate(key); //block until any updates are done semaphore.acquire(); - log.debug("Cache loading done!!!!"); + log.debug("Cache loading done!!!! - key: " + cacheKey); } catch(Exception e){ throw new ApiException(e); } finally {