ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [07/50] ignite git commit: wip
Date Thu, 08 Sep 2016 14:45:49 GMT
wip


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

Branch: refs/heads/ignite-3199-1
Commit: 31c586aed2f128023d8d1abe8da7733fb5770232
Parents: b8e9299
Author: Pavel Tupitsyn <ptupitsyn@apache.org>
Authored: Mon Sep 5 16:43:42 2016 +0300
Committer: Pavel Tupitsyn <ptupitsyn@apache.org>
Committed: Mon Sep 5 16:43:42 2016 +0300

----------------------------------------------------------------------
 .../platform/websession/LockEntryProcessor.java | 24 ++++++++++++--------
 1 file changed, 14 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/31c586ae/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/LockEntryProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/LockEntryProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/LockEntryProcessor.java
index 5a26aeb..0f0822b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/LockEntryProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/LockEntryProcessor.java
@@ -29,9 +29,9 @@ import java.sql.Timestamp;
 /**
  * Entry processor that locks web session data.
  */
-public class LockEntryProcessor implements CacheEntryProcessor<String, SessionStateData,
Object> {
+public class LockEntryProcessor implements CacheEntryProcessor<String, BinaryObject, Object>
{
     /** {@inheritDoc} */
-    @Override public Object process(MutableEntry<String, SessionStateData> entry, Object...
objects)
+    @Override public Object process(MutableEntry<String, BinaryObject> entry, Object...
objects)
         throws EntryProcessorException {
         // Arg contains lock info: node id + thread id
         // Return result is either BinarizableSessionStateStoreData (when not locked) or
lockAge (when locked)
@@ -39,25 +39,29 @@ public class LockEntryProcessor implements CacheEntryProcessor<String,
SessionSt
         if (!entry.exists())
             return null;
 
-        SessionStateData data = entry.getValue();
+        BinaryObject data = entry.getValue();
 
         assert data != null;
 
-        if (data.getLockNodeId() != null) {
+        if (data.field("LockNodeId") != null) {
             // Already locked: return lock time.
-            assert data.getLockTime() != null;
+            Object lockTime = data.field("LockTime");
 
-            return data.getLockTime();
+            assert lockTime != null;
+
+            return lockTime;
         }
 
         LockInfo lockInfo = (LockInfo)objects[0];
 
         // Not locked: lock and return result
-        data.setLockNodeId(lockInfo.getLockNodeId());
-        data.setLockId(lockInfo.getLockId());
-        data.setLockTime(lockInfo.getLockTime());
+        final BinaryObjectBuilder builder = data.toBuilder();
+
+        builder.setField("LockNodeId", lockInfo.getLockNodeId());
+        builder.setField("LockId", lockInfo.getLockId());
+        builder.setField("LockTime", lockInfo.getLockTime());
 
-        entry.setValue(data);
+        entry.setValue(builder.build());
 
         return data;
     }


Mime
View raw message