Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 531A017EAB for ; Tue, 15 Sep 2015 12:02:31 +0000 (UTC) Received: (qmail 99042 invoked by uid 500); 15 Sep 2015 12:02:31 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 98945 invoked by uid 500); 15 Sep 2015 12:02:31 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 98308 invoked by uid 99); 15 Sep 2015 12:02:30 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Sep 2015 12:02:30 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id AF40ADFE10; Tue, 15 Sep 2015 12:02:30 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: vozerov@apache.org To: commits@ignite.apache.org Date: Tue, 15 Sep 2015 12:02:57 -0000 Message-Id: <13344e6bec9b4d68b89106228db48f54@git.apache.org> In-Reply-To: <4a957c9a5fdd4865b1c419406bde5615@git.apache.org> References: <4a957c9a5fdd4865b1c419406bde5615@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [29/50] [abbrv] ignite git commit: IGNITE-1197 - Reverted fix. 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-gg-10760 Commit: c70680a8be837258ae3e10d034f1a53522d6f0f8 Parents: cb9b766 Author: Alexey Goncharuk Authored: Mon Sep 14 18:53:29 2015 -0700 Committer: Alexey Goncharuk 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, return new Iterator() { /** */ - private GridDhtCacheEntry lastEntry; + GridDhtCacheEntry lastEntry; - { - lastEntry = advance(); + @Override public boolean hasNext() { + return it.hasNext(); } - private GridDhtCacheEntry advance() { - if (it.hasNext()) { - Map.Entry entry = it.next(); - - byte[] keyBytes = entry.getKey(); + @Override public GridDhtCacheEntry next() { + Map.Entry 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); } };