public boolean containsKey(Object key) { return innerCache.containsKey(key); }
public void removeLocal(K key) { if (innerCache.containsKey(key)) { innerCache.removeAll(key); } }
public void put(K key, V value) { Broadcaster.EVENT eventType = innerCache.containsKey(key) ? Broadcaster.EVENT.UPDATE : Broadcaster.EVENT.CREATE; synchronized (this) { innerCache.put(key, value); } syncRemote(key, eventType); }
public void remove(K key) { if (innerCache.containsKey(key)) { innerCache.removeAll(key); syncRemote(key, Broadcaster.EVENT.DROP); } }
continue; if (mmClean.containsKey(a)) { mm.putAll(a, mmClean.get(a));
public boolean exists(UnnamedToroIndex toroIndex) { return memory.toroToDb.containsKey(toroIndex); }
public boolean containsKey(Object key) { return innerCache.containsKey(key); }
public boolean existsToroIndex(UnnamedToroIndex index) { return memory.toroToDb.containsKey(index); }
public boolean existsDbIndex(UnnamedDbIndex index) { return memory.dbToToro.containsKey(index); }
public boolean exists(UnnamedDbIndex dbIndex) { return memory.dbToToro.containsKey(dbIndex); }
public void removeLocal(K key) { if (innerCache.containsKey(key)) { innerCache.removeAll(key); } }
public boolean inVocabulary(String word, POS pos) { if(allWNPOSWords == null) setAllWordNetWords(); return allWNPOSWords.containsKey(word); }
public void remove(K key) { if (innerCache.containsKey(key)) { innerCache.removeAll(key); syncRemote(key, Broadcaster.EVENT.DROP); } }
private <T extends Predicate> Multimap<Role, T> getRolePredicateMap(Class<T> type) { HashMultimap<Role, T> rolePredicateMap = HashMultimap.create(); HashMultimap<Var, T> predicateMap = HashMultimap.create(); getPredicates(type).forEach(p -> p.getVarNames().forEach(v -> predicateMap.put(v, p))); Multimap<Role, Var> roleMap = getRoleVarMap(); roleMap.entries().stream() .filter(e -> predicateMap.containsKey(e.getValue())) .forEach(e -> rolePredicateMap.putAll(e.getKey(), predicateMap.get(e.getValue()))); return rolePredicateMap; }
public void put(K key, V value) { Broadcaster.EVENT eventType = innerCache.containsKey(key) ? Broadcaster.EVENT.UPDATE : Broadcaster.EVENT.CREATE; synchronized (this) { innerCache.put(key, value); } syncRemote(key, eventType); }
/** * * @param referenceIndex expected reference index (according to the non-standard sort order) of matching SAMRecord * @param position expected position (according to the non-standard sort order) of matching SAMRecord * @param key key of matching SAMRecord * @return matching SAMRecord if it exists, null otherwise */ protected Set<SAMRecord> findMatching(int referenceIndex, int position, String key) { load(referenceIndex, position); if (currentReads.containsKey(key)) { return currentReads.get(key); } return null; } /**
for (MRTaskType taskType : MRTaskType.values()){ Pair<JobPrototype,MRTaskType> jobTaskKey = Pair.of(jobPrototype, taskType); if (jobNodeDeclarations.containsKey(jobTaskKey)){ jobProtoStringBuilder.append(String.format(" subgraph cluster%d {\n", clusterIndex++)); jobProtoStringBuilder.append(String.format(" %s\n", getTaskGraphAttributes(taskType)));
protected synchronized void unwrapConnection ( final EntryWrapper wrapper ) { this.entryMap.remove ( wrapper.getConnectionDescriptor (), wrapper ); if ( !this.entryMap.containsKey ( wrapper.getConnectionDescriptor () ) ) { wrapper.getEntry ().dispose (); } }
protected synchronized void unwrapConnection ( final EntryWrapper wrapper ) { this.entryMap.remove ( wrapper.getConnectionDescriptor (), wrapper ); if ( !this.entryMap.containsKey ( wrapper.getConnectionDescriptor () ) ) { wrapper.getEntry ().dispose (); } }
private static void notifySubscribers(PersistentActor persistentActor, InternalMessage internalMessage, ActorRef receiverRef, InternalActorSystem actorSystem) { if(persistentActor.getMessageSubscribers() != null) { try { // todo consider using ActorRefGroup here if(persistentActor.getMessageSubscribers().containsKey(internalMessage.getPayloadClass())) { // copy the bytes from the incoming message, discarding possible changes made in onReceive NextMessage nextMessage = new NextMessage(internalMessage.getPayloadClass(), getMessageBytes(internalMessage, actorSystem)); ((Set<MessageSubscriber>) persistentActor.getMessageSubscribers().get(internalMessage.getPayloadClass())) .stream().filter(messageSubscriber -> messageSubscriber.getAndDecrement() > 0) .forEach(messageSubscriber -> messageSubscriber.getSubscriberRef().tell(nextMessage, receiverRef)); } } catch(Exception e) { logger.error("Unexpected exception while forwarding message to Subscribers", e); } } }