ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [2/6] incubator-ignite git commit: #ignite-286: remove iterator(int p) from off-heap processor.
Date Mon, 27 Apr 2015 14:38:57 GMT
#ignite-286: remove iterator(int p) from off-heap processor.


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

Branch: refs/heads/ignite-286
Commit: ccad025b52c8dbc7e842dd29a87b07d444d24d24
Parents: ba4f12a
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Mon Apr 27 16:37:28 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Mon Apr 27 16:37:28 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheSwapManager.java         |  8 ++++----
 .../processors/offheap/GridOffHeapProcessor.java       | 13 -------------
 .../util/offheap/GridOffHeapPartitionedMap.java        |  8 --------
 .../util/offheap/unsafe/GridUnsafePartitionedMap.java  |  5 -----
 .../GridOffHeapPartitionedMapAbstractSelfTest.java     |  4 ++--
 5 files changed, 6 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ccad025b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
index 4235688..afc1a31 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
@@ -1331,7 +1331,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
             @Override protected Iterator<KeyCacheObject> partitionIterator(int part)
                 throws IgniteCheckedException
             {
-                return keyIterator(offheap.iterator(spaceName, part));
+                return keyIterator(offheap.iterator(spaceName, new int[]{part}));
             }
         };
     }
@@ -1564,7 +1564,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
 
         checkIteratorQueue();
 
-        return new IteratorWrapper(offheap.iterator(spaceName, part));
+        return new IteratorWrapper(offheap.iterator(spaceName, new int[]{part}));
     }
 
     /**
@@ -1601,7 +1601,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
         if (!offheapEnabled)
             return new GridEmptyCloseableIterator<>();
 
-        return new OffHeapIterator(offheap.iterator(spaceName, part));
+        return new OffHeapIterator(offheap.iterator(spaceName, new int[]{part}));
     }
 
     /**
@@ -1702,7 +1702,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
 
         return new PartitionsIterator<K, V>(parts) {
             @Override protected GridCloseableIterator<? extends Map.Entry<byte[], byte[]>>
partitionIterator(int part) {
-                return offheap.iterator(spaceName, part);
+                return offheap.iterator(spaceName, new int[]{part});
             }
         };
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ccad025b/modules/core/src/main/java/org/apache/ignite/internal/processors/offheap/GridOffHeapProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/offheap/GridOffHeapProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/offheap/GridOffHeapProcessor.java
index 20da1eb..5062b3b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/offheap/GridOffHeapProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/offheap/GridOffHeapProcessor.java
@@ -329,17 +329,4 @@ public class GridOffHeapProcessor extends GridProcessorAdapter {
 
         return m == null ? -1 : m.allocatedSize();
     }
-
-    /**
-     * Gets iterator over contents of partition.
-     *
-     * @param spaceName Space name.
-     * @param part Partition.
-     * @return Iterator.
-     */
-    public GridCloseableIterator<IgniteBiTuple<byte[], byte[]>> iterator(@Nullable
String spaceName, int part) {
-        GridOffHeapPartitionedMap m = offheap(spaceName);
-
-        return m == null ? new GridEmptyCloseableIterator<IgniteBiTuple<byte[], byte[]>>()
: m.iterator(part);
-    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ccad025b/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMap.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMap.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMap.java
index 9478b1d..50915ed 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMap.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMap.java
@@ -202,14 +202,6 @@ public interface GridOffHeapPartitionedMap {
     public <T> GridCloseableIterator<T> iterator(CX2<T2<Long, Integer>,
T2<Long, Integer>, T> c);
 
     /**
-     * Gets iterator over certain partition.
-     *
-     * @param p Partition.
-     * @return Iterator over certain partition.
-     */
-    public GridCloseableIterator<IgniteBiTuple<byte[], byte[]>> iterator(int
p);
-
-    /**
      * Sets callback for when entries are evicted due to memory constraints.
      * The parameter into closure is key bytes.
      *

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ccad025b/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafePartitionedMap.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafePartitionedMap.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafePartitionedMap.java
index cd993c8..f646256 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafePartitionedMap.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafePartitionedMap.java
@@ -399,11 +399,6 @@ public class GridUnsafePartitionedMap implements GridOffHeapPartitionedMap
{
         };
     }
 
-    /** {@inheritDoc} */
-    @Override public GridCloseableIterator<IgniteBiTuple<byte[], byte[]>> iterator(int
p) {
-        return mapFor(p).iterator();
-    }
-
     /**
      * Gets number of LRU stripes.
      *

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ccad025b/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMapAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMapAbstractSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMapAbstractSelfTest.java
index eb0525b..d0e1aea 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMapAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/util/offheap/GridOffHeapPartitionedMapAbstractSelfTest.java
@@ -685,7 +685,7 @@ public abstract class GridOffHeapPartitionedMapAbstractSelfTest extends
GridComm
 
                 int cnt = 0;
 
-                try (GridCloseableIterator<IgniteBiTuple<byte[], byte[]>> it
= map.iterator(p)) {
+                try (GridCloseableIterator<IgniteBiTuple<byte[], byte[]>> it
= map.iterator(new int[]{p})) {
                     while (it.hasNext()) {
                         IgniteBiTuple<byte[], byte[]> t = it.next();
 
@@ -760,7 +760,7 @@ public abstract class GridOffHeapPartitionedMapAbstractSelfTest extends
GridComm
                         assertNotNull(map.get(p, hash(key), key.getBytes()));
                         assertEquals(new String(map.get(p, hash(key), key.getBytes())), val);
 
-                        try (GridCloseableIterator<IgniteBiTuple<byte[], byte[]>>
it = map.iterator(p)) {
+                        try (GridCloseableIterator<IgniteBiTuple<byte[], byte[]>>
it = map.iterator(new int[]{p})) {
                             while (it.hasNext()) {
                                 IgniteBiTuple<byte[], byte[]> t = it.next();
 


Mime
View raw message