ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [16/43] incubator-ignite git commit: ignite-656: introduce constant for skip store flag's bit mask
Date Thu, 23 Apr 2015 18:13:12 GMT
ignite-656: introduce constant for skip store flag's bit mask


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

Branch: refs/heads/ignite-sprint-4
Commit: f3a20e1a45fa336a8e08425174542128b3be793f
Parents: 7e11333
Author: Denis Magda <dmagda@gridgain.com>
Authored: Fri Apr 17 13:43:24 2015 +0300
Committer: Denis Magda <dmagda@gridgain.com>
Committed: Fri Apr 17 13:43:24 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/processors/cache/GridCacheUtils.java      | 3 +++
 .../cache/distributed/GridDistributedLockRequest.java         | 7 ++++---
 .../internal/processors/cache/transactions/IgniteTxEntry.java | 7 ++++---
 3 files changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f3a20e1a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
index 8c72bc2..78f291a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
@@ -94,6 +94,9 @@ public class GridCacheUtils {
     /** Expire time: must be calculated based on TTL value. */
     public static final long EXPIRE_TIME_CALCULATE = -1L;
 
+    /** Skip store flag bit mask. */
+    public static final int SKIP_STORE_FLAG_MASK = 0x1;
+
     /** Per-thread generated UID store. */
     private static final ThreadLocal<UUID> UUIDS = new ThreadLocal<UUID>() {
         @Override protected UUID initialValue() {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f3a20e1a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java
index 51eec3f..cddad87 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java
@@ -89,7 +89,7 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage
{
 
     /**
      * Additional flags.
-     * Bit 1 - for skipStore flag value.
+     * GridCacheUtils.SKIP_STORE_FLAG_MASK - for skipStore flag value.
      */
     private byte flags;
 
@@ -233,13 +233,14 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage
{
      * @param skipStore Skip store flag.
      */
     private void skipStore(boolean skipStore){
-        flags = skipStore ? (byte)(flags | 0x1) : (byte)(flags & 0xFE);
+        flags = skipStore ? (byte)(flags | GridCacheUtils.SKIP_STORE_FLAG_MASK) :
+                    (byte)(flags & ~GridCacheUtils.SKIP_STORE_FLAG_MASK);
     }
 
     /**
      * @return Skip store flag.
      */
-    public boolean skipStore() { return (flags & 0x1) == 1; };
+    public boolean skipStore() { return (flags & GridCacheUtils.SKIP_STORE_FLAG_MASK)
== 1; };
 
     /**
      * @return Transaction isolation or <tt>null</tt> if not in transaction.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f3a20e1a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
index 05d660c..88e64d7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
@@ -152,7 +152,7 @@ public class IgniteTxEntry implements GridPeerDeployAware, Message {
 
     /**
      * Additional flags.
-     * Bit 1 - for skipStore flag value.
+     * GridCacheUtils.SKIP_STORE_FLAG_MASK - for skipStore flag value.
      */
     private byte flags;
 
@@ -423,13 +423,14 @@ public class IgniteTxEntry implements GridPeerDeployAware, Message {
      * @param skipStore Skip store flag.
      */
     public void skipStore(boolean skipStore){
-        flags = skipStore ? (byte)(flags | 0x1) : (byte)(flags & 0xFE);
+        flags = skipStore ? (byte)(flags | GridCacheUtils.SKIP_STORE_FLAG_MASK) :
+                        (byte)(flags & ~GridCacheUtils.SKIP_STORE_FLAG_MASK);
     }
 
     /**
      * @return Skip store flag.
      */
-    public boolean skipStore() { return (flags & 0x1) == 1; };
+    public boolean skipStore() { return (flags & GridCacheUtils.SKIP_STORE_FLAG_MASK)
== 1; };
 
     /**
      * @return Tx key.


Mime
View raw message