ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [33/53] [abbrv] incubator-ignite git commit: IGNITE-49 Fixed code style
Date Tue, 27 Jan 2015 16:40:53 GMT
IGNITE-49 Fixed code style


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

Branch: refs/heads/sprint-1
Commit: c524ed0cc1adcb740312668256bb8f8f1f987934
Parents: 401b24f
Author: nikolay_tikhonov <ntikhonov@gridgain.com>
Authored: Mon Jan 26 15:11:43 2015 +0300
Committer: nikolay_tikhonov <ntikhonov@gridgain.com>
Committed: Mon Jan 26 15:11:43 2015 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/cache/CacheManager.java   |   1 -
 .../processors/cache/GridCacheAdapter.java      | 143 ++++++++-----------
 2 files changed, 57 insertions(+), 87 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c524ed0c/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java b/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java
index a2e62ac..b540372 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java
@@ -22,7 +22,6 @@ import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.lang.*;
 import org.apache.ignite.internal.util.typedef.*;
-import org.apache.ignite.mxbean.*;
 
 import javax.cache.*;
 import javax.cache.configuration.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c524ed0c/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 dbb4a42..706f151 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
@@ -823,7 +823,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
     @Nullable protected GridTuple<V> peek0(boolean failFast, K key, @Nullable Collection<GridCachePeekMode>
modes,
         IgniteTxEx<K, V> tx) throws IgniteCheckedException, GridCacheFilterFailedException
{
         if (F.isEmpty(modes))
-            return F.t(peek(key, (IgnitePredicate<CacheEntry<K, V>>) null));
+            return F.t(peek(key, (IgnitePredicate<CacheEntry<K, V>>)null));
 
         assert modes != null;
 
@@ -1109,7 +1109,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
 
     /** {@inheritDoc} */
     @Override public Set<CacheEntry<K, V>> primaryEntrySet() {
-        return primaryEntrySet((IgnitePredicate<CacheEntry<K, V>>[]) null);
+        return primaryEntrySet((IgnitePredicate<CacheEntry<K, V>>[])null);
     }
 
     /** {@inheritDoc} */
@@ -1119,12 +1119,12 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
 
     /** {@inheritDoc} */
     @Override public Set<K> primaryKeySet() {
-        return primaryKeySet((IgnitePredicate<CacheEntry<K, V>>[]) null);
+        return primaryKeySet((IgnitePredicate<CacheEntry<K, V>>[])null);
     }
 
     /** {@inheritDoc} */
     @Override public Collection<V> values() {
-        return values((IgnitePredicate<CacheEntry<K, V>>[]) null);
+        return values((IgnitePredicate<CacheEntry<K, V>>[])null);
     }
 
     /** {@inheritDoc} */
@@ -1134,7 +1134,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
 
     /** {@inheritDoc} */
     @Override public Collection<V> primaryValues() {
-        return primaryValues((IgnitePredicate<CacheEntry<K, V>>[]) null);
+        return primaryValues((IgnitePredicate<CacheEntry<K, V>>[])null);
     }
 
     /**
@@ -1314,7 +1314,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
         }
         catch (ComputeTaskTimeoutException e) {
             U.warn(log, "Timed out waiting for remote nodes to finish cache clear (consider
increasing " +
-                    "'networkTimeout' configuration property) [cacheName=" + name() + "]");
+                "'networkTimeout' configuration property) [cacheName=" + name() + "]");
 
             throw e;
         }
@@ -1397,9 +1397,8 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
         String taskName = ctx.kernalContext().job().currentTaskName();
 
         return getAllAsync(Collections.singletonList(key), /*force primary*/true, /*skip
tx*/false, null, null,
-                taskName, true).chain(new CX1<IgniteFuture<Map<K, V>>, V>()
{
-            @Override
-            public V applyx(IgniteFuture<Map<K, V>> e) throws IgniteCheckedException
{
+            taskName, true).chain(new CX1<IgniteFuture<Map<K, V>>, V>()
{
+            @Override public V applyx(IgniteFuture<Map<K, V>> e) throws IgniteCheckedException
{
                 return e.get().get(key);
             }
         });
@@ -1421,12 +1420,12 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
 
     /** {@inheritDoc} */
     @Nullable @Override public V reload(K key) throws IgniteCheckedException {
-        return reload(key, (IgnitePredicate<CacheEntry<K, V>>[]) null);
+        return reload(key, (IgnitePredicate<CacheEntry<K, V>>[])null);
     }
 
     /** {@inheritDoc} */
     @Override public IgniteFuture<V> reloadAsync(K key) {
-        return reloadAsync(key, (IgnitePredicate<CacheEntry<K, V>>[]) null);
+        return reloadAsync(key, (IgnitePredicate<CacheEntry<K, V>>[])null);
     }
 
     /** {@inheritDoc} */
@@ -1436,7 +1435,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
 
     /** {@inheritDoc} */
     @Override public IgniteFuture<?> reloadAllAsync(@Nullable Collection<? extends
K> keys) {
-        return reloadAllAsync(keys, (IgnitePredicate<CacheEntry<K, V>>[]) null);
+        return reloadAllAsync(keys, (IgnitePredicate<CacheEntry<K, V>>[])null);
     }
 
     /** {@inheritDoc} */
@@ -2209,7 +2208,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
             @Override
             public IgniteFuture<V> op(IgniteTxLocalAdapter<K, V> tx) {
                 return tx.putAllAsync(ctx, F.t(key, val), true, entry, ttl, filter)
-                        .chain((IgniteClosure<IgniteFuture<GridCacheReturn<V>>,
V>) RET2VAL);
+                    .chain((IgniteClosure<IgniteFuture<GridCacheReturn<V>>,
V>)RET2VAL);
             }
 
             @Override
@@ -2263,13 +2262,11 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
         ctx.denyOnLocalRead();
 
         syncOp(new SyncInOp(drMap.size() == 1) {
-            @Override
-            public void inOp(IgniteTxLocalAdapter<K, V> tx) throws IgniteCheckedException
{
+            @Override public void inOp(IgniteTxLocalAdapter<K, V> tx) throws IgniteCheckedException
{
                 tx.putAllDrAsync(ctx, drMap).get();
             }
 
-            @Override
-            public String toString() {
+            @Override public String toString() {
                 return "putAllDr [drMap=" + drMap + ']';
             }
         });
@@ -2286,13 +2283,11 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
         ctx.denyOnLocalRead();
 
         return asyncOp(new AsyncInOp(drMap.keySet()) {
-            @Override
-            public IgniteFuture<?> inOp(IgniteTxLocalAdapter<K, V> tx) {
+            @Override public IgniteFuture<?> inOp(IgniteTxLocalAdapter<K, V>
tx) {
                 return tx.putAllDrAsync(ctx, drMap);
             }
 
-            @Override
-            public String toString() {
+            @Override public String toString() {
                 return "putAllDrAsync [drMap=" + drMap + ']';
             }
         });
@@ -2344,19 +2339,16 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
         ctx.denyOnLocalRead();
 
         return syncOp(new SyncOp<Map<K, EntryProcessorResult<T>>>(keys.size()
== 1) {
-            @Nullable
-            @Override
-            public Map<K, EntryProcessorResult<T>> op(IgniteTxLocalAdapter tx)
-                    throws IgniteCheckedException {
+            @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>>() {
-                    @Override
-                    public EntryProcessor apply(K k) {
+                    @Override public EntryProcessor apply(K k) {
                         return entryProcessor;
                     }
                 });
 
                 IgniteFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>>
fut =
-                        tx.invokeAsync(ctx, invokeMap, args);
+                    tx.invokeAsync(ctx, invokeMap, args);
 
                 return fut.get().value();
             }
@@ -2393,9 +2385,8 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
             (IgniteFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>>)fut;
 
         return fut0.chain(new CX1<IgniteFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>>,
EntryProcessorResult<T>>() {
-            @Override
-            public EntryProcessorResult<T> applyx(IgniteFuture<GridCacheReturn<Map<K,
EntryProcessorResult<T>>>> fut)
-                    throws IgniteCheckedException {
+            @Override public EntryProcessorResult<T> applyx(IgniteFuture<GridCacheReturn<Map<K,
EntryProcessorResult<T>>>> fut)
+                throws IgniteCheckedException {
                 GridCacheReturn<Map<K, EntryProcessorResult<T>>> ret =
fut.get();
 
                 Map<K, EntryProcessorResult<T>> resMap = ret.value();
@@ -2443,9 +2434,8 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
             (IgniteFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>>)fut;
 
         return fut0.chain(new CX1<IgniteFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>>,
Map<K, EntryProcessorResult<T>>>() {
-            @Override
-            public Map<K, EntryProcessorResult<T>> applyx(IgniteFuture<GridCacheReturn<Map<K,
EntryProcessorResult<T>>>> fut)
-                    throws IgniteCheckedException {
+            @Override public Map<K, EntryProcessorResult<T>> applyx(IgniteFuture<GridCacheReturn<Map<K,
EntryProcessorResult<T>>>> fut)
+                throws IgniteCheckedException {
                 GridCacheReturn<Map<K, EntryProcessorResult<T>>> ret =
fut.get();
 
                 assert ret != null;
@@ -2503,10 +2493,8 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
         ctx.denyOnLocalRead();
 
         return syncOp(new SyncOp<Map<K, EntryProcessorResult<T>>>(map.size()
== 1) {
-            @Nullable
-            @Override
-            public Map<K, EntryProcessorResult<T>> op(IgniteTxLocalAdapter tx)
-                    throws IgniteCheckedException {
+            @Nullable @Override public Map<K, EntryProcessorResult<T>> op(IgniteTxLocalAdapter
tx)
+                throws IgniteCheckedException {
                 IgniteFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>>
fut = tx.invokeAsync(ctx, map, args);
 
                 return fut.get().value();
@@ -2543,14 +2531,12 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
         ctx.denyOnLocalRead();
 
         return asyncOp(new AsyncOp<Boolean>(key) {
-            @Override
-            public IgniteFuture<Boolean> op(IgniteTxLocalAdapter<K, V> tx) {
+            @Override public IgniteFuture<Boolean> op(IgniteTxLocalAdapter<K, V>
tx) {
                 return tx.putAllAsync(ctx, F.t(key, val), false, entry, ttl, filter).chain(
-                        (IgniteClosure<IgniteFuture<GridCacheReturn<V>>, Boolean>)
RET2FLAG);
+                    (IgniteClosure<IgniteFuture<GridCacheReturn<V>>, Boolean>)RET2FLAG);
             }
 
-            @Override
-            public String toString() {
+            @Override public String toString() {
                 return "putxAsync [key=" + key + ", val=" + val + ", filter=" + Arrays.toString(filter)
+ ']';
             }
         });
@@ -2568,13 +2554,11 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
         ctx.denyOnLocalRead();
 
         return ctx.cloneOnFlag(syncOp(new SyncOp<V>(true) {
-            @Override
-            public V op(IgniteTxLocalAdapter<K, V> tx) throws IgniteCheckedException
{
+            @Override public V op(IgniteTxLocalAdapter<K, V> tx) throws IgniteCheckedException
{
                 return tx.putAllAsync(ctx, F.t(key, val), true, null, -1, ctx.noPeekArray()).get().value();
             }
 
-            @Override
-            public String toString() {
+            @Override public String toString() {
                 return "putIfAbsent [key=" + key + ", val=" + val + ']';
             }
         }));
@@ -2688,13 +2672,11 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
         ctx.denyOnLocalRead();
 
         return ctx.cloneOnFlag(syncOp(new SyncOp<V>(true) {
-            @Override
-            public V op(IgniteTxLocalAdapter<K, V> tx) throws IgniteCheckedException
{
+            @Override public V op(IgniteTxLocalAdapter<K, V> tx) throws IgniteCheckedException
{
                 return tx.putAllAsync(ctx, F.t(key, val), true, null, -1, ctx.hasPeekArray()).get().value();
             }
 
-            @Override
-            public String toString() {
+            @Override public String toString() {
                 return "replace [key=" + key + ", val=" + val + ']';
             }
         }));
@@ -2744,13 +2726,11 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
         ctx.denyOnLocalRead();
 
         return syncOp(new SyncOp<Boolean>(true) {
-            @Override
-            public Boolean op(IgniteTxLocalAdapter<K, V> tx) throws IgniteCheckedException
{
+            @Override public Boolean op(IgniteTxLocalAdapter<K, V> tx) throws IgniteCheckedException
{
                 return tx.putAllAsync(ctx, F.t(key, val), false, null, -1, ctx.hasPeekArray()).get().success();
             }
 
-            @Override
-            public String toString() {
+            @Override public String toString() {
                 return "replacex [key=" + key + ", val=" + val + ']';
             }
         });
@@ -2768,14 +2748,12 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
         ctx.denyOnLocalRead();
 
         return asyncOp(new AsyncOp<Boolean>(key) {
-            @Override
-            public IgniteFuture<Boolean> op(IgniteTxLocalAdapter<K, V> tx) {
+            @Override public IgniteFuture<Boolean> op(IgniteTxLocalAdapter<K, V>
tx) {
                 return tx.putAllAsync(ctx, F.t(key, val), false, null, -1, ctx.hasPeekArray()).chain(
-                        (IgniteClosure<IgniteFuture<GridCacheReturn<V>>, Boolean>)
RET2FLAG);
+                    (IgniteClosure<IgniteFuture<GridCacheReturn<V>>, Boolean>)RET2FLAG);
             }
 
-            @Override
-            public String toString() {
+            @Override public String toString() {
                 return "replacexAsync [key=" + key + ", val=" + val + ']';
             }
         });
@@ -3160,18 +3138,16 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
             validateCacheKey(key);
 
         return syncOp(new SyncOp<GridCacheReturn<V>>(true) {
-            @Override
-            public GridCacheReturn<V> op(IgniteTxLocalAdapter<K, V> tx) throws
IgniteCheckedException {
+            @Override public GridCacheReturn<V> op(IgniteTxLocalAdapter<K, V>
tx) throws IgniteCheckedException {
                 // Register before hiding in the filter.
                 if (ctx.deploymentEnabled())
                     ctx.deploy().registerClass(val);
 
                 return tx.removeAllAsync(ctx, Collections.singletonList(key), null, true,
-                        ctx.vararg(F.<K, V>cacheContainsPeek(val))).get();
+                    ctx.vararg(F.<K, V>cacheContainsPeek(val))).get();
             }
 
-            @Override
-            public String toString() {
+            @Override public String toString() {
                 return "remove [key=" + key + ", val=" + val + ']';
             }
         });
@@ -3208,13 +3184,11 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
         ctx.dr().onReceiveCacheEntriesReceived(drMap.size());
 
         return asyncOp(new AsyncInOp(drMap.keySet()) {
-            @Override
-            public IgniteFuture<?> inOp(IgniteTxLocalAdapter<K, V> tx) {
+            @Override public IgniteFuture<?> inOp(IgniteTxLocalAdapter<K, V>
tx) {
                 return tx.removeAllDrAsync(ctx, drMap);
             }
 
-            @Override
-            public String toString() {
+            @Override public String toString() {
                 return "removeAllDrASync [drMap=" + drMap + ']';
             }
         });
@@ -3265,7 +3239,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
                 }
 
                 return tx.removeAllAsync(ctx, Collections.singletonList(key), null, true,
-                        ctx.vararg(F.<K, V>cacheContainsPeek(val)));
+                    ctx.vararg(F.<K, V>cacheContainsPeek(val)));
             }
 
             @Override public String toString() {
@@ -3284,21 +3258,20 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
         ctx.denyOnLocalRead();
 
         return asyncOp(new AsyncOp<GridCacheReturn<V>>(key) {
-            @Override
-            public IgniteFuture<GridCacheReturn<V>> op(IgniteTxLocalAdapter<K,
V> tx) {
+            @Override public IgniteFuture<GridCacheReturn<V>> op(IgniteTxLocalAdapter<K,
V> tx) {
                 // Register before hiding in the filter.
                 try {
                     if (ctx.deploymentEnabled())
                         ctx.deploy().registerClass(oldVal);
-                } catch (IgniteCheckedException e) {
+                }
+                catch (IgniteCheckedException e) {
                     return new GridFinishedFuture<>(ctx.kernalContext(), e);
                 }
 
                 return tx.putAllAsync(ctx, F.t(key, newVal), true, null, -1, ctx.equalsPeekArray(oldVal));
             }
 
-            @Override
-            public String toString() {
+            @Override public String toString() {
                 return "replaceAsync [key=" + key + ", oldVal=" + oldVal + ", newVal=" +
newVal + ']';
             }
         });
@@ -3409,13 +3382,11 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
         final IgnitePredicate<CacheEntry<K, V>>[] p = filter;
 
         syncOp(new SyncInOp(false) {
-            @Override
-            public void inOp(IgniteTxLocalAdapter<K, V> tx) throws IgniteCheckedException
{
+            @Override public void inOp(IgniteTxLocalAdapter<K, V> tx) throws IgniteCheckedException
{
                 tx.removeAllAsync(ctx, keySet(p), null, false, null).get();
             }
 
-            @Override
-            public String toString() {
+            @Override public String toString() {
                 return "removeAll [filter=" + Arrays.toString(p) + ']';
             }
         });
@@ -3596,7 +3567,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
     @Override public IgniteTx txStartPartition(int partId, IgniteTxConcurrency concurrency,
         IgniteTxIsolation isolation, long timeout, int txSize) throws IllegalStateException,
IgniteCheckedException {
         return ctx.kernalContext().cache().transactions().txStartPartition(name(), partId,
concurrency, isolation,
-                timeout, txSize);
+            timeout, txSize);
     }
 
     /** {@inheritDoc} */
@@ -3915,20 +3886,20 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
             .execute();
 
         return ctx.itHolder().iterator(fut, new CacheIteratorConverter<Cache.Entry<K,
V>, Map.Entry<K, V>>() {
-            @Override
-            protected Cache.Entry<K, V> convert(Map.Entry<K, V> e) {
+            @Override protected Cache.Entry<K, V> convert(Map.Entry<K, V> e)
{
                 return new CacheEntryImpl<>(e.getKey(), e.getValue());
             }
 
-            @Override
-            protected void remove(Cache.Entry<K, V> item) {
+            @Override protected void remove(Cache.Entry<K, V> item) {
                 GridCacheProjectionImpl<K, V> prev = ctx.gate().enter(prj);
 
                 try {
                     GridCacheAdapter.this.removex(item.getKey());
-                } catch (IgniteCheckedException e) {
+                }
+                catch (IgniteCheckedException e) {
                     throw new CacheException(e);
-                } finally {
+                }
+                finally {
                     ctx.gate().leave(prev);
                 }
             }


Mime
View raw message