IGNITE-3052 .NET: Deprecateв CacheEvent.LockId. This closes #671.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/47b1b7f4 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/47b1b7f4 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/47b1b7f4 Branch: refs/heads/ignite-1786 Commit: 47b1b7f4e4cdfdedb3f40616966cf1e802007dda Parents: 4d99d9e Author: Pavel Tupitsyn <[email protected]> Authored: Wed Apr 27 11:24:48 2016 +0300 Committer: vozerov-gridgain <[email protected]> Committed: Wed Apr 27 11:24:48 2016 +0300 ---------------------------------------------------------------------- .../internal/processors/platform/PlatformContextImpl.java | 1 - .../platforms/dotnet/Apache.Ignite.Core.Tests/EventsTest.cs | 4 ++-- .../dotnet/Apache.Ignite.Core/Events/CacheEvent.cs | 9 ++++----- 3 files changed, 6 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/47b1b7f4/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContextImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContextImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContextImpl.java index f6e0079..d544fff 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContextImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContextImpl.java @@ -514,7 +514,6 @@ public class PlatformContextImpl implements PlatformContext { writeNode(writer, event0.eventNode()); writer.writeObject(event0.key()); PlatformUtils.writeIgniteUuid(writer, event0.xid()); - writer.writeObject(event0.lockId()); writer.writeObject(event0.newValue()); writer.writeObject(event0.oldValue()); writer.writeBoolean(event0.hasOldValue()); http://git-wip-us.apache.org/repos/asf/ignite/blob/47b1b7f4/modules/platforms/dotnet/Apache.Ignite.Core.Tests/EventsTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/EventsTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/EventsTest.cs index a538cb4..6f51f4a 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/EventsTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/EventsTest.cs @@ -238,7 +238,7 @@ namespace Apache.Ignite.Core.Tests EventObjectType = typeof (CacheEvent), GenerateEvent = g => g.GetCache<int, int>(null).Put(1, 1), VerifyEvents = (e, g) => VerifyCacheEvents(e, g), - EventCount = 1 + EventCount = 2 }; yield return new EventTestCase @@ -484,7 +484,7 @@ namespace Apache.Ignite.Core.Tests Assert.AreEqual(true, cacheEvent.IsNear); Assert.AreEqual(2, cacheEvent.Key); Assert.AreEqual(expectedGridGuid, cacheEvent.Xid); - Assert.AreEqual(3, cacheEvent.LockId); + Assert.AreEqual(null, cacheEvent.LockId); Assert.AreEqual(4, cacheEvent.NewValue); Assert.AreEqual(true, cacheEvent.HasNewValue); Assert.AreEqual(5, cacheEvent.OldValue); http://git-wip-us.apache.org/repos/asf/ignite/blob/47b1b7f4/modules/platforms/dotnet/Apache.Ignite.Core/Events/CacheEvent.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Events/CacheEvent.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Events/CacheEvent.cs index 4c75e0a..ec22fad 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Events/CacheEvent.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Events/CacheEvent.cs @@ -18,6 +18,7 @@ namespace Apache.Ignite.Core.Events { using System; + using System.Diagnostics.CodeAnalysis; using System.Globalization; using Apache.Ignite.Core.Binary; using Apache.Ignite.Core.Cluster; @@ -47,9 +48,6 @@ namespace Apache.Ignite.Core.Events private readonly IgniteGuid? _xid; /** */ - private readonly object _lockId; - - /** */ private readonly object _newValue; /** */ @@ -82,7 +80,6 @@ namespace Apache.Ignite.Core.Events _eventNode = ReadNode(r); _key = r.ReadObject<object>(); _xid = IgniteGuid.Read(r); - _lockId = r.ReadObject<object>(); _newValue = r.ReadObject<object>(); _oldValue = r.ReadObject<object>(); _hasOldValue = r.ReadBoolean(); @@ -125,7 +122,9 @@ namespace Apache.Ignite.Core.Events /// <summary> /// ID of the lock if held or null if no lock held. /// </summary> - public object LockId { get { return _lockId; } } + [Obsolete("LockId is no longer provided. This property is always null.")] + [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Compatibility")] + public object LockId { get { return null; } } /// <summary> /// Gets new value for this event.
