net.sf.ehcache.Cache.getMemoryStoreSize()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(209)

本文整理了Java中net.sf.ehcache.Cache.getMemoryStoreSize()方法的一些代码示例,展示了Cache.getMemoryStoreSize()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Cache.getMemoryStoreSize()方法的具体详情如下:
包路径:net.sf.ehcache.Cache
类名称:Cache
方法名:getMemoryStoreSize

Cache.getMemoryStoreSize介绍

[英]Returns the number of elements in the memory store.
[中]返回内存存储中的元素数。

代码示例

代码示例来源:origin: banq/jdonframework

public long size() {
  Cache cache = manager.getCache(ehcacheConf.getPredefinedCacheName());
  return cache.getMemoryStoreSize();
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache

/**
 * {@inheritDoc}
 *
 * @see net.sf.ehcache.hibernate.management.api.EhcacheStats#getNumberOfElementsInMemory(java.lang.String)
 */
public int getNumberOfElementsInMemory(String region) {
  Cache cache = this.cacheManager.getCache(region);
  if (cache != null) {
    return (int) cache.getMemoryStoreSize();
  } else {
    return -1;
  }
}

代码示例来源:origin: org.gatein.shindig/shindig-common

/**
  * @return The current size of the cache.
  *
  * Note that this does not call getSize on the underlying cache, which is very expensive. This
  * will not include the size of remote caches.
  */
 public long getSize() {
  return cache.getMemoryStoreSize() + cache.getDiskStoreSize();
 }
}

代码示例来源:origin: com.lmco.shindig/shindig-common

/**
  * @return The current size of the cache.
  *
  * Note that this does not call getSize on the underlying cache, which is very expensive. This
  * will not include the size of remote caches.
  */
 public long getSize() {
  return cache.getMemoryStoreSize() + cache.getDiskStoreSize();
 }
}

代码示例来源:origin: org.wso2.org.apache.shindig/shindig-common

/**
  * @return The current size of the cache.
  *
  * Note that this does not call getSize on the underlying cache, which is very expensive. This
  * will not include the size of remote caches.
  */
 public long getSize() {
  return cache.getMemoryStoreSize() + cache.getDiskStoreSize();
 }
}

代码示例来源:origin: org.apache.shindig/shindig-common

/**
  * @return The current size of the cache.
  *
  * Note that this does not call getSize on the underlying cache, which is very expensive. This
  * will not include the size of remote caches.
  */
 public long getSize() {
  return cache.getMemoryStoreSize() + cache.getDiskStoreSize();
 }
}

代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all

public long getElementCountInMemory() {
  try {
    return cache.getMemoryStoreSize();
  }
  catch (net.sf.ehcache.CacheException ce) {
    throw new CacheException( ce );
  }
}

代码示例来源:origin: apache/shindig

/**
  * @return The current size of the cache.
  *
  * Note that this does not call getSize on the underlying cache, which is very expensive. This
  * will not include the size of remote caches.
  */
 public long getSize() {
  return cache.getMemoryStoreSize() + cache.getDiskStoreSize();
 }
}

代码示例来源:origin: edu.ucar/netcdf

public void stats() {
 System.out.printf(" elems added= %s%n", addElements.get());
 System.out.printf(" reqs= %d%n", requests.get());
 System.out.printf(" hits= %d%n", hits.get());
 if (cache != null) {
  System.out.printf(" cache= %s%n", cache.toString());
  System.out.printf(" cache.size= %d%n", cache.getSize());
  System.out.printf(" cache.memorySize= %d%n", cache.getMemoryStoreSize());
  Statistics stats = cache.getStatistics();
  System.out.printf(" stats= %s%n", stats.toString());
 }
}

代码示例来源:origin: deegree/deegree3

@Override
public synchronized RasterData getRasterData() {
  // synchronized to prevent multiple reader.read()-calls when
  RasterData raster;
  if ( LOG.isDebugEnabled() ) {
    LOG.debug( "accessing: " + this.toString() );
  }
  Element elem = cache.get( identifier );
  if ( elem == null ) {
    raster = reader.read();
    elem = new Element( identifier, raster );
    cache.put( elem );
    if ( LOG.isDebugEnabled() ) {
      LOG.debug( "cache miss: " + this.toString() + "#mem: " + cache.getMemoryStoreSize() );
    }
  } else {
    raster = (RasterData) elem.getObjectValue();
    if ( LOG.isDebugEnabled() ) {
      LOG.debug( "cache hit: " + this.toString() );
    }
  }
  return raster;
}

代码示例来源:origin: actiontech/dble

@Override
public void clearCache() {
  LOGGER.info("clear cache " + name);
  enCache.removeAll();
  enCache.clearStatistics();
  cacheStatistics.reset();
  cacheStatistics.setMemorySize(enCache.getMemoryStoreSize());
}

代码示例来源:origin: org.apache.portals.jetspeed-2/jetspeed-cm

CacheMonitorStateImpl state = new CacheMonitorStateImpl(name);
Statistics statistics = cache.getStatistics();        
state.setMemoryStoreSize(cache.getMemoryStoreSize());
if (calculate)

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache

/**
 * {@inheritDoc}
 * <p/>
 * Note, the {@link #getSize} method will have the same value as the size
 * reported by Statistics for the statistics accuracy of
 * {@link Statistics#STATISTICS_ACCURACY_BEST_EFFORT}.
 */
public Statistics getStatistics() throws IllegalStateException {
  int size = getSizeBasedOnAccuracy(getLiveCacheStatistics()
      .getStatisticsAccuracy());
  return new Statistics(this, getLiveCacheStatistics()
      .getStatisticsAccuracy(), getLiveCacheStatistics()
      .getCacheHitCount(), getLiveCacheStatistics()
      .getOnDiskHitCount(), getLiveCacheStatistics()
      .getOffHeapHitCount(), getLiveCacheStatistics()
      .getInMemoryHitCount(), getLiveCacheStatistics()
      .getCacheMissCount(), getLiveCacheStatistics()
      .getOnDiskMissCount(), getLiveCacheStatistics()
      .getOffHeapMissCount(), getLiveCacheStatistics()
      .getInMemoryMissCount(), size, getAverageGetTime(),
      getLiveCacheStatistics().getEvictedCount(),
      getMemoryStoreSize(), getOffHeapStoreSize(), getDiskStoreSize(),
      getSearchesPerSecond(), getAverageSearchTime(), getLiveCacheStatistics().getWriterQueueLength());
}

相关文章

微信公众号

最新文章

更多

Cache类方法