ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [06/13] ignite git commit: IGNITE-2263: retain -> manual copy in MemoryEventStorageSpi.
Date Sat, 02 Jan 2016 09:21:45 GMT
IGNITE-2263: retain -> manual copy in MemoryEventStorageSpi.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/7cfb386c
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/7cfb386c
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/7cfb386c

Branch: refs/heads/ignite-2263
Commit: 7cfb386c81e22b183370cd6c728ee73934cb8eff
Parents: b3d9a70
Author: thatcoach <ppozerov@list.ru>
Authored: Sat Jan 2 11:55:04 2016 +0300
Committer: thatcoach <ppozerov@list.ru>
Committed: Sat Jan 2 11:55:04 2016 +0300

----------------------------------------------------------------------
 .../memory/MemoryEventStorageSpi.java           | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/7cfb386c/modules/core/src/main/java/org/apache/ignite/spi/eventstorage/memory/MemoryEventStorageSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/eventstorage/memory/MemoryEventStorageSpi.java
b/modules/core/src/main/java/org/apache/ignite/spi/eventstorage/memory/MemoryEventStorageSpi.java
index 56a627a..e471561 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/eventstorage/memory/MemoryEventStorageSpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/eventstorage/memory/MemoryEventStorageSpi.java
@@ -17,10 +17,8 @@
 
 package org.apache.ignite.spi.eventstorage.memory;
 
-import java.util.Collection;
 import org.apache.ignite.IgniteLogger;
 import org.apache.ignite.events.Event;
-import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.internal.A;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
@@ -33,7 +31,10 @@ import org.apache.ignite.spi.IgniteSpiMultipleInstancesSupport;
 import org.apache.ignite.spi.eventstorage.EventStorageSpi;
 import org.jsr166.ConcurrentLinkedDeque8;
 
-import static org.apache.ignite.events.EventType.EVT_NODE_METRICS_UPDATED;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import static org.apache.ignite.events.EventType.*;
 
 /**
  * In-memory {@link org.apache.ignite.spi.eventstorage.EventStorageSpi} implementation. All
events are
@@ -222,7 +223,18 @@ public class MemoryEventStorageSpi extends IgniteSpiAdapter implements
EventStor
 
         cleanupQueue();
 
-        return F.retain((Collection<T>)evts, true, p);
+        if (p == null)
+            return (Collection<T>)new ArrayList<>(evts);
+        else {
+            ArrayList<T> res = new ArrayList<>(evts.sizex());
+
+            for (Event evt : evts) {
+                if (p.apply((T)evt))
+                    res.add((T)evt);
+            }
+
+            return res;
+        }
     }
 
     /** {@inheritDoc} */


Mime
View raw message