net.sf.ehcache.Ehcache.setNodeBulkLoadEnabled()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(8.1k)|赞(0)|评价(0)|浏览(144)

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

Ehcache.setNodeBulkLoadEnabled介绍

[英]Enable/disable bulk-load mode in this node for this cache. Calling setBulkLoadEnabled(true) when the cache is already in bulk-load mode or calling setBulkLoadEnabled(false) when already NOT in bulk-load mode will be a no-op.

Applies to caches clustered with Terracotta only.

When using Terracotta clustered caches with nonstop enabled, the timeout used by this method is NonstopConfiguration#getBulkOpsTimeoutMultiplyFactor() times the timeout value in the nonstop config.
[中]为此缓存启用/禁用此节点中的批量加载模式。当缓存已处于大容量加载模式时调用setBulkLoadEnabled(true),或当缓存未处于大容量加载模式时调用setBulkLoadEnabled(false)将是不可操作的。
仅适用于使用Terracotta群集的缓存。
使用启用了非停止的Terracotta群集缓存时,此方法使用的超时为非停止配置#getBulkOpsTimeoutMultiplyFactor()乘以非停止配置中的超时值。

代码示例

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

/**
 * {@inheritDoc}
 */
public void setNodeBulkLoadEnabled(boolean enabledBulkLoad) throws UnsupportedOperationException, TerracottaNotRunningException {
  underlyingCache.setNodeBulkLoadEnabled(enabledBulkLoad);
}

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

/**
* {@inheritDoc}
*/
public void setNodeBulkLoadEnabled(boolean arg0) throws UnsupportedOperationException, TerracottaNotRunningException {
  // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  Thread t = Thread.currentThread();
  ClassLoader prev = t.getContextClassLoader();
  t.setContextClassLoader(this.classLoader);
  try {
    this.cache.setNodeBulkLoadEnabled(arg0);
  } finally {
    t.setContextClassLoader(prev);
  }
}

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

/**
 * {@inheritDoc}
 */
@Override
public void setNodeBulkLoadEnabled(boolean bulkLoadEnabled) {
  if (bulkLoadEnabled && getTransactional()) {
    LOG.warn("a transactional cache cannot be put into bulk-load mode");
    return;
  }
  cache.setNodeBulkLoadEnabled(bulkLoadEnabled);
}

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

private static void requestBulkLoadRestored(Ehcache cache) {
 bulkloadLock.lock();
 try {
   String key = cache.getCacheManager().getName() + "/" + cache.getName();
   AtomicInteger permits = bulkLoadTrackingMap.get(key);
   if (permits != null) {
    if (permits.decrementAndGet() == 0) {
      // last one out. reset it to true
      bulkLoadTrackingMap.remove(key);
      cache.setNodeBulkLoadEnabled(true);
    }
   }
 } finally {
   bulkloadLock.unlock();
 }
}

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

private static void requestBulkLoadEnabled(Ehcache cache) {
 bulkloadLock.lock();
 try {
   boolean prior = cache.isNodeBulkLoadEnabled();
   // yes, this is racy. we can do no better until we have per-thread bulk loading
   if (prior) {
    String key = cache.getCacheManager().getName() + "/" + cache.getName();
    AtomicInteger permits = bulkLoadTrackingMap.get(key);
    if (permits == null) {
      // first time in. actually switch it
      permits = new AtomicInteger(1);
      bulkLoadTrackingMap.put(key, permits);
      cache.setNodeBulkLoadEnabled(true);
    } else {
      permits.incrementAndGet();
    }
   }
 } finally {
   bulkloadLock.unlock();
 }
}

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

/**
 * {@inheritDoc}
 */
public void setNodeBulkLoadEnabled(boolean enabledBulkLoad) throws UnsupportedOperationException, TerracottaNotRunningException {
  underlyingCache.setNodeBulkLoadEnabled(enabledBulkLoad);
}

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

/**
 * {@inheritDoc}
 */
public void setNodeBulkLoadEnabled(boolean enabledBulkLoad) throws UnsupportedOperationException, TerracottaNotRunningException {
  underlyingCache.setNodeBulkLoadEnabled(enabledBulkLoad);
}

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

/**
 * {@inheritDoc}
 */
public void setNodeBulkLoadEnabled(boolean enabledBulkLoad) throws UnsupportedOperationException, TerracottaNotRunningException {
  underlyingCache.setNodeBulkLoadEnabled(enabledBulkLoad);
}

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

/**
* {@inheritDoc}
*/
public void setNodeBulkLoadEnabled(boolean arg0) throws UnsupportedOperationException, TerracottaNotRunningException {
  // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  Thread t = Thread.currentThread();
  ClassLoader prev = t.getContextClassLoader();
  t.setContextClassLoader(this.classLoader);
  try {
    this.cache.setNodeBulkLoadEnabled(arg0);
  } finally {
    t.setContextClassLoader(prev);
  }
}

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

