ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject incubator-ignite git commit: #ignite-683: Fix alignments.
Date Thu, 09 Apr 2015 14:09:17 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-683-1 d6ae9036d -> d175ca683


#ignite-683: Fix alignments.


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

Branch: refs/heads/ignite-683-1
Commit: d175ca683a38e104de60d53f0db8fc95add578a6
Parents: d6ae903
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Thu Apr 9 17:09:07 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Thu Apr 9 17:09:07 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheAdapter.java      | 99 ++++++++++++++------
 .../dht/colocated/GridDhtColocatedCache.java    |  3 -
 .../distributed/near/GridNearAtomicCache.java   | 27 ++----
 .../near/GridNearTransactionalCache.java        |  2 +-
 .../local/atomic/GridLocalAtomicCache.java      | 28 ++----
 5 files changed, 84 insertions(+), 75 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d175ca68/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 6a97777..babfe3c 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
@@ -2004,15 +2004,21 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
         }
     }
 
-    /** */
-    public V put(K key, V val, @Nullable CacheEntryPredicate... filter)
-        throws IgniteCheckedException {
+    /**
+     * @param key Key to store in cache.
+     * @param val Value to be associated with the given key.
+     * @param filter Filter.
+     * @return Previous value associated with specified key, or {@code null}
+     *  if entry did not pass the filter, or if there was no mapping for the key in swap
+     *  or in persistent storage.
+     * @throws IgniteCheckedException
+     */
+    public V put(K key, V val, @Nullable CacheEntryPredicate... filter) throws IgniteCheckedException
{
         return put0(key, val, filter);
     }
 
     /** {@inheritDoc} */
-    @Override public V put(K key, V val)
-        throws IgniteCheckedException {
+    @Override public V put(K key, V val) throws IgniteCheckedException {
         return put0(key, val, CU.empty0());
     }
 
@@ -2025,9 +2031,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
      * @return Previous value.
      * @throws IgniteCheckedException If failed.
      */
-    @Nullable public V put0(final K key,
-                            final V val,
-                            @Nullable final CacheEntryPredicate[] filter)
+    @Nullable public V put0(final K key, final V val, @Nullable final CacheEntryPredicate[]
filter)
         throws IgniteCheckedException
     {
         boolean statsEnabled = ctx.config().isStatisticsEnabled();
@@ -2090,7 +2094,12 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
         return putAsync(key, val, CU.empty0());
     }
 
-    /** */
+    /**
+     * @param key Key.
+     * @param val Value.
+     * @param filter Filter.
+     * @return Put operation future.
+     */
     public IgniteInternalFuture<V> putAsync(K key, V val,
                                                       @Nullable CacheEntryPredicate[] filter)
{
         final boolean statsEnabled = ctx.config().isStatisticsEnabled();
@@ -2138,9 +2147,16 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
         return putx(key, val, CU.empty0());
     }
 
-    /**  */
-    public boolean putx(final K key, final V val,
-        final CacheEntryPredicate[] filter) throws IgniteCheckedException {
+    /**
+     * @param key Key.
+     * @param val Value.
+     * @param filter Filter.
+     * @return {@code True} if optional filter passed and value was stored in cache,
+     *      {@code false} otherwise. Note that this method will return {@code true} if filter
is not
+     *      specified.
+     * @throws IgniteCheckedException If put operation failed.
+     */
+    public boolean putx(final K key, final V val, final CacheEntryPredicate[] filter) throws
IgniteCheckedException {
         boolean statsEnabled = ctx.config().isStatisticsEnabled();
 
         long start = statsEnabled ? System.nanoTime() : 0L;
@@ -2252,11 +2268,11 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
             @Nullable @Override public Map<K, EntryProcessorResult<T>> op(IgniteTxLocalAdapter
tx)
                 throws IgniteCheckedException {
                 Map<? extends K, EntryProcessor<K, V, Object>> invokeMap = F.viewAsMap(keys,
-                        new C1<K, EntryProcessor<K, V, Object>>() {
+                    new C1<K, EntryProcessor<K, V, Object>>() {
                             @Override public EntryProcessor apply(K k) {
-                                return entryProcessor;
-                            }
-                        });
+                            return entryProcessor;
+                        }
+                    });
 
                 IgniteInternalFuture<GridCacheReturn> fut = tx.invokeAsync(ctx, invokeMap,
args);
 
@@ -2296,19 +2312,19 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
         return fut0.chain(new CX1<IgniteInternalFuture<GridCacheReturn>, EntryProcessorResult<T>>()
{
             @Override public EntryProcessorResult<T> applyx(IgniteInternalFuture<GridCacheReturn>
fut)
                 throws IgniteCheckedException {
-                    GridCacheReturn ret = fut.get();
-
-                    Map<K, EntryProcessorResult<T>> resMap = ret.value();
+                GridCacheReturn ret = fut.get();
 
-                    if (resMap != null) {
-                        assert resMap.isEmpty() || resMap.size() == 1 : resMap.size();
+                Map<K, EntryProcessorResult<T>> resMap = ret.value();
 
-                        return resMap.isEmpty() ? null : resMap.values().iterator().next();
-                    }
+                if (resMap != null) {
+                    assert resMap.isEmpty() || resMap.size() == 1 : resMap.size();
 
-                    return null;
+                    return resMap.isEmpty() ? null : resMap.values().iterator().next();
                 }
-            });
+
+                return null;
+            }
+        });
     }
 
     /** {@inheritDoc} */
