net.sf.ehcache.config.Configuration.setMaxBytesLocalDisk()方法的使用及代码示例

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

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

Configuration.setMaxBytesLocalDisk介绍

[英]Sets maximum amount of bytes the CacheManager will use on the Disk Tier.
[中]设置CacheManager将在磁盘层上使用的最大字节数。

代码示例

代码示例来源:origin: net.sf.ehcache/ehcache

/**
 * Sets the maxOnDisk size
 * @param amount the amount of unit
 * @param memoryUnit the actual unit
 * @return this
 * @see #setMaxBytesLocalDisk(Long)
 */
public Configuration maxBytesLocalDisk(final long amount, final MemoryUnit memoryUnit) {
  setMaxBytesLocalDisk(memoryUnit.toBytes(amount));
  return this;
}

代码示例来源:origin: net.sf.ehcache/ehcache

/**
 * {@inheritDoc}
 */
public void setMaxBytesLocalDiskAsString(String maxBytes) {
  try {
    cacheManager.getConfiguration().setMaxBytesLocalDisk(maxBytes);
  } catch (RuntimeException e) {
    throw Utils.newPlainException(e);
  }
}

代码示例来源:origin: net.sf.ehcache/ehcache

/**
 * {@inheritDoc}
 */
public void setMaxBytesLocalDisk(long maxBytes) {
  try {
    cacheManager.getConfiguration().setMaxBytesLocalDisk(maxBytes);
  } catch (RuntimeException e) {
    throw Utils.newPlainException(e);
  }
}

代码示例来源:origin: net.sf.ehcache/ehcache

/**
 * Sets maximum amount of bytes the CacheManager will use on the Disk Tier.
 * @param maxBytesOnDisk String representation of the size.
 * @see MemoryUnit#parseSizeInBytes(String)
 */
public void setMaxBytesLocalDisk(final String maxBytesOnDisk) {
  assertArgumentNotNull("MaxBytesLocalDisk", maxBytesOnDisk);
  
  final String origInput = maxBytesLocalDiskInput;
  try {
    maxBytesLocalDiskInput = maxBytesOnDisk;
    setMaxBytesLocalDisk(MemoryUnit.parseSizeInBytes(maxBytesOnDisk));
  } catch (RuntimeException rte) {
    maxBytesLocalDiskInput = origInput;
    throw rte;
  }
}

代码示例来源:origin: net.sf.ehcache.internal/ehcache-core

/**
 * Sets the maxOnDisk size
 * @param amount the amount of unit
 * @param memoryUnit the actual unit
 * @return this
 * @see #setMaxBytesLocalDisk(Long)
 */
public Configuration maxBytesLocalDisk(final long amount, final MemoryUnit memoryUnit) {
  setMaxBytesLocalDisk(memoryUnit.toBytes(amount));
  return this;
}

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

/**
 * Sets the maxOnDisk size
 * @param amount the amount of unit
 * @param memoryUnit the actual unit
 * @return this
 * @see #setMaxBytesLocalDisk(Long)
 */
public Configuration maxBytesLocalDisk(final long amount, final MemoryUnit memoryUnit) {
  setMaxBytesLocalDisk(memoryUnit.toBytes(amount));
  return this;
}

代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache

/**
 * Sets the maxOnDisk size
 * @param amount the amount of unit
 * @param memoryUnit the actual unit
 * @return this
 * @see #setMaxBytesLocalDisk(Long)
 */
public Configuration maxBytesLocalDisk(final long amount, final MemoryUnit memoryUnit) {
  setMaxBytesLocalDisk(memoryUnit.toBytes(amount));
  return this;
}

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

/**
 * {@inheritDoc}
 */
public void setMaxBytesLocalDisk(long maxBytes) {
  try {
    cacheManager.getConfiguration().setMaxBytesLocalDisk(maxBytes);
  } catch (RuntimeException e) {
    throw Utils.newPlainException(e);
  }
}

代码示例来源:origin: net.sf.ehcache.internal/ehcache-core

/**
 * {@inheritDoc}
 */
public void setMaxBytesLocalDiskAsString(String maxBytes) {
  try {
    cacheManager.getConfiguration().setMaxBytesLocalDisk(maxBytes);
  } catch (RuntimeException e) {
    throw Utils.newPlainException(e);
  }
}

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

/**
 * Sets maximum amount of bytes the CacheManager will use on the Disk Tier.
 * @param maxBytesOnDisk String representation of the size.
 * @see MemoryUnit#parseSizeInBytes(String)
 */
public void setMaxBytesLocalDisk(final String maxBytesOnDisk) {
  assertArgumentNotNull("MaxBytesLocalDisk", maxBytesOnDisk);
  setMaxBytesLocalDisk(MemoryUnit.parseSizeInBytes(maxBytesOnDisk));
  maxBytesLocalDiskInput = maxBytesOnDisk;
}

代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache

/**
 * {@inheritDoc}
 */
public void setMaxBytesLocalDiskAsString(String maxBytes) {
  try {
    cacheManager.getConfiguration().setMaxBytesLocalDisk(maxBytes);
  } catch (RuntimeException e) {
    throw Utils.newPlainException(e);
  }
}

代码示例来源:origin: net.sf.ehcache.internal/ehcache-core

/**
 * {@inheritDoc}
 */
public void setMaxBytesLocalDisk(long maxBytes) {
  try {
    cacheManager.getConfiguration().setMaxBytesLocalDisk(maxBytes);
  } catch (RuntimeException e) {
    throw Utils.newPlainException(e);
  }
}

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

/**
 * {@inheritDoc}
 */
public void setMaxBytesLocalDiskAsString(String maxBytes) {
  try {
    cacheManager.getConfiguration().setMaxBytesLocalDisk(maxBytes);
  } catch (RuntimeException e) {
    throw Utils.newPlainException(e);
  }
}

代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache

/**
 * {@inheritDoc}
 */
public void setMaxBytesLocalDisk(long maxBytes) {
  try {
    cacheManager.getConfiguration().setMaxBytesLocalDisk(maxBytes);
  } catch (RuntimeException e) {
    throw Utils.newPlainException(e);
  }
}

代码示例来源:origin: net.sf.ehcache.internal/ehcache-core

/**
 * Sets maximum amount of bytes the CacheManager will use on the Disk Tier.
 * @param maxBytesOnDisk String representation of the size.
 * @see MemoryUnit#parseSizeInBytes(String)
 */
public void setMaxBytesLocalDisk(final String maxBytesOnDisk) {
  assertArgumentNotNull("MaxBytesLocalDisk", maxBytesOnDisk);
  
  final String origInput = maxBytesLocalDiskInput;
  try {
    maxBytesLocalDiskInput = maxBytesOnDisk;
    setMaxBytesLocalDisk(MemoryUnit.parseSizeInBytes(maxBytesOnDisk));
  } catch (RuntimeException rte) {
    maxBytesLocalDiskInput = origInput;
    throw rte;
  }
}

代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache

/**
 * Sets maximum amount of bytes the CacheManager will use on the Disk Tier.
 * @param maxBytesOnDisk String representation of the size.
 * @see MemoryUnit#parseSizeInBytes(String)
 */
public void setMaxBytesLocalDisk(final String maxBytesOnDisk) {
  assertArgumentNotNull("MaxBytesLocalDisk", maxBytesOnDisk);
  
  final String origInput = maxBytesLocalDiskInput;
  try {
    maxBytesLocalDiskInput = maxBytesOnDisk;
    setMaxBytesLocalDisk(MemoryUnit.parseSizeInBytes(maxBytesOnDisk));
  } catch (RuntimeException rte) {
    maxBytesLocalDiskInput = origInput;
    throw rte;
  }
}

代码示例来源:origin: org.geotools/gt-s3-geotiff

private static CacheManager buildCache(CacheConfig config) {
  CacheManager manager;
  if (config.getConfigurationPath() != null) {
    manager = CacheManager.newInstance(config.getConfigurationPath());
  } else {
    Configuration cacheConfig = new Configuration();
    cacheConfig.setMaxBytesLocalDisk((long) config.getDiskCacheSize());
    cacheConfig.setMaxBytesLocalHeap((long) config.getHeapSize());
    CacheConfiguration defaultCacheConfiguration =
        new CacheConfiguration()
            .persistence(
                new PersistenceConfiguration()
                    .strategy(
                        PersistenceConfiguration.Strategy
                            .LOCALTEMPSWAP));
    cacheConfig.defaultCache(defaultCacheConfiguration);
    if (config.isUseDiskCache()) {
      DiskStoreConfiguration diskConfig = new DiskStoreConfiguration();
      diskConfig.setPath(config.getCacheDirectory().toAbsolutePath().toString());
      cacheConfig.diskStore(diskConfig);
    }
    manager = new CacheManager(cacheConfig);
    manager.addCache(DEFAULT_CACHE);
    Cache cache = manager.getCache(DEFAULT_CACHE);
    SelfPopulatingCache populatingCache =
        new SelfPopulatingCache(cache, new S3ChunkEntryFactory(config));
    manager.replaceCacheWithDecoratedCache(cache, populatingCache);
  }
  return manager;
}

代码示例来源:origin: yrain/smart-cache

configuration.setName(Cache.ID);
configuration.setMaxBytesLocalHeap(localMaxBytesLocalHeap);
configuration.setMaxBytesLocalDisk(localMaxBytesLocalDisk);

相关文章

Configuration类方法