Пример #1
0
 /** {@inheritDoc} */
 @Override
 public <V extends VType> Query createQuery(
     String channelName, Class<V> type, QueryParameters parameters) {
   CacheConfig config = configMap.get(parameters.config);
   if (config == null) config = configMap.get(Parameter.Default);
   PVCache pvCache = (PVCache) cachedPVs.get(channelName);
   if (pvCache == null) {
     pvCache = new PVCacheImpl(channelName, config.getSources(), config.getStorage());
     // TODO: calculate retrieval gap from statistics
     ((PVCacheImpl) pvCache).setRetrievalGap(config.getRetrievalGap());
     pvCache.setStatisticsEnabled(statisticsEnabled);
     cachedPVs.put(channelName, pvCache);
   }
   Query query = new QueryImpl(pvCache, config.getNbOfChunksPerQuery());
   query.update(parameters);
   return query;
 }
Пример #2
0
 /** {@inheritDoc} */
 @Override
 public void flush() {
   for (PVCache pvCache : cachedPVs.values()) pvCache.flush();
 }
Пример #3
0
 /** {@inheritDoc} */
 @Override
 public void setStatisticsEnabled(boolean enabled) {
   this.statisticsEnabled = enabled;
   for (PVCache pvCache : cachedPVs.values()) pvCache.setStatisticsEnabled(statisticsEnabled);
 }