Repository: apex-malhar
Updated Branches:
  refs/heads/master e082133a1 -> e0081143f


APEXMALHAR-2245 #resolve Add the key in removedKeys even if the key does not 
appear in the cache


Project: http://git-wip-us.apache.org/repos/asf/apex-malhar/repo
Commit: http://git-wip-us.apache.org/repos/asf/apex-malhar/commit/e0081143
Tree: http://git-wip-us.apache.org/repos/asf/apex-malhar/tree/e0081143
Diff: http://git-wip-us.apache.org/repos/asf/apex-malhar/diff/e0081143

Branch: refs/heads/master
Commit: e0081143fa7590d92cc51c1eacfd45c98958e34c
Parents: e082133
Author: David Yan <da...@datatorrent.com>
Authored: Mon Sep 19 17:13:22 2016 -0700
Committer: Thomas Weise <tho...@datatorrent.com>
Committed: Tue Sep 20 10:47:44 2016 -0700

----------------------------------------------------------------------
 .../lib/state/spillable/WindowBoundedMapCache.java     | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/apex-malhar/blob/e0081143/library/src/main/java/org/apache/apex/malhar/lib/state/spillable/WindowBoundedMapCache.java
----------------------------------------------------------------------
diff --git 
a/library/src/main/java/org/apache/apex/malhar/lib/state/spillable/WindowBoundedMapCache.java
 
b/library/src/main/java/org/apache/apex/malhar/lib/state/spillable/WindowBoundedMapCache.java
index 6db1f1a..0e1d55e 100644
--- 
a/library/src/main/java/org/apache/apex/malhar/lib/state/spillable/WindowBoundedMapCache.java
+++ 
b/library/src/main/java/org/apache/apex/malhar/lib/state/spillable/WindowBoundedMapCache.java
@@ -87,15 +87,12 @@ public class WindowBoundedMapCache<K, V>
   public void remove(K key)
   {
     Preconditions.checkNotNull(key);
-
-    if (!cache.containsKey(key)) {
-      return;
-    }
-
-    cache.remove(key);
-    changedKeys.remove(key);
     removedKeys.add(key);
-    priorityQueue.remove(key);
+    if (cache.containsKey(key)) {
+      cache.remove(key);
+      changedKeys.remove(key);
+      priorityQueue.remove(key);
+    }
   }
 
   public Set<K> getChangedKeys()

Reply via email to