ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [14/50] incubator-ignite git commit: #ignite-683: Remove unused methods reload.
Date Mon, 13 Apr 2015 17:40:02 GMT
#ignite-683: Remove unused methods reload.


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

Branch: refs/heads/ignite-sprint-4
Commit: 349bde7b5a6a2015d05863cfbe9ae764c4c22360
Parents: 12642c6
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Thu Apr 9 18:43:40 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Thu Apr 9 18:43:40 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/CacheProjection.java       | 27 ------------
 .../processors/cache/GridCacheAdapter.java      | 44 --------------------
 .../cache/GridCacheProjectionImpl.java          | 10 -----
 .../processors/cache/GridCacheProxyImpl.java    | 25 -----------
 .../distributed/dht/GridDhtCacheAdapter.java    | 11 -----
 .../distributed/near/GridNearCacheAdapter.java  | 17 --------
 6 files changed, 134 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/349bde7b/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 b18a650..671a4a5 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
@@ -286,33 +286,6 @@ public interface CacheProjection<K, V> extends Iterable<Cache.Entry<K,
V>> {
     public IgniteInternalFuture<Boolean> containsKeysAsync(Collection<? extends
K> keys);
 
     /**
-     * Reloads a single key from persistent storage. This method
-     * delegates to <code>CacheStore#load(Transaction, Object)</code>
-     * method.
-     * <h2 class="header">Transactions</h2>
-     * This method does not participate in transactions, however it does not violate
-     * cache integrity and can be used safely with or without transactions.
-     *
-     * @param key Key to reload.
-     * @return Reloaded value or current value if entry was updated while reloading.
-     * @throws IgniteCheckedException If reloading failed.
-     */
-    @Nullable public V reload(K key) throws IgniteCheckedException;
-
-    /**
-     * Asynchronously reloads a single key from persistent storage. This method
-     * delegates to <code>CacheStore#load(Transaction, Object)</code>
-     * method.
-     * <h2 class="header">Transactions</h2>
-     * This method does not participate in transactions, however it does not violate
-     * cache integrity and can be used safely with or without transactions.
-     *
-     * @param key Key to reload.
-     * @return Future to be completed whenever the entry is reloaded.
-     */
-    public IgniteInternalFuture<V> reloadAsync(K key);
-
-    /**
      * @param key Key.
      * @param peekModes Peek modes.
      * @param plc Expiry policy if TTL should be updated.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/349bde7b/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 a18f160..edf14da 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
@@ -4722,50 +4722,6 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
     }
 
     /**
-     * @param key Key.
-     * @return Reloaded value.
-     * @throws IgniteCheckedException If failed.
-     */
-    @Override @Nullable public V reload(K key) throws IgniteCheckedException {
-        A.notNull(key, "key");
-
-        if (keyCheck)
-            validateCacheKey(key);
-
-        AffinityTopologyVersion topVer = ctx.affinity().affinityTopologyVersion();
-
-        while (true) {
-            try {
-                KeyCacheObject cacheKey = ctx.toCacheKeyObject(key);
-
-                // Do not reload near entries, they will be reloaded in DHT cache.
-                if (ctx.isNear() && ctx.affinity().localNode(cacheKey, topVer))
-                    return null;
-
-                CacheObject val = entryEx(cacheKey).innerReload();
-
-                return (V)(val != null ? val.value(ctx.cacheObjectContext(), true) : null);
-            }
-            catch (GridCacheEntryRemovedException ignored) {
-                if (log.isDebugEnabled())
-                    log.debug("Attempted to reload a removed entry for key (will retry):
" + key);
-            }
-        }
-    }
-
-    /**
-     * @param key Key.
-     * @return Reload future.
-     */
-    @Override public IgniteInternalFuture<V> reloadAsync(final K key) {
-        return ctx.closures().callLocalSafe(ctx.projectSafe(new Callable<V>() {
-            @Nullable @Override public V call() throws IgniteCheckedException {
-                return reload(key);
-            }
-        }), true);
-    }
-
-    /**
      * @param keys Keys.
      * @param deserializePortable Deserialize portable flag.
      * @return Read future.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/349bde7b/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 9f3ae1b..1dd5c23 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
@@ -262,16 +262,6 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K,
V
     }
 
     /** {@inheritDoc} */
-    @Override public V reload(K key) throws IgniteCheckedException {
-        return cache.reload(key);
-    }
-
-    /** {@inheritDoc} */
-    @Override public IgniteInternalFuture<V> reloadAsync(K key) {
-        return cache.reloadAsync(key);
-    }
-
-    /** {@inheritDoc} */
     @Override public V get(K key) throws IgniteCheckedException {
         return cache.get(key, deserializePortables());
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/349bde7b/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 d83266c..2c55deb 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
@@ -355,31 +355,6 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K,
V>, Externali
     }
 
     /** {@inheritDoc} */
-    @Nullable @Override public V reload(K key)
-        throws IgniteCheckedException {
-        GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
-
-        try {
-            return delegate.reload(key);
-        }
-        finally {
-            gate.leave(prev);
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public IgniteInternalFuture<V> reloadAsync(K key) {
-        GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
-
-        try {
-            return delegate.reloadAsync(key);
-        }
-        finally {
-            gate.leave(prev);
-        }
-    }
-
-    /** {@inheritDoc} */
     @Nullable @Override public V get(K key) throws IgniteCheckedException {
         GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/349bde7b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
index 865dbbe..c58e14b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
@@ -540,17 +540,6 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap
             skipVals);
     }
 
-    /** {@inheritDoc} */
-    @Override public V reload(K key)
-        throws IgniteCheckedException {
-        try {
-            return super.reload(key);
-        }
-        catch (GridDhtInvalidPartitionException ignored) {
-            return null;
-        }
-    }
-
     /**
      * @param keys Keys to get
      * @param readThrough Read through flag.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/349bde7b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
index e70a632..3ee3a77 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
@@ -200,23 +200,6 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda
             skipVals);
     }
 
-    /** {@inheritDoc} */
-    @Override public V reload(K key)
-        throws IgniteCheckedException {
-        V val;
-
-        try {
-            val = dht().reload(key);
-        }
-        catch (GridDhtInvalidPartitionException ignored) {
-            return null;
-        }
-
-        V nearVal = super.reload(key);
-
-        return val == null ? nearVal : val;
-    }
-
     /**
      * @param tx Transaction.
      * @param keys Keys to load.


Mime
View raw message