/** * Discards any cached principal for the given credentials. * * @param credentials a set of credentials */ public void invalidate(C credentials) { cache.invalidate(credentials); }
/** * Discards any cached role associations for the given principal and role. * * @param principal * @param role */ public void invalidate(P principal, String role) { cache.invalidate(ImmutablePair.of(principal, role)); }
public boolean clear(String key) { loadingCache.invalidate(key); return Boolean.TRUE; } }
public boolean clear(String key) { loadingCache.invalidate(key); return Boolean.TRUE; } }
@Test(dataProvider = "caches") @CacheSpec(population = Population.EMPTY, refreshAfterWrite = Expire.ONE_MINUTE, executor = CacheExecutor.THREADED, removalListener = Listener.CONSUMING) public void invalidate(CacheContext context) { AtomicBoolean refresh = new AtomicBoolean(); Integer key = context.absentKey(); Integer original = 1; Integer refreshed = 2; LoadingCache<Integer, Integer> cache = context.build(k -> { await().untilTrue(refresh); return refreshed; }); cache.put(key, original); context.ticker().advance(2, TimeUnit.MINUTES); assertThat(cache.getIfPresent(key), is(original)); cache.invalidate(key); refresh.set(true); await().until(() -> cache.getIfPresent(key), is(refreshed)); await().until(() -> cache, hasRemovalNotifications(context, 1, RemovalCause.EXPLICIT)); await().until(() -> context, both(hasLoadSuccessCount(1)).and(hasLoadFailureCount(0))); }
@Test(dataProvider = "caches") @CacheSpec(population = Population.EMPTY, executor = CacheExecutor.THREADED, removalListener = Listener.CONSUMING) public void refresh_invalidate(CacheContext context) { AtomicBoolean refresh = new AtomicBoolean(); Integer key = context.absentKey(); Integer original = 1; Integer refreshed = 2; LoadingCache<Integer, Integer> cache = context.build(k -> { await().untilTrue(refresh); return refreshed; }); cache.put(key, original); cache.refresh(key); cache.invalidate(key); refresh.set(true); await().until(() -> cache.getIfPresent(key), is(refreshed)); await().until(() -> cache, hasRemovalNotifications(context, 1, RemovalCause.EXPLICIT)); await().until(() -> context, both(hasLoadSuccessCount(1)).and(hasLoadFailureCount(0))); }
perfLog.log("emit-message", "key={}, elapsed time to emit messages", key); cache.invalidate(key); Tuple messageTuple = streamMessageMap.get("message:"); collector.ack(messageTuple);
protected static void invalidateOntologyCaches(OWLImmutableOntologyImpl o) { ontsignatures.invalidate(o); ontanonCaches.invalidate(o); ontclassesSignatures.invalidate(o); ontdataPropertySignatures.invalidate(o); ontobjectPropertySignatures.invalidate(o); ontdatatypeSignatures.invalidate(o); ontindividualSignatures.invalidate(o); ontannotationPropertiesSignatures.invalidate(o); }
protected static void invalidateOntologyCaches(OWLImmutableOntologyImpl o) { ontsignatures.invalidate(o); ontanonCaches.invalidate(o); ontclassesSignatures.invalidate(o); ontdataPropertySignatures.invalidate(o); ontobjectPropertySignatures.invalidate(o); ontdatatypeSignatures.invalidate(o); ontindividualSignatures.invalidate(o); ontannotationPropertiesSignatures.invalidate(o); }
@Override public void remove(String key) { if (StrUtil.isBlank(key)) { return; } loadingCache.invalidate(key); temporaryLoadingCache.invalidate(key); }
public void invalidate(long position) { long pageAlignedPos = position & alignmentMask; cache.invalidate(new Key(source, pageAlignedPos)); }
public void invalidate(long position) { long pageAlignedPos = position & alignmentMask; cache.invalidate(new Key(source, pageAlignedPos)); }
private String invalidateNodePath(String deletedPath) { String memberId = group.getMemberId(deletedPath); servicesByMemberId.invalidate(memberId); return memberId; }
public void invalidate(String identifier) { Objects.requireNonNull(identifier, "identifier"); cache.get().synchronous().invalidate(identifier); cacheHolders.remove(identifier); listeners.removeAll(identifier); }
public void invalidate(String identifier) { Preconditions.checkNotNull(identifier, "identifier"); cache.synchronous().invalidate(identifier); cacheHolders.remove(identifier); listeners.removeAll(identifier); }
@Override public void onUpdate(String path, LocalPolicies data, Stat stat) { final NamespaceName namespace = new NamespaceName(getNamespaceFromPoliciesPath(path)); try { LOG.info("Policy updated for namespace {}, refreshing the bundle cache.", namespace); // invalidate the bundle cache to fetch new bundle data from the policies bundlesCache.synchronous().invalidate(namespace); } catch (Exception e) { LOG.error("Failed to update the policy change for ns {}", namespace, e); } }
@Override public void onUpdate(String path, LocalPolicies data, Stat stat) { final NamespaceName namespace = NamespaceName.get(getNamespaceFromPoliciesPath(path)); try { LOG.info("Policy updated for namespace {}, refreshing the bundle cache.", namespace); // invalidate the bundle cache to fetch new bundle data from the policies bundlesCache.synchronous().invalidate(namespace); } catch (Exception e) { LOG.error("Failed to update the policy change for ns {}", namespace, e); } }
public void setModified(ProjectId projectId, long modifiedAt, UserId modifiedBy) { collection.updateOne(withProjectId(projectId), updateModified(modifiedBy, modifiedAt)); cache.invalidate(projectId); // No need to invalidate display languages cache }
public void setInTrash(ProjectId projectId, boolean inTrash) { collection.updateOne(withProjectId(projectId), updateInTrash(inTrash)); cache.invalidate(projectId); // No need to invalidate display languages cache }
public void uncache(String identifier) { if (!getTypeInfo().isNameValid(identifier)) { throw new IllegalArgumentException("Provided name " + identifier + " is not valid for subjects of type " + type.getTypeName()); } persistentData.invalidate(identifier); transientData.invalidate(identifier); cache.synchronous().invalidate(identifier); }