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/18 16:33:19 UTC

[1/2] ignite git commit: IGNITE-2166: .NET: Added toBuilder() method to BinaryObject interface. This closes #379.

Repository: ignite
Updated Branches:
  refs/heads/master 83b2bf5e1 -> d7fd58077


IGNITE-2166: .NET: Added toBuilder() method to BinaryObject interface. This closes #379.


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

Branch: refs/heads/master
Commit: 22cf3a345e8f6bd517d4b0e875cabdd69491713e
Parents: c160ed4
Author: Pavel Tupitsyn <pt...@gridgain.com>
Authored: Mon Jan 18 18:31:39 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon Jan 18 18:31:39 2016 +0300

----------------------------------------------------------------------
 .../apache/ignite/internal/binary/BinaryEnumObjectImpl.java  | 3 +--
 .../Apache.Ignite.Core.Tests/Binary/BinaryBuilderSelfTest.cs | 8 ++++----
 .../dotnet/Apache.Ignite.Core/Binary/IBinaryObject.cs        | 8 ++++++++
 .../dotnet/Apache.Ignite.Core/Impl/Binary/Binary.cs          | 3 +++
 .../dotnet/Apache.Ignite.Core/Impl/Binary/BinaryEnum.cs      | 6 ++++++
 .../dotnet/Apache.Ignite.Core/Impl/Binary/BinaryObject.cs    | 6 ++++++
 6 files changed, 28 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/22cf3a34/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java
index 536c582..180e20a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java
@@ -23,7 +23,6 @@ import org.apache.ignite.binary.BinaryObjectBuilder;
 import org.apache.ignite.binary.BinaryObjectException;
 import org.apache.ignite.binary.BinaryType;
 import org.apache.ignite.internal.GridDirectTransient;
-import org.apache.ignite.internal.binary.builder.BinaryObjectBuilderImpl;
 import org.apache.ignite.internal.processors.cache.CacheObject;
 import org.apache.ignite.internal.processors.cache.CacheObjectContext;
 import org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl;
@@ -124,7 +123,7 @@ public class BinaryEnumObjectImpl implements BinaryObjectEx, Externalizable, Cac
 
     /** {@inheritDoc} */
     @Override public BinaryObjectBuilder toBuilder() throws BinaryObjectException {
-        return BinaryObjectBuilderImpl.wrap(this);
+        throw new UnsupportedOperationException("Builder cannot be created for enum.");
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/22cf3a34/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryBuilderSelfTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryBuilderSelfTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryBuilderSelfTest.cs
index 373e173..d442fb1 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryBuilderSelfTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryBuilderSelfTest.cs
@@ -265,7 +265,7 @@ namespace Apache.Ignite.Core.Tests.Binary
             Assert.AreEqual(0, meta.Fields.Count);
 
             // Populate it with field.
-            IBinaryObjectBuilder builder = _grid.GetBinary().GetBuilder(binObj);
+            IBinaryObjectBuilder builder = binObj.ToBuilder();
 
             Assert.IsNull(builder.GetField<object>("val"));
 
@@ -288,7 +288,7 @@ namespace Apache.Ignite.Core.Tests.Binary
             Assert.AreEqual(BinaryTypeNames.TypeNameObject, meta.GetFieldTypeName("val"));
 
             // Perform field remove.
-            builder = _grid.GetBinary().GetBuilder(binObj);
+            builder = binObj.ToBuilder();
 
             Assert.AreEqual(val, builder.GetField<object>("val"));
 
@@ -314,7 +314,7 @@ namespace Apache.Ignite.Core.Tests.Binary
                 .SetField("val2", inner)
                 .Build();
 
-            binObj = _grid.GetBinary().GetBuilder(binObj).RemoveField("val").Build();
+            binObj = binObj.ToBuilder().RemoveField("val").Build();
 
             Remove obj = binObj.Deserialize<Remove>();
 
@@ -636,7 +636,7 @@ namespace Apache.Ignite.Core.Tests.Binary
             Assert.AreEqual(6, obj.FDouble);
 
             // Overwrite.
-            binObj = _grid.GetBinary().GetBuilder(binObj)
+            binObj = binObj.ToBuilder()
                 .SetField<byte>("fByte", 7)
                 .SetField("fBool", false)
                 .SetField<short>("fShort", 8)

http://git-wip-us.apache.org/repos/asf/ignite/blob/22cf3a34/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryObject.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryObject.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryObject.cs
index c5aa80e..841972d 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryObject.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryObject.cs
@@ -63,5 +63,13 @@ namespace Apache.Ignite.Core.Binary
         /// The value of underlying enum in int form.
         /// </value>
         int EnumValue { get; }
+
+        /// <summary>
+        /// Creates a new <see cref="IBinaryObjectBuilder"/> based on this object.
+        /// <para />
+        /// This is equivalent to <see cref="IBinary.GetBuilder(IBinaryObject)"/>.
+        /// </summary>
+        /// <returns>New <see cref="IBinaryObjectBuilder"/> based on this object.</returns>
+        IBinaryObjectBuilder ToBuilder();
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/22cf3a34/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Binary.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Binary.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Binary.cs
index 43a4bb8..7062606 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Binary.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Binary.cs
@@ -104,6 +104,9 @@ namespace Apache.Ignite.Core.Impl.Binary
             if (obj0 == null)
                 throw new ArgumentException("Unsupported object type: " + obj.GetType());
 
+            if (obj0 is BinaryEnum)
+                throw new InvalidOperationException("Builder cannot be created for enum.");
+
             IBinaryTypeDescriptor desc = _marsh.GetDescriptor(true, obj0.TypeId);
             
             return Builder0(null, obj0, desc);

http://git-wip-us.apache.org/repos/asf/ignite/blob/22cf3a34/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryEnum.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryEnum.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryEnum.cs
index 97f44b0..50b2eb8 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryEnum.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryEnum.cs
@@ -87,6 +87,12 @@ namespace Apache.Ignite.Core.Impl.Binary
         }
 
         /** <inheritdoc /> */
+        public IBinaryObjectBuilder ToBuilder()
+        {
+            return _marsh.Ignite.GetBinary().GetBuilder(this);
+        }
+
+        /** <inheritdoc /> */
         public bool Equals(BinaryEnum other)
         {
             if (ReferenceEquals(null, other))

http://git-wip-us.apache.org/repos/asf/ignite/blob/22cf3a34/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryObject.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryObject.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryObject.cs
index 90607dd..16f95a1 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryObject.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryObject.cs
@@ -133,6 +133,12 @@ namespace Apache.Ignite.Core.Impl.Binary
             }
         }
 
+        /** <inheritdoc /> */
+        public IBinaryObjectBuilder ToBuilder()
+        {
+            return _marsh.Ignite.GetBinary().GetBuilder(this);
+        }
+
         /// <summary>
         /// Internal deserialization routine.
         /// </summary>


[2/2] ignite git commit: Merge remote-tracking branch 'origin/master'

Posted by vo...@apache.org.
Merge remote-tracking branch 'origin/master'


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

Branch: refs/heads/master
Commit: d7fd5807763330c80536e5fe4b9cd8e8129f0a57
Parents: 22cf3a3 83b2bf5
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Mon Jan 18 18:33:00 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon Jan 18 18:33:00 2016 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheAdapter.java      |  30 +-
 .../processors/cache/GridCacheContext.java      |  33 ++
 .../dht/CacheDistributedGetFutureAdapter.java   |  28 +-
 .../dht/GridClientPartitionTopology.java        |   2 +
 .../dht/GridDhtPartitionTopologyImpl.java       |  27 +-
 .../dht/GridPartitionedGetFuture.java           | 241 ++++++-----
 .../dht/GridPartitionedSingleGetFuture.java     | 229 ++++++----
 .../dht/atomic/GridDhtAtomicCache.java          |  26 ++
 .../colocated/GridDhtColocatedLockFuture.java   |   4 -
 .../distributed/near/GridNearGetFuture.java     | 267 +++++++-----
 .../cache/transactions/IgniteTxManager.java     |  18 +-
 .../internal/TestRecordingCommunicationSpi.java | 157 +++++++
 ...idCacheConfigurationConsistencySelfTest.java |  58 +--
 .../cache/IgniteCacheNearLockValueSelfTest.java |  62 +--
 .../cache/IgniteCacheStoreCollectionTest.java   |  12 +
 ...eDynamicCacheStartNoExchangeTimeoutTest.java |   7 +
 ...ridCachePartitionNotLoadedEventSelfTest.java |   7 +-
 .../IgniteCacheAtomicNodeRestartTest.java       |   2 +
 ...niteCacheClientNodeChangingTopologyTest.java |   4 +-
 .../distributed/IgniteCacheGetRestartTest.java  | 280 ++++++++++++
 .../IgniteCacheReadFromBackupTest.java          | 427 +++++++++++++++++++
 .../IgniteCacheSingleGetMessageTest.java        |  88 +---
 .../IgniteCrossCacheTxStoreSelfTest.java        |   1 +
 .../GridCacheDhtPreloadMessageCountTest.java    |  62 +--
 .../near/GridCacheGetStoreErrorSelfTest.java    |   9 +-
 .../GridCachePartitionedNodeRestartTest.java    |   4 +-
 ...ePartitionedOptimisticTxNodeRestartTest.java |   4 +-
 .../IgniteCacheRestartTestSuite2.java           |   3 +
 .../testsuites/IgniteCacheTestSuite4.java       |   2 +
 ...niteCacheP2pUnmarshallingQueryErrorTest.java |  18 +-
 30 files changed, 1527 insertions(+), 585 deletions(-)
----------------------------------------------------------------------