ignite-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [ignite] Jokser commented on a change in pull request #5765: IGNITE-10078 Node failure during concurrent partition updates may cause partition desync between primary and backup.
Date Tue, 14 May 2019 14:41:02 GMT
Jokser commented on a change in pull request #5765: IGNITE-10078 Node failure during concurrent
partition updates may cause partition desync between primary and backup.
URL: https://github.com/apache/ignite/pull/5765#discussion_r283834941
 
 

 ##########
 File path: modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
 ##########
 @@ -1166,6 +1179,72 @@ else if (type == 2)
         return set;
     }
 
+    /**
+     * @param cache Cache.
+     * @param part Partition.
+     * @param cnt Count.
+     * @param skipCnt Skip keys from start.
+     * @return List of keys for partition.
+     */
+    protected List<Integer> partitionKeys(IgniteCache<?, ?> cache, int part,
int cnt, int skipCnt) {
+        IgniteCacheProxyImpl proxy = cache.unwrap(IgniteCacheProxyImpl.class);
+
+        GridCacheContext<?, ?> cctx = proxy.context();
+
+        int k = 0, c = 0, skip0 = 0;
+
+        List<Integer> keys = new ArrayList<>(cnt);
+
+        while(c < cnt) {
+            if (cctx.affinity().partition(k) == part) {
+                if (skip0 < skipCnt) {
+                    k++;
+                    skip0++;
+
+                    continue;
+                }
+
+                c++;
+
+                keys.add(k);
+            }
+
+            k++;
+        }
+
+        return keys;
+    }
+
+    protected Iterator<Integer> partitionKeysIterator(IgniteCache<?, ?> cache,
int part) {
 
 Review comment:
   Missed javadocs.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message