Repository: ignite
Updated Branches:
  refs/heads/ignite-1.4 cc0d1f571 -> d39345b87


IGNITE-1197 - Reverted fix.


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

Branch: refs/heads/ignite-1.4
Commit: c70680a8be837258ae3e10d034f1a53522d6f0f8
Parents: cb9b766
Author: Alexey Goncharuk <alexey.goncha...@gmail.com>
Authored: Mon Sep 14 18:53:29 2015 -0700
Committer: Alexey Goncharuk <alexey.goncha...@gmail.com>
Committed: Mon Sep 14 18:53:29 2015 -0700

----------------------------------------------------------------------
 .../distributed/dht/GridDhtLocalPartition.java  | 62 ++++++--------------
 1 file changed, 19 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/c70680a8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
index a58451f..c5f15cd 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
@@ -708,62 +708,38 @@ public class GridDhtLocalPartition implements 
Comparable<GridDhtLocalPartition>,
 
         return new Iterator<GridDhtCacheEntry>() {
             /** */
-            private GridDhtCacheEntry lastEntry;
+            GridDhtCacheEntry lastEntry;
 
-            {
-                lastEntry = advance();
+            @Override public boolean hasNext() {
+                return it.hasNext();
             }
 
-            private GridDhtCacheEntry advance() {
-                if (it.hasNext()) {
-                    Map.Entry<byte[], GridCacheSwapEntry> entry = it.next();
-
-                    byte[] keyBytes = entry.getKey();
+            @Override public GridDhtCacheEntry next() {
+                Map.Entry<byte[], GridCacheSwapEntry> entry = it.next();
 
-                    while (true) {
-                        try {
-                            KeyCacheObject key = 
cctx.toCacheKeyObject(keyBytes);
+                byte[] keyBytes = entry.getKey();
 
-                            lastEntry = 
(GridDhtCacheEntry)cctx.cache().entryEx(key, false);
+                while (true) {
+                    try {
+                        KeyCacheObject key = cctx.toCacheKeyObject(keyBytes);
 
-                            lastEntry.unswap(true);
+                        lastEntry = 
(GridDhtCacheEntry)cctx.cache().entryEx(key, false);
 
-                            return lastEntry;
-                        }
-                        catch (GridCacheEntryRemovedException e) {
-                            if (log.isDebugEnabled())
-                                log.debug("Got removed entry: " + lastEntry);
-                        }
-                        catch (IgniteCheckedException e) {
-                            throw new CacheException(e);
-                        }
-                        catch (GridDhtInvalidPartitionException e) {
-                            if (log.isDebugEnabled())
-                                log.debug("Got invalid partition exception: " 
+ e);
+                        lastEntry.unswap(true);
 
-                            return null;
-                        }
+                        return lastEntry;
+                    }
+                    catch (GridCacheEntryRemovedException e) {
+                        if (log.isDebugEnabled())
+                            log.debug("Got removed entry: " + lastEntry);
+                    }
+                    catch (IgniteCheckedException e) {
+                        throw new CacheException(e);
                     }
                 }
-
-                return null;
-            }
-
-            @Override public boolean hasNext() {
-                return lastEntry != null;
-            }
-
-            @Override public GridDhtCacheEntry next() {
-                if (lastEntry == null)
-                    throw new NoSuchElementException();
-
-                return lastEntry;
             }
 
             @Override public void remove() {
-                if (lastEntry == null)
-                    throw new NoSuchElementException();
-
                 map.remove(lastEntry.key(), lastEntry);
             }
         };

Reply via email to