You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by pt...@apache.org on 2016/09/14 10:22:20 UTC
ignite git commit: Remove isDiff flag
Repository: ignite
Updated Branches:
refs/heads/ignite-3199-1 8cbaeb752 -> f6593cf39
Remove isDiff flag
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f6593cf3
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f6593cf3
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f6593cf3
Branch: refs/heads/ignite-3199-1
Commit: f6593cf39f8c8524f294a147202c3268829e1fe7
Parents: 8cbaeb7
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Wed Sep 14 13:22:07 2016 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Wed Sep 14 13:22:07 2016 +0300
----------------------------------------------------------------------
.../websession/PlatformDotNetSessionData.java | 13 -------------
.../PlatformDotNetSessionSetAndUnlockProcessor.java | 2 +-
.../Impl/IgniteSessionStateItemCollection.cs | 14 +-------------
3 files changed, 2 insertions(+), 27 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/f6593cf3/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotNetSessionData.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotNetSessionData.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotNetSessionData.java
index 9aef02e..18dbab0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotNetSessionData.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotNetSessionData.java
@@ -39,9 +39,6 @@ public class PlatformDotNetSessionData implements Binarylizable {
/** Items. */
private Map<String, byte[]> items;
- /** Diff flag. */
- private boolean isDiff;
-
/** Static objects. */
@GridToStringExclude
private byte[] staticObjects;
@@ -66,13 +63,6 @@ public class PlatformDotNetSessionData implements Binarylizable {
}
/**
- * @return Diff flag.
- */
- public boolean isDiff() {
- return isDiff;
- }
-
- /**
* @return Static objects.
*/
public byte[] staticObjects() {
@@ -204,7 +194,6 @@ public class PlatformDotNetSessionData implements Binarylizable {
res.staticObjects = staticObjects;
res.items = items;
res.timeout = timeout;
- res.isDiff = isDiff;
return res;
}
@@ -222,7 +211,6 @@ public class PlatformDotNetSessionData implements Binarylizable {
* @param writer Binary writer.
*/
public void writeBinary(BinaryRawWriter writer) {
- writer.writeBoolean(isDiff);
writer.writeInt(items.size());
for (Map.Entry<String, byte[]> e : items.entrySet()) {
@@ -252,7 +240,6 @@ public class PlatformDotNetSessionData implements Binarylizable {
*/
public void readBinary(BinaryRawReader reader) {
items = new TreeMap<>();
- isDiff = reader.readBoolean();
int count = reader.readInt();
for (int i = 0; i < count; i++)
http://git-wip-us.apache.org/repos/asf/ignite/blob/f6593cf3/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotNetSessionSetAndUnlockProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotNetSessionSetAndUnlockProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotNetSessionSetAndUnlockProcessor.java
index 589ed03..9015c5c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotNetSessionSetAndUnlockProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotNetSessionSetAndUnlockProcessor.java
@@ -77,7 +77,7 @@ public class PlatformDotNetSessionSetAndUnlockProcessor implements
* @param data Data.
*/
public PlatformDotNetSessionSetAndUnlockProcessor(PlatformDotNetSessionData data) {
- this(data.lockNodeId(), data.lockId(), true, data.items(), data.isDiff(), data.staticObjects(), data.timeout());
+ this(data.lockNodeId(), data.lockId(), true, data.items(), true, data.staticObjects(), data.timeout());
}
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/f6593cf3/modules/platforms/dotnet/Apache.Ignite.AspNet/Impl/IgniteSessionStateItemCollection.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.AspNet/Impl/IgniteSessionStateItemCollection.cs b/modules/platforms/dotnet/Apache.Ignite.AspNet/Impl/IgniteSessionStateItemCollection.cs
index 40d882b..5e2e7ab 100644
--- a/modules/platforms/dotnet/Apache.Ignite.AspNet/Impl/IgniteSessionStateItemCollection.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.AspNet/Impl/IgniteSessionStateItemCollection.cs
@@ -45,9 +45,6 @@ namespace Apache.Ignite.AspNet.Impl
/** Indicates where this is a new collection, not a deserialized old one. */
private readonly bool _isNew;
- /** Indicates that this instance is a diff. */
- private readonly bool _isDiff;
-
/** Removed keys. Hash set because keys can be removed multiple times. */
private HashSet<string> _removedKeys;
@@ -62,8 +59,6 @@ namespace Apache.Ignite.AspNet.Impl
{
Debug.Assert(reader != null);
- _isDiff = reader.ReadBoolean();
-
var count = reader.ReadInt();
_dict = new Dictionary<string, int>(count);
@@ -204,14 +199,9 @@ namespace Apache.Ignite.AspNet.Impl
{
IgniteArgumentCheck.NotNull(writer, "writer");
- if (_isDiff)
- throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture,
- "Cannot serialize incomplete {0}.", GetType()));
-
if (_isNew || _dirtyAll || !changesOnly || (_removedKeys == null && _list.All(x => x.IsDirty)))
{
// Write in full mode.
- writer.WriteBoolean(false);
writer.WriteInt(_list.Count);
foreach (var entry in _list)
@@ -225,8 +215,6 @@ namespace Apache.Ignite.AspNet.Impl
else
{
// Write in diff mode.
- writer.WriteBoolean(true);
-
var removed = GetRemovedKeys();
var count = _list.Count(x => x.IsDirty) + (removed == null ? 0 : removed.Count);
@@ -341,7 +329,7 @@ namespace Apache.Ignite.AspNet.Impl
foreach (var key in removed)
Remove(key);
}
- else if (!changes._isDiff)
+ else
{
// Not a diff: replace all.
Clear();