ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject ignite git commit: ignite-4768
Date Tue, 07 Mar 2017 07:13:18 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-4768 9edb0e79b -> 91826bbe0


ignite-4768


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

Branch: refs/heads/ignite-4768
Commit: 91826bbe053966a06e2c676231f9027f867b7130
Parents: 9edb0e7
Author: sboikov <sboikov@gridgain.com>
Authored: Tue Mar 7 10:12:21 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Tue Mar 7 10:12:21 2017 +0300

----------------------------------------------------------------------
 .../distributed/dht/GridDhtTxPrepareFuture.java | 18 +------
 .../dht/GridDhtTxPrepareResponse.java           | 53 ++++----------------
 2 files changed, 11 insertions(+), 60 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/91826bbe/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
index 1227ba9..84b8e7a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
@@ -1479,7 +1479,7 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
 
         while (true) {
             try {
-                Collection<ClusterNode> dhtNodes = dht.topology().nodes(cached.partition(),
tx.topologyVersion());
+                List<ClusterNode> dhtNodes = dht.topology().nodes(cached.partition(),
tx.topologyVersion());
 
                 if (log.isDebugEnabled())
                     log.debug("Mapping entry to DHT nodes [nodes=" + U.toShortString(dhtNodes)
+
@@ -1709,22 +1709,6 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
                 }
 
                 // Process invalid partitions (no need to remap).
-                // Keep this loop for backward compatibility.
-                if (!F.isEmpty(res.invalidPartitions())) {
-                    for (Iterator<IgniteTxEntry> it = dhtMapping.entries().iterator();
it.hasNext();) {
-                        IgniteTxEntry entry  = it.next();
-
-                        if (res.invalidPartitions().contains(entry.cached().partition()))
{
-                            it.remove();
-
-                            if (log.isDebugEnabled())
-                                log.debug("Removed mapping for entry from dht mapping [key="
+ entry.key() +
-                                    ", tx=" + tx + ", dhtMapping=" + dhtMapping + ']');
-                        }
-                    }
-                }
-
-                // Process invalid partitions (no need to remap).
                 if (!F.isEmpty(res.invalidPartitionsByCacheId())) {
                     Map<Integer, int[]> invalidPartsMap = res.invalidPartitionsByCacheId();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/91826bbe/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java
index 2eba9f1..fdead95 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java
@@ -60,14 +60,9 @@ public class GridDhtTxPrepareResponse extends GridDistributedTxPrepareResponse
{
     /** Mini future ID. */
     private IgniteUuid miniId;
 
-    /** Invalid partitions. */
-    @GridToStringInclude
-    @GridDirectCollection(int.class)
-    private Collection<Integer> invalidParts;
-
     /** Invalid partitions by cache ID. */
     @GridDirectMap(keyType = Integer.class, valueType = int[].class)
-    private Map<Integer, int[]> invalidPartsByCacheId;
+    private Map<Integer, int[]> invalidParts;
 
     /** Preload entries. */
     @GridDirectCollection(GridCacheEntryInfo.class)
@@ -143,31 +138,17 @@ public class GridDhtTxPrepareResponse extends GridDistributedTxPrepareResponse
{
     }
 
     /**
-     * @return Invalid partitions.
-     */
-    public Collection<Integer> invalidPartitions() {
-        return invalidParts;
-    }
-
-    /**
-     * @param invalidParts Invalid partitions.
-     */
-    public void invalidPartitions(Collection<Integer> invalidParts) {
-        this.invalidParts = invalidParts;
-    }
-
-    /**
      * @return Map from cacheId to an array of invalid partitions.
      */
     public Map<Integer, int[]> invalidPartitionsByCacheId() {
-        return invalidPartsByCacheId;
+        return invalidParts;
     }
 
     /**
      * @param invalidPartsByCacheId Map from cache ID to an array of invalid partitions.
      */
     public void invalidPartitionsByCacheId(Map<Integer, Set<Integer>> invalidPartsByCacheId)
{
-        this.invalidPartsByCacheId = CU.convertInvalidPartitions(invalidPartsByCacheId);
+        this.invalidParts = CU.convertInvalidPartitions(invalidPartsByCacheId);
     }
 
     /**
@@ -263,30 +244,24 @@ public class GridDhtTxPrepareResponse extends GridDistributedTxPrepareResponse
{
                 writer.incrementState();
 
             case 9:
-                if (!writer.writeCollection("invalidParts", invalidParts, MessageCollectionItemType.INT))
+                if (!writer.writeMap("invalidParts", invalidParts, MessageCollectionItemType.INT,
MessageCollectionItemType.INT_ARR))
                     return false;
 
                 writer.incrementState();
 
             case 10:
-                if (!writer.writeMap("invalidPartsByCacheId", invalidPartsByCacheId, MessageCollectionItemType.INT,
MessageCollectionItemType.INT_ARR))
-                    return false;
-
-                writer.incrementState();
-
-            case 11:
                 if (!writer.writeIgniteUuid("miniId", miniId))
                     return false;
 
                 writer.incrementState();
 
-            case 12:
+            case 11:
                 if (!writer.writeCollection("nearEvicted", nearEvicted, MessageCollectionItemType.MSG))
                     return false;
 
                 writer.incrementState();
 
-            case 13:
+            case 12:
                 if (!writer.writeCollection("preloadEntries", preloadEntries, MessageCollectionItemType.MSG))
                     return false;
 
@@ -317,7 +292,7 @@ public class GridDhtTxPrepareResponse extends GridDistributedTxPrepareResponse
{
                 reader.incrementState();
 
             case 9:
-                invalidParts = reader.readCollection("invalidParts", MessageCollectionItemType.INT);
+                invalidParts = reader.readMap("invalidParts", MessageCollectionItemType.INT,
MessageCollectionItemType.INT_ARR, false);
 
                 if (!reader.isLastRead())
                     return false;
@@ -325,14 +300,6 @@ public class GridDhtTxPrepareResponse extends GridDistributedTxPrepareResponse
{
                 reader.incrementState();
 
             case 10:
-                invalidPartsByCacheId = reader.readMap("invalidPartsByCacheId", MessageCollectionItemType.INT,
MessageCollectionItemType.INT_ARR, false);
-
-                if (!reader.isLastRead())
-                    return false;
-
-                reader.incrementState();
-
-            case 11:
                 miniId = reader.readIgniteUuid("miniId");
 
                 if (!reader.isLastRead())
@@ -340,7 +307,7 @@ public class GridDhtTxPrepareResponse extends GridDistributedTxPrepareResponse
{
 
                 reader.incrementState();
 
-            case 12:
+            case 11:
                 nearEvicted = reader.readCollection("nearEvicted", MessageCollectionItemType.MSG);
 
                 if (!reader.isLastRead())
@@ -348,7 +315,7 @@ public class GridDhtTxPrepareResponse extends GridDistributedTxPrepareResponse
{
 
                 reader.incrementState();
 
-            case 13:
+            case 12:
                 preloadEntries = reader.readCollection("preloadEntries", MessageCollectionItemType.MSG);
 
                 if (!reader.isLastRead())
@@ -368,6 +335,6 @@ public class GridDhtTxPrepareResponse extends GridDistributedTxPrepareResponse
{
 
     /** {@inheritDoc} */
     @Override public byte fieldsCount() {
-        return 14;
+        return 13;
     }
 }


Mime
View raw message