You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/06/10 12:00:32 UTC

incubator-ignite git commit: #sberb-25: fix javadoc for removeAll operations.

Repository: incubator-ignite
Updated Branches:
  refs/heads/sberb-25 [created] f887d3d5b


#sberb-25: fix javadoc for removeAll operations.


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

Branch: refs/heads/sberb-25
Commit: f887d3d5b0a15e7a408a107f5b3acc4e4ac4c0d0
Parents: e0426f0
Author: ivasilinets <iv...@gridgain.com>
Authored: Wed Jun 10 13:00:14 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Wed Jun 10 13:00:14 2015 +0300

----------------------------------------------------------------------
 .../java/org/apache/ignite/IgniteCache.java     | 49 +++++++++++++++++++-
 .../processors/cache/IgniteInternalCache.java   | 33 ++++---------
 2 files changed, 57 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f887d3d5/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..0d9e7e4 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.*;
@@ -374,11 +375,55 @@ public interface IgniteCache<K, V> extends javax.cache.Cache<K, V>, IgniteAsyncS
     @IgniteAsyncSupported
     @Override public V getAndReplace(K key, V val);
 
-    /** {@inheritDoc} */
+    /**
+     * Removes entries for the specified keys.
+     * <p>
+     * The order in which the individual entries are removed is undefined.
+     * <p>
+     * For every entry in the key set, 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 key set is empty, the {@link CacheWriter} is not called.
+     * <p>
+     * This operation is not transactional.
+     *
+     * @param keys the keys to remove
+     * @throws NullPointerException  if keys is null or if it contains a null key
+     * @throws IllegalStateException if the cache is {@link #isClosed()}
+     * @throws CacheException        if there is a problem during the remove
+     * @throws ClassCastException    if the implementation is configured to perform
+     *                               runtime-type-checking, and the key or value
+     *                               types are incompatible with those that have been
+     *                               configured for the {@link Cache}
+     * @see CacheWriter#deleteAll
+     */
     @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.
+     * <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/f887d3d5/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..941ace8 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,14 +1135,11 @@ 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.
+     * This method is not transactional.
      *
      * @param keys Keys whose mappings are to be removed from cache.
      * @throws IgniteCheckedException If remove failed.
@@ -1150,14 +1147,11 @@ 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.
+     * This method is not transactional.
      *
      * @param keys Keys whose mappings are to be removed from cache.
      * @return Future for the remove operation. The future will complete whenever
@@ -1166,20 +1160,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.
      */