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

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

本文整理了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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public void setNodeBulkLoadEnabled(boolean enabledBulkLoad) throws UnsupportedOperationException, TerracottaNotRunningException {
  5. underlyingCache.setNodeBulkLoadEnabled(enabledBulkLoad);
  6. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public void setNodeBulkLoadEnabled(boolean arg0) throws UnsupportedOperationException, TerracottaNotRunningException {
  5. // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  6. Thread t = Thread.currentThread();
  7. ClassLoader prev = t.getContextClassLoader();
  8. t.setContextClassLoader(this.classLoader);
  9. try {
  10. this.cache.setNodeBulkLoadEnabled(arg0);
  11. } finally {
  12. t.setContextClassLoader(prev);
  13. }
  14. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. @Override
  5. public void setNodeBulkLoadEnabled(boolean bulkLoadEnabled) {
  6. if (bulkLoadEnabled && getTransactional()) {
  7. LOG.warn("a transactional cache cannot be put into bulk-load mode");
  8. return;
  9. }
  10. cache.setNodeBulkLoadEnabled(bulkLoadEnabled);
  11. }

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

  1. private static void requestBulkLoadRestored(Ehcache cache) {
  2. bulkloadLock.lock();
  3. try {
  4. String key = cache.getCacheManager().getName() + "/" + cache.getName();
  5. AtomicInteger permits = bulkLoadTrackingMap.get(key);
  6. if (permits != null) {
  7. if (permits.decrementAndGet() == 0) {
  8. // last one out. reset it to true
  9. bulkLoadTrackingMap.remove(key);
  10. cache.setNodeBulkLoadEnabled(true);
  11. }
  12. }
  13. } finally {
  14. bulkloadLock.unlock();
  15. }
  16. }

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

  1. private static void requestBulkLoadEnabled(Ehcache cache) {
  2. bulkloadLock.lock();
  3. try {
  4. boolean prior = cache.isNodeBulkLoadEnabled();
  5. // yes, this is racy. we can do no better until we have per-thread bulk loading
  6. if (prior) {
  7. String key = cache.getCacheManager().getName() + "/" + cache.getName();
  8. AtomicInteger permits = bulkLoadTrackingMap.get(key);
  9. if (permits == null) {
  10. // first time in. actually switch it
  11. permits = new AtomicInteger(1);
  12. bulkLoadTrackingMap.put(key, permits);
  13. cache.setNodeBulkLoadEnabled(true);
  14. } else {
  15. permits.incrementAndGet();
  16. }
  17. }
  18. } finally {
  19. bulkloadLock.unlock();
  20. }
  21. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public void setNodeBulkLoadEnabled(boolean enabledBulkLoad) throws UnsupportedOperationException, TerracottaNotRunningException {
  5. underlyingCache.setNodeBulkLoadEnabled(enabledBulkLoad);
  6. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public void setNodeBulkLoadEnabled(boolean enabledBulkLoad) throws UnsupportedOperationException, TerracottaNotRunningException {
  5. underlyingCache.setNodeBulkLoadEnabled(enabledBulkLoad);
  6. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public void setNodeBulkLoadEnabled(boolean enabledBulkLoad) throws UnsupportedOperationException, TerracottaNotRunningException {
  5. underlyingCache.setNodeBulkLoadEnabled(enabledBulkLoad);
  6. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public void setNodeBulkLoadEnabled(boolean arg0) throws UnsupportedOperationException, TerracottaNotRunningException {
  5. // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  6. Thread t = Thread.currentThread();
  7. ClassLoader prev = t.getContextClassLoader();
  8. t.setContextClassLoader(this.classLoader);
  9. try {
  10. this.cache.setNodeBulkLoadEnabled(arg0);
  11. } finally {
  12. t.setContextClassLoader(prev);
  13. }
  14. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public void setNodeBulkLoadEnabled(boolean arg0) throws UnsupportedOperationException, TerracottaNotRunningException {
  5. // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  6. Thread t = Thread.currentThread();
  7. ClassLoader prev = t.getContextClassLoader();
  8. t.setContextClassLoader(this.classLoader);
  9. try {
  10. this.cache.setNodeBulkLoadEnabled(arg0);
  11. } finally {
  12. t.setContextClassLoader(prev);
  13. }
  14. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public void setNodeBulkLoadEnabled(boolean arg0) throws UnsupportedOperationException, TerracottaNotRunningException {
  5. // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  6. Thread t = Thread.currentThread();
  7. ClassLoader prev = t.getContextClassLoader();
  8. t.setContextClassLoader(this.classLoader);
  9. try {
  10. this.cache.setNodeBulkLoadEnabled(arg0);
  11. } finally {
  12. t.setContextClassLoader(prev);
  13. }
  14. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. @Override
  5. public void setNodeBulkLoadEnabled(boolean bulkLoadEnabled) {
  6. if (bulkLoadEnabled && getTransactional()) {
  7. LOG.warn("a transactional cache cannot be put into bulk-load mode");
  8. return;
  9. }
  10. cache.setNodeBulkLoadEnabled(bulkLoadEnabled);
  11. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. @Override
  5. public void setNodeBulkLoadEnabled(boolean bulkLoadEnabled) {
  6. if (bulkLoadEnabled && getTransactional()) {
  7. LOG.warn("a transactional cache cannot be put into bulk-load mode");
  8. return;
  9. }
  10. cache.setNodeBulkLoadEnabled(bulkLoadEnabled);
  11. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public void setNodeBulkLoadEnabled(boolean bulkLoadEnabled) {
  5. if (bulkLoadEnabled && getTransactional()) {
  6. LOG.warn("a transactional cache cannot be put into bulk-load mode");
  7. return;
  8. }
  9. cache.setNodeBulkLoadEnabled(!bulkLoadEnabled);
  10. }

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

  1. private static void requestBulkLoadRestored(Ehcache cache) {
  2. bulkloadLock.lock();
  3. try {
  4. String key = cache.getCacheManager().getName() + "/" + cache.getName();
  5. AtomicInteger permits = bulkLoadTrackingMap.get(key);
  6. if (permits != null) {
  7. if (permits.decrementAndGet() == 0) {
  8. // last one out. reset it to true
  9. bulkLoadTrackingMap.remove(key);
  10. cache.setNodeBulkLoadEnabled(true);
  11. }
  12. }
  13. } finally {
  14. bulkloadLock.unlock();
  15. }
  16. }

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

  1. private static void requestBulkLoadRestored(Ehcache cache) {
  2. bulkloadLock.lock();
  3. try {
  4. String key = cache.getCacheManager().getName() + "/" + cache.getName();
  5. AtomicInteger permits = bulkLoadTrackingMap.get(key);
  6. if (permits != null) {
  7. if (permits.decrementAndGet() == 0) {
  8. // last one out. reset it to true
  9. bulkLoadTrackingMap.remove(key);
  10. cache.setNodeBulkLoadEnabled(true);
  11. }
  12. }
  13. } finally {
  14. bulkloadLock.unlock();
  15. }
  16. }

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

  1. private static void requestBulkLoadEnabled(Ehcache cache) {
  2. bulkloadLock.lock();
  3. try {
  4. boolean prior = cache.isNodeBulkLoadEnabled();
  5. // yes, this is racy. we can do no better until we have per-thread bulk loading
  6. if (prior) {
  7. String key = cache.getCacheManager().getName() + "/" + cache.getName();
  8. AtomicInteger permits = bulkLoadTrackingMap.get(key);
  9. if (permits == null) {
  10. // first time in. actually switch it
  11. permits = new AtomicInteger(1);
  12. bulkLoadTrackingMap.put(key, permits);
  13. cache.setNodeBulkLoadEnabled(true);
  14. } else {
  15. permits.incrementAndGet();
  16. }
  17. }
  18. } finally {
  19. bulkloadLock.unlock();
  20. }
  21. }

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

  1. private static void requestBulkLoadEnabled(Ehcache cache) {
  2. bulkloadLock.lock();
  3. try {
  4. boolean prior = cache.isNodeBulkLoadEnabled();
  5. // yes, this is racy. we can do no better until we have per-thread bulk loading
  6. if (prior) {
  7. String key = cache.getCacheManager().getName() + "/" + cache.getName();
  8. AtomicInteger permits = bulkLoadTrackingMap.get(key);
  9. if (permits == null) {
  10. // first time in. actually switch it
  11. permits = new AtomicInteger(1);
  12. bulkLoadTrackingMap.put(key, permits);
  13. cache.setNodeBulkLoadEnabled(true);
  14. } else {
  15. permits.incrementAndGet();
  16. }
  17. }
  18. } finally {
  19. bulkloadLock.unlock();
  20. }
  21. }

相关文章

Ehcache类方法