ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [19/50] [abbrv] incubator-ignite git commit: #ignite-333: Remove class GlobalClearKeyCallable.
Date Sat, 14 Mar 2015 02:36:59 GMT
#ignite-333: Remove class GlobalClearKeyCallable.


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

Branch: refs/heads/ignite-45
Commit: b39bfbe2cdd0df156b05b0d05b58748c342a9f13
Parents: 7e3ad24
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Fri Mar 13 12:12:25 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Fri Mar 13 12:12:25 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheAdapter.java      | 66 ++++----------------
 1 file changed, 12 insertions(+), 54 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b39bfbe2/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 fc00f6a..58645c3 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
@@ -1440,7 +1440,11 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
         // Clear local cache synchronously.
         clearLocally(key);
 
-        clearRemotes(0, new GlobalClearKeyCallable<K>(name(), key));
+        Set<K> keys = U.newHashSet(1);
+
+        keys.add(key);
+
+        clearRemotes(0, new GlobalClearKeySetCallable<K, V>(name(), new HashSet<K>(keys)));
     }
 
     /** {@inheritDoc} */
@@ -1448,17 +1452,21 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
         // Clear local cache synchronously.
         clearLocallyAll(keys);
 
-        clearRemotes(0, new GlobalClearKeySetCallable(name(), keys));
+        clearRemotes(0, new GlobalClearKeySetCallable<K, V>(name(), keys));
     }
 
     /** {@inheritDoc} */
     @Override public IgniteInternalFuture<?> clearAsync(K key) {
-        return clearAsync(new GlobalClearKeyCallable<K>(name(), key));
+        Set<K> keys = U.newHashSet(1);
+
+        keys.add(key);
+
+        return clearAsync(new GlobalClearKeySetCallable<K, V>(name(), keys));
     }
 
     /** {@inheritDoc} */
     @Override public IgniteInternalFuture<?> clearAsync(Set<K> keys) {
-        return clearAsync(new GlobalClearKeySetCallable(name(), keys));
+        return clearAsync(new GlobalClearKeySetCallable<K, V>(name(), keys));
     }
 
     /** {@inheritDoc} */
@@ -5571,56 +5579,6 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
     }
 
     /**
-     * Global clear key.
-     */
-    @GridInternal
-    private static class GlobalClearKeyCallable<K> extends GlobalClearCallable {
-        /** */
-        private static final long serialVersionUID = 0L;
-
-        /** Key to remove. */
-        private K key;
-
-        /**
-         * Empty constructor for serialization.
-         */
-        public GlobalClearKeyCallable() {
-            // No-op.
-        }
-
-        /**
-         * @param cacheName Cache name.
-         * @param key Key to clear.
-         */
-        private GlobalClearKeyCallable(String cacheName, K key) {
-            super(cacheName);
-
-            this.key = key;
-        }
-
-        /** {@inheritDoc} */
-        @Override public Object call() throws Exception {
-            ((IgniteEx)ignite).cachex(cacheName).clearLocally(key);
-
-            return null;
-        }
-
-        /** {@inheritDoc} */
-        @Override public void writeExternal(ObjectOutput out) throws IOException {
-            super.writeExternal(out);
-
-            out.writeObject(key);
-        }
-
-        /** {@inheritDoc} */
-        @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
-            super.readExternal(in);
-
-            key = (K)in.readObject();
-        }
-    }
-
-    /**
      * Global clear keys.
      */
     @GridInternal


Mime
View raw message