You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2017/04/14 08:53:24 UTC

[30/50] [abbrv] ignite git commit: IGNITE-3477 - Fixing .NET tests

IGNITE-3477 - Fixing .NET tests


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

Branch: refs/heads/ignite-4929
Commit: 10485a0f99faa67b25682e623167e1246b83cc67
Parents: 8d2b020
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Thu Apr 13 16:37:23 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Thu Apr 13 16:37:23 2017 +0300

----------------------------------------------------------------------
 .../internal/binary/BinaryReaderExImpl.java     |  2 +-
 .../ignite/internal/binary/BinaryUtils.java     | 14 ++++++--
 .../cache/database/tree/io/DataPageIO.java      |  5 +--
 ...tCachePluginConfigurationClosureFactory.java | 37 ++++++++++++++++++++
 4 files changed, 52 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/10485a0f/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java
index d6fefe3..c8ca803 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java
@@ -1911,7 +1911,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
                 break;
 
             case BINARY_OBJ:
-                obj = BinaryUtils.doReadBinaryObject(in, ctx);
+                obj = BinaryUtils.doReadBinaryObject(in, ctx, false);
 
                 ((BinaryObjectImpl)obj).context(ctx);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/10485a0f/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
index e4011a4..f36c137 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
@@ -1451,7 +1451,7 @@ public class BinaryUtils {
     /**
      * @return Value.
      */
-    public static BinaryObject doReadBinaryObject(BinaryInputStream in, BinaryContext ctx) {
+    public static BinaryObject doReadBinaryObject(BinaryInputStream in, BinaryContext ctx, boolean detach) {
         if (in.offheapPointer() > 0) {
             int len = in.readInt();
 
@@ -1467,7 +1467,15 @@ public class BinaryUtils {
             byte[] arr = doReadByteArray(in);
             int start = in.readInt();
 
-            return new BinaryObjectImpl(ctx, arr, start);
+            BinaryObjectImpl binO = new BinaryObjectImpl(ctx, arr, start);
+
+            if (detach) {
+                binO.detachAllowed(true);
+
+                return binO.detach();
+            }
+
+            return binO;
         }
     }
 
@@ -1892,7 +1900,7 @@ public class BinaryUtils {
                 return doReadMap(in, ctx, ldr, handles, false, null);
 
             case GridBinaryMarshaller.BINARY_OBJ:
-                return doReadBinaryObject(in, ctx);
+                return doReadBinaryObject(in, ctx, detach);
 
             case GridBinaryMarshaller.ENUM:
                 return doReadBinaryEnum(in, ctx, doReadEnumType(in));

http://git-wip-us.apache.org/repos/asf/ignite/blob/10485a0f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/DataPageIO.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/DataPageIO.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/DataPageIO.java
index 9546890..3ed69e1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/DataPageIO.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/DataPageIO.java
@@ -1397,10 +1397,11 @@ public class DataPageIO extends PageIO {
             PageUtils.putShort(addr, 0, (short)payloadSize);
             addr += 2;
 
-            if (cacheIdSize != 0)
+            if (cacheIdSize != 0) {
                 PageUtils.putInt(addr, 0, row.cacheId());
 
-            addr += cacheIdSize;
+                addr += cacheIdSize;
+            }
 
             addr += row.key().putValue(addr);
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/10485a0f/modules/core/src/test/java/org/apache/ignite/platform/plugin/cache/PlatformTestCachePluginConfigurationClosureFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/platform/plugin/cache/PlatformTestCachePluginConfigurationClosureFactory.java b/modules/core/src/test/java/org/apache/ignite/platform/plugin/cache/PlatformTestCachePluginConfigurationClosureFactory.java
new file mode 100644
index 0000000..c294342
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/platform/plugin/cache/PlatformTestCachePluginConfigurationClosureFactory.java
@@ -0,0 +1,37 @@
+/*
+ * 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.platform.plugin.cache;
+
+import org.apache.ignite.plugin.platform.PlatformCachePluginConfigurationClosure;
+import org.apache.ignite.plugin.platform.PlatformCachePluginConfigurationClosureFactory;
+
+/**
+ * Test closure factory.
+ */
+public class PlatformTestCachePluginConfigurationClosureFactory
+    implements PlatformCachePluginConfigurationClosureFactory {
+    /** {@inheritDoc} */
+    @Override public int id() {
+        return 0;
+    }
+
+    /** {@inheritDoc} */
+    @Override public PlatformCachePluginConfigurationClosure create() {
+        return new PlatformTestCachePluginConfigurationClosure();
+    }
+}