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/09 08:50:00 UTC

ignite git commit: read-write processor

Repository: ignite
Updated Branches:
  refs/heads/ignite-3199-1 6f3ffcfc8 -> 8850ea9af


read-write processor


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

Branch: refs/heads/ignite-3199-1
Commit: 8850ea9af455f152347431e59bbca4603e9b5cb1
Parents: 6f3ffcf
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Fri Sep 9 11:49:50 2016 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Fri Sep 9 11:49:50 2016 +0300

----------------------------------------------------------------------
 ...tformDotnetSessionSetAndUnlockProcessor.java | 41 +++++++++++++++++++-
 .../Impl/Cache/ICacheInternal.cs                |  1 -
 2 files changed, 39 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/8850ea9a/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 ad3f3f9..158f4e5 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
@@ -18,6 +18,8 @@
 package org.apache.ignite.internal.processors.platform.websession;
 
 import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.binary.BinaryRawReader;
+import org.apache.ignite.binary.BinaryRawWriter;
 import org.apache.ignite.binary.BinaryReader;
 import org.apache.ignite.binary.BinaryWriter;
 import org.apache.ignite.binary.Binarylizable;
@@ -27,6 +29,7 @@ import org.apache.ignite.internal.util.typedef.internal.S;
 import javax.cache.processor.EntryProcessorException;
 import javax.cache.processor.MutableEntry;
 import java.util.Map;
+import java.util.TreeMap;
 import java.util.UUID;
 
 /**
@@ -124,12 +127,46 @@ public class PlatformDotnetSessionSetAndUnlockProcessor implements
 
     /** {@inheritDoc} */
     @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
-        // TODO
+        BinaryRawWriter raw = writer.rawWriter();
+
+        raw.writeUuid(lockNodeId);
+        raw.writeLong(lockId);
+        raw.writeBoolean(update);
+        raw.writeBoolean(isDiff);
+        raw.writeByteArray(staticData);
+        raw.writeInt(timeout);
+
+        if (items != null) {
+            raw.writeInt(items.size());
+
+            for (Map.Entry<String, byte[]> e : items.entrySet()) {
+                raw.writeString(e.getKey());
+                raw.writeByteArray(e.getValue());
+            }
+        }
+        else
+            raw.writeInt(-1);
     }
 
     /** {@inheritDoc} */
     @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
-        // TODO
+        BinaryRawReader raw = reader.rawReader();
+
+        lockNodeId = raw.readUuid();
+        lockId = raw.readLong();
+        update = raw.readBoolean();
+        isDiff = raw.readBoolean();
+        staticData = raw.readByteArray();
+        timeout = raw.readInt();
+
+        int cnt = raw.readInt();
+
+        if (cnt >= 0) {
+            items = new TreeMap<>();
+
+            for (int i = 0; i < cnt; i++)
+                items.put(raw.readString(), raw.readByteArray());
+        }
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/8850ea9a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/ICacheInternal.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/ICacheInternal.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/ICacheInternal.cs
index 4157833..27cdf0a 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/ICacheInternal.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/ICacheInternal.cs
@@ -20,7 +20,6 @@ namespace Apache.Ignite.Core.Impl.Cache
     using System;
     using Apache.Ignite.Core.Binary;
     using Apache.Ignite.Core.Cache.Query;
-    using Apache.Ignite.Core.Impl.Binary;
 
     /// <summary>
     /// Extended Cache interface for internal needs.