/**
* {@inheritDoc}
*/
public void setNodeBulkLoadEnabled(boolean arg0) throws UnsupportedOperationException, TerracottaNotRunningException {
  // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  Thread t = Thread.currentThread();
  ClassLoader prev = t.getContextClassLoader();
  t.setContextClassLoader(this.classLoader);
  try {
    this.cache.setNodeBulkLoadEnabled(arg0);
  } finally {
    t.setContextClassLoader(prev);
  }
}

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

/**
* {@inheritDoc}
*/
public void setNodeBulkLoadEnabled(boolean arg0) throws UnsupportedOperationException, TerracottaNotRunningException {
  // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  Thread t = Thread.currentThread();
  ClassLoader prev = t.getContextClassLoader();
  t.setContextClassLoader(this.classLoader);
  try {
    this.cache.setNodeBulkLoadEnabled(arg0);
  } finally {
    t.setContextClassLoader(prev);
  }
}

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

/**
 * {@inheritDoc}
 */
@Override
public void setNodeBulkLoadEnabled(boolean bulkLoadEnabled) {
  if (bulkLoadEnabled && getTransactional()) {
    LOG.warn("a transactional cache cannot be put into bulk-load mode");
    return;
  }
  cache.setNodeBulkLoadEnabled(bulkLoadEnabled);
}

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

/**
 * {@inheritDoc}
 */
@Override
public void setNodeBulkLoadEnabled(boolean bulkLoadEnabled) {
  if (bulkLoadEnabled && getTransactional()) {
    LOG.warn("a transactional cache cannot be put into bulk-load mode");
    return;
  }
  cache.setNodeBulkLoadEnabled(bulkLoadEnabled);
}

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

/**
 * {@inheritDoc}
 */
public void setNodeBulkLoadEnabled(boolean bulkLoadEnabled) {
  if (bulkLoadEnabled && getTransactional()) {
    LOG.warn("a transactional cache cannot be put into bulk-load mode");
    return;
  }
  cache.setNodeBulkLoadEnabled(!bulkLoadEnabled);
}

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

private static void requestBulkLoadRestored(Ehcache cache) {
 bulkloadLock.lock();
 try {
   String key = cache.getCacheManager().getName() + "/" + cache.getName();
   AtomicInteger permits = bulkLoadTrackingMap.get(key);
   if (permits != null) {
    if (permits.decrementAndGet() == 0) {
      // last one out. reset it to true
      bulkLoadTrackingMap.remove(key);
      cache.setNodeBulkLoadEnabled(true);
    }
   }
 } finally {
   bulkloadLock.unlock();
 }
}

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

private static void requestBulkLoadRestored(Ehcache cache) {
 bulkloadLock.lock();
 try {
   String key = cache.getCacheManager().getName() + "/" + cache.getName();
   AtomicInteger permits = bulkLoadTrackingMap.get(key);
   if (permits != null) {
    if (permits.decrementAndGet() == 0) {
      // last one out. reset it to true
      bulkLoadTrackingMap.remove(key);
      cache.setNodeBulkLoadEnabled(true);
    }
   }
 } finally {
   bulkloadLock.unlock();
 }
}

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

private static void requestBulkLoadEnabled(Ehcache cache) {
 bulkloadLock.lock();
 try {
   boolean prior = cache.isNodeBulkLoadEnabled();
   // yes, this is racy. we can do no better until we have per-thread bulk loading
   if (prior) {
    String key = cache.getCacheManager().getName() + "/" + cache.getName();
    AtomicInteger permits = bulkLoadTrackingMap.get(key);
    if (permits == null) {
      // first time in. actually switch it
      permits = new AtomicInteger(1);
      bulkLoadTrackingMap.put(key, permits);
      cache.setNodeBulkLoadEnabled(true);
    } else {
      permits.incrementAndGet();
    }
   }
 } finally {
   bulkloadLock.unlock();
 }
}

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

private static void requestBulkLoadEnabled(Ehcache cache) {
 bulkloadLock.lock();
 try {
   boolean prior = cache.isNodeBulkLoadEnabled();
   // yes, this is racy. we can do no better until we have per-thread bulk loading
   if (prior) {
    String key = cache.getCacheManager().getName() + "/" + cache.getName();
    AtomicInteger permits = bulkLoadTrackingMap.get(key);
    if (permits == null) {
      // first time in. actually switch it
      permits = new AtomicInteger(1);
      bulkLoadTrackingMap.put(key, permits);
      cache.setNodeBulkLoadEnabled(true);
    } else {
      permits.incrementAndGet();
    }
   }
 } finally {
   bulkloadLock.unlock();
 }
}

相关文章

Ehcache类方法