@@ -2410,7 +2426,12 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
         return putxAsync(key, val, CU.empty0());
     }
 
-    /** {@inheritDoc} */
+    /**
+     * @param key Key.
+     * @param val Value.
+     * @param filter Filter.
+     * @return Put future.
+     */
     public IgniteInternalFuture<Boolean> putxAsync(K key, V val,
         @Nullable CacheEntryPredicate... filter) {
         final boolean statsEnabled = ctx.config().isStatisticsEnabled();
@@ -2434,7 +2455,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
      * @return Putx operation future.
      */
     public IgniteInternalFuture<Boolean> putxAsync0(final K key, final V val,
-                                                    @Nullable final CacheEntryPredicate...
filter) {
+        @Nullable final CacheEntryPredicate... filter) {
         A.notNull(key, "key", val, "val");
 
         if (keyCheck)
@@ -2742,7 +2763,11 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
         putAll(m, CU.empty0());
     }
 
-    /** */
+    /**
+     * @param m Map to put.
+     * @param filter Filter.
+     * @throws IgniteCheckedException If put operation failed.
+     */
     public void putAll(@Nullable final Map<? extends K, ? extends V> m,
         final CacheEntryPredicate[] filter) throws IgniteCheckedException {
         boolean statsEnabled = ctx.config().isStatisticsEnabled();
@@ -2776,7 +2801,11 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
         return putAllAsync(m, CU.empty0());
     }
 
-    /**  */
+    /**
+     * @param m Map to put.
+     * @param filter Filter.
+     * @return Put future.
+     */
     public IgniteInternalFuture<?> putAllAsync(final Map<? extends K, ? extends
V> m,
         @Nullable final CacheEntryPredicate... filter) {
         if (F.isEmpty(m))
@@ -2898,7 +2927,11 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
         removeAll(keys, CU.empty0());
     }
 
-    /** */
+    /**
+     * @param keys Keys to remove.
+     * @param filter Filter.
+     * @throws IgniteCheckedException If failed.
+     */
     public void removeAll(final Collection<? extends K> keys,
         final CacheEntryPredicate... filter) throws IgniteCheckedException {
         boolean statsEnabled = ctx.config().isStatisticsEnabled();
@@ -2932,7 +2965,11 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
         return removeAllAsync(keys, CU.empty0());
     }
 
-    /** {@inheritDoc} */
+    /**
+     * @param keys Keys to remove.
+     * @param filter Filter.
+     * @return Remove future.
+     */
     public IgniteInternalFuture<?> removeAllAsync(@Nullable final Collection<? extends
K> keys,
         final CacheEntryPredicate... filter) {
         final boolean statsEnabled = ctx.config().isStatisticsEnabled();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d175ca68/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
index 420c8dc..073af66 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
@@ -414,9 +414,6 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
 
                 GridDistributedCacheEntry entry = peekExx(cacheKey);
 
-                if (!ctx.isAll(entry, CU.empty0()))
-                    break; // While.
-
                 GridCacheMvccCandidate lock =
                     ctx.mvcc().removeExplicitLock(Thread.currentThread().getId(), cacheKey,
null);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d175ca68/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
index 9fbd01c..4fe76ef 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
@@ -388,18 +388,12 @@ public class GridNearAtomicCache<K, V> extends GridNearCacheAdapter<K,
V> {
     }
 
     /** {@inheritDoc} */
-    @Override public V put0(
-        K key,
-        V val,
-        @Nullable CacheEntryPredicate[] filter
-    ) throws IgniteCheckedException {
+    @Override public V put0( K key, V val, @Nullable CacheEntryPredicate[] filter) throws
IgniteCheckedException {
         return dht.put0(key, val, filter);
     }
 
     /** {@inheritDoc} */
-    @Override public boolean putx0(K key,
-                                   V val,
-                                   @Nullable CacheEntryPredicate... filter) throws IgniteCheckedException
{
+    @Override public boolean putx0(K key, V val, @Nullable CacheEntryPredicate... filter)
throws IgniteCheckedException {
         return dht.putx0(key, val, filter);
     }
 
@@ -412,17 +406,13 @@ public class GridNearAtomicCache<K, V> extends GridNearCacheAdapter<K,
V> {
 
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
-    @Override public IgniteInternalFuture<V> putAsync0(K key,
-                                                       V val,
-                                                       @Nullable CacheEntryPredicate... filter)
{
+    @Override public IgniteInternalFuture<V> putAsync0(K key, V val, @Nullable CacheEntryPredicate...
filter) {
         return dht.putAsync0(key, val, filter);
     }
 
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
-    @Override public IgniteInternalFuture<Boolean> putxAsync0(K key,
-                                                              V val,
-                                                              @Nullable CacheEntryPredicate...
filter) {
+    @Override public IgniteInternalFuture<Boolean> putxAsync0(K key, V val, @Nullable
CacheEntryPredicate... filter) {
         return dht.putxAsync0(key, val, filter);
     }
 
@@ -564,15 +554,13 @@ public class GridNearAtomicCache<K, V> extends GridNearCacheAdapter<K,
V> {
     }
 
     /** {@inheritDoc} */
-    @Override public V remove0(K key,
-                               @Nullable CacheEntryPredicate... filter) throws IgniteCheckedException
{
+    @Override public V remove0(K key, @Nullable CacheEntryPredicate... filter) throws IgniteCheckedException
{
         return dht.remove0(key, filter);
     }
 
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
-    @Override public IgniteInternalFuture<V> removeAsync0(K key,
-                                                          @Nullable CacheEntryPredicate...
filter) {
+    @Override public IgniteInternalFuture<V> removeAsync0(K key, @Nullable CacheEntryPredicate...
filter) {
         return dht.removeAsync0(key, filter);
     }
 
@@ -589,8 +577,7 @@ public class GridNearAtomicCache<K, V> extends GridNearCacheAdapter<K,
V> {
     }
 
     /** {@inheritDoc} */
-    @Override public boolean removex0(K key,
-                                      @Nullable CacheEntryPredicate... filter) throws IgniteCheckedException
{
+    @Override public boolean removex0(K key, @Nullable CacheEntryPredicate... filter) throws
IgniteCheckedException {
         return dht.removex0(key, filter);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d175ca68/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
index e68ff59..7388977 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
@@ -483,7 +483,7 @@ public class GridNearTransactionalCache<K, V> extends GridNearCacheAdapter<K,
V>
 
                     GridDistributedCacheEntry entry = peekExx(cacheKey);
 
-                    if (entry == null || !ctx.isAll(entry, CU.empty0()))
+                    if (entry == null)
                         break; // While.
 
                     try {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d175ca68/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
index 4c002d8..3e7db5e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
@@ -100,9 +100,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K,
V> {
 
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
-    @Override public V put0(K key,
-                            V val,
-                            @Nullable CacheEntryPredicate[] filter) throws IgniteCheckedException
{
+    @Override public V put0(K key, V val, @Nullable CacheEntryPredicate[] filter) throws
IgniteCheckedException {
         A.notNull(key, "key", val, "val");
 
         return (V)updateAllInternal(UPDATE,
@@ -118,9 +116,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K,
V> {
 
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
-    @Override public boolean putx0(K key,
-                                   V val,
-                                   @Nullable CacheEntryPredicate... filter) throws IgniteCheckedException
{
+    @Override public boolean putx0(K key, V val, @Nullable CacheEntryPredicate... filter)
throws IgniteCheckedException {
         A.notNull(key, "key", val, "val");
 
         return (Boolean)updateAllInternal(UPDATE,
@@ -153,9 +149,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K,
V> {
 
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
-    @Override public IgniteInternalFuture<V> putAsync0(K key,
-                                                       V val,
-                                                       @Nullable CacheEntryPredicate... filter)
{
+    @Override public IgniteInternalFuture<V> putAsync0(K key, V val, @Nullable CacheEntryPredicate...
filter) {
         A.notNull(key, "key", val, "val");
 
         return updateAllAsync0(F0.asMap(key, val),
@@ -168,9 +162,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K,
V> {
 
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
-    @Override public IgniteInternalFuture<Boolean> putxAsync0(K key,
-                                                              V val,
-                                                              @Nullable CacheEntryPredicate...
filter) {
+    @Override public IgniteInternalFuture<Boolean> putxAsync0(K key, V val, @Nullable
CacheEntryPredicate... filter) {
         A.notNull(key, "key", val, "val");
 
         return updateAllAsync0(F0.asMap(key, val),
@@ -315,8 +307,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K,
V> {
 
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
-    @Override public V remove0(K key,
-                               @Nullable CacheEntryPredicate... filter) throws IgniteCheckedException
{
+    @Override public V remove0(K key, @Nullable CacheEntryPredicate... filter) throws IgniteCheckedException
{
         return (V)updateAllInternal(DELETE,
             Collections.singleton(key),
             null,
@@ -330,8 +321,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K,
V> {
 
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
-    @Override public IgniteInternalFuture<V> removeAsync0(K key,
-                                                          @Nullable CacheEntryPredicate...
filter) {
+    @Override public IgniteInternalFuture<V> removeAsync0(K key, @Nullable CacheEntryPredicate...
filter) {
         return removeAllAsync0(Collections.singletonList(key), true, false, filter);
     }
 
@@ -358,8 +348,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K,
V> {
 
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
-    @Override public boolean removex0(K key,
-                                      @Nullable CacheEntryPredicate... filter) throws IgniteCheckedException
{
+    @Override public boolean removex0(K key, @Nullable CacheEntryPredicate... filter) throws
IgniteCheckedException {
         boolean statsEnabled = ctx.config().isStatisticsEnabled();
 
         long start = statsEnabled ? System.nanoTime() : 0L;
@@ -384,8 +373,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K,
V> {
 
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
-    @Override public IgniteInternalFuture<Boolean> removexAsync0(K key,
-                                                                 @Nullable CacheEntryPredicate...
filter) {
+    @Override public IgniteInternalFuture<Boolean> removexAsync0(K key, @Nullable CacheEntryPredicate...
filter) {
         A.notNull(key, "key");
 
         return removeAllAsync0(Collections.singletonList(key), false, false, filter);


Mime
View raw message