@Override public Collection<? extends CacheStatistics> getCacheStats(String cacheType) throws AdminException { if(cacheType.equals(Admin.Cache.QUERY_SERVICE_RESULT_SET_CACHE.name())){ return Arrays.asList(this.embeddedServer.getRsCache().buildCacheStats(cacheType)); } else if(cacheType.equals(Admin.Cache.PREPARED_PLAN_CACHE.name())) { return Arrays.asList(this.embeddedServer.getPpcCache().buildCacheStats(cacheType)); } else { throw new AdminProcessingException(RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40139, cacheType, Admin.Cache.QUERY_SERVICE_RESULT_SET_CACHE, Admin.Cache.PREPARED_PLAN_CACHE)); } }
@Override public void clearCache(String cacheType, String vdbName, String vdbVersion) throws AdminException { checkVDB(vdbName, vdbVersion); if(cacheType.equals(Admin.Cache.QUERY_SERVICE_RESULT_SET_CACHE.name())){ this.embeddedServer.getRsCache().clearForVDB(new VDBKey(vdbName, vdbVersion)); } else if(cacheType.equals(Admin.Cache.PREPARED_PLAN_CACHE.name())) { this.embeddedServer.getPpcCache().clearForVDB(new VDBKey(vdbName, vdbVersion)); } else { throw new AdminProcessingException(RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40139, cacheType, Admin.Cache.QUERY_SERVICE_RESULT_SET_CACHE, Admin.Cache.PREPARED_PLAN_CACHE)); } }
@Override public void clearCache(String cacheType) throws AdminException { if(cacheType.equals(Admin.Cache.QUERY_SERVICE_RESULT_SET_CACHE.name())){ this.embeddedServer.getRsCache().clearAll(); } else if(cacheType.equals(Admin.Cache.PREPARED_PLAN_CACHE.name())) { this.embeddedServer.getPpcCache().clearAll(); } else { throw new AdminProcessingException(RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40139, cacheType, Admin.Cache.QUERY_SERVICE_RESULT_SET_CACHE, Admin.Cache.PREPARED_PLAN_CACHE)); } }