ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yzhda...@apache.org
Subject ignite git commit: added partition id to dht atomic update response
Date Fri, 30 Dec 2016 10:08:50 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-comm-balance-master b8eb27f60 -> 5223d5237


added partition id to dht atomic update response


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

Branch: refs/heads/ignite-comm-balance-master
Commit: 5223d5237a79411e5cdbd0e39bd1102114da164a
Parents: b8eb27f
Author: Yakov Zhdanov <yzhdanov@gridgain.com>
Authored: Fri Dec 30 13:08:42 2016 +0300
Committer: Yakov Zhdanov <yzhdanov@gridgain.com>
Committed: Fri Dec 30 13:08:42 2016 +0300

----------------------------------------------------------------------
 .../GridDhtAtomicAbstractUpdateRequest.java     |  2 +-
 .../dht/atomic/GridDhtAtomicCache.java          |  2 ++
 .../GridDhtAtomicSingleUpdateRequest.java       |  5 ++--
 .../dht/atomic/GridDhtAtomicUpdateRequest.java  | 10 +++----
 .../dht/atomic/GridDhtAtomicUpdateResponse.java | 31 +++++++++++++++++++-
 .../atomic/GridNearAtomicFullUpdateRequest.java |  1 -
 6 files changed, 39 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/5223d523/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicAbstractUpdateRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicAbstractUpdateRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicAbstractUpdateRequest.java
index f0bea07..deb9ce4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicAbstractUpdateRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicAbstractUpdateRequest.java
@@ -134,7 +134,7 @@ public abstract class GridDhtAtomicAbstractUpdateRequest extends GridCacheMessag
         boolean addPrevVal,
         int partId,
         @Nullable CacheObject prevVal,
-        @Nullable Long updateCntr
+        long updateCntr
     );
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/5223d523/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index 8b697d1..d52421e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -3226,6 +3226,8 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
         GridDhtAtomicUpdateResponse res = new GridDhtAtomicUpdateResponse(ctx.cacheId(),
req.futureVersion(),
             ctx.deploymentEnabled());
 
+        res.partition(req.partition());
+
         Boolean replicate = ctx.isDrEnabled();
 
         boolean intercept = req.forceTransformBackups() && ctx.config().getInterceptor()
!= null;

http://git-wip-us.apache.org/repos/asf/ignite/blob/5223d523/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java
index 0af7cf5..a7e6c24 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java
@@ -161,7 +161,7 @@ public class GridDhtAtomicSingleUpdateRequest extends GridDhtAtomicAbstractUpdat
         boolean addPrevVal,
         int partId,
         @Nullable CacheObject prevVal,
-        @Nullable Long updateCntr
+        long updateCntr
     ) {
         assert entryProcessor == null;
         assert ttl <= 0 : ttl;
@@ -177,8 +177,7 @@ public class GridDhtAtomicSingleUpdateRequest extends GridDhtAtomicAbstractUpdat
         if (addPrevVal)
             this.prevVal = prevVal;
 
-        if (updateCntr != null)
-            this.updateCntr = updateCntr;
+        this.updateCntr = updateCntr;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/5223d523/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
index 1854e52..7144963 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
@@ -227,7 +227,7 @@ public class GridDhtAtomicUpdateRequest extends GridDhtAtomicAbstractUpdateReque
         boolean addPrevVal,
         int partId,
         @Nullable CacheObject prevVal,
-        @Nullable Long updateCntr
+        long updateCntr
     ) {
         keys.add(key);
 
@@ -248,12 +248,10 @@ public class GridDhtAtomicUpdateRequest extends GridDhtAtomicAbstractUpdateReque
             prevVals.add(prevVal);
         }
 
-        if (updateCntr != null) {
-            if (updateCntrs == null)
-                updateCntrs = new GridLongList();
+        if (updateCntrs == null)
+            updateCntrs = new GridLongList();
 
-            updateCntrs.add(updateCntr);
-        }
+        updateCntrs.add(updateCntr);
 
         // In case there is no conflict, do not create the list.
         if (conflictVer != null) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/5223d523/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java
index ff12af0..c3d3ca9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java
@@ -69,6 +69,9 @@ public class GridDhtAtomicUpdateResponse extends GridCacheMessage implements
Gri
     @GridDirectCollection(KeyCacheObject.class)
     private List<KeyCacheObject> nearEvicted;
 
+    /** */
+    private int partId = -1;
+
     /**
      * Empty constructor required by {@link Externalizable}.
      */
@@ -157,6 +160,18 @@ public class GridDhtAtomicUpdateResponse extends GridCacheMessage implements
Gri
         nearEvicted.add(key);
     }
 
+    /**
+     * @param partId Partition ID to set.
+     */
+    public void partition(int partId) {
+        this.partId = partId;
+    }
+
+    /** {@inheritDoc} */
+    @Override public int partition() {
+        return partId;
+    }
+
     /** {@inheritDoc} */
     @Override public void prepareMarshal(GridCacheSharedContext ctx) throws IgniteCheckedException
{
         super.prepareMarshal(ctx);
@@ -234,6 +249,12 @@ public class GridDhtAtomicUpdateResponse extends GridCacheMessage implements
Gri
 
                 writer.incrementState();
 
+            case 7:
+                if (!writer.writeInt("partId", partId))
+                    return false;
+
+                writer.incrementState();
+
         }
 
         return true;
@@ -282,6 +303,14 @@ public class GridDhtAtomicUpdateResponse extends GridCacheMessage implements
Gri
 
                 reader.incrementState();
 
+            case 7:
+                partId = reader.readInt("partId");
+
+                if (!reader.isLastRead())
+                    return false;
+
+                reader.incrementState();
+
         }
 
         return reader.afterMessageRead(GridDhtAtomicUpdateResponse.class);
@@ -294,7 +323,7 @@ public class GridDhtAtomicUpdateResponse extends GridCacheMessage implements
Gri
 
     /** {@inheritDoc} */
     @Override public byte fieldsCount() {
-        return 7;
+        return 8;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/5223d523/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicFullUpdateRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicFullUpdateRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicFullUpdateRequest.java
index 87d9225..08c2474 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicFullUpdateRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicFullUpdateRequest.java
@@ -41,7 +41,6 @@ import org.apache.ignite.internal.processors.cache.distributed.IgniteExternaliza
 import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
 import org.apache.ignite.internal.util.GridLongList;
 import org.apache.ignite.internal.util.tostring.GridToStringInclude;
-import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.internal.CU;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;


Mime
View raw message