ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject ignite git commit: ignite-4932 WIP
Date Thu, 13 Apr 2017 09:43:02 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-4932 b948e2449 -> bf0b2406d


ignite-4932 WIP


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

Branch: refs/heads/ignite-4932
Commit: bf0b2406dab39ca16916b4368db890576712fa3e
Parents: b948e24
Author: sboikov <sboikov@gridgain.com>
Authored: Thu Apr 13 12:42:56 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Thu Apr 13 12:42:56 2017 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheAdapter.java      | 18 +++++--------
 .../dht/GridPartitionedGetFuture.java           | 28 +++++++++-----------
 .../dht/GridPartitionedSingleGetFuture.java     | 26 +++++++++---------
 .../local/atomic/GridLocalAtomicCache.java      | 11 +++-----
 4 files changed, 33 insertions(+), 50 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/bf0b2406/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 bafa25d..5d86f74 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
@@ -1920,14 +1920,12 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K,
V
 
                             GridCacheEntryEx entry = null;
 
-                            boolean skipEntry;
+                            boolean skipEntry = false;
 
                             if (offheapRead) {
                                 GridCacheSwapEntry swapEntry = ctx.swap().readSwapEntry(key);
 
                                 if (swapEntry != null) {
-                                    skipEntry = true;
-
                                     long expireTime = swapEntry.expireTime();
 
                                     if (expireTime != 0) {
@@ -1938,31 +1936,27 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K,
V
                                                 expireTime,
                                                 swapEntry.ttl());
                                         }
-                                        else
-                                            skipEntry = false; // Do not skip entry if need
process expiration.
                                     }
                                     else
                                         res = new EntryGetResult(swapEntry.value(), swapEntry.version(),
false);
                                 }
-                                else
-                                    skipEntry = !storeEnabled;
 
-                                if (skipEntry) {
+                                if (res != null) {
+                                    skipEntry = true;
+
                                     if (evt) {
                                         ctx.events().readEvent(key,
                                             null,
-                                            swapEntry != null ? swapEntry.value() : null,
+                                            swapEntry.value(),
                                             subjId,
                                             taskName,
                                             !deserializeBinary);
                                     }
 
                                     if (updateMetrics && ctx.cache().configuration().isStatisticsEnabled())
-                                        ctx.cache().metrics0().onRead(swapEntry != null);
+                                        ctx.cache().metrics0().onRead(true);
                                 }
                             }
-                            else
-                                skipEntry = false;
 
                             if (!skipEntry) {
                                 entry = needEntry ? entryEx(key) : peekEx(key);

http://git-wip-us.apache.org/repos/asf/ignite/blob/bf0b2406/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
index 798e2dd..b4b4494 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
@@ -443,41 +443,37 @@ public class GridPartitionedGetFuture<K, V> extends CacheDistributedGetFutureAda
 
         while (true) {
             try {
-                boolean skipEntry;
+                boolean skipEntry = false;
 
                 EntryGetResult getRes = null;
                 CacheObject v = null;
                 GridCacheVersion ver = null;
 
                 if (offheapRead) {
-                    skipEntry = true;
-
                     GridCacheSwapEntry swapEntry = cctx.swap().readSwapEntry(key);
 
                     if (swapEntry != null) {
                         long expireTime = swapEntry.expireTime();
 
                         if (expireTime == 0 || expireTime < U.currentTimeMillis()) {
+                            skipEntry = true;
+
                             v = swapEntry.value();
 
                             if (needVer)
                                 ver = swapEntry.version();
-                        }
-                        else
-                            skipEntry = false;
-                    }
 
-                    if (skipEntry && evt) {
-                        cctx.events().readEvent(key,
-                            null,
-                            swapEntry != null ? swapEntry.value() : null,
-                            subjId,
-                            taskName,
-                            !deserializeBinary);
+                            if (evt) {
+                                cctx.events().readEvent(key,
+                                    null,
+                                    swapEntry.value(),
+                                    subjId,
+                                    taskName,
+                                    !deserializeBinary);
+                            }
+                        }
                     }
                 }
-                else
-                    skipEntry = false;
 
                 if (!skipEntry) {
                     GridCacheEntryEx entry =

http://git-wip-us.apache.org/repos/asf/ignite/blob/bf0b2406/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java
index 11d4fc1..80b307f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java
@@ -369,37 +369,35 @@ public class GridPartitionedSingleGetFuture extends GridFutureAdapter<Object>
im
                 CacheObject v = null;
                 GridCacheVersion ver = null;
 
-                boolean skipEntry;
+                boolean skipEntry = false;
 
                 if (offheapRead) {
-                    skipEntry = true;
-
                     GridCacheSwapEntry swapEntry = cctx.swap().readSwapEntry(key);
 
                     if (swapEntry != null) {
                         long expireTime = swapEntry.expireTime();
 
                         if (expireTime == 0 || expireTime < U.currentTimeMillis()) {
+                            skipEntry = true;
+
                             v = swapEntry.value();
 
                             if (needVer)
                                 ver = swapEntry.version();
+
+                            if (evt) {
+                                cctx.events().readEvent(key,
+                                    null,
+                                    swapEntry.value(),
+                                    subjId,
+                                    taskName,
+                                    !deserializeBinary);
+                            }
                         }
                         else
                             skipEntry = false;
                     }
-
-                    if (skipEntry && evt) {
-                        cctx.events().readEvent(key,
-                            null,
-                            swapEntry != null ? swapEntry.value() : null,
-                            subjId,
-                            taskName,
-                            !deserializeBinary);
-                    }
                 }
-                else
-                    skipEntry = false;
 
                 if (!skipEntry) {
                     GridCacheEntryEx entry = colocated.context().isSwapOrOffheapEnabled()
? colocated.entryEx(key) :

http://git-wip-us.apache.org/repos/asf/ignite/blob/bf0b2406/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
index 04048af..74eaf17 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
@@ -406,17 +406,17 @@ public class GridLocalAtomicCache<K, V> extends GridLocalCache<K,
V> {
 
             KeyCacheObject cacheKey = ctx.toCacheKeyObject(key);
 
-            boolean skipEntry;
+            boolean skipEntry = false;
 
             if (offheapRead) {
-                skipEntry = true;
-
                 GridCacheSwapEntry swapEntry = ctx.swap().readSwapEntry(cacheKey);
 
                 if (swapEntry != null) {
                     long expireTime = swapEntry.expireTime();
 
                     if (expireTime == 0 || expireTime < U.currentTimeMillis()) {
+                        skipEntry = true;
+
                         ctx.addResult(vals,
                             cacheKey,
                             swapEntry.value(),
@@ -442,14 +442,9 @@ public class GridLocalAtomicCache<K, V> extends GridLocalCache<K,
V> {
                                 !deserializeBinary);
                         }
                     }
-                    else
-                        skipEntry = false;
                 }
                 else
                     success = false;
-
-                if (skipEntry && !success && !storeEnabled && configuration().isStatisticsEnabled()
&& !skipVals)
-                    metrics0().onRead(false);
             }
             else
                 skipEntry = false;


Mime
View raw message