#sberb-25: IgniteCache.removeAll ignores tx timeout - add JavaDoc for IgniteCache.removeAll
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/6a155962 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/6a155962 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/6a155962 Branch: refs/heads/ignite-695 Commit: 6a1559623ed587bd793e922e762b5ec76af024ad Parents: 8f455a9 Author: ivasilinets <ivasilin...@gridgain.com> Authored: Wed Jun 10 15:40:49 2015 +0300 Committer: ivasilinets <ivasilin...@gridgain.com> Committed: Wed Jun 10 15:40:49 2015 +0300 ---------------------------------------------------------------------- .../java/org/apache/ignite/IgniteCache.java | 25 +++++++++++++++++- .../processors/cache/IgniteInternalCache.java | 27 ++++++-------------- 2 files changed, 32 insertions(+), 20 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6a155962/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 a54adc9..2b97e55 100644 --- a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java +++ b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java @@ -30,6 +30,7 @@ import org.jetbrains.annotations.*; import javax.cache.*; import javax.cache.configuration.*; +import javax.cache.event.*; import javax.cache.expiry.*; import javax.cache.integration.*; import javax.cache.processor.*; @@ -378,7 +379,29 @@ public interface IgniteCache<K, V> extends javax.cache.Cache<K, V>, IgniteAsyncS @IgniteAsyncSupported @Override public void removeAll(Set<? extends K> keys); - /** {@inheritDoc} */ + /** + * Removes all of the mappings from this cache. + * <p> + * The order that the individual entries are removed is undefined. + * <p> + * For every mapping that exists the following are called: + * <ul> + * <li>any registered {@link CacheEntryRemovedListener}s</li> + * <li>if the cache is a write-through cache, the {@link CacheWriter}</li> + * </ul> + * If the cache is empty, the {@link CacheWriter} is not called. + * <p> + * This operation is not transactional. It calls broadcast closure that + * deletes all primary keys from remote nodes. + * <p> + * This is potentially an expensive operation as listeners are invoked. + * Use {@link #clear()} to avoid this. + * + * @throws IllegalStateException if the cache is {@link #isClosed()} + * @throws CacheException if there is a problem during the remove + * @see #clear() + * @see CacheWriter#deleteAll + */ @IgniteAsyncSupported @Override public void removeAll(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6a155962/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java index d98379c..9972f92 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java @@ -1135,11 +1135,9 @@ public interface IgniteInternalCache<K, V> extends Iterable<Cache.Entry<K, V>> { public IgniteInternalFuture<Boolean> removeAsync(K key, V val); /** - * Removes given key mappings from cache for entries for which the optionally passed in filters do - * pass. + * Removes given key mappings from cache. * <p> - * If write-through is enabled, the values will be removed from {@link CacheStore} - * via <code>@link CacheStore#removeAll(Transaction, Collection)</code> method. + * If write-through is enabled, the values will be removed from {@link CacheStore} via {@link IgniteDataStreamer}. * <h2 class="header">Transactions</h2> * This method is transactional and will enlist the entry into ongoing transaction * if there is one. @@ -1150,11 +1148,9 @@ public interface IgniteInternalCache<K, V> extends Iterable<Cache.Entry<K, V>> { public void removeAll(@Nullable Collection<? extends K> keys) throws IgniteCheckedException; /** - * Asynchronously removes given key mappings from cache for entries for which the optionally - * passed in filters do pass. + * Asynchronously removes given key mappings from cache for entries. * <p> - * If write-through is enabled, the values will be removed from {@link CacheStore} - * via <code>@link CacheStore#removeAll(Transaction, Collection)</code> method. + * If write-through is enabled, the values will be removed from {@link CacheStore} via {@link IgniteDataStreamer}. * <h2 class="header">Transactions</h2> * This method is transactional and will enlist the entry into ongoing transaction * if there is one. @@ -1166,20 +1162,13 @@ public interface IgniteInternalCache<K, V> extends Iterable<Cache.Entry<K, V>> { public IgniteInternalFuture<?> removeAllAsync(@Nullable Collection<? extends K> keys); /** - * Removes mappings from cache for entries for which the optionally passed in filters do - * pass. If passed in filters are {@code null}, then all entries in cache will be enrolled - * into transaction. + * Removes mappings from cache. * <p> - * <b>USE WITH CARE</b> - if your cache has many entries that pass through the filter or if filter - * is empty, then transaction will quickly become very heavy and slow. Also, locks - * are acquired in undefined order, so it may cause a deadlock when used with - * other concurrent transactional updates. + * <b>USE WITH CARE</b> - if your cache has many entries then transaction will quickly become very heavy and slow. * <p> - * If write-through is enabled, the values will be removed from {@link CacheStore} - * via <code>@link CacheStore#removeAll(Transaction, Collection)</code> method. + * If write-through is enabled, the values will be removed from {@link CacheStore} via {@link IgniteDataStreamer}. * <h2 class="header">Transactions</h2> - * This method is transactional and will enlist the entry into ongoing transaction - * if there is one. + * This method is not transactional. * * @throws IgniteCheckedException If remove failed. */