ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [3/4] ignite git commit: Fix.
Date Fri, 29 Apr 2016 14:01:01 GMT
Fix.


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

Branch: refs/heads/ignite-3074
Commit: 32eb555b98d20462b121663687b43522cec941e0
Parents: 363c306
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Fri Apr 29 17:00:28 2016 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Fri Apr 29 17:00:28 2016 +0300

----------------------------------------------------------------------
 .../benchmarks/jmh/JmhAbstractBenchmark.java    |  2 +-
 .../GridDhtAtomicAbstractUpdateFuture.java      | 29 ++++++++------------
 .../atomic/GridDhtAtomicSingleUpdateFuture.java | 18 ------------
 .../dht/atomic/GridDhtAtomicUpdateFuture.java   | 22 ---------------
 4 files changed, 12 insertions(+), 59 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/32eb555b/modules/benchmarks/src/main/java/org/apache/ignite/internal/benchmarks/jmh/JmhAbstractBenchmark.java
----------------------------------------------------------------------
diff --git a/modules/benchmarks/src/main/java/org/apache/ignite/internal/benchmarks/jmh/JmhAbstractBenchmark.java
b/modules/benchmarks/src/main/java/org/apache/ignite/internal/benchmarks/jmh/JmhAbstractBenchmark.java
index 69e4a78..8ba4dc9 100644
--- a/modules/benchmarks/src/main/java/org/apache/ignite/internal/benchmarks/jmh/JmhAbstractBenchmark.java
+++ b/modules/benchmarks/src/main/java/org/apache/ignite/internal/benchmarks/jmh/JmhAbstractBenchmark.java
@@ -72,7 +72,7 @@ public abstract class JmhAbstractBenchmark {
      * @return Value.
      */
     protected static int intProperty(String name) {
-        return intProperty(name, 0);
+        return intProperty(name, 1);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/32eb555b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicAbstractUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicAbstractUpdateFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicAbstractUpdateFuture.java
index 9c86fec..54c9bf2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicAbstractUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicAbstractUpdateFuture.java
@@ -42,6 +42,7 @@ import org.jetbrains.annotations.Nullable;
 
 import javax.cache.processor.EntryProcessor;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.UUID;
@@ -107,6 +108,9 @@ public abstract class GridDhtAtomicAbstractUpdateFuture extends GridFutureAdapte
     /** Continuous query closures. */
     private List<CI1<Boolean>> cntQryClos;
 
+    /** Entries with readers. */
+    private Map<KeyCacheObject, GridDhtCacheEntry> nearReadersEntries;
+
     /**
      * Constructor.
      *
@@ -247,7 +251,10 @@ public abstract class GridDhtAtomicAbstractUpdateFuture extends GridFutureAdapte
                 mapping(nodeId, req);
             }
 
-            nearReaderEntry(entry.key(), entry);
+            if (nearReadersEntries == null)
+                nearReadersEntries = new HashMap<>();
+
+            nearReadersEntries.put(entry.key(), entry);
 
             req.addNearWriteValue(entry.key(),
                 val,
@@ -316,7 +323,9 @@ public abstract class GridDhtAtomicAbstractUpdateFuture extends GridFutureAdapte
         for (int i = 0; i < updateRes.nearEvictedCount(); i++) {
             KeyCacheObject key = updateRes.nearEvicted(i);
 
-            GridDhtCacheEntry entry = nearReaderEntry(key);
+            assert nearReadersEntries != null;
+
+            GridDhtCacheEntry entry = nearReadersEntries.get(key);
 
             try {
                 entry.removeReader(nodeId, updateRes.messageId());
@@ -479,22 +488,6 @@ public abstract class GridDhtAtomicAbstractUpdateFuture extends GridFutureAdapte
     }
 
     /**
-     * Add near reader entry.
-     *
-     * @param key Key.
-     * @param entry Near reader entry.
-     */
-    protected abstract void nearReaderEntry(KeyCacheObject key, GridDhtCacheEntry entry);
-
-    /**
-     * Get near reader entry.
-     *
-     * @param key Key.
-     * @return Near reader entry.
-     */
-    protected abstract GridDhtCacheEntry nearReaderEntry(KeyCacheObject key);
-
-    /**
      * Send DHT request.
      *
      * @param req Request.

http://git-wip-us.apache.org/repos/asf/ignite/blob/32eb555b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateFuture.java
index ae421da..7b1a2cd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateFuture.java
@@ -33,9 +33,6 @@ public class GridDhtAtomicSingleUpdateFuture extends GridDhtAtomicAbstractUpdate
     /** Key. */
     private KeyCacheObject key;
 
-    /** Entry with reader. */
-    private GridDhtCacheEntry nearReaderEntry;
-
     /**
      * Constructor.
      *
@@ -69,21 +66,6 @@ public class GridDhtAtomicSingleUpdateFuture extends GridDhtAtomicAbstractUpdate
     }
 
     /** {@inheritDoc} */
-    @Override protected void nearReaderEntry(KeyCacheObject key, GridDhtCacheEntry entry)
{
-        assert F.eq(this.key, key);
-        assert nearReaderEntry == null;
-
-        nearReaderEntry = entry;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected GridDhtCacheEntry nearReaderEntry(KeyCacheObject key) {
-        assert F.eq(this.key, key);
-
-        return nearReaderEntry;
-    }
-
-    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(GridDhtAtomicSingleUpdateFuture.class, this);
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/32eb555b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
index 3286ef8..10c149c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
@@ -18,13 +18,9 @@
 package org.apache.ignite.internal.processors.cache.distributed.dht.atomic;
 
 import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import org.apache.ignite.internal.processors.cache.GridCacheContext;
 import org.apache.ignite.internal.processors.cache.KeyCacheObject;
-import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtCacheEntry;
 import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
 import org.apache.ignite.internal.util.typedef.CI2;
 import org.apache.ignite.internal.util.typedef.internal.S;
@@ -37,9 +33,6 @@ public class GridDhtAtomicUpdateFuture extends GridDhtAtomicAbstractUpdateFuture
     /** */
     private static final long serialVersionUID = 0L;
 
-    /** Entries with readers. */
-    private Map<KeyCacheObject, GridDhtCacheEntry> nearReadersEntries;
-
     /** Future keys. */
     private final List<KeyCacheObject> keys;
 
@@ -79,21 +72,6 @@ public class GridDhtAtomicUpdateFuture extends GridDhtAtomicAbstractUpdateFuture
     }
 
     /** {@inheritDoc} */
-    @Override protected void nearReaderEntry(KeyCacheObject key, GridDhtCacheEntry entry)
{
-        if (nearReadersEntries == null)
-            nearReadersEntries = new HashMap<>();
-
-        nearReadersEntries.put(entry.key(), entry);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected GridDhtCacheEntry nearReaderEntry(KeyCacheObject key) {
-        assert nearReadersEntries != null;
-
-        return nearReadersEntries.get(key);
-    }
-
-    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(GridDhtAtomicUpdateFuture.class, this);
     }


Mime
View raw message