Skip to content

Commit

Permalink
- Replaced Map with LazyRemovalCache in FD_SOCK (https://issues.jboss…
Browse files Browse the repository at this point in the history
….org/browse/JGRP-2086)

- Added addAll() and entrySet() to LazyRemovalCache
  • Loading branch information
belaban committed Sep 19, 2016
1 parent d00ea56 commit 49ca50f
Show file tree
Hide file tree
Showing 6 changed files with 171 additions and 214 deletions.
14 changes: 14 additions & 0 deletions src/org/jgroups/blocks/LazyRemovalCache.java
Expand Up @@ -51,6 +51,20 @@ public boolean add(K key, V val) {
return added;
}

public void addAll(Map<K,V> m) {
if(m == null)
return;
for(Map.Entry<K,V> entry: m.entrySet()) {
K key=entry.getKey();
V val=entry.getValue();
map.put(key, new Entry<>(val));
}
}

public Set<Map.Entry<K, Entry<V>>> entrySet() {
return map.entrySet();
}

public boolean containsKey(K key) {
return map.containsKey(key);
}
Expand Down

0 comments on commit 49ca50f

Please sign in to comment.