ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [19/34] ignite git commit: IGNITE-3477 - Fixed missing partition ID in iterators
Date Thu, 30 Mar 2017 17:25:29 GMT
IGNITE-3477 - Fixed missing partition ID in iterators


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

Branch: refs/heads/ignite-3477-master
Commit: 2bcf8f51f2420b33c9602a0ad27bb479dfceaae3
Parents: c4e7b4e
Author: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Authored: Mon Mar 27 18:35:41 2017 +0300
Committer: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Committed: Wed Mar 29 19:29:37 2017 +0300

----------------------------------------------------------------------
 .../cache/IgniteCacheOffheapManagerImpl.java         | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/2bcf8f51/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
index 156911b..16d3715 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
@@ -557,6 +557,9 @@ public class IgniteCacheOffheapManagerImpl extends GridCacheManagerAdapter
imple
             private GridCursor<? extends CacheDataRow> cur;
 
             /** */
+            private int curPart;
+
+            /** */
             private CacheDataRow next;
 
             @Override protected CacheDataRow onNext() {
@@ -573,14 +576,19 @@ public class IgniteCacheOffheapManagerImpl extends GridCacheManagerAdapter
imple
 
                 while (true) {
                     if (cur == null) {
-                        if (dataIt.hasNext())
-                            cur = dataIt.next().cursor();
+                        if (dataIt.hasNext()) {
+                            CacheDataStore ds = dataIt.next();
+
+                            curPart = ds.partId();
+                            cur = ds.cursor();
+                        }
                         else
                             break;
                     }
 
                     if (cur.next()) {
                         next = cur.get();
+                        next.key().partition(curPart);
 
                         break;
                     }
@@ -801,6 +809,9 @@ public class IgniteCacheOffheapManagerImpl extends GridCacheManagerAdapter
imple
                 if (amount != -1 && cleared > amount)
                     return true;
 
+                if (row.key.partition() == -1)
+                    row.key.partition(cctx.affinity().partition(row.key));
+
                 assert row.key != null && row.link != 0 && row.expireTime
!= 0 : row;
 
                 if (pendingEntries.remove(row) != null) {


Mime
View raw message