You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2016/01/29 11:26:05 UTC

[1/2] ignite git commit: IGNITE-2498: Full fix for (p2p + offheap) deserialization issue.

Repository: ignite
Updated Branches:
  refs/heads/ignite-1.5.6 d25db2a2d -> b68c5607c


IGNITE-2498: Full fix for (p2p + offheap) deserialization issue.


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

Branch: refs/heads/ignite-1.5.6
Commit: efc92f7d91bbec2631228cf06ab1d5a0df3aef4e
Parents: d25db2a
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Fri Jan 29 12:44:49 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Fri Jan 29 13:14:28 2016 +0300

----------------------------------------------------------------------
 .../internal/processors/cache/GridCacheMapEntry.java | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/efc92f7d/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 775ba87..19c1312 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
@@ -220,7 +220,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
         }
         else {
             try {
-                if (cctx.kernalContext().config().isPeerClassLoadingEnabled()) {
+                if (isPeerClassLoadingEnabled()) {
                     Object val0 = null;
 
                     if (val != null && val.cacheObjectType() != CacheObject.TYPE_BYTE_ARR) {
@@ -571,7 +571,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
             IgniteUuid valClsLdrId = null;
             IgniteUuid keyClsLdrId = null;
 
-            if (cctx.kernalContext().config().isPeerClassLoadingEnabled() && !cctx.binaryMarshaller()) {
+            if (isPeerClassLoadingEnabled()) {
                 if (val != null) {
                     valClsLdrId = cctx.deploy().getClassLoaderId(
                         U.detectObjectClassLoader(val.value(cctx.cacheObjectContext(), false)));
@@ -598,6 +598,13 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
     }
 
     /**
+     * @return {@code True} if peer class loading is enabled.
+     */
+    private boolean isPeerClassLoadingEnabled() {
+        return !cctx.binaryMarshaller() && cctx.kernalContext().config().isPeerClassLoadingEnabled();
+    }
+
+    /**
      * @return Value bytes and flag indicating whether value is byte array.
      */
     protected IgniteBiTuple<byte[], Byte> valueBytes0() {
@@ -3157,7 +3164,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
         if (hasOffHeapPointer()) {
             CacheObject val0 = cctx.fromOffheap(offHeapPointer(), tmp);
 
-            if (!tmp && cctx.kernalContext().config().isPeerClassLoadingEnabled())
+            if (!tmp && isPeerClassLoadingEnabled())
                 val0.finishUnmarshal(cctx.cacheObjectContext(), cctx.deploy().globalLoader());
 
             return val0;
@@ -4045,7 +4052,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
                     IgniteUuid valClsLdrId = null;
                     IgniteUuid keyClsLdrId = null;
 
-                    if (cctx.kernalContext().config().isPeerClassLoadingEnabled()) {
+                    if (isPeerClassLoadingEnabled()) {
                         if (val != null) {
                             valClsLdrId = cctx.deploy().getClassLoaderId(
                                 U.detectObjectClassLoader(val.value(cctx.cacheObjectContext(), false)));


[2/2] ignite git commit: IGNITE-2498: Finalization.

Posted by vo...@apache.org.
IGNITE-2498: Finalization.


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

Branch: refs/heads/ignite-1.5.6
Commit: b68c5607cbbfeddce9ec2da78d73f9f2597f77f1
Parents: efc92f7
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Fri Jan 29 13:10:48 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Fri Jan 29 13:14:40 2016 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheMapEntry.java     |  2 +-
 .../GridCacheDeploymentOffHeapSelfTest.java     |  4 +-
 ...ridCacheDeploymentOffHeapValuesSelfTest.java | 41 ++++++++++++++++++++
 .../testsuites/IgniteCacheTestSuite3.java       |  2 +
 4 files changed, 46 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/b68c5607/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 19c1312..b258c73 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
@@ -3164,7 +3164,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
         if (hasOffHeapPointer()) {
             CacheObject val0 = cctx.fromOffheap(offHeapPointer(), tmp);
 
-            if (!tmp && isPeerClassLoadingEnabled())
+            if (!tmp && cctx.kernalContext().config().isPeerClassLoadingEnabled())
                 val0.finishUnmarshal(cctx.cacheObjectContext(), cctx.deploy().globalLoader());
 
             return val0;

http://git-wip-us.apache.org/repos/asf/ignite/blob/b68c5607/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentOffHeapSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentOffHeapSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentOffHeapSelfTest.java
index 1adc3b4..ed58c3e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentOffHeapSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentOffHeapSelfTest.java
@@ -21,7 +21,7 @@ import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.NearCacheConfiguration;
 
 import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
-import static org.apache.ignite.cache.CacheMemoryMode.OFFHEAP_VALUES;
+import static org.apache.ignite.cache.CacheMemoryMode.OFFHEAP_TIERED;
 
 /**
  * Tests deployment with off-heap storage.
@@ -31,7 +31,7 @@ public class GridCacheDeploymentOffHeapSelfTest extends GridCacheDeploymentSelfT
     @Override protected CacheConfiguration cacheConfiguration() throws Exception {
         CacheConfiguration cacheCfg = super.cacheConfiguration();
 
-        cacheCfg.setMemoryMode(OFFHEAP_VALUES);
+        cacheCfg.setMemoryMode(OFFHEAP_TIERED);
         cacheCfg.setOffHeapMaxMemory(0);
         cacheCfg.setAtomicityMode(TRANSACTIONAL);
         cacheCfg.setNearConfiguration(new NearCacheConfiguration());

http://git-wip-us.apache.org/repos/asf/ignite/blob/b68c5607/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentOffHeapValuesSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentOffHeapValuesSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentOffHeapValuesSelfTest.java
new file mode 100644
index 0000000..73d5183
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentOffHeapValuesSelfTest.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.NearCacheConfiguration;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static org.apache.ignite.cache.CacheMemoryMode.OFFHEAP_VALUES;
+
+/**
+ * Tests deployment with off-heap storage.
+ */
+public class GridCacheDeploymentOffHeapValuesSelfTest extends GridCacheDeploymentSelfTest {
+    /** {@inheritDoc} */
+    @Override protected CacheConfiguration cacheConfiguration() throws Exception {
+        CacheConfiguration cacheCfg = super.cacheConfiguration();
+
+        cacheCfg.setMemoryMode(OFFHEAP_VALUES);
+        cacheCfg.setOffHeapMaxMemory(0);
+        cacheCfg.setAtomicityMode(TRANSACTIONAL);
+        cacheCfg.setNearConfiguration(new NearCacheConfiguration());
+
+        return cacheCfg;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/b68c5607/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java
index b86a33d..d82f0b7 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java
@@ -21,6 +21,7 @@ import junit.framework.TestSuite;
 import org.apache.ignite.internal.processors.cache.GridCacheAtomicEntryProcessorDeploymentSelfTest;
 import org.apache.ignite.internal.processors.cache.GridCacheConditionalDeploymentSelfTest;
 import org.apache.ignite.internal.processors.cache.GridCacheDeploymentOffHeapSelfTest;
+import org.apache.ignite.internal.processors.cache.GridCacheDeploymentOffHeapValuesSelfTest;
 import org.apache.ignite.internal.processors.cache.GridCacheDeploymentSelfTest;
 import org.apache.ignite.internal.processors.cache.GridCacheEntryVersionSelfTest;
 import org.apache.ignite.internal.processors.cache.GridCacheOrderedPreloadingSelfTest;
@@ -125,6 +126,7 @@ public class IgniteCacheTestSuite3 extends TestSuite {
 
         suite.addTestSuite(GridCacheDeploymentSelfTest.class);
         suite.addTestSuite(GridCacheDeploymentOffHeapSelfTest.class);
+        suite.addTestSuite(GridCacheDeploymentOffHeapValuesSelfTest.class);
         suite.addTestSuite(GridCacheConditionalDeploymentSelfTest.class);
         suite.addTestSuite(GridCacheAtomicEntryProcessorDeploymentSelfTest.class);
         suite.addTestSuite(GridCacheTransactionalEntryProcessorDeploymentSelfTest.class);