本文整理了Java中net.sf.ehcache.Ehcache.getDiskStoreSize()
方法的一些代码示例,展示了Ehcache.getDiskStoreSize()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ehcache.getDiskStoreSize()
方法的具体详情如下:
包路径:net.sf.ehcache.Ehcache
类名称:Ehcache
方法名:getDiskStoreSize
[英]Returns the number of elements in the disk store.
[中]返回磁盘存储中的元素数。
代码示例来源:origin: apache/shiro
/**
* Returns the size (in bytes) that this EhCache's disk store is consuming or <code>-1</code> if
* that number is unknown or cannot be calculated.
*
* @return the size (in bytes) that this EhCache's disk store is consuming or <code>-1</code> if
* that number is unknown or cannot be calculated.
*/
public long getDiskStoreSize() {
try {
return cache.getDiskStoreSize();
} catch (Throwable t) {
throw new CacheException(t);
}
}
代码示例来源:origin: net.sf.ehcache/ehcache
/**
* {@inheritDoc}
*/
@Deprecated public int getDiskStoreSize() throws IllegalStateException {
return underlyingCache.getDiskStoreSize();
}
代码示例来源:origin: net.sf.ehcache/ehcache
/**
* {@inheritDoc}
*/
@Deprecated public int getDiskStoreSize() throws IllegalStateException {
// THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
Thread t = Thread.currentThread();
ClassLoader prev = t.getContextClassLoader();
t.setContextClassLoader(this.classLoader);
try {
return this.cache.getDiskStoreSize();
} finally {
t.setContextClassLoader(prev);
}
}
代码示例来源:origin: javamelody/javamelody
} else {
this.inMemoryObjectCount = cache.getMemoryStoreSize();
this.onDiskObjectCount = cache.getDiskStoreSize();
代码示例来源:origin: net.sf.ehcache/ehcache-explicitlocking
/**
* Returns the number of elements in the disk store.
*
* @return the number of elements in the disk store.
* @throws IllegalStateException
* if the cache is not {@link net.sf.ehcache.Status#STATUS_ALIVE}
*/
public int getDiskStoreSize() throws IllegalStateException {
return cache.getDiskStoreSize();
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache
/**
* {@inheritDoc}
*/
public int getDiskStoreSize() throws IllegalStateException {
return underlyingCache.getDiskStoreSize();
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache
/**
* @return the number of elements in ehcache's DiskStore. 0 is there is no DiskStore
*/
public final long getElementCountOnDisk() {
return cache.getDiskStoreSize();
}
代码示例来源:origin: org.terracotta/ehcache-probe
public Long call() throws Exception {
return (long) cache.getDiskStoreSize();
}
}));
代码示例来源:origin: net.sf.ehcache.internal/ehcache-core
/**
* {@inheritDoc}
*/
@Deprecated public int getDiskStoreSize() throws IllegalStateException {
return underlyingCache.getDiskStoreSize();
}
代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache
/**
* {@inheritDoc}
*/
@Deprecated public int getDiskStoreSize() throws IllegalStateException {
return underlyingCache.getDiskStoreSize();
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache
/**
* {@inheritDoc}
*/
public long getLocalDiskSize() {
if (!statisticsEnabled.get()) {
return 0;
}
return cache.getDiskStoreSize();
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache
/**
* {@inheritDoc}
*/
public int getDiskStoreSize() throws IllegalStateException {
// THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
Thread t = Thread.currentThread();
ClassLoader prev = t.getContextClassLoader();
t.setContextClassLoader(this.classLoader);
try {
return this.cache.getDiskStoreSize();
} finally {
t.setContextClassLoader(prev);
}
}
代码示例来源:origin: net.sf.ehcache.internal/ehcache-core
/**
* {@inheritDoc}
*/
@Deprecated public int getDiskStoreSize() throws IllegalStateException {
// THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
Thread t = Thread.currentThread();
ClassLoader prev = t.getContextClassLoader();
t.setContextClassLoader(this.classLoader);
try {
return this.cache.getDiskStoreSize();
} finally {
t.setContextClassLoader(prev);
}
}
代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache
/**
* {@inheritDoc}
*/
@Deprecated public int getDiskStoreSize() throws IllegalStateException {
// THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
Thread t = Thread.currentThread();
ClassLoader prev = t.getContextClassLoader();
t.setContextClassLoader(this.classLoader);
try {
return this.cache.getDiskStoreSize();
} finally {
t.setContextClassLoader(prev);
}
}
代码示例来源:origin: com.madgag/mini-git-server-server
public int getDiskStoreSize() throws IllegalStateException {
return self().getDiskStoreSize();
}
代码示例来源:origin: rtyley/mini-git-server
public int getDiskStoreSize() throws IllegalStateException {
return self().getDiskStoreSize();
}
代码示例来源:origin: org.apache.shiro/shiro-ehcache
/**
* Returns the size (in bytes) that this EhCache's disk store is consuming or <code>-1</code> if
* that number is unknown or cannot be calculated.
*
* @return the size (in bytes) that this EhCache's disk store is consuming or <code>-1</code> if
* that number is unknown or cannot be calculated.
*/
public long getDiskStoreSize() {
try {
return cache.getDiskStoreSize();
} catch (Throwable t) {
throw new CacheException(t);
}
}
代码示例来源:origin: DSpace/DSpace
/**
* Generate some stats for this cache.
* Note that this is not cheap so do not use it very often.
*
* @param cache an Ehcache
* @return the stats of this cache as a string
*/
protected static String generateCacheStats(Ehcache cache) {
StringBuilder sb = new StringBuilder();
sb.append(cache.getName()).append(":");
// this will make this costly but it is important to get accurate settings
cache.setStatisticsAccuracy(Statistics.STATISTICS_ACCURACY_GUARANTEED);
Statistics stats = cache.getStatistics();
final long memSize = cache.getMemoryStoreSize();
final long diskSize = cache.getDiskStoreSize();
final long size = memSize + diskSize;
final long hits = stats.getCacheHits();
final long misses = stats.getCacheMisses();
final String hitPercentage = ((hits + misses) > 0) ? ((100l * hits) / (hits + misses)) + "%" : "N/A";
final String missPercentage = ((hits + misses) > 0) ? ((100l * misses) / (hits + misses)) + "%" : "N/A";
sb.append(" Size: ").append(size).append(" [memory:").append(memSize).append(", disk:").append(diskSize)
.append("]");
sb.append(", Hits: ").append(hits).append(" [memory:").append(stats.getInMemoryHits()).append(", disk:")
.append(stats.getOnDiskHits()).append("] (").append(hitPercentage).append(")");
sb.append(", Misses: ").append(misses).append(" (").append(missPercentage).append(")");
return sb.toString();
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache
/**
* {@inheritDoc}
*/
public long getElementCountOnDisk() {
try {
return cache.getDiskStoreSize();
} catch (net.sf.ehcache.CacheException ce) {
if (ce instanceof NonStopCacheException) {
HibernateNonstopCacheExceptionHandler.getInstance().handleNonstopCacheException((NonStopCacheException) ce);
return -1;
} else {
throw new CacheException(ce);
}
}
}
代码示例来源:origin: org.terracotta/ehcache-probe
@RestMethod(required = { PARAM_CACHE })
public void getCacheElementCountDisk(RestRequest request,
RestResponse response) throws IOException {
String cacheName = request.getParameter(PARAM_CACHE);
Ehcache cache = cacheManager.getEhcache(cacheName);
if (cache != null) {
response.value(cache.getDiskStoreSize());
}
}
内容来源于网络,如有侵权,请联系作者删除!