ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [74/82] [abbrv] ignite git commit: Platforms: reworked PlatformCacheEntryFilter interface.
Date Tue, 01 Sep 2015 12:08:23 GMT
Platforms: reworked PlatformCacheEntryFilter interface.


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

Branch: refs/heads/ignite-1093-2
Commit: 6d0aff43c4e30069cab19a8c71c96b4e47b9ae8d
Parents: 66d46ec
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Tue Sep 1 11:29:55 2015 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Tue Sep 1 11:29:55 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheAdapter.java      |  5 +-
 .../cache/GridLoadCacheCloseablePredicate.java  | 30 -----------
 .../distributed/dht/GridDhtCacheAdapter.java    |  6 +--
 .../CacheQueryCloseableScanBiPredicate.java     | 30 -----------
 .../cache/query/GridCacheQueryManager.java      | 52 ++++++++++----------
 .../cache/PlatformCacheEntryFilter.java         | 11 +++--
 6 files changed, 39 insertions(+), 95 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/6d0aff43/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index 653c2b1..68749b9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -94,6 +94,7 @@ import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
 import org.apache.ignite.internal.processors.datastreamer.DataStreamerEntry;
 import org.apache.ignite.internal.processors.datastreamer.DataStreamerImpl;
 import org.apache.ignite.internal.processors.dr.IgniteDrDataStreamerCacheUpdater;
+import org.apache.ignite.internal.processors.platform.cache.PlatformCacheEntryFilter;
 import org.apache.ignite.internal.processors.task.GridInternal;
 import org.apache.ignite.internal.transactions.IgniteTxHeuristicCheckedException;
 import org.apache.ignite.internal.transactions.IgniteTxRollbackCheckedException;
@@ -3470,8 +3471,8 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K,
V
             }
         }
         finally {
-            if (p instanceof GridLoadCacheCloseablePredicate)
-                ((GridLoadCacheCloseablePredicate)p).onClose();
+            if (p instanceof PlatformCacheEntryFilter)
+                ((PlatformCacheEntryFilter)p).onClose();
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/6d0aff43/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridLoadCacheCloseablePredicate.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridLoadCacheCloseablePredicate.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridLoadCacheCloseablePredicate.java
deleted file mode 100644
index 1331a42..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridLoadCacheCloseablePredicate.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.processors.cache;
-
-import org.apache.ignite.lang.*;
-
-/**
- * Special version of bi-predicate for LoadCache with close callback.
- */
-public interface GridLoadCacheCloseablePredicate<K, V> extends IgniteBiPredicate<K,
V> {
-    /**
-     * Callback invoked when predicate is no longer needed.
-     */
-    public void onClose();
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/6d0aff43/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
index ecacb29..ee56b16 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
@@ -50,7 +50,6 @@ import org.apache.ignite.internal.processors.cache.GridCacheEntryRemovedExceptio
 import org.apache.ignite.internal.processors.cache.GridCacheMapEntry;
 import org.apache.ignite.internal.processors.cache.GridCacheMapEntryFactory;
 import org.apache.ignite.internal.processors.cache.GridCachePreloader;
-import org.apache.ignite.internal.processors.cache.GridLoadCacheCloseablePredicate;
 import org.apache.ignite.internal.processors.cache.IgniteCacheExpiryPolicy;
 import org.apache.ignite.internal.processors.cache.KeyCacheObject;
 import org.apache.ignite.internal.processors.cache.distributed.GridCacheTtlUpdateRequest;
@@ -62,6 +61,7 @@ import org.apache.ignite.internal.processors.cache.distributed.near.GridNearCach
 import org.apache.ignite.internal.processors.cache.distributed.near.GridNearGetRequest;
 import org.apache.ignite.internal.processors.cache.distributed.near.GridNearGetResponse;
 import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
+import org.apache.ignite.internal.processors.platform.cache.PlatformCacheEntryFilter;
 import org.apache.ignite.internal.util.future.GridCompoundFuture;
 import org.apache.ignite.internal.util.future.GridFutureAdapter;
 import org.apache.ignite.internal.util.lang.GridIteratorAdapter;
@@ -477,8 +477,8 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap
 
         }
         finally {
-            if (p instanceof GridLoadCacheCloseablePredicate)
-                ((GridLoadCacheCloseablePredicate)p).onClose();
+            if (p instanceof PlatformCacheEntryFilter)
+                ((PlatformCacheEntryFilter)p).onClose();
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/6d0aff43/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQueryCloseableScanBiPredicate.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQueryCloseableScanBiPredicate.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQueryCloseableScanBiPredicate.java
deleted file mode 100644
index d6c56e2..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQueryCloseableScanBiPredicate.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.processors.cache.query;
-
-import org.apache.ignite.lang.IgniteBiPredicate;
-
-/**
- * Special version of bi-predicate for cache scan queries with close callback.
- */
-public interface CacheQueryCloseableScanBiPredicate<K, V> extends IgniteBiPredicate<K,
V> {
-    /**
-     * Callback invoked when predicate is not longer needed.
-     */
-    public void onClose();
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/6d0aff43/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
index 4206230..b3f8720 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
@@ -17,29 +17,6 @@
 
 package org.apache.ignite.internal.processors.cache.query;
 
-import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.sql.SQLException;
-import java.util.ArrayDeque;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.Queue;
-import java.util.UUID;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ConcurrentMap;
-import javax.cache.Cache;
-import javax.cache.expiry.ExpiryPolicy;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteException;
@@ -71,6 +48,7 @@ import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtUnrese
 import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
 import org.apache.ignite.internal.processors.datastructures.GridCacheSetItemKey;
 import org.apache.ignite.internal.processors.datastructures.GridSetQueryPredicate;
+import org.apache.ignite.internal.processors.platform.cache.PlatformCacheEntryFilter;
 import org.apache.ignite.internal.processors.query.GridQueryFieldMetadata;
 import org.apache.ignite.internal.processors.query.GridQueryFieldsResult;
 import org.apache.ignite.internal.processors.query.GridQueryIndexDescriptor;
@@ -112,6 +90,30 @@ import org.apache.ignite.spi.indexing.IndexingSpi;
 import org.jetbrains.annotations.Nullable;
 import org.jsr166.ConcurrentHashMap8;
 
+import javax.cache.Cache;
+import javax.cache.expiry.ExpiryPolicy;
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.sql.SQLException;
+import java.util.ArrayDeque;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Queue;
+import java.util.UUID;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ConcurrentMap;
+
 import static org.apache.ignite.cache.CacheMode.LOCAL;
 import static org.apache.ignite.events.EventType.EVT_CACHE_QUERY_EXECUTED;
 import static org.apache.ignite.events.EventType.EVT_CACHE_QUERY_OBJECT_READ;
@@ -1010,8 +1012,8 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
                     heapIt.close();
                 }
                 finally {
-                    if (keyValFilter instanceof CacheQueryCloseableScanBiPredicate)
-                        ((CacheQueryCloseableScanBiPredicate)keyValFilter).onClose();
+                    if (keyValFilter instanceof PlatformCacheEntryFilter)
+                        ((PlatformCacheEntryFilter)keyValFilter).onClose();
                 }
             }
         };

http://git-wip-us.apache.org/repos/asf/ignite/blob/6d0aff43/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCacheEntryFilter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCacheEntryFilter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCacheEntryFilter.java
index bd3e281..94de2bc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCacheEntryFilter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCacheEntryFilter.java
@@ -17,13 +17,14 @@
 
 package org.apache.ignite.internal.processors.platform.cache;
 
-import org.apache.ignite.internal.processors.cache.GridLoadCacheCloseablePredicate;
-import org.apache.ignite.internal.processors.cache.query.CacheQueryCloseableScanBiPredicate;
+import org.apache.ignite.lang.IgniteBiPredicate;
 
 /**
  * Platform cache entry filter interface.
  */
-public interface PlatformCacheEntryFilter<K, V> extends GridLoadCacheCloseablePredicate<K,
V>,
-    CacheQueryCloseableScanBiPredicate<K, V> {
-    // No-op.
+public interface PlatformCacheEntryFilter<K, V> extends IgniteBiPredicate<K, V>
{
+    /**
+     * Callback invoked when filter is no longer needed.
+     */
+    public void onClose();
 }
\ No newline at end of file


Mime
View raw message