ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [03/50] [abbrv] ignite git commit: IGNITE-3227 Removed redundant methods from IgniteCache and its implementations, updated test accordingly
Date Wed, 06 Jul 2016 18:23:02 GMT
IGNITE-3227 Removed redundant methods from IgniteCache and its implementations, updated test
accordingly


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

Branch: refs/heads/ignite-3227
Commit: 5343edaaaad04b7f95c16926630ac7fb56f691a6
Parents: 2e8b36b
Author: Alexander Paschenko <alexander.a.paschenko@gmail.com>
Authored: Mon Jul 4 17:46:45 2016 +0300
Committer: Alexander Paschenko <alexander.a.paschenko@gmail.com>
Committed: Mon Jul 4 17:46:45 2016 +0300

----------------------------------------------------------------------
 .../java/org/apache/ignite/IgniteCache.java     |  24 ---
 .../processors/cache/IgniteCacheProxy.java      |  76 +--------
 .../cache/IgniteCachePeekModesAbstractTest.java | 154 +++++++++----------
 .../multijvm/IgniteCacheProcessProxy.java       |  43 ------
 4 files changed, 82 insertions(+), 215 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/5343edaa/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
index 328a1e4..40eedaf 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
@@ -370,19 +370,6 @@ public interface IgniteCache<K, V> extends javax.cache.Cache<K,
V>, IgniteAsyncS
     public long sizeLong(CachePeekMode... peekModes) throws CacheException;
 
     /**
-     * Gets the number of all entries cached in a partion. By default, if {@code peekModes}
value isn't defined,
-     * only size of primary copies of partition will be returned. This behavior is identical
to calling
-     * this method with {@link CachePeekMode#PRIMARY} peek mode.
-     * <p>
-     * NOTE: this operation is distributed and will query all participating nodes for their
partition cache sizes.
-     * @param partition partition.
-     * @param peekModes Optional peek modes. If not provided, then total partition cache
size is returned.
-     * @return Partition cache size across all nodes.
-     */
-    @IgniteAsyncSupported
-    public int size(int partition, CachePeekMode... peekModes) throws CacheException;
-
-    /**
      * Gets the number of all entries cached in a partition as a long value. By default,
if {@code peekModes} value
      * isn't defined, only size of primary copies across all nodes will be returned. This
behavior is identical to
      * calling this method with {@link CachePeekMode#PRIMARY} peek mode.
@@ -407,17 +394,6 @@ public interface IgniteCache<K, V> extends javax.cache.Cache<K,
V>, IgniteAsyncS
     public int localSize(CachePeekMode... peekModes);
 
     /**
-     * Gets the number of all entries cached on this node for the partition. By default,
if {@code peekModes} value isn't defined,
-     * only size of primary copies will be returned. This behavior is identical to calling
this method with
-     * {@link CachePeekMode#PRIMARY} peek mode.
-     *
-     * @param partition partition.
-     * @param peekModes Optional peek modes. If not provided, then total cache size is returned.
-     * @return Cache size on this node.
-     */
-    public int localSize(int partition, CachePeekMode... peekModes);
-
-    /**
      * Gets the number of all entries cached on this node as a long value. By default, if
{@code peekModes} value isn't
      * defined, only size of primary copies will be returned. This behavior is identical
to calling this method with
      * {@link CachePeekMode#PRIMARY} peek mode.

http://git-wip-us.apache.org/repos/asf/ignite/blob/5343edaa/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
index 828d629..b8a4c0d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
@@ -858,61 +858,19 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K,
V
     }
 
     /** {@inheritDoc} */
-    @Override public int size(int partition, CachePeekMode... peekModes) throws CacheException
{
+    @Override public long sizeLong(int part, CachePeekMode... peekModes) throws CacheException
{
         GridCacheGateway<K, V> gate = this.gate;
 
         CacheOperationContext prev = onEnter(gate, opCtx);
 
         try {
             if (isAsync()) {
-                IgniteInternalFuture<Long> fut = delegate.sizeLongAsync(partition,
peekModes);
-
-                IgniteInternalFuture<Integer> resFut = fut.chain(new C1<IgniteInternalFuture<Long>,
Integer>() {
-                    @Override public Integer apply(IgniteInternalFuture<Long> res)
{
-                        try {
-                            Long longRes = res.get();
-
-                            if (longRes != null && longRes > Integer.MAX_VALUE)
-                                throw new IgniteCheckedException("Size is too big " +
-                                    "(use sizeLong(...) methods instead): " + longRes);
-
-                            return longRes == null ? 0 : (int)(long)longRes;
-                        }
-                        catch (IgniteCheckedException e) {
-                            throw new GridClosureException(e);
-                        }
-                    }
-                });
-
-                setFuture(resFut);
-
-                return 0;
-            }
-            else
-                return castSize(delegate.sizeLong(partition, peekModes));
-        }
-        catch (IgniteCheckedException e) {
-            throw cacheException(e);
-        }
-        finally {
-            onLeave(gate, prev);
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public long sizeLong(int partition, CachePeekMode... peekModes) throws CacheException
{
-        GridCacheGateway<K, V> gate = this.gate;
-
-        CacheOperationContext prev = onEnter(gate, opCtx);
-
-        try {
-            if (isAsync()) {
-                setFuture(delegate.sizeLongAsync(partition, peekModes));
+                setFuture(delegate.sizeLongAsync(part, peekModes));
 
                 return 0;
             }
             else
-                return delegate.sizeLong(partition, peekModes);
+                return delegate.sizeLong(part, peekModes);
         }
         catch (IgniteCheckedException e) {
             throw cacheException(e);
@@ -940,23 +898,6 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K,
V
     }
 
     /** {@inheritDoc} */
-    @Override public int localSize(int partition, CachePeekMode... peekModes) {
-        GridCacheGateway<K, V> gate = this.gate;
-
-        CacheOperationContext prev = onEnter(gate, opCtx);
-
-        try {
-            return castSize(delegate.localSizeLong(partition, peekModes));
-        }
-        catch (IgniteCheckedException e) {
-            throw cacheException(e);
-        }
-        finally {
-            onLeave(gate, prev);
-        }
-    }
-
-    /** {@inheritDoc} */
     @Override public long localSizeLong(CachePeekMode... peekModes) {
         GridCacheGateway<K, V> gate = this.gate;
 
@@ -974,13 +915,13 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K,
V
     }
 
     /** {@inheritDoc} */
-    @Override public long localSizeLong(int partition, CachePeekMode... peekModes) {
+    @Override public long localSizeLong(int part, CachePeekMode... peekModes) {
         GridCacheGateway<K, V> gate = this.gate;
 
         CacheOperationContext prev = onEnter(gate, opCtx);
 
         try {
-            return delegate.localSizeLong(partition, peekModes);
+            return delegate.localSizeLong(part, peekModes);
         }
         catch (IgniteCheckedException e) {
             throw cacheException(e);
@@ -2244,13 +2185,6 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K,
V
         }
     }
 
-    private int castSize(long size) throws CacheException {
-        if (size > Integer.MAX_VALUE)
-            throw new CacheException("Size is too big (use sizeLong(...) methods instead):
" + size);
-
-        return (int)size;
-    }
-
     /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(IgniteCacheProxy.class, this);

http://git-wip-us.apache.org/repos/asf/ignite/blob/5343edaa/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekModesAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekModesAbstractTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekModesAbstractTest.java
index 5b131e2..9c37f55 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekModesAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekModesAbstractTest.java
@@ -517,22 +517,22 @@ public abstract class IgniteCachePeekModesAbstractTest extends IgniteCacheAbstra
                 final int size = i + 1;
 
                 assertEquals(size, cache0.localSize());
-                assertEquals(size, cache0.localSize(partition, PRIMARY));
-                assertEquals(size, cache0.localSize(partition, BACKUP));
-                assertEquals(size, cache0.localSize(partition, NEAR));
-                assertEquals(size, cache0.localSize(partition, ALL));
+                assertEquals(size, cache0.localSizeLong(partition, PRIMARY));
+                assertEquals(size, cache0.localSizeLong(partition, BACKUP));
+                assertEquals(size, cache0.localSizeLong(partition, NEAR));
+                assertEquals(size, cache0.localSizeLong(partition, ALL));
 
                 assertEquals(size, cache0.size());
-                assertEquals(size, cache0.size(partition, PRIMARY));
-                assertEquals(size, cache0.size(partition, BACKUP));
-                assertEquals(size, cache0.size(partition, NEAR));
-                assertEquals(size, cache0.size(partition, ALL));
+                assertEquals(size, cache0.sizeLong(partition, PRIMARY));
+                assertEquals(size, cache0.sizeLong(partition, BACKUP));
+                assertEquals(size, cache0.sizeLong(partition, NEAR));
+                assertEquals(size, cache0.sizeLong(partition, ALL));
 
                 cacheAsync0.size();
 
                 assertEquals(size, cacheAsync0.future().get());
 
-                cacheAsync0.size(partition, PRIMARY);
+                cacheAsync0.sizeLong(partition, PRIMARY);
 
                 assertEquals(size, cacheAsync0.future().get());
             }
@@ -543,16 +543,16 @@ public abstract class IgniteCachePeekModesAbstractTest extends IgniteCacheAbstra
                 final int size = HEAP_ENTRIES - i - 1;
 
                 assertEquals(size, cache0.localSize());
-                assertEquals(size, cache0.localSize(partition, PRIMARY));
-                assertEquals(size, cache0.localSize(partition, BACKUP));
-                assertEquals(size, cache0.localSize(partition, NEAR));
-                assertEquals(size, cache0.localSize(partition, ALL));
+                assertEquals(size, cache0.localSizeLong(partition, PRIMARY));
+                assertEquals(size, cache0.localSizeLong(partition, BACKUP));
+                assertEquals(size, cache0.localSizeLong(partition, NEAR));
+                assertEquals(size, cache0.localSizeLong(partition, ALL));
 
                 assertEquals(size, cache0.size());
-                assertEquals(size, cache0.size(partition, PRIMARY));
-                assertEquals(size, cache0.size(partition, BACKUP));
-                assertEquals(size, cache0.size(partition, NEAR));
-                assertEquals(size, cache0.size(partition, ALL));
+                assertEquals(size, cache0.sizeLong(partition, PRIMARY));
+                assertEquals(size, cache0.sizeLong(partition, BACKUP));
+                assertEquals(size, cache0.sizeLong(partition, NEAR));
+                assertEquals(size, cache0.sizeLong(partition, ALL));
 
                 cacheAsync0.size();
 
@@ -584,23 +584,23 @@ public abstract class IgniteCachePeekModesAbstractTest extends IgniteCacheAbstra
                 assertTrue(totalSwap + totalOffheap < totalKeys);
 
                 assertEquals(totalKeys, cache0.localSize());
-                assertEquals(totalKeys, cache0.localSize(partition, ALL));
+                assertEquals(totalKeys, cache0.localSizeLong(partition, ALL));
 
-                assertEquals(totalOffheap, cache0.localSize(partition, OFFHEAP));
-                assertEquals(totalSwap, cache0.localSize(partition, SWAP));
-                assertEquals(totalKeys - (totalSwap + totalOffheap), cache0.localSize(partition,
ONHEAP));
+                assertEquals(totalOffheap, cache0.localSizeLong(partition, OFFHEAP));
+                assertEquals(totalSwap, cache0.localSizeLong(partition, SWAP));
+                assertEquals(totalKeys - (totalSwap + totalOffheap), cache0.localSizeLong(partition,
ONHEAP));
 
-                assertEquals(totalOffheap, cache0.size(partition, OFFHEAP));
-                assertEquals(totalSwap, cache0.size(partition, SWAP));
-                assertEquals(totalKeys - (totalSwap + totalOffheap), cache0.size(partition,
ONHEAP));
+                assertEquals(totalOffheap, cache0.sizeLong(partition, OFFHEAP));
+                assertEquals(totalSwap, cache0.sizeLong(partition, SWAP));
+                assertEquals(totalKeys - (totalSwap + totalOffheap), cache0.sizeLong(partition,
ONHEAP));
 
-                assertEquals(totalOffheap, cache0.localSize(partition, OFFHEAP, PRIMARY));
-                assertEquals(totalSwap, cache0.localSize(partition, SWAP, PRIMARY));
-                assertEquals(totalKeys - (totalSwap + totalOffheap), cache0.localSize(partition,
ONHEAP, PRIMARY));
+                assertEquals(totalOffheap, cache0.localSizeLong(partition, OFFHEAP, PRIMARY));
+                assertEquals(totalSwap, cache0.localSizeLong(partition, SWAP, PRIMARY));
+                assertEquals(totalKeys - (totalSwap + totalOffheap), cache0.localSizeLong(partition,
ONHEAP, PRIMARY));
 
-                assertEquals(totalOffheap, cache0.localSize(partition, OFFHEAP, BACKUP));
-                assertEquals(totalSwap, cache0.localSize(partition, SWAP, BACKUP));
-                assertEquals(totalKeys - (totalSwap + totalOffheap), cache0.localSize(partition,
ONHEAP, BACKUP));
+                assertEquals(totalOffheap, cache0.localSizeLong(partition, OFFHEAP, BACKUP));
+                assertEquals(totalSwap, cache0.localSizeLong(partition, SWAP, BACKUP));
+                assertEquals(totalKeys - (totalSwap + totalOffheap), cache0.localSizeLong(partition,
ONHEAP, BACKUP));
             }
             finally {
                 cache0.removeAll(keys);
@@ -774,18 +774,18 @@ public abstract class IgniteCachePeekModesAbstractTest extends IgniteCacheAbstra
 
                 assertEquals(PUT_KEYS, cache0.localSize(BACKUP));
                 assertEquals(PUT_KEYS, cache0.localSize(ALL));
-                assertEquals(partitionSize, cache0.localSize(partition, BACKUP));
-                assertEquals(partitionSize, cache0.localSize(partition, ALL));
-                assertEquals(0, cache0.localSize(partition, PRIMARY));
-                assertEquals(0, cache0.localSize(partition, NEAR));
+                assertEquals(partitionSize, cache0.localSizeLong(partition, BACKUP));
+                assertEquals(partitionSize, cache0.localSizeLong(partition, ALL));
+                assertEquals(0, cache0.localSizeLong(partition, PRIMARY));
+                assertEquals(0, cache0.localSizeLong(partition, NEAR));
 
                 for (int i = 0; i < gridCount(); i++) {
                     IgniteCache<Integer, String> cache = jcache(i);
                     assertEquals(0, cache.size(NEAR));
-                    assertEquals(partitionSize, cache.size(partition, PRIMARY));
-                    assertEquals(partitionSize * (gridCount() - 1), cache.size(partition,
BACKUP));
-                    assertEquals(partitionSize * gridCount(), cache.size(partition, PRIMARY,
BACKUP));
-                    assertEquals(partitionSize * gridCount(), cache.size(partition, ALL));
// Primary + backups.
+                    assertEquals(partitionSize, cache.sizeLong(partition, PRIMARY));
+                    assertEquals(partitionSize * (gridCount() - 1), cache.sizeLong(partition,
BACKUP));
+                    assertEquals(partitionSize * gridCount(), cache.sizeLong(partition, PRIMARY,
BACKUP));
+                    assertEquals(partitionSize * gridCount(), cache.sizeLong(partition, ALL));
// Primary + backups.
                 }
             }
             else {
@@ -805,30 +805,30 @@ public abstract class IgniteCachePeekModesAbstractTest extends IgniteCacheAbstra
 
                 if (hasNearCache()) {
                     assertEquals(0, cache0.localSize());
-                    assertEquals(0, cache0.localSize(partition, ALL));
-                    assertEquals(0, cache0.localSize(partition, NEAR));
+                    assertEquals(0, cache0.localSizeLong(partition, ALL));
+                    assertEquals(0, cache0.localSizeLong(partition, NEAR));
 
                     for (int i = 0; i < gridCount(); i++) {
                         IgniteCache<Integer, String> cache = jcache(i);
 
-                        assertEquals(0, cache.size(partition, NEAR));
-                        assertEquals(partitionSize, cache.size(partition, BACKUP));
-                        assertEquals(partitionSize * 2, cache.size(partition, PRIMARY, BACKUP));
-                        assertEquals(partitionSize * 2, cache.size(partition, ALL)); // Primary
+ backups + near.
+                        assertEquals(0, cache.sizeLong(partition, NEAR));
+                        assertEquals(partitionSize, cache.sizeLong(partition, BACKUP));
+                        assertEquals(partitionSize * 2, cache.sizeLong(partition, PRIMARY,
BACKUP));
+                        assertEquals(partitionSize * 2, cache.sizeLong(partition, ALL));
// Primary + backups + near.
                     }
                 }
                 else {
                     assertEquals(0, cache0.localSize());
-                    //assertEquals(partitionSize, cache0.localSize(partition, ALL));
-                    assertEquals(0, cache0.localSize(partition, NEAR));
+                    //assertEquals(partitionSize, cache0.localSizeLong(partition, ALL));
+                    assertEquals(0, cache0.localSizeLong(partition, NEAR));
 
                     for (int i = 0; i < gridCount(); i++) {
                         IgniteCache<Integer, String> cache = jcache(i);
 
                         assertEquals(0, cache.size(NEAR));
-                        assertEquals(partitionSize, cache.size(partition, BACKUP));
-                        assertEquals(partitionSize * 2, cache.size(partition, PRIMARY, BACKUP));
-                        assertEquals(partitionSize * 2, cache.size(partition, ALL)); // Primary
+ backups.
+                        assertEquals(partitionSize, cache.sizeLong(partition, BACKUP));
+                        assertEquals(partitionSize * 2, cache.sizeLong(partition, PRIMARY,
BACKUP));
+                        assertEquals(partitionSize * 2, cache.sizeLong(partition, ALL));
// Primary + backups.
                     }
                 }
 
@@ -858,11 +858,11 @@ public abstract class IgniteCachePeekModesAbstractTest extends IgniteCacheAbstra
 
                 IgniteCache<Integer, String> cache = jcache(i);
 
-                assertEquals(primary, cache.localSize(partition, PRIMARY));
-                assertEquals(backups, cache.localSize(partition, BACKUP));
-                assertEquals(primary + backups, cache.localSize(partition, PRIMARY, BACKUP));
-                assertEquals(primary + backups, cache.localSize(partition, BACKUP, PRIMARY));
-                assertEquals(primary + backups, cache.localSize(partition, ALL));
+                assertEquals(primary, cache.localSizeLong(partition, PRIMARY));
+                assertEquals(backups, cache.localSizeLong(partition, BACKUP));
+                assertEquals(primary + backups, cache.localSizeLong(partition, PRIMARY, BACKUP));
+                assertEquals(primary + backups, cache.localSizeLong(partition, BACKUP, PRIMARY));
+                assertEquals(primary + backups, cache.localSizeLong(partition, ALL));
             }
 
             cache0.remove(keys.get(0));
@@ -884,15 +884,15 @@ public abstract class IgniteCachePeekModesAbstractTest extends IgniteCacheAbstra
             }
 
             if (cacheMode() == REPLICATED) {
-                assertEquals(primary+backups, cache0.localSize(partition, ALL));
-                assertEquals(primary, cache0.localSize(partition, PRIMARY));
-                assertEquals(backups, cache0.localSize(partition, BACKUP));
+                assertEquals(primary+backups, cache0.localSizeLong(partition, ALL));
+                assertEquals(primary, cache0.localSizeLong(partition, PRIMARY));
+                assertEquals(backups, cache0.localSizeLong(partition, BACKUP));
             }
             else {
                 if (hasNearCache())
-                    assertEquals(0, cache0.localSize(partition, ALL));
+                    assertEquals(0, cache0.localSizeLong(partition, ALL));
                 else
-                    assertEquals(0, cache0.localSize(partition, ALL));
+                    assertEquals(0, cache0.localSizeLong(partition, ALL));
             }
         }
         finally {
@@ -1265,18 +1265,18 @@ public abstract class IgniteCachePeekModesAbstractTest extends IgniteCacheAbstra
 
             assertEquals(primaryKeys.size(), cache0.localSize());
             assertEquals(totalKeys, cache0.localSize(ALL));
-            assertEquals(totalOffheap, cache0.localSize(partition, PRIMARY, BACKUP, NEAR,
OFFHEAP));
-            assertEquals(totalSwap, cache0.localSize(partition, PRIMARY, BACKUP, NEAR, SWAP));
-            assertEquals(swapKeys.get1(), (Integer)cache0.localSize(partition, SWAP, PRIMARY));
-            assertEquals(swapKeys.get2(), (Integer)cache0.localSize(partition, SWAP, BACKUP));
+            assertEquals(totalOffheap, cache0.localSizeLong(partition, PRIMARY, BACKUP, NEAR,
OFFHEAP));
+            assertEquals(totalSwap, cache0.localSizeLong(partition, PRIMARY, BACKUP, NEAR,
SWAP));
+            assertEquals((long) swapKeys.get1(), cache0.localSizeLong(partition, SWAP, PRIMARY));
+            assertEquals((long) swapKeys.get2(), cache0.localSizeLong(partition, SWAP, BACKUP));
 
-            assertEquals(offheapKeys.get1(), (Integer)cache0.localSize(partition, OFFHEAP,
PRIMARY));
-            assertEquals(offheapKeys.get2(), (Integer)cache0.localSize(partition, OFFHEAP,
BACKUP));
+            assertEquals((long) offheapKeys.get1(), cache0.localSizeLong(partition, OFFHEAP,
PRIMARY));
+            assertEquals((long) offheapKeys.get2(), cache0.localSizeLong(partition, OFFHEAP,
BACKUP));
 
-            assertEquals(swapKeys.get1() + offheapKeys.get1(), cache0.localSize(partition,
SWAP, OFFHEAP, PRIMARY));
-            assertEquals(swapKeys.get2() + offheapKeys.get2(), cache0.localSize(partition,
SWAP, OFFHEAP, BACKUP));
+            assertEquals(swapKeys.get1() + offheapKeys.get1(), cache0.localSizeLong(partition,
SWAP, OFFHEAP, PRIMARY));
+            assertEquals(swapKeys.get2() + offheapKeys.get2(), cache0.localSizeLong(partition,
SWAP, OFFHEAP, BACKUP));
 
-            assertEquals(totalSwap + totalOffheap, cache0.localSize(partition, PRIMARY, BACKUP,
NEAR, SWAP, OFFHEAP));
+            assertEquals(totalSwap + totalOffheap, cache0.localSizeLong(partition, PRIMARY,
BACKUP, NEAR, SWAP, OFFHEAP));
 
             int globalParitionSwapPrimary = 0;
             int globalPartitionSwapBackup = 0;
@@ -1321,17 +1321,17 @@ public abstract class IgniteCachePeekModesAbstractTest extends IgniteCacheAbstra
                 assertEquals(globalTotal, cache.size(PRIMARY, BACKUP, NEAR, ONHEAP, OFFHEAP,
SWAP));
                 assertEquals(globalTotal, cache.size(ONHEAP, OFFHEAP, SWAP, PRIMARY, BACKUP));
 
-                assertEquals(globalPartitionTotalSwap, cache.size(partition, PRIMARY, BACKUP,
NEAR, SWAP));
-                assertEquals(globalParitionSwapPrimary, cache.size(partition, SWAP, PRIMARY));
-                assertEquals(globalPartitionSwapBackup, cache.size(partition, SWAP, BACKUP));
+                assertEquals(globalPartitionTotalSwap, cache.sizeLong(partition, PRIMARY,
BACKUP, NEAR, SWAP));
+                assertEquals(globalParitionSwapPrimary, cache.sizeLong(partition, SWAP, PRIMARY));
+                assertEquals(globalPartitionSwapBackup, cache.sizeLong(partition, SWAP, BACKUP));
 
-                assertEquals(globalPartitionTotalOffheap, cache.size(partition, PRIMARY,
BACKUP, NEAR, OFFHEAP));
-                assertEquals(globalPartitionOffheapPrimary, cache.size(partition, OFFHEAP,
PRIMARY));
-                assertEquals(globalPartitionOffheapBackup, cache.size(partition, OFFHEAP,
BACKUP));
+                assertEquals(globalPartitionTotalOffheap, cache.sizeLong(partition, PRIMARY,
BACKUP, NEAR, OFFHEAP));
+                assertEquals(globalPartitionOffheapPrimary, cache.sizeLong(partition, OFFHEAP,
PRIMARY));
+                assertEquals(globalPartitionOffheapBackup, cache.sizeLong(partition, OFFHEAP,
BACKUP));
 
-                assertEquals(globalPartitionTotalSwap + globalPartitionTotalOffheap, cache.size(partition,
PRIMARY, BACKUP, NEAR, SWAP, OFFHEAP));
-                assertEquals(globalParitionSwapPrimary + globalPartitionOffheapPrimary, cache.size(partition,
SWAP, OFFHEAP, PRIMARY));
-                assertEquals(globalPartitionSwapBackup + globalPartitionOffheapBackup, cache.size(partition,
SWAP, OFFHEAP, BACKUP));
+                assertEquals(globalPartitionTotalSwap + globalPartitionTotalOffheap, cache.sizeLong(partition,
PRIMARY, BACKUP, NEAR, SWAP, OFFHEAP));
+                assertEquals(globalParitionSwapPrimary + globalPartitionOffheapPrimary, cache.sizeLong(partition,
SWAP, OFFHEAP, PRIMARY));
+                assertEquals(globalPartitionSwapBackup + globalPartitionOffheapBackup, cache.sizeLong(partition,
SWAP, OFFHEAP, BACKUP));
             }
         }
         finally {

http://git-wip-us.apache.org/repos/asf/ignite/blob/5343edaa/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
index 4d4971f..3be0423 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
@@ -197,11 +197,6 @@ public class IgniteCacheProcessProxy<K, V> implements IgniteCache<K,
V> {
     }
 
     /** {@inheritDoc} */
-    @Override public int size(int partition, CachePeekMode... peekModes) throws CacheException
{
-        return compute.call(new PartitionSizeTask(cacheName, isAsync, peekModes, partition,
false));
-    }
-
-    /** {@inheritDoc} */
     @Override public long sizeLong(CachePeekMode... peekModes) throws CacheException {
         return compute.call(new SizeLongTask(cacheName, isAsync, peekModes, false));
     }
@@ -217,11 +212,6 @@ public class IgniteCacheProcessProxy<K, V> implements IgniteCache<K,
V> {
     }
 
     /** {@inheritDoc} */
-    @Override public int localSize(int partition, CachePeekMode... peekModes) {
-        return compute.call(new PartitionSizeTask(cacheName, isAsync, peekModes, partition,true));
-    }
-
-    /** {@inheritDoc} */
     @Override public long localSizeLong(CachePeekMode... peekModes) {
         return compute.call(new SizeLongTask(cacheName, isAsync, peekModes, true));
     }
@@ -698,39 +688,6 @@ public class IgniteCacheProcessProxy<K, V> implements IgniteCache<K,
V> {
     /**
      *
      */
-    private static class PartitionSizeTask extends CacheTaskAdapter<Void, Void, Integer>
{
-        /** Partition. */
-        int partition;
-
-        /** Peek modes. */
-        private final CachePeekMode[] peekModes;
-
-        /** Local. */
-        private final boolean loc;
-
-        /**
-         * @param cacheName Cache name.
-         * @param async Async.
-         * @param peekModes Peek modes.
-         * @param partition partition.
-         * @param loc Local.
-         */
-        public PartitionSizeTask(String cacheName, boolean async, CachePeekMode[] peekModes,
int partition, boolean loc) {
-            super(cacheName, async);
-            this.loc = loc;
-            this.peekModes = peekModes;
-            this.partition = partition;
-        }
-
-        /** {@inheritDoc} */
-        @Override public Integer call() throws Exception {
-            return loc ? cache().localSize(partition, peekModes) : cache().size(partition,
peekModes);
-        }
-    }
-
-    /**
-     *
-     */
     private static class SizeLongTask extends CacheTaskAdapter<Void, Void, Long> {
         /** Peek modes. */
         private final CachePeekMode[] peekModes;


Mime
View raw message