com.google.common.cache.LocalCache.processPendingNotifications()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(97)

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

LocalCache.processPendingNotifications介绍

[英]Notifies listeners that an entry has been automatically removed due to expiration, eviction, or eligibility for garbage collection. This should be called every time expireEntries or evictEntry is called (once the lock is released).
[中]通知侦听器由于过期、逐出或垃圾收集的资格,条目已自动删除。每次调用ExpireEntry或ReceiveEntry时(一旦释放锁),都应该调用该函数。

代码示例

代码示例来源:origin: google/j2objc

void runUnlockedCleanup() {
  // locked cleanup may generate notifications we can send unlocked
  if (!isHeldByCurrentThread()) {
   map.processPendingNotifications();
  }
 }
}

代码示例来源:origin: google/guava

void runUnlockedCleanup() {
  // locked cleanup may generate notifications we can send unlocked
  if (!isHeldByCurrentThread()) {
   map.processPendingNotifications();
  }
 }
}

代码示例来源:origin: wildfly/wildfly

void runUnlockedCleanup() {
  // locked cleanup may generate notifications we can send unlocked
  if (!isHeldByCurrentThread()) {
   map.processPendingNotifications();
  }
 }
}

代码示例来源:origin: google/guava

static void processPendingNotifications(Cache<?, ?> cache) {
 if (hasLocalCache(cache)) {
  LocalCache<?, ?> cchm = toLocalCache(cache);
  cchm.processPendingNotifications();
 }
}

代码示例来源:origin: google/guava

static void expireEntries(LocalCache<?, ?> cchm, long expiringTime, FakeTicker ticker) {
 for (Segment<?, ?> segment : cchm.segments) {
  drainRecencyQueue(segment);
 }
 ticker.advance(2 * expiringTime, TimeUnit.MILLISECONDS);
 long now = ticker.read();
 for (Segment<?, ?> segment : cchm.segments) {
  expireEntries(segment, now);
  assertEquals("Expiration queue must be empty by now", 0, writeQueueSize(segment));
  assertEquals("Expiration queue must be empty by now", 0, accessQueueSize(segment));
  assertEquals("Segments must be empty by now", 0, segmentSize(segment));
 }
 cchm.processPendingNotifications();
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

void runUnlockedCleanup() {
 // locked cleanup may generate notifications we can send unlocked
 if (!isHeldByCurrentThread()) {
  map.processPendingNotifications();
 }
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/com.google.guava

void runUnlockedCleanup() {
 // locked cleanup may generate notifications we can send unlocked
 if (!isHeldByCurrentThread()) {
  map.processPendingNotifications();
 }
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

void runUnlockedCleanup() {
 // locked cleanup may generate notifications we can send unlocked
 if (!isHeldByCurrentThread()) {
  map.processPendingNotifications();
 }
}

代码示例来源:origin: org.hudsonci.lib.guava/guava

void runUnlockedCleanup() {
 // locked cleanup may generate notifications we can send unlocked
 if (!isHeldByCurrentThread()) {
  map.processPendingNotifications();
 }
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

void runUnlockedCleanup() {
  // locked cleanup may generate notifications we can send unlocked
  if (!isHeldByCurrentThread()) {
   map.processPendingNotifications();
  }
 }
}

代码示例来源:origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

void runUnlockedCleanup() {
  // locked cleanup may generate notifications we can send unlocked
  if (!isHeldByCurrentThread()) {
   map.processPendingNotifications();
  }
 }
}

代码示例来源:origin: com.google.guava/guava-jdk5

void runUnlockedCleanup() {
 // locked cleanup may generate notifications we can send unlocked
 if (!isHeldByCurrentThread()) {
  map.processPendingNotifications();
 }
}

代码示例来源:origin: org.sonatype.sisu/sisu-guava

void runUnlockedCleanup() {
 // locked cleanup may generate notifications we can send unlocked
 if (!isHeldByCurrentThread()) {
  map.processPendingNotifications();
 }
}

代码示例来源:origin: com.diffplug.guava/guava-cache

void runUnlockedCleanup() {
  // locked cleanup may generate notifications we can send unlocked
  if (!isHeldByCurrentThread()) {
    map.processPendingNotifications();
  }
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

void runUnlockedCleanup() {
 // locked cleanup may generate notifications we can send unlocked
 if (!isHeldByCurrentThread()) {
  map.processPendingNotifications();
 }
}

代码示例来源:origin: Nextdoor/bender

void runUnlockedCleanup() {
 // locked cleanup may generate notifications we can send unlocked
 if (!isHeldByCurrentThread()) {
  map.processPendingNotifications();
 }
}

代码示例来源:origin: com.google.guava/guava-tests

static void processPendingNotifications(Cache<?, ?> cache) {
 if (hasLocalCache(cache)) {
  LocalCache<?, ?> cchm = toLocalCache(cache);
  cchm.processPendingNotifications();
 }
}

代码示例来源:origin: com.google.guava/guava-tests

static void expireEntries(
  LocalCache<?, ?> cchm, long expiringTime, FakeTicker ticker) {
 for (Segment<?, ?> segment : cchm.segments) {
  drainRecencyQueue(segment);
 }
 ticker.advance(2 * expiringTime, TimeUnit.MILLISECONDS);
 long now = ticker.read();
 for (Segment<?, ?> segment : cchm.segments) {
  expireEntries(segment, now);
  assertEquals("Expiration queue must be empty by now", 0, writeQueueSize(segment));
  assertEquals("Expiration queue must be empty by now", 0, accessQueueSize(segment));
  assertEquals("Segments must be empty by now", 0, segmentSize(segment));
 }
 cchm.processPendingNotifications();
}

相关文章

微信公众号

最新文章

更多