You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ag...@apache.org on 2017/03/27 15:35:51 UTC

ignite git commit: IGNITE-3477 - Fixed missing partition ID in iterators

Repository: ignite
Updated Branches:
  refs/heads/ignite-3477-master fcc490694 -> d91a72c9a


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/d91a72c9
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d91a72c9
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d91a72c9

Branch: refs/heads/ignite-3477-master
Commit: d91a72c9aed5c52ee66f5c766aeebc1ed25eeea1
Parents: fcc4906
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Mon Mar 27 18:35:41 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Mon Mar 27 18:35:41 2017 +0300

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


http://git-wip-us.apache.org/repos/asf/ignite/blob/d91a72c9/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) {