Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-683-2 [created] 3a0d1fcdd


#ignite-683: Remove unused methods.


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

Branch: refs/heads/ignite-683-2
Commit: 040d154651a1b9a74b132888aa5acc391ec68cae
Parents: d175ca6
Author: ivasilinets <ivasilin...@gridgain.com>
Authored: Thu Apr 9 17:23:01 2015 +0300
Committer: ivasilinets <ivasilin...@gridgain.com>
Committed: Thu Apr 9 17:23:01 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/CacheProjection.java       | 25 +------------------
 .../processors/cache/GridCacheAdapter.java      | 18 +++-----------
 .../cache/GridCacheProjectionImpl.java          | 10 --------
 .../processors/cache/GridCacheProxyImpl.java    | 26 +-------------------
 .../ignite/cache/hibernate/HibernateRegion.java |  2 +-
 5 files changed, 7 insertions(+), 74 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/040d1546/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheProjection.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheProjection.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheProjection.java
index 31dab7e..efb122b 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheProjection.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheProjection.java
@@ -104,7 +104,7 @@ import java.util.concurrent.*;
  *  for nodes on which given keys reside. All {@code 'gridProjection(..)'} 
methods are not
  *  transactional and will not enlist keys into ongoing transaction.
  * </li>
- * <li>Method {@link GridCache#toMap()} to convert this interface into 
standard Java {@link ConcurrentMap} interface.
+ * <li>
  * </ul>
  * <h1 class="header">Extended Put And Remove Methods</h1>
  * All methods that end with {@code 'x'} provide the same functionality as 
their sibling
@@ -269,13 +269,6 @@ public interface CacheProjection<K, V> extends 
Iterable<Cache.Entry<K, V>> {
     public boolean isEmpty();
 
     /**
-     * Converts this API into standard Java {@link ConcurrentMap} interface.
-     *
-     * @return {@link ConcurrentMap} representation of given cache projection.
-     */
-    public ConcurrentMap<K, V> toMap();
-
-    /**
      * @param key Key.
      * @return {@code True} if cache contains mapping for a given key.
      */
@@ -1096,10 +1089,8 @@ public interface CacheProjection<K, V> extends 
Iterable<Cache.Entry<K, V>> {
      * Ignite will make the best attempt to clear caches on all nodes. If some 
caches
      * could not be cleared, then exception will be thrown.
      * <p>
-     * This method is identical to calling {@link #clear(long) clear(0)}.
      *
      * @throws IgniteCheckedException In case of cache could not be cleared on 
any of the nodes.
-     * @deprecated Deprecated in favor of {@link #clear(long)} method.
      */
     public void clear() throws IgniteCheckedException;
 
@@ -1121,20 +1112,6 @@ public interface CacheProjection<K, V> extends 
Iterable<Cache.Entry<K, V>> {
     public IgniteInternalFuture<?> clearAsync(Set<? extends K> keys);
 
     /**
-     * Clears cache on all nodes that store it's data. That is, caches are 
cleared on remote
-     * nodes and local node, as opposed to {@link 
CacheProjection#clearLocally()} method which only
-     * clears local node's cache.
-     * <p>
-     * Ignite will make the best attempt to clearLocally caches on all nodes. 
If some caches
-     * could not be cleared, then exception will be thrown.
-     *
-     * @param timeout Timeout for clearLocally all task in milliseconds (0 for 
never).
-     *      Set it to larger value for large caches.
-     * @throws IgniteCheckedException In case of cache could not be cleared on 
any of the nodes.
-     */
-    public void clear(long timeout) throws IgniteCheckedException;
-
-    /**
      * Removes given key mapping from cache. If cache previously contained 
value for the given key,
      * then this value is returned. In case of {@link CacheMode#PARTITIONED} 
or {@link CacheMode#REPLICATED}
      * caches, the value will be loaded from the primary node, which in its 
turn may load the value

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/040d1546/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index babfe3c..b5dfb16 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -1160,7 +1160,10 @@ public abstract class GridCacheAdapter<K, V> implements 
GridCache<K, V>,
 
     /** {@inheritDoc} */
     @Override public void clear() throws IgniteCheckedException {
-        clear(0);
+        // Clear local cache synchronously.
+        clearLocally();
+
+        clearRemotes(0, new GlobalClearAllCallable(name()));
     }
 
     /** {@inheritDoc} */
@@ -1189,14 +1192,6 @@ public abstract class GridCacheAdapter<K, V> implements 
GridCache<K, V>,
         return clearAsync(new GlobalClearKeySetCallable<K, V>(name(), keys));
     }
 
-    /** {@inheritDoc} */
-    @Override public void clear(long timeout) throws IgniteCheckedException {
-        // Clear local cache synchronously.
-        clearLocally();
-
-        clearRemotes(timeout, new GlobalClearAllCallable(name()));
-    }
-
     /**
      * @param timeout Timeout for clearLocally all task in milliseconds (0 for 
never).
      *      Set it to larger value for large caches.
@@ -3525,11 +3520,6 @@ public abstract class GridCacheAdapter<K, V> implements 
GridCache<K, V>,
         return ctx.swap().swapSize();
     }
 
-    /** {@inheritDoc} */
-    @Override public ConcurrentMap<K, V> toMap() {
-        return new GridCacheMapAdapter<>(this);
-    }
-
     /**
      * Checks if cache is working in JTA transaction and enlist cache as 
XAResource if necessary.
      *

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/040d1546/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java
index ca19446..1f28b98 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java
@@ -612,11 +612,6 @@ public class GridCacheProjectionImpl<K, V> implements 
GridCacheProjectionEx<K, V
     }
 
     /** {@inheritDoc} */
-    @Override public void clear(long timeout) throws IgniteCheckedException {
-        cache.clear(timeout);
-    }
-
-    /** {@inheritDoc} */
     @Override public boolean clearLocally(K key) {
         return cache.clearLocally0(key);
     }
@@ -787,11 +782,6 @@ public class GridCacheProjectionImpl<K, V> implements 
GridCacheProjectionEx<K, V
     }
 
     /** {@inheritDoc} */
-    @Override public ConcurrentMap<K, V> toMap() {
-        return new GridCacheMapAdapter<>(this);
-    }
-
-    /** {@inheritDoc} */
     @Override public Iterator<Cache.Entry<K, V>> iterator() {
         return cache.entrySet().iterator();
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/040d1546/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
index 5df6964..f06c008 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
@@ -285,18 +285,6 @@ public class GridCacheProxyImpl<K, V> implements 
GridCacheProxy<K, V>, Externali
     }
 
     /** {@inheritDoc} */
-    @Override public ConcurrentMap<K, V> toMap() {
-        GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
-
-        try {
-            return cache.toMap();
-        }
-        finally {
-            gate.leave(prev);
-        }
-    }
-
-    /** {@inheritDoc} */
     @Override public GridCacheProjectionEx<K, V> forSubjectId(UUID subjId) {
         return delegate.forSubjectId(subjId);
     }
@@ -1131,7 +1119,7 @@ public class GridCacheProxyImpl<K, V> implements 
GridCacheProxy<K, V>, Externali
         GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
 
         try {
-            delegate.clear(0);
+            delegate.clear();
         }
         finally {
             gate.leave(prev);
@@ -1175,18 +1163,6 @@ public class GridCacheProxyImpl<K, V> implements 
GridCacheProxy<K, V>, Externali
     }
 
     /** {@inheritDoc} */
-    @Override public void clear(long timeout) throws IgniteCheckedException {
-        GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
-
-        try {
-            delegate.clear(timeout);
-        }
-        finally {
-            gate.leave(prev);
-        }
-    }
-
-    /** {@inheritDoc} */
     @Override public boolean clearLocally(K key) {
         GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/040d1546/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateRegion.java
----------------------------------------------------------------------
diff --git 
a/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateRegion.java
 
b/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateRegion.java
index 8b41d9e..f284a29 100644
--- 
a/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateRegion.java
+++ 
b/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/HibernateRegion.java
@@ -86,7 +86,7 @@ public class HibernateRegion implements Region {
 
     /** {@inheritDoc} */
     @Override public Map toMap() {
-        return cache.toMap();
+        return new HashMap();
     }
 
     /** {@inheritDoc} */

Reply via email to