ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject ignite git commit: Single 'get' optimization.
Date Thu, 19 Nov 2015 06:45:48 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-single-op-get a68645a61 -> 00c980940


Single 'get' optimization.


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

Branch: refs/heads/ignite-single-op-get
Commit: 00c980940e4efa215402559bf104d8f3f7d961f4
Parents: a68645a
Author: sboikov <sboikov@gridgain.com>
Authored: Thu Nov 19 09:43:57 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Thu Nov 19 09:43:57 2015 +0300

----------------------------------------------------------------------
 .../internal/processors/cache/GridCacheAdapter.java       |  6 +++++-
 .../distributed/dht/GridPartitionedSingleGetFuture.java   | 10 +++-------
 .../replicated/GridCacheReplicatedMetricsSelfTest.java    |  9 ---------
 3 files changed, 8 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/00c98094/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 10b8976..562a0eb 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
@@ -1651,8 +1651,12 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K,
V
                     while (true) {
                         GridCacheEntryEx entry = needEntry ? entryEx(key) : peekEx(key);
 
-                        if (entry == null)
+                        if (entry == null) {
+                            if (!skipVals && ctx.config().isStatisticsEnabled())
+                                ctx.cache().metrics0().onRead(false);
+
                             break;
+                        }
 
                         try {
                             T2<CacheObject, GridCacheVersion> res = entry.innerGetVersioned(null,

http://git-wip-us.apache.org/repos/asf/ignite/blob/00c98094/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 0317bbb..8f2357b 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
@@ -371,15 +371,15 @@ public class GridPartitionedSingleGetFuture extends GridFutureAdapter<Object>
im
 
                         colocated.context().evicts().touch(entry, topVer);
 
-                        if (!skipVals && cctx.config().isStatisticsEnabled())
-                            cctx.cache().metrics0().onRead(v != null);
-
                         // Entry was not in memory or in swap, so we remove it from cache.
                         if (v == null) {
                             if (isNew && entry.markObsoleteIfEmpty(ver))
                                 colocated.removeIfObsolete(key);
                         }
                         else {
+                            if (!skipVals && cctx.config().isStatisticsEnabled())
+                                cctx.cache().metrics0().onRead(true);
+
                             if (!skipVals)
                                 setResult(v, ver);
                             else
@@ -388,10 +388,6 @@ public class GridPartitionedSingleGetFuture extends GridFutureAdapter<Object>
im
                             return null;
                         }
                     }
-                    else {
-                        if (!skipVals && cctx.config().isStatisticsEnabled())
-                            cctx.cache().metrics0().onRead(false);
-                    }
 
                     break;
                 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/00c98094/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedMetricsSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedMetricsSelfTest.java
index 319aa56..2fa43be 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedMetricsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedMetricsSelfTest.java
@@ -18,7 +18,6 @@
 package org.apache.ignite.internal.processors.cache.distributed.replicated;
 
 import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.internal.processors.cache.GridCacheTransactionalAbstractMetricsSelfTest;
 
 import static org.apache.ignite.cache.CacheMode.REPLICATED;
@@ -30,14 +29,6 @@ public class GridCacheReplicatedMetricsSelfTest extends GridCacheTransactionalAb
     /** */
     private static final int GRID_CNT = 2;
 
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception
{
-        IgniteConfiguration c = super.getConfiguration(gridName);
-
-        c.getTransactionConfiguration().setTxSerializableEnabled(true);
-
-        return c;
-    }
-
     /** {@inheritDoc} */
     @Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception
{
         CacheConfiguration cfg = super.cacheConfiguration(gridName);


Mime
View raw message