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

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

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

Configuration.setMaxBytesLocalOffHeap介绍

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

代码示例

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

/**
 * Sets the maximum size for the OffHeap tier for all the caches this CacheManagers holds.
 * @param amount the amount of unit
 * @param memoryUnit the actual unit
 * @return this
 */
public Configuration maxBytesLocalOffHeap(final long amount, final MemoryUnit memoryUnit) {
  setMaxBytesLocalOffHeap(memoryUnit.toBytes(amount));
  return this;
}

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

/**
 * Sets maximum amount of bytes the CacheManager will use on the OffHeap Tier.
 * @param maxBytesOffHeap String representation of the size.
 * @see MemoryUnit#parseSizeInBytes(String)
 */
public void setMaxBytesLocalOffHeap(final String maxBytesOffHeap) {
  assertArgumentNotNull("MaxBytesLocalOffHeap", maxBytesOffHeap);
  
  final String origInput = maxBytesLocalOffHeapInput;
  try {
    maxBytesLocalOffHeapInput = maxBytesOffHeap;
    if (isPercentage(maxBytesOffHeap)) {
      long maxMemory = getOffHeapLimit();
      long mem = maxMemory / HUNDRED * parsePercentage(maxBytesOffHeap);
      setMaxBytesLocalOffHeap(mem);
    } else {
      setMaxBytesLocalOffHeap(MemoryUnit.parseSizeInBytes(maxBytesOffHeap));
    }
  } catch (RuntimeException rte) {
    maxBytesLocalOffHeapInput = origInput;
    throw rte;
  }
}

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

/**
 * Sets the maximum size for the OffHeap tier for all the caches this CacheManagers holds.
 * @param amount the amount of unit
 * @param memoryUnit the actual unit
 * @return this
 */
public Configuration maxBytesLocalOffHeap(final long amount, final MemoryUnit memoryUnit) {
  setMaxBytesLocalOffHeap(memoryUnit.toBytes(amount));
  return this;
}

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

/**
 * Sets the maximum size for the OffHeap tier for all the caches this CacheManagers holds.
 * @param amount the amount of unit
 * @param memoryUnit the actual unit
 * @return this
 */
public Configuration maxBytesLocalOffHeap(final long amount, final MemoryUnit memoryUnit) {
  setMaxBytesLocalOffHeap(memoryUnit.toBytes(amount));
  return this;
}

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

/**
 * Sets the maximum size for the OffHeap tier for all the caches this CacheManagers holds.
 * @param amount the amount of unit
 * @param memoryUnit the actual unit
 * @return this
 */
public Configuration maxBytesLocalOffHeap(final long amount, final MemoryUnit memoryUnit) {
  setMaxBytesLocalOffHeap(memoryUnit.toBytes(amount));
  return this;
}

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

/**
 * Sets maximum amount of bytes the CacheManager will use on the OffHeap Tier.
 * @param maxBytesOffHeap String representation of the size.
 * @see MemoryUnit#parseSizeInBytes(String)
 */
public void setMaxBytesLocalOffHeap(final String maxBytesOffHeap) {
  assertArgumentNotNull("MaxBytesLocalOffHeap", maxBytesOffHeap);
  if (isPercentage(maxBytesOffHeap)) {
    long maxMemory = getOffHeapLimit();
    long mem = maxMemory / HUNDRED * parsePercentage(maxBytesOffHeap);
    setMaxBytesLocalOffHeap(mem);
  } else {
    setMaxBytesLocalOffHeap(MemoryUnit.parseSizeInBytes(maxBytesOffHeap));
  }
  maxBytesLocalOffHeapInput = maxBytesOffHeap;
}

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

/**
 * Sets maximum amount of bytes the CacheManager will use on the OffHeap Tier.
 * @param maxBytesOffHeap String representation of the size.
 * @see MemoryUnit#parseSizeInBytes(String)
 */
public void setMaxBytesLocalOffHeap(final String maxBytesOffHeap) {
  assertArgumentNotNull("MaxBytesLocalOffHeap", maxBytesOffHeap);
  
  final String origInput = maxBytesLocalOffHeapInput;
  try {
    maxBytesLocalOffHeapInput = maxBytesOffHeap;
    if (isPercentage(maxBytesOffHeap)) {
      long maxMemory = getOffHeapLimit();
      long mem = maxMemory / HUNDRED * parsePercentage(maxBytesOffHeap);
      setMaxBytesLocalOffHeap(mem);
    } else {
      setMaxBytesLocalOffHeap(MemoryUnit.parseSizeInBytes(maxBytesOffHeap));
    }
  } catch (RuntimeException rte) {
    maxBytesLocalOffHeapInput = origInput;
    throw rte;
  }
}

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

/**
 * Sets maximum amount of bytes the CacheManager will use on the OffHeap Tier.
 * @param maxBytesOffHeap String representation of the size.
 * @see MemoryUnit#parseSizeInBytes(String)
 */
public void setMaxBytesLocalOffHeap(final String maxBytesOffHeap) {
  assertArgumentNotNull("MaxBytesLocalOffHeap", maxBytesOffHeap);
  
  final String origInput = maxBytesLocalOffHeapInput;
  try {
    maxBytesLocalOffHeapInput = maxBytesOffHeap;
    if (isPercentage(maxBytesOffHeap)) {
      long maxMemory = getOffHeapLimit();
      long mem = maxMemory / HUNDRED * parsePercentage(maxBytesOffHeap);
      setMaxBytesLocalOffHeap(mem);
    } else {
      setMaxBytesLocalOffHeap(MemoryUnit.parseSizeInBytes(maxBytesOffHeap));
    }
  } catch (RuntimeException rte) {
    maxBytesLocalOffHeapInput = origInput;
    throw rte;
  }
}

相关文章

Configuration类方法