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-1516-1
Date Tue, 22 Sep 2015 07:22:15 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-1516-1 4533bd7cd -> a85fe3130


ignite-1516-1


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

Branch: refs/heads/ignite-1516-1
Commit: a85fe3130aff1101cade38b5147de5a5e1be6944
Parents: 4533bd7
Author: sboikov <sboikov@gridgain.com>
Authored: Tue Sep 22 10:22:06 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Tue Sep 22 10:22:06 2015 +0300

----------------------------------------------------------------------
 .../processors/query/h2/IgniteH2Indexing.java   | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a85fe313/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
index 817a465..8595187 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
@@ -71,6 +71,7 @@ import org.apache.ignite.internal.processors.cache.CacheObjectContext;
 import org.apache.ignite.internal.processors.cache.GridCacheAdapter;
 import org.apache.ignite.internal.processors.cache.GridCacheAffinityManager;
 import org.apache.ignite.internal.processors.cache.GridCacheContext;
+import org.apache.ignite.internal.processors.cache.IgniteInternalCache;
 import org.apache.ignite.internal.processors.cache.QueryCursorImpl;
 import org.apache.ignite.internal.processors.cache.query.GridCacheTwoStepQuery;
 import org.apache.ignite.internal.processors.query.GridQueryFieldMetadata;
@@ -98,7 +99,6 @@ import org.apache.ignite.internal.util.lang.GridCloseableIterator;
 import org.apache.ignite.internal.util.offheap.unsafe.GridUnsafeGuard;
 import org.apache.ignite.internal.util.offheap.unsafe.GridUnsafeMemory;
 import org.apache.ignite.internal.util.typedef.F;
-import org.apache.ignite.internal.util.typedef.internal.CU;
 import org.apache.ignite.internal.util.typedef.internal.LT;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.SB;
@@ -2110,9 +2110,6 @@ public class IgniteH2Indexing implements GridQueryIndexing {
         /** */
         private final boolean preferSwapVal;
 
-        /** */
-        private final GridCacheContext cctx;
-
         /**
          * @param type Type descriptor.
          * @param schema Schema.
@@ -2143,14 +2140,6 @@ public class IgniteH2Indexing implements GridQueryIndexing {
             valType = DataType.getTypeFromClass(type.valueClass());
 
             preferSwapVal = schema.ccfg.getMemoryMode() == CacheMemoryMode.OFFHEAP_TIERED;
-
-            if (ctx != null) { // Can be null in tests.
-                GridCacheContext<Object, ?> cctx0 = ctx.cache().context().cacheContext(CU.cacheId(schema.ccfg.getName()));
-
-                cctx = cctx0.isNear() ? cctx0.near().dht().context() : cctx0;
-            }
-            else
-                cctx = null;
         }
 
         /** {@inheritDoc} */
@@ -2271,6 +2260,13 @@ public class IgniteH2Indexing implements GridQueryIndexing {
         /** {@inheritDoc} */
         @SuppressWarnings("unchecked")
         @Override public Object readFromSwap(Object key) throws IgniteCheckedException {
+            IgniteInternalCache<Object, ?> cache = ctx.cache().cache(schema.spaceName);
+
+            GridCacheContext cctx = cache.context();
+
+            if (cctx.isNear())
+                cctx = cctx.near().dht().context();
+
             CacheObject v = cctx.swap().readValue(cctx.toCacheKeyObject(key), true, true);
 
             if (v == null)


Mime
View raw message