org.infinispan.Cache.removeAsync()方法的使用及代码示例

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

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

Cache.removeAsync介绍

暂无

代码示例

代码示例来源:origin: org.infinispan/infinispan-server-hotrod

private void onTransactionCompleted(CacheXid cacheXid) {
 storage.removeAsync(cacheXid);
}

代码示例来源:origin: org.infinispan/infinispan-core

@Override
public <K> Future<?> perform(Cache<K, Object> cache, K key) {
 //this works because value != initial value, so the match will fail.
 return cache.removeAsync(key, "v1");
}

代码示例来源:origin: org.infinispan/infinispan-core

@Override
public <K> Future<?> perform(Cache<K, Object> cache, K key) {
 return cache.removeAsync(key);
}

代码示例来源:origin: org.infinispan/infinispan-core

@Override
public <K> Future<?> perform(Cache<K, Object> cache, K key) {
 return cache.removeAsync(key);
}

代码示例来源:origin: org.keycloak/keycloak-model-infinispan

@Override
public void accept(AuthenticatedClientSessionEntity clientSessionEntity) {
  clientSessionsSize.incrementAndGet();
  Future future = offlineClientSessionCache.removeAsync(clientSessionEntity.getId());
  futures.addTask(future);
}

代码示例来源:origin: org.keycloak/keycloak-model-infinispan

@Override
public void accept(AuthenticatedClientSessionEntity clientSessionEntity) {
  clientSessionsSize.incrementAndGet();
  Future future = clientSessionCache.removeAsync(clientSessionEntity.getId());
  futures.addTask(future);
}

代码示例来源:origin: org.keycloak/keycloak-model-infinispan

@Override
public void accept(UserSessionEntity userSessionEntity) {
  userSessionsSize.incrementAndGet();
  Future future = sessionCache.removeAsync(userSessionEntity.getId());
  futures.addTask(future);
  userSessionEntity.getAuthenticatedClientSessions().forEach((clientUUID, clientSessionId) -> {
    clientSessionsSize.incrementAndGet();
    Future f = clientSessionCache.removeAsync(clientSessionId);
    futures.addTask(f);
  });
}

代码示例来源:origin: org.keycloak/keycloak-model-infinispan

@Override
  public void accept(UserSessionEntity userSessionEntity) {
    userSessionsSize.incrementAndGet();
    Future future = offlineSessionCache.removeAsync(userSessionEntity.getId());
    futures.addTask(future);
    userSessionEntity.getAuthenticatedClientSessions().forEach((clientUUID, clientSessionId) -> {
      clientSessionsSize.incrementAndGet();
      Future f = offlineClientSessionCache.removeAsync(clientSessionId);
      futures.addTask(f);
    });
  }
});

代码示例来源:origin: org.keycloak/keycloak-model-infinispan

@Override
public void accept(UserSessionEntity userSessionEntity) {
  userSessionsSize.incrementAndGet();
  // Remove session from remoteCache too. Use removeAsync for better perf
  Future future = localCache.removeAsync(userSessionEntity.getId());
  futures.addTask(future);
  userSessionEntity.getAuthenticatedClientSessions().forEach((clientUUID, clientSessionId) -> {
    Future f = localClientSessionCache.removeAsync(clientSessionId);
    futures.addTask(f);
  });
}

代码示例来源:origin: org.infinispan/infinispan-core

@Override
public <K> Future<?> perform(Cache<K, Object> cache, K key) {
 return cache.removeAsync(key, initialValue());
}

代码示例来源:origin: org.infinispan/infinispan-core

public void testAsyncOps() throws Exception {

   CompletableFuture<Object> result = cache.putAsync("k", "v");
   assert result.get() == null;

   result = cache.removeAsync("k");
   assert result.get().equals("v");

   final CompletableFuture<Void> voidNotifyingFuture = cache.putAllAsync(Collections.singletonMap("k", "v"));
   voidNotifyingFuture.get();

   assert cache.get("k").equals("v");
  }
}

代码示例来源:origin: org.exoplatform.jcr/exo.jcr.component.core

cache.removeAsync(key);

代码示例来源:origin: org.infinispan/infinispan-core

public void testRemoveConditionalAsync() throws Exception {
 c.put("k", "v");
 Future<Boolean> f = c.removeAsync("k", "v_nonexistent");
 assertFutureResult(f, false);
 assertEquals("v", c.get("k"));
 f = c.removeAsync("k", "v");
 assertFutureResult(f, true);
 assertNull(c.get("k"));
}

代码示例来源:origin: org.infinispan/infinispan-core

public void testRemoveAsync() throws Exception {
 c.put("k", "v");
 assertEquals("v", c.get("k"));
 CompletableFuture<String> f = c.removeAsync("k");
 assertFutureResult(f, "v");
 assertNull(c.get("k"));
}

代码示例来源:origin: org.infinispan/infinispan-core

final Future f3 = c1.removeAsync(key);
assert f3 != null;
eventually(f3::isDone);
Future<Boolean> f5 = c1.removeAsync(key, v_null);
assert f5 != null;
assert !f5.isCancelled();
final Future f6 = c1.removeAsync(key, v4);
assert f6 != null;
eventually(f6::isDone);

代码示例来源:origin: org.keycloak/keycloak-model-infinispan

private void removeAllLocalUserLoginFailuresEvent(String realmId) {
  FuturesHelper futures = new FuturesHelper();
  Cache<LoginFailureKey, SessionEntityWrapper<LoginFailureEntity>> localCache = CacheDecorators.localCache(loginFailureCache);
  Cache<LoginFailureKey, SessionEntityWrapper<LoginFailureEntity>> localCacheStoreIgnore = CacheDecorators.skipCacheLoaders(localCache);
  localCacheStoreIgnore
      .entrySet()
      .stream()
      .filter(UserLoginFailurePredicate.create(realmId))
      .map(Mappers.loginFailureId())
      .forEach(loginFailureKey -> {
        // Remove loginFailure from remoteCache too. Use removeAsync for better perf
        Future future = localCache.removeAsync(loginFailureKey);
        futures.addTask(future);
      });
  futures.waitForAllToFinish();
  log.debugf("Removed %d login failures in realm %s", futures.size(), realmId);
}

相关文章