本文整理了Java中net.sf.ehcache.config.Configuration.getMaxBytesLocalHeap()
方法的一些代码示例,展示了Configuration.getMaxBytesLocalHeap()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.getMaxBytesLocalHeap()
方法的具体详情如下:
包路径:net.sf.ehcache.config.Configuration
类名称:Configuration
方法名:getMaxBytesLocalHeap
[英]Maximum amount of bytes the CacheManager will use on the heap
[中]CacheManager将在堆上使用的最大字节数
代码示例来源:origin: net.sf.ehcache/ehcache
/**
* @return Original input for maxBytesLocalHeap
*/
public String getMaxBytesLocalHeapAsString() {
return maxBytesLocalHeapInput != null ? maxBytesLocalHeapInput : Long.toString(getMaxBytesLocalHeap());
}
代码示例来源:origin: net.sf.ehcache/ehcache
private void testAddMaxBytesLocalHeapAttribute() {
if (configuration.getMaxBytesLocalHeap() > 0) {
addAttribute(new SimpleNodeAttribute("maxBytesLocalHeap", configuration.getMaxBytesLocalHeapAsString())
.optional(true).defaultValue(String.valueOf(Configuration.DEFAULT_MAX_BYTES_ON_HEAP)));
}
}
代码示例来源:origin: net.sf.ehcache/ehcache
/**
* {@inheritDoc}
*/
public long getMaxBytesLocalHeap() {
return cacheManager.getConfiguration().getMaxBytesLocalHeap();
}
代码示例来源:origin: net.sf.ehcache.internal/ehcache-core
private void testAddMaxBytesLocalHeapAttribute() {
if (configuration.getMaxBytesLocalHeap() > 0) {
addAttribute(new SimpleNodeAttribute("maxBytesLocalHeap", configuration.getMaxBytesLocalHeapAsString())
.optional(true).defaultValue(String.valueOf(Configuration.DEFAULT_MAX_BYTES_ON_HEAP)));
}
}
代码示例来源:origin: net.sf.ehcache/ehcache
if (configuration.isMaxBytesLocalHeapSet() && Runtime.getRuntime().maxMemory() - configuration.getMaxBytesLocalHeap() < 0) {
errors.add(new ConfigError("You've assigned more memory to the on-heap than the VM can sustain, " +
"please adjust your -Xmx setting accordingly"));
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache
private void testAddMaxBytesLocalHeapAttribute() {
if (configuration.getMaxBytesLocalHeap() > 0) {
addAttribute(new SimpleNodeAttribute("maxBytesLocalHeap", configuration.getMaxBytesLocalHeapAsString())
.optional(true).defaultValue(String.valueOf(Configuration.DEFAULT_MAX_BYTES_ON_HEAP)));
}
}
代码示例来源:origin: net.sf.ehcache/ehcache
/**
* {@inheritDoc}
*/
@Override
public void setMaxBytesLocalHeap(long maxBytes) {
try {
if (cache.getCacheManager().getConfiguration().isMaxBytesLocalHeapSet()) {
long heapPoolSize = cache.getCacheManager().getConfiguration().getMaxBytesLocalHeap();
if (maxBytes > heapPoolSize) {
throw new IllegalArgumentException("Requested maxBytesLocalHeap (" + maxBytes
+ ") greater than available CacheManager heap pool size (" + heapPoolSize + ")");
}
}
cache.getCacheConfiguration().setMaxBytesLocalHeap(maxBytes);
} catch (RuntimeException e) {
throw Utils.newPlainException(e);
}
}
代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache
private void testAddMaxBytesLocalHeapAttribute() {
if (configuration.getMaxBytesLocalHeap() > 0) {
addAttribute(new SimpleNodeAttribute("maxBytesLocalHeap", configuration.getMaxBytesLocalHeapAsString())
.optional(true).defaultValue(String.valueOf(Configuration.DEFAULT_MAX_BYTES_ON_HEAP)));
}
}
代码示例来源:origin: net.sf.ehcache/ehcache
/**
* {@inheritDoc}
*/
@Override
public void setMaxBytesLocalHeapAsString(String maxBytes) {
try {
cache.getCacheConfiguration().setMaxBytesLocalHeap(maxBytes);
} catch (RuntimeException e) {
throw Utils.newPlainException(e);
}
if (cache.getCacheConfiguration().isMaxBytesLocalHeapPercentageSet()) {
long cacheAssignedMem = cache.getCacheManager().getConfiguration().getMaxBytesLocalHeap()
* cache.getCacheConfiguration().getMaxBytesLocalHeapPercentage() / PERCENTAGE_DIVISOR;
setMaxBytesLocalHeap(cacheAssignedMem);
}
}
代码示例来源:origin: net.sf.ehcache.internal/ehcache-core
/**
* @return Original input for maxBytesLocalHeap
*/
public String getMaxBytesLocalHeapAsString() {
return maxBytesLocalHeapInput != null ? maxBytesLocalHeapInput : Long.toString(getMaxBytesLocalHeap());
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache
/**
* @return Original input for maxBytesLocalHeap
*/
public String getMaxBytesLocalHeapAsString() {
return maxBytesLocalHeapInput != null ? maxBytesLocalHeapInput : Long.toString(getMaxBytesLocalHeap());
}
代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache
/**
* @return Original input for maxBytesLocalHeap
*/
public String getMaxBytesLocalHeapAsString() {
return maxBytesLocalHeapInput != null ? maxBytesLocalHeapInput : Long.toString(getMaxBytesLocalHeap());
}
代码示例来源:origin: net.sf.ehcache/ehcache
/**
* Configures the cache pools
* @param configuration the Configuration of the CacheManager managing this cache
*/
void configCachePools(Configuration configuration) {
long cacheAssignedMem;
if (getMaxBytesLocalHeapPercentage() != null) {
cacheAssignedMem = configuration.getMaxBytesLocalHeap() * getMaxBytesLocalHeapPercentage() / HUNDRED_PERCENT;
setMaxBytesLocalHeap(cacheAssignedMem);
}
if (offHeapPoolUsage == null && getMaxBytesLocalOffHeapPercentage() != null) {
cacheAssignedMem = configuration.getMaxBytesLocalOffHeap() * getMaxBytesLocalOffHeapPercentage() / HUNDRED_PERCENT;
setMaxBytesLocalOffHeap(cacheAssignedMem);
}
if (getMaxBytesLocalDiskPercentage() != null) {
cacheAssignedMem = configuration.getMaxBytesLocalDisk() * getMaxBytesLocalDiskPercentage() / HUNDRED_PERCENT;
setMaxBytesLocalDisk(cacheAssignedMem);
}
}
代码示例来源:origin: net.sf.ehcache/ehcache
PoolEvictor evictor = new BalancedAccessEvictor();
SizeOfEngine sizeOfEngine = createSizeOfEngine(null);
this.onHeapPool = new BoundedPool(configuration.getMaxBytesLocalHeap(), evictor, sizeOfEngine);
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache
/**
* {@inheritDoc}
*/
public long getMaxBytesLocalHeap() {
return cacheManager.getConfiguration().getMaxBytesLocalHeap();
}
代码示例来源:origin: net.sf.ehcache.internal/ehcache-core
/**
* {@inheritDoc}
*/
public long getMaxBytesLocalHeap() {
return cacheManager.getConfiguration().getMaxBytesLocalHeap();
}
代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache
/**
* {@inheritDoc}
*/
public long getMaxBytesLocalHeap() {
return cacheManager.getConfiguration().getMaxBytesLocalHeap();
}
代码示例来源:origin: net.sf.ehcache/ehcache
configCachePools(cacheManager.getConfiguration());
errors.addAll(verifyPoolAllocationsBeforeAddingTo(cacheManager,
cacheManager.getConfiguration().getMaxBytesLocalHeap(),
cacheManager.getConfiguration().getMaxBytesLocalOffHeap(),
cacheManager.getConfiguration().getMaxBytesLocalDisk(), parentCache));
代码示例来源:origin: net.sf.ehcache/ehcache
element.addAttribute(new SimpleNodeAttribute("eternal", cacheConfiguration.isEternal()).optional(true).defaultValue(
CacheConfiguration.DEFAULT_ETERNAL_VALUE));
if (!(cacheConfiguration.getMaxBytesLocalHeap() > 0 || configuration.getMaxBytesLocalHeap() > 0)) {
element.addAttribute(new SimpleNodeAttribute("maxEntriesLocalHeap", cacheConfiguration.getMaxEntriesLocalHeap()).optional(false));
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache
/**
* {@inheritDoc}
*/
public void setMaxBytesLocalHeapAsString(String maxBytes) {
try {
cache.getCacheConfiguration().setMaxBytesLocalHeap(maxBytes);
} catch (RuntimeException e) {
throw Utils.newPlainException(e);
}
if (cache.getCacheConfiguration().isMaxBytesLocalHeapPercentageSet()) {
long cacheAssignedMem = cache.getCacheManager().getConfiguration().getMaxBytesLocalHeap() *
cache.getCacheConfiguration().getMaxBytesLocalHeapPercentage() / PERCENTAGE_DIVISOR;
setMaxBytesLocalHeap(cacheAssignedMem);
}
}
内容来源于网络,如有侵权,请联系作者删除!