public Set entrySet() { LinkedHashSet set = new LinkedHashSet(super.size()); Iterator i = super.entrySet().iterator(); while ( i.hasNext() ) { Map.Entry e = (Map.Entry)i.next(); Object key = e.getKey(); MapEntry entry = (MapEntry)super.get(key); if ( entry != null && entry.isPrimary() ) { set.add(new MapEntry(key, entry.getValue())); } } return Collections.unmodifiableSet(set); }
@Override public Set<MapEntry> entrySet() { LinkedHashSet<MapEntry> set = new LinkedHashSet<MapEntry>(super.size()); Iterator<Map.Entry<?,?>> i = super.entrySet().iterator(); while ( i.hasNext() ) { Map.Entry<?,?> e = i.next(); Object key = e.getKey(); MapEntry entry = (MapEntry)super.get(key); if ( entry != null && entry.isActive() ) { set.add(new MapEntry(key, entry.getValue())); } } return Collections.unmodifiableSet(set); }
public V put(K key, V value, boolean notify) { MapEntry<K,V> entry = new MapEntry<>(key, value); entry.setBackup(false); entry.setProxy(false); entry.setPrimary(channel.getLocalMember(false)); V old = null; //make sure that any old values get removed if ( containsKey(key) ) old = remove(key); try { if ( notify ) { Member[] backup = publishEntryInfo(key, value); entry.setBackupNodes(backup); } } catch (ChannelException x) { log.error("Unable to replicate out data for a LazyReplicatedMap.put operation", x); } innerMap.put(key,entry); return old; }
MapEntry<K,V> entry = innerMap.get(mapmsg.getKey()); if ( entry==null ) { entry = new MapEntry<>((K) mapmsg.getKey(), (V) mapmsg.getValue()); MapEntry<K,V> old = innerMap.putIfAbsent(entry.getKey(), entry); if (old != null) { MapEntry<K,V> entry = innerMap.get(mapmsg.getKey()); if (entry == null) { entry = new MapEntry<>((K) mapmsg.getKey(), (V) mapmsg.getValue()); entry.setBackup(mapmsg.getMsgType() == MapMessage.MSG_BACKUP); entry.setProxy(false);
MapEntry<K,V> entry = innerMap.get(mapmsg.getKey()); if ( entry==null ) { entry = new MapEntry<>((K) mapmsg.getKey(), (V) mapmsg.getValue()); MapEntry<K,V> old = innerMap.putIfAbsent(entry.getKey(), entry); if (old != null) { MapEntry<K,V> entry = innerMap.get(mapmsg.getKey()); if (entry == null) { entry = new MapEntry<>((K) mapmsg.getKey(), (V) mapmsg.getValue()); entry.setBackup(mapmsg.getMsgType() == MapMessage.MSG_BACKUP); entry.setProxy(false);
MapEntry entry = (MapEntry)super.get(mapmsg.getKey()); if ( entry==null ) { entry = new MapEntry(mapmsg.getKey(), mapmsg.getValue()); entry.setBackup(false); entry.setProxy(true); MapEntry entry = (MapEntry)super.get(mapmsg.getKey()); if (entry == null) { entry = new MapEntry(mapmsg.getKey(), mapmsg.getValue()); entry.setBackup(mapmsg.getMsgType() == MapMessage.MSG_BACKUP); entry.setProxy(false);
MapEntry entry = (MapEntry)super.get(mapmsg.getKey()); if ( entry==null ) { entry = new MapEntry(mapmsg.getKey(), mapmsg.getValue()); entry.setBackup(false); entry.setProxy(true); MapEntry entry = (MapEntry)super.get(mapmsg.getKey()); if (entry == null) { entry = new MapEntry(mapmsg.getKey(), mapmsg.getValue()); entry.setBackup(mapmsg.getMsgType() == MapMessage.MSG_BACKUP); entry.setProxy(false);
public Object put(Object key, Object value, boolean notify) { MapEntry entry = new MapEntry(key,value); entry.setBackup(false); entry.setProxy(false); entry.setPrimary(channel.getLocalMember(false)); Object old = null; //make sure that any old values get removed if ( containsKey(key) ) old = remove(key); try { if ( notify ) { Member[] backup = publishEntryInfo(key, value); entry.setBackupNodes(backup); } } catch (ChannelException x) { log.error("Unable to replicate out data for a LazyReplicatedMap.put operation", x); } super.put(key,entry); return old; }
public V put(K key, V value, boolean notify) { MapEntry<K,V> entry = new MapEntry<>(key, value); entry.setBackup(false); entry.setProxy(false); entry.setCopy(false); entry.setPrimary(channel.getLocalMember(false)); V old = null; //make sure that any old values get removed if ( containsKey(key) ) old = remove(key); try { if ( notify ) { Member[] backup = publishEntryInfo(key, value); entry.setBackupNodes(backup); } } catch (ChannelException x) { log.error(sm.getString("abstractReplicatedMap.unable.put"), x); } innerMap.put(key,entry); return old; }
public Object put(Object key, Object value, boolean notify) { MapEntry entry = new MapEntry(key,value); entry.setBackup(false); entry.setProxy(false); entry.setPrimary(channel.getLocalMember(false)); Object old = null; //make sure that any old values get removed if ( containsKey(key) ) old = remove(key); try { if ( notify ) { Member[] backup = publishEntryInfo(key, value); entry.setBackupNodes(backup); } } catch (ChannelException x) { log.error("Unable to replicate out data for a LazyReplicatedMap.put operation", x); } super.put(key,entry); return old; }