ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [30/50] ignite git commit: Better lock info naming.
Date Thu, 08 Sep 2016 14:46:12 GMT
Better lock info naming.


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

Branch: refs/heads/ignite-3199-1
Commit: 7a90d5539f454891714d235947a49b6687c1bca7
Parents: ab4bf73
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Wed Sep 7 20:04:39 2016 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Wed Sep 7 20:04:39 2016 +0300

----------------------------------------------------------------------
 .../platform/websession/LockEntryProcessor.java |  6 +--
 .../platform/websession/LockInfo.java           | 48 +++++++++++---------
 .../websession/UnlockEntryProcessor.java        |  4 +-
 3 files changed, 32 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/7a90d553/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 ac5ca8a..a8591a4 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
@@ -55,9 +55,9 @@ public class LockEntryProcessor implements CacheEntryProcessor<String,
SessionSt
         LockInfo lockInfo = (LockInfo)objects[0];
 
         // Not locked: lock and return result
-        data.setLockNodeId(lockInfo.getLockNodeId());
-        data.setLockId(lockInfo.getLockId());
-        data.setLockTime(lockInfo.getLockTime());
+        data.setLockNodeId(lockInfo.nodeId());
+        data.setLockId(lockInfo.id());
+        data.setLockTime(lockInfo.getTime());
 
         // Apply.
         entry.setValue(data);

http://git-wip-us.apache.org/repos/asf/ignite/blob/7a90d553/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/LockInfo.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/LockInfo.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/LockInfo.java
index 6142b00..e71ae38 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/LockInfo.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/LockInfo.java
@@ -23,6 +23,7 @@ import org.apache.ignite.binary.BinaryRawWriter;
 import org.apache.ignite.binary.BinaryReader;
 import org.apache.ignite.binary.BinaryWriter;
 import org.apache.ignite.binary.Binarylizable;
+import org.apache.ignite.internal.util.typedef.internal.S;
 
 import java.sql.Timestamp;
 import java.util.UUID;
@@ -31,51 +32,56 @@ import java.util.UUID;
  * Web session lock info.
  */
 public class LockInfo implements Binarylizable {
-    /** */
-    private long lockId;
+    /** ID. */
+    private long id;
 
-    /** */
-    private UUID lockNodeId;
+    /** Node ID. */
+    private UUID nodeId;
 
-    /** */
-    private Timestamp lockTime;
+    /** Time. */
+    private Timestamp time;
 
     /**
-     * Gets the lock id.
+     * @return Lock ID.
      */
-    public long getLockId() {
-        return lockId;
+    public long id() {
+        return id;
     }
 
     /**
-     * Gets the lock node id.
+     * @return Node ID.
      */
-    public UUID getLockNodeId() {
-        return lockNodeId;
+    public UUID nodeId() {
+        return nodeId;
     }
 
     /**
-     * Gets the lock time.
+     * @return Time.
      */
-    public Timestamp getLockTime() {
-        return lockTime;
+    public Timestamp getTime() {
+        return time;
     }
 
     /** {@inheritDoc} */
     @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
         BinaryRawWriter raw = writer.rawWriter();
 
-        raw.writeLong(lockId);
-        raw.writeUuid(lockNodeId);
-        raw.writeTimestamp(lockTime);
+        raw.writeLong(id);
+        raw.writeUuid(nodeId);
+        raw.writeTimestamp(time);
     }
 
     /** {@inheritDoc} */
     @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
         BinaryRawReader raw = reader.rawReader();
 
-        lockId = raw.readLong();
-        lockNodeId = raw.readUuid();
-        lockTime = raw.readTimestamp();
+        id = raw.readLong();
+        nodeId = raw.readUuid();
+        time = raw.readTimestamp();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(LockInfo.class, this);
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/7a90d553/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/UnlockEntryProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/UnlockEntryProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/UnlockEntryProcessor.java
index 640695d..5554026 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/UnlockEntryProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/UnlockEntryProcessor.java
@@ -41,10 +41,10 @@ public class UnlockEntryProcessor implements CacheEntryProcessor<String,
Session
 
         LockInfo lockInfo = (LockInfo)objects[0];
 
-        if (!data.getLockNodeId().equals(lockInfo.getLockNodeId()))
+        if (!data.getLockNodeId().equals(lockInfo.nodeId()))
             throw new IllegalStateException("Can not unlock session data: lock node id check
failed.");
 
-        if (data.getLockId() != lockInfo.getLockId())
+        if (data.getLockId() != lockInfo.id())
             throw new IllegalStateException("Can not unlock session data: lock id check failed.");
 
         // Unlock.


Mime
View raw message