ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject [28/39] incubator-ignite git commit: # IGNITE-54-55 Remove unnecessary variable.
Date Thu, 05 Feb 2015 21:40:39 GMT
# IGNITE-54-55 Remove unnecessary variable.


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

Branch: refs/heads/ignite-sql-tests
Commit: 0945e36b362b25b6011e27b53fc7c906426cfd46
Parents: 6ec4622
Author: sevdokimov <sevdokimov@gridgain.com>
Authored: Wed Feb 4 19:54:30 2015 +0300
Committer: sevdokimov <sevdokimov@gridgain.com>
Committed: Wed Feb 4 19:54:30 2015 +0300

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


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0945e36b/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 d12e341..fffea58 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
@@ -82,9 +82,6 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
     /** */
     private static final long serialVersionUID = 0L;
 
-    /** removeAll() batch size. */
-    private static final long REMOVE_ALL_BATCH_SIZE = 100L;
-
     /** clearLocally() split threshold. */
     public static final int CLEAR_ALL_SPLIT_THRESHOLD = 10000;
 
@@ -3402,7 +3399,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
 
                 if (!nodes.isEmpty()) {
                     ctx.closures().callAsyncNoFailover(BROADCAST,
-                        new GlobalRemoveAllCallable<>(name(), topVer, REMOVE_ALL_BATCH_SIZE),
nodes, true).get();
+                        new GlobalRemoveAllCallable<>(name(), topVer), nodes, true).get();
                 }
             } while (ctx.affinity().affinityTopologyVersion() > topVer);
         }
@@ -5206,6 +5203,9 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
     @GridInternal
     private static class GlobalRemoveAllCallable<K,V> implements Callable<Object>,
Externalizable {
         /** */
+        private static final long REMOVE_ALL_BATCH_SIZE = 100L;
+
+        /** */
         private static final long serialVersionUID = 0L;
 
         /** Cache name. */
@@ -5214,9 +5214,6 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
         /** Topology version. */
         private long topVer;
 
-        /** Remove batch size. */
-        private long rmvBatchSz;
-
         /** Injected grid instance. */
         @IgniteInstanceResource
         private Ignite ignite;
@@ -5233,10 +5230,9 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
          * @param topVer Topology version.
          * @param rmvBatchSz Remove batch size.
          */
-        private GlobalRemoveAllCallable(String cacheName, long topVer, long rmvBatchSz) {
+        private GlobalRemoveAllCallable(String cacheName, long topVer) {
             this.cacheName = cacheName;
             this.topVer = topVer;
-            this.rmvBatchSz = rmvBatchSz;
         }
 
         /**
@@ -5260,7 +5256,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
                 if (ctx.affinity().primary(ctx.localNode(), k, topVer))
                     keys.add(k);
 
-                if (keys.size() >= rmvBatchSz) {
+                if (keys.size() >= REMOVE_ALL_BATCH_SIZE) {
                     cache.removeAll(keys);
 
                     keys.clear();
@@ -5276,14 +5272,12 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
         @Override public void writeExternal(ObjectOutput out) throws IOException {
             U.writeString(out, cacheName);
             out.writeLong(topVer);
-            out.writeLong(rmvBatchSz);
         }
 
         /** {@inheritDoc} */
         @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
             cacheName = U.readString(in);
             topVer = in.readLong();
-            rmvBatchSz = in.readLong();
         }
     }
 


Mime
View raw message