ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [05/35] ignite git commit: IGNITE-2600 .NET: Optimization - do not serialize object if AtomicReference CAS succeeded. This closes #496.
Date Fri, 26 Feb 2016 13:16:23 GMT
IGNITE-2600 .NET: Optimization - do not serialize object if AtomicReference CAS succeeded.
This closes #496.


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

Branch: refs/heads/ignite-2407
Commit: 592ece0370bed97c23b0d53f74b14a5bb78a0d2e
Parents: af17db5
Author: Pavel Tupitsyn <ptupitsyn@gridgain.com>
Authored: Fri Feb 19 17:03:47 2016 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Fri Feb 19 17:03:47 2016 +0300

----------------------------------------------------------------------
 .../platform/datastructures/PlatformAtomicReference.java      | 7 ++++++-
 .../Apache.Ignite.Core/Impl/DataStructures/AtomicReference.cs | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/592ece03/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/datastructures/PlatformAtomicReference.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/datastructures/PlatformAtomicReference.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/datastructures/PlatformAtomicReference.java
index 81b7570..5080139 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/datastructures/PlatformAtomicReference.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/datastructures/PlatformAtomicReference.java
@@ -132,7 +132,12 @@ public class PlatformAtomicReference extends PlatformAbstractTarget {
 
             Object res = atomicRef.compareAndSetAndGet(val, cmp);
 
-            writer.writeObject(res);
+            if (cmp == res)
+                writer.writeBoolean(true);
+            else {
+                writer.writeBoolean(false);
+                writer.writeObject(res);
+            }
         }
         else
             super.processInStreamOutStream(type, reader, writer);

http://git-wip-us.apache.org/repos/asf/ignite/blob/592ece03/modules/platforms/dotnet/Apache.Ignite.Core/Impl/DataStructures/AtomicReference.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/DataStructures/AtomicReference.cs
b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/DataStructures/AtomicReference.cs
index e871412..d22afeb 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/DataStructures/AtomicReference.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/DataStructures/AtomicReference.cs
@@ -74,7 +74,7 @@ namespace Apache.Ignite.Core.Impl.DataStructures
                     writer.WriteObject(value);
                     writer.WriteObject(comparand);
                 },
-                stream => Marshaller.StartUnmarshal(stream).Deserialize<T>());
+                stream => stream.ReadBool() ? comparand : Marshaller.StartUnmarshal(stream).Deserialize<T>());
         }
 
         /** <inheritDoc /> */


Mime
View raw message