本文整理了Java中net.sf.ehcache.config.Configuration.getMaxBytesLocalDisk()
方法的一些代码示例,展示了Configuration.getMaxBytesLocalDisk()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.getMaxBytesLocalDisk()
方法的具体详情如下:
包路径:net.sf.ehcache.config.Configuration
类名称:Configuration
方法名:getMaxBytesLocalDisk
[英]Maximum amount of bytes the CacheManager will use on the Disk Tier.
[中]CacheManager将在磁盘层上使用的最大字节数。
代码示例来源:origin: net.sf.ehcache/ehcache
/**
* @return Original input for maxBytesLocalDisk
*/
public String getMaxBytesLocalDiskAsString() {
return maxBytesLocalDiskInput != null ? maxBytesLocalDiskInput : Long.toString(getMaxBytesLocalDisk());
}
代码示例来源:origin: net.sf.ehcache/ehcache
private void testAddMaxBytesLocalDiskAttribute() {
if (configuration.getMaxBytesLocalDisk() > 0) {
addAttribute(new SimpleNodeAttribute("maxBytesLocalDisk", configuration.getMaxBytesLocalDiskAsString())
.optional(true).defaultValue(String.valueOf(Configuration.DEFAULT_MAX_BYTES_ON_DISK)));
}
}
代码示例来源:origin: net.sf.ehcache/ehcache
/**
* {@inheritDoc}
*/
public long getMaxBytesLocalDisk() {
return cacheManager.getConfiguration().getMaxBytesLocalDisk();
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache
private void testAddMaxBytesLocalDiskAttribute() {
if (configuration.getMaxBytesLocalDisk() > 0) {
addAttribute(new SimpleNodeAttribute("maxBytesLocalDisk", configuration.getMaxBytesLocalDiskAsString())
.optional(true).defaultValue(String.valueOf(Configuration.DEFAULT_MAX_BYTES_ON_DISK)));
}
}
代码示例来源:origin: net.sf.ehcache/ehcache
private static void validateOverAllocation(RuntimeCfg config, Long newValue) {
ArrayList<ConfigError> errors = new ArrayList<ConfigError>();
for (Cache cache : getAllActiveCaches(config.cacheManager)) {
CacheConfiguration cacheConfiguration = cache.getCacheConfiguration();
errors.addAll(cacheConfiguration.validateCachePools(config.getConfiguration()));
errors.addAll(cacheConfiguration.verifyPoolAllocationsBeforeAddingTo(config.cacheManager,
newValue, config.getConfiguration().getMaxBytesLocalOffHeap(),
config.getConfiguration().getMaxBytesLocalDisk(), null));
}
if (!errors.isEmpty()) {
throw new InvalidConfigurationException("Can't reduce CacheManager byte tuning by so much", errors);
}
}
代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache
private void testAddMaxBytesLocalDiskAttribute() {
if (configuration.getMaxBytesLocalDisk() > 0) {
addAttribute(new SimpleNodeAttribute("maxBytesLocalDisk", configuration.getMaxBytesLocalDiskAsString())
.optional(true).defaultValue(String.valueOf(Configuration.DEFAULT_MAX_BYTES_ON_DISK)));
}
}
代码示例来源:origin: net.sf.ehcache/ehcache
/**
* {@inheritDoc}
*/
@Override
public void setMaxBytesLocalDisk(long maxBytes) {
try {
if (cache.getCacheManager().getConfiguration().isMaxBytesLocalDiskSet()) {
long diskPoolSize = cache.getCacheManager().getConfiguration().getMaxBytesLocalDisk();
if (maxBytes > diskPoolSize) {
throw new IllegalArgumentException("Requested maxBytesLocalDisk (" + maxBytes
+ ") greater than available CacheManager disk pool size (" + diskPoolSize + ")");
}
}
cache.getCacheConfiguration().setMaxBytesLocalDisk(maxBytes);
} catch (RuntimeException e) {
throw Utils.newPlainException(e);
}
}
代码示例来源:origin: net.sf.ehcache.internal/ehcache-core
private void testAddMaxBytesLocalDiskAttribute() {
if (configuration.getMaxBytesLocalDisk() > 0) {
addAttribute(new SimpleNodeAttribute("maxBytesLocalDisk", configuration.getMaxBytesLocalDiskAsString())
.optional(true).defaultValue(String.valueOf(Configuration.DEFAULT_MAX_BYTES_ON_DISK)));
}
}
代码示例来源:origin: net.sf.ehcache/ehcache
/**
* {@inheritDoc}
*/
@Override
public void setMaxBytesLocalDiskAsString(String maxBytes) {
try {
cache.getCacheConfiguration().setMaxBytesLocalDisk(maxBytes);
} catch (RuntimeException e) {
throw Utils.newPlainException(e);
}
if (cache.getCacheConfiguration().isMaxBytesLocalDiskPercentageSet()) {
long cacheAssignedMem = cache.getCacheManager().getConfiguration().getMaxBytesLocalDisk()
* cache.getCacheConfiguration().getMaxBytesLocalDiskPercentage() / PERCENTAGE_DIVISOR;
setMaxBytesLocalDisk(cacheAssignedMem);
}
}
代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache
/**
* @return Original input for maxBytesLocalDisk
*/
public String getMaxBytesLocalDiskAsString() {
return maxBytesLocalDiskInput != null ? maxBytesLocalDiskInput : Long.toString(getMaxBytesLocalDisk());
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache
/**
* @return Original input for maxBytesLocalDisk
*/
public String getMaxBytesLocalDiskAsString() {
return maxBytesLocalDiskInput != null ? maxBytesLocalDiskInput : Long.toString(getMaxBytesLocalDisk());
}
代码示例来源:origin: net.sf.ehcache.internal/ehcache-core
/**
* @return Original input for maxBytesLocalDisk
*/
public String getMaxBytesLocalDiskAsString() {
return maxBytesLocalDiskInput != null ? maxBytesLocalDiskInput : Long.toString(getMaxBytesLocalDisk());
}
代码示例来源: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
this.onDiskPool = new BoundedPool(configuration.getMaxBytesLocalDisk(), evictor, null);
代码示例来源:origin: net.sf.ehcache.internal/ehcache-core
/**
* {@inheritDoc}
*/
public long getMaxBytesLocalDisk() {
return cacheManager.getConfiguration().getMaxBytesLocalDisk();
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache
/**
* {@inheritDoc}
*/
public long getMaxBytesLocalDisk() {
return cacheManager.getConfiguration().getMaxBytesLocalDisk();
}
代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache
/**
* {@inheritDoc}
*/
public long getMaxBytesLocalDisk() {
return cacheManager.getConfiguration().getMaxBytesLocalDisk();
}
代码示例来源:origin: net.sf.ehcache/ehcache
cacheManager.getConfiguration().getMaxBytesLocalHeap(),
cacheManager.getConfiguration().getMaxBytesLocalOffHeap(),
cacheManager.getConfiguration().getMaxBytesLocalDisk(), parentCache));
if (!errors.isEmpty()) {
throw new InvalidConfigurationException(errors);
代码示例来源:origin: net.sf.ehcache.internal/ehcache-core
private static void validateOverAllocation(RuntimeCfg config, Long newValue) {
ArrayList<ConfigError> errors = new ArrayList<ConfigError>();
for (Cache cache : getAllActiveCaches(config.cacheManager)) {
CacheConfiguration cacheConfiguration = cache.getCacheConfiguration();
errors.addAll(cacheConfiguration.validateCachePools(config.getConfiguration()));
errors.addAll(cacheConfiguration.verifyPoolAllocationsBeforeAddingTo(config.cacheManager,
newValue, config.getConfiguration().getMaxBytesLocalOffHeap(),
config.getConfiguration().getMaxBytesLocalDisk(), null));
}
if (!errors.isEmpty()) {
throw new InvalidConfigurationException("Can't reduce CacheManager byte tuning by so much", errors);
}
}
代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache
private static void validateOverAllocation(RuntimeCfg config, Long newValue) {
ArrayList<ConfigError> errors = new ArrayList<ConfigError>();
for (Cache cache : getAllActiveCaches(config.cacheManager)) {
CacheConfiguration cacheConfiguration = cache.getCacheConfiguration();
errors.addAll(cacheConfiguration.validateCachePools(config.getConfiguration()));
errors.addAll(cacheConfiguration.verifyPoolAllocationsBeforeAddingTo(config.cacheManager,
newValue, config.getConfiguration().getMaxBytesLocalOffHeap(),
config.getConfiguration().getMaxBytesLocalDisk(), null));
}
if (!errors.isEmpty()) {
throw new InvalidConfigurationException("Can't reduce CacheManager byte tuning by so much", errors);
}
}
内容来源于网络,如有侵权,请联系作者删除!