ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [1/2] ignite git commit: tmp
Date Tue, 21 Mar 2017 09:29:26 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-4680-sb-1 [created] 9cc4612e3


tmp


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

Branch: refs/heads/ignite-4680-sb-1
Commit: a58a5db87806e5f814f6336c1f88eb1a8cdda88c
Parents: 956549e
Author: sboikov <sboikov@gridgain.com>
Authored: Tue Mar 21 11:50:14 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Tue Mar 21 11:50:14 2017 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheMapEntry.java     |  4 +-
 .../distributed/dht/GridDhtLocalPartition.java  | 80 +++++++++++++++++++-
 .../dht/atomic/GridDhtAtomicCache.java          | 22 +-----
 3 files changed, 83 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a58a5db8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index 54b4ed7..77612b0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
@@ -2050,7 +2050,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter
impleme
 
         Long updateCntr0 = null;
 
-        synchronized (this) {
+        //synchronized (this) {
             boolean internal = isInternal() || !context().userCache();
 
             Map<UUID, CacheContinuousQueryListener> lsnrs = cctx.continuousQueries().updateListeners(internal,
false);
@@ -2705,7 +2705,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter
impleme
 
                 assert rmv;
             }
-        }
+       // }
 
         if (log.isDebugEnabled())
             log.debug("Updated cache entry [val=" + val + ", old=" + oldVal + ", entry="
+ this + ']');

http://git-wip-us.apache.org/repos/asf/ignite/blob/a58a5db8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
index 693a049..99fdc87 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.internal.processors.cache.distributed.dht;
 
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
@@ -130,7 +131,7 @@ public class GridDhtLocalPartition implements Comparable<GridDhtLocalPartition>,
      * @param entryFactory Entry factory.
      */
     @SuppressWarnings("ExternalizableWithoutPublicNoArgConstructor")
-    GridDhtLocalPartition(GridCacheContext cctx, int id, GridCacheMapEntryFactory entryFactory)
{
+    GridDhtLocalPartition(final GridCacheContext cctx, int id, final GridCacheMapEntryFactory
entryFactory) {
         assert cctx != null;
 
         this.id = id;
@@ -144,7 +145,82 @@ public class GridDhtLocalPartition implements Comparable<GridDhtLocalPartition>,
             }
         };
 
-        map = new GridCacheConcurrentMapImpl(cctx, entryFactory, cctx.config().getStartSize()
/ cctx.affinity().partitions());
+        //map = new GridCacheConcurrentMapImpl(cctx, entryFactory, cctx.config().getStartSize()
/ cctx.affinity().partitions());
+
+        map = new GridCacheConcurrentMap() {
+            private final HashMap<KeyCacheObject, GridCacheMapEntry> m = new HashMap<>();
+
+            @Nullable
+            @Override
+            public GridCacheMapEntry getEntry(KeyCacheObject key) {
+                return m.get(key);
+            }
+
+            @Nullable
+            @Override
+            public GridCacheMapEntry putEntryIfObsoleteOrAbsent(AffinityTopologyVersion topVer,
+                                                                KeyCacheObject key,
+                                                                @Nullable CacheObject val,
+                                                                boolean create,
+                                                                boolean touch) {
+                GridCacheMapEntry e = entryFactory.create(cctx, topVer, key, 0, val);
+
+                m.put(key, e);
+
+                return e;
+            }
+
+            @Override
+            public boolean removeEntry(GridCacheEntryEx entry) {
+                return m.remove(entry.key()) != null;
+            }
+
+            @Override
+            public int size() {
+                return m.size();
+            }
+
+            @Override
+            public int publicSize() {
+                return m.size();
+            }
+
+            @Override
+            public void incrementPublicSize(GridCacheEntryEx e) {
+
+            }
+
+            @Override
+            public void decrementPublicSize(GridCacheEntryEx e) {
+
+            }
+
+            @Nullable
+            @Override
+            public GridCacheMapEntry randomEntry() {
+                return null;
+            }
+
+            @Override
+            public Set<KeyCacheObject> keySet(CacheEntryPredicate... filter) {
+                return m.keySet();
+            }
+
+            @Override
+            public Iterable<GridCacheMapEntry> entries(CacheEntryPredicate... filter)
{
+                return m.values();
+            }
+
+            @Override
+            public Iterable<GridCacheMapEntry> allEntries(CacheEntryPredicate... filter)
{
+                return m.values();
+            }
+
+            @Override
+            public Set<GridCacheMapEntry> entrySet(CacheEntryPredicate... filter) {
+                return new HashSet<>(m.values());
+            }
+        };
 
         int delQueueSize = CU.isSystemCache(cctx.name()) ? 100 :
             Math.max(MAX_DELETE_QUEUE_SIZE / cctx.affinity().partitions(), 20);

http://git-wip-us.apache.org/repos/asf/ignite/blob/a58a5db8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index feed87f..51e40f4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -1860,19 +1860,6 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
 
                 e.printStackTrace();
             }
-            finally {
-                if (locked != null)
-                    unlockEntries(locked, req.topologyVersion());
-
-                // Enqueue if necessary after locks release.
-                if (deleted != null) {
-                    assert !deleted.isEmpty();
-                    assert ctx.deferredDelete() : this;
-
-                    for (IgniteBiTuple<GridDhtCacheEntry, GridCacheVersion> e : deleted)
-                        ctx.onDeferredDelete(e.get1(), e.get2());
-                }
-            }
         }
         catch (GridDhtInvalidPartitionException ignore) {
             if (log.isDebugEnabled())
@@ -1931,7 +1918,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
             false,
             ctx.deploymentEnabled());
 
-        List<GridDhtCacheEntry> locked = lockEntries(req, req.topologyVersion(), stripeIdxs);
+        //List<GridDhtCacheEntry> locked = lockEntries(req, req.topologyVersion(),
stripeIdxs);
 
         boolean hasNear = ctx.discovery().cacheNearNode(node, name());
 
@@ -1960,7 +1947,6 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
             hasNear,
             req,
             res,
-            locked,
             ver,
             null,
             ctx.isDrEnabled(),
@@ -1976,7 +1962,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
 
         res.returnValue(retVal);
 
-        unlockEntries(locked, null);
+        //unlockEntries(locked, null);
 
         if (TEST_STRIPE_SUBMIT){
             for (int i = 0; i < req.size(); i++) {
@@ -2471,7 +2457,6 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
      * @param hasNear {@code True} if originating node has near cache.
      * @param req Update request.
      * @param res Update response.
-     * @param locked Locked entries.
      * @param ver Assigned update version.
      * @param dhtFut Optional DHT future.
      * @param replicate Whether DR is enabled for that cache.
@@ -2488,7 +2473,6 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
         boolean hasNear,
         GridNearAtomicAbstractUpdateRequest req,
         GridNearAtomicUpdateResponse res,
-        List<GridDhtCacheEntry> locked,
         GridCacheVersion ver,
         @Nullable GridDhtAtomicAbstractUpdateFuture dhtFut,
         boolean replicate,
@@ -2519,7 +2503,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
             // We are holding java-level locks on entries at this point.
             // No GridCacheEntryRemovedException can be thrown.
             try {
-                GridDhtCacheEntry entry = locked.get(i);
+                GridDhtCacheEntry entry = entryExx(k, topVer);
 
                 GridCacheVersion newConflictVer = req.conflictVersion(trueIdx);
                 long newConflictTtl = req.conflictTtl(trueIdx);


Mime
View raw message