ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [16/53] [abbrv] ignite git commit: Removed getOrCreateEntry(...).
Date Mon, 10 Apr 2017 15:55:23 GMT
Removed getOrCreateEntry(...).


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

Branch: refs/heads/ignite-3477-master
Commit: 7d7b28377c0f53037e5207a18a109ad22c8954aa
Parents: ecfc45e
Author: Ilya Lantukh <ilantukh@gridgain.com>
Authored: Fri Mar 31 16:41:15 2017 +0300
Committer: Ilya Lantukh <ilantukh@gridgain.com>
Committed: Fri Mar 31 16:41:15 2017 +0300

----------------------------------------------------------------------
 .../internal/processors/cache/GridCacheAdapter.java |  2 +-
 .../processors/cache/GridCacheConcurrentMap.java    |  2 --
 .../cache/GridCacheConcurrentMapImpl.java           | 16 ----------------
 .../processors/cache/GridNoStorageCacheMap.java     |  5 -----
 .../dht/GridCachePartitionedConcurrentMap.java      |  9 ---------
 .../distributed/dht/GridDhtLocalPartition.java      | 14 +++-----------
 6 files changed, 4 insertions(+), 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/7d7b2837/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 93cfe2f..4a51c53 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
@@ -954,7 +954,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K,
V
      * @return Entry (never {@code null}).
      */
     public GridCacheEntryEx entryEx(KeyCacheObject key, AffinityTopologyVersion topVer) {
-        GridCacheEntryEx e = map.getOrCreateEntry(key, topVer);
+        GridCacheEntryEx e = map.putEntryIfObsoleteOrAbsent(topVer, key, null, true, false);
 
         assert e != null;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/7d7b2837/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
index cd7c031..debc65b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
@@ -35,8 +35,6 @@ public interface GridCacheConcurrentMap {
      */
     @Nullable public GridCacheMapEntry getEntry(KeyCacheObject key);
 
-    public GridCacheMapEntry getOrCreateEntry(KeyCacheObject key, AffinityTopologyVersion
topVer);
-
     /**
      * @param topVer Topology version.
      * @param key Key.

http://git-wip-us.apache.org/repos/asf/ignite/blob/7d7b2837/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMapImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMapImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMapImpl.java
index 79b9361..10f5ca3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMapImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMapImpl.java
@@ -109,22 +109,6 @@ public class GridCacheConcurrentMapImpl implements GridCacheConcurrentMap
{
     }
 
     /** {@inheritDoc} */
-    @Override public GridCacheMapEntry getOrCreateEntry(KeyCacheObject key, AffinityTopologyVersion
topVer) {
-        GridCacheMapEntry cur = getEntry(key);
-
-        if (cur == null || cur.obsolete()) {
-            cur = putEntryIfObsoleteOrAbsent(
-                topVer,
-                key,
-                null,
-                true,
-                false);
-        }
-
-        return cur;
-    }
-
-    /** {@inheritDoc} */
     @Nullable @Override public GridCacheMapEntry putEntryIfObsoleteOrAbsent(final AffinityTopologyVersion
topVer,
         KeyCacheObject key,
         @Nullable final CacheObject val,

http://git-wip-us.apache.org/repos/asf/ignite/blob/7d7b2837/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridNoStorageCacheMap.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridNoStorageCacheMap.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridNoStorageCacheMap.java
index 0f5097a..db3533d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridNoStorageCacheMap.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridNoStorageCacheMap.java
@@ -45,11 +45,6 @@ public class GridNoStorageCacheMap implements GridCacheConcurrentMap {
     }
 
     /** {@inheritDoc} */
-    @Override public GridCacheMapEntry getOrCreateEntry(KeyCacheObject key, AffinityTopologyVersion
topVer) {
-        return new GridDhtCacheEntry(ctx, topVer, key, key.hashCode(), null);
-    }
-
-    /** {@inheritDoc} */
     @Override public GridCacheMapEntry putEntryIfObsoleteOrAbsent(AffinityTopologyVersion
topVer, KeyCacheObject key,
         @Nullable CacheObject val, boolean create, boolean touch) {
         if (create)

http://git-wip-us.apache.org/repos/asf/ignite/blob/7d7b2837/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedConcurrentMap.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedConcurrentMap.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedConcurrentMap.java
index f8574e7..cfbe9bb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedConcurrentMap.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedConcurrentMap.java
@@ -79,15 +79,6 @@ public class GridCachePartitionedConcurrentMap implements GridCacheConcurrentMap
     }
 
     /** {@inheritDoc} */
-    @Override public GridCacheMapEntry getOrCreateEntry(KeyCacheObject key, AffinityTopologyVersion
topVer) {
-        GridDhtLocalPartition part = localPartition(key, topVer, true);
-
-        assert part != null;
-
-        return part.getOrCreateEntry(key, topVer);
-    }
-
-    /** {@inheritDoc} */
     @Override public GridCacheMapEntry putEntryIfObsoleteOrAbsent(AffinityTopologyVersion
topVer, KeyCacheObject key,
         @Nullable CacheObject val, boolean create, boolean touch) {
         GridDhtLocalPartition part = localPartition(key, topVer, create);

http://git-wip-us.apache.org/repos/asf/ignite/blob/7d7b2837/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 cff533e..9389afd 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
@@ -329,15 +329,6 @@ public class GridDhtLocalPartition implements Comparable<GridDhtLocalPartition>,
     }
 
     /** {@inheritDoc} */
-    @Override public GridDhtCacheEntry getOrCreateEntry(KeyCacheObject key, AffinityTopologyVersion
topVer) {
-        GridCacheMapEntry entry = map.getOrCreateEntry(key, topVer);
-
-        assert entry instanceof GridDhtCacheEntry;
-
-        return (GridDhtCacheEntry)entry;
-    }
-
-    /** {@inheritDoc} */
     @Override public boolean removeEntry(GridCacheEntryEx entry) {
         return map.removeEntry(entry);
     }
@@ -970,9 +961,10 @@ public class GridDhtLocalPartition implements Comparable<GridDhtLocalPartition>,
                     try {
                         CacheDataRow row = it0.next();
 
-                        GridDhtCacheEntry cached = getOrCreateEntry(row.key(), cctx.affinity().affinityTopologyVersion());
+                        GridCacheMapEntry cached = putEntryIfObsoleteOrAbsent(cctx.affinity().affinityTopologyVersion(),
+                            row.key(), null, true, false);
 
-                        if (cached.clearInternal(clearVer, extras)) {
+                        if (cached instanceof GridDhtCacheEntry && ((GridDhtCacheEntry)cached).clearInternal(clearVer,
extras)) {
                             if (rec) {
                                 cctx.events().addEvent(cached.partition(),
                                     cached.key(),


Mime
View raw message