ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [20/50] [abbrv] incubator-ignite git commit: # ignite-44
Date Mon, 19 Jan 2015 14:20:57 GMT
# ignite-44


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

Branch: refs/heads/ignite-54
Commit: 180720f156c6246bdd1eb17e257fe8e2564d6750
Parents: fd61c91
Author: sboikov <sboikov@gridgain.com>
Authored: Tue Dec 30 13:16:12 2014 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Tue Dec 30 13:16:12 2014 +0300

----------------------------------------------------------------------
 .../processors/cache/IgniteCacheProxy.java      |  2 +-
 .../org/gridgain/grid/cache/GridCacheFlag.java  |  2 +-
 .../processors/cache/GridCacheAdapter.java      | 21 ++++++++++++++++++++
 .../processors/cache/GridCacheProjectionEx.java | 10 ++++++++++
 .../cache/GridCacheProjectionImpl.java          |  7 +++++++
 .../processors/cache/GridCacheProxyImpl.java    | 14 +++++++++++++
 .../dht/atomic/GridDhtAtomicCache.java          |  7 +++++++
 .../distributed/near/GridNearAtomicCache.java   |  7 +++++++
 .../local/atomic/GridLocalAtomicCache.java      |  7 +++++++
 .../dataload/GridDataLoadCacheUpdaters.java     |  7 +------
 ...micPrimaryWriteOrderWithStoreInvokeTest.java |  2 +-
 .../websession/GridWebSessionListener.java      |  2 --
 12 files changed, 77 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/180720f1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
index afa2986..a985fde 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
@@ -82,7 +82,7 @@ public class IgniteCacheProxy<K, V> extends IgniteAsyncSupportAdapter
implements
     /**
      * @return Ignite instance.
      */
-    public GridEx ignite() {
+    @Override public GridEx ignite() {
         return ctx.grid();
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/180720f1/modules/core/src/main/java/org/gridgain/grid/cache/GridCacheFlag.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/cache/GridCacheFlag.java b/modules/core/src/main/java/org/gridgain/grid/cache/GridCacheFlag.java
index fdff068..f4805d4 100644
--- a/modules/core/src/main/java/org/gridgain/grid/cache/GridCacheFlag.java
+++ b/modules/core/src/main/java/org/gridgain/grid/cache/GridCacheFlag.java
@@ -9,7 +9,7 @@
 
 package org.gridgain.grid.cache;
 
-import org.apache.ignite.IgniteCache;
+import org.apache.ignite.*;
 import org.apache.ignite.transactions.*;
 import org.jetbrains.annotations.*;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/180720f1/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheAdapter.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheAdapter.java
index bd9ddcf..54c11a3 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheAdapter.java
@@ -2388,6 +2388,27 @@ public abstract class GridCacheAdapter<K, V> extends GridMetadataAwareAdapter
im
     }
 
     /** {@inheritDoc} */
+    @Override public <T> Map<K, EntryProcessorResult<T>> invokeAll(
+        final Map<? extends K, ? extends EntryProcessor<K, V, T>> map,
+        final Object... args) throws IgniteCheckedException {
+        A.notNull(map, "map");
+
+        if (keyCheck)
+            validateCacheKeys(map.keySet());
+
+        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 {
+                IgniteFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>>
fut = tx.invokeAsync(ctx, map, args);
+
+                return fut.get().value();
+            }
+        });
+    }
+
+    /** {@inheritDoc} */
     @Override public IgniteFuture<Boolean> putxAsync(K key, V val,
         @Nullable IgnitePredicate<GridCacheEntry<K, V>>... filter) {
         return putxAsync(key, val, null, -1, filter);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/180720f1/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheProjectionEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheProjectionEx.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheProjectionEx.java
index 9831c59..f1f2483 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheProjectionEx.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheProjectionEx.java
@@ -428,6 +428,16 @@ public interface GridCacheProjectionEx<K, V> extends GridCacheProjection<K,
V> {
     /**
      * @param map Map containing keys and entry processors to be applied to values.
      * @param args Arguments.
+     * @return Invoke results.
+     * @throws IgniteCheckedException If failed.
+     */
+    public <T> Map<K, EntryProcessorResult<T>> invokeAll(
+        Map<? extends K, ? extends EntryProcessor<K, V, T>> map,
+        Object... args) throws IgniteCheckedException;
+
+    /**
+     * @param map Map containing keys and entry processors to be applied to values.
+     * @param args Arguments.
      * @return Future.
      */
     public <T> IgniteFuture<Map<K, EntryProcessorResult<T>>> invokeAllAsync(

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/180720f1/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheProjectionImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheProjectionImpl.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheProjectionImpl.java
index 765875f..8cebb39 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheProjectionImpl.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheProjectionImpl.java
@@ -801,6 +801,13 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K,
V
     }
 
     /** {@inheritDoc} */
+    @Override public <T> Map<K, EntryProcessorResult<T>> invokeAll(
+        Map<? extends K, ? extends EntryProcessor<K, V, T>> map,
+        Object... args) throws IgniteCheckedException {
+        return cache.invokeAll(map, args);
+    }
+
+    /** {@inheritDoc} */
     @Override public <T> IgniteFuture<Map<K, EntryProcessorResult<T>>>
invokeAllAsync(
         Map<? extends K, ? extends EntryProcessor<K, V, T>> map,
         Object... args) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/180720f1/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheProxyImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheProxyImpl.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheProxyImpl.java
index dd24388..9d5db1c 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheProxyImpl.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheProxyImpl.java
@@ -770,6 +770,20 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K,
V>, Externali
     }
 
     /** {@inheritDoc} */
+    @Override public <T> Map<K, EntryProcessorResult<T>> invokeAll(
+        Map<? extends K, ? extends EntryProcessor<K, V, T>> map,
+        Object... args) throws IgniteCheckedException {
+        GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
+
+        try {
+            return delegate.invokeAll(map, args);
+        }
+        finally {
+            gate.leave(prev);
+        }
+    }
+
+    /** {@inheritDoc} */
     @Override public <T> IgniteFuture<Map<K, EntryProcessorResult<T>>>
invokeAllAsync(
         Map<? extends K, ? extends EntryProcessor<K, V, T>> map,
         Object... args) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/180720f1/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index 70491e0..ea952d7 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -671,6 +671,13 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
     }
 
     /** {@inheritDoc} */
+    @Override public <T> Map<K, EntryProcessorResult<T>> invokeAll(
+        Map<? extends K, ? extends EntryProcessor<K, V, T>> map,
+        Object... args) throws IgniteCheckedException {
+        return invokeAllAsync(map, args).get();
+    }
+
+    /** {@inheritDoc} */
     @Override public <T> IgniteFuture<Map<K, EntryProcessorResult<T>>>
invokeAllAsync(
         Map<? extends K, ? extends EntryProcessor<K, V, T>> map,
         Object... args) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/180720f1/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearAtomicCache.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearAtomicCache.java
index 6af4977..67c6fce 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearAtomicCache.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearAtomicCache.java
@@ -554,6 +554,13 @@ public class GridNearAtomicCache<K, V> extends GridNearCacheAdapter<K,
V> {
     }
 
     /** {@inheritDoc} */
+    @Override public <T> Map<K, EntryProcessorResult<T>> invokeAll(
+        Map<? extends K, ? extends EntryProcessor<K, V, T>> map,
+        Object... args) throws IgniteCheckedException {
+        return dht.invokeAllAsync(map, args).get();
+    }
+
+    /** {@inheritDoc} */
     @Override public <T> IgniteFuture<Map<K, EntryProcessorResult<T>>>
invokeAllAsync(Set<? extends K> keys,
         EntryProcessor<K, V, T> entryProcessor,
         Object... args) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/180720f1/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/local/atomic/GridLocalAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/local/atomic/GridLocalAtomicCache.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/local/atomic/GridLocalAtomicCache.java
index 639ab38..9d5cebf 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/local/atomic/GridLocalAtomicCache.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/local/atomic/GridLocalAtomicCache.java
@@ -714,6 +714,13 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K,
V> {
     }
 
     /** {@inheritDoc} */
+    @Override public <T> Map<K, EntryProcessorResult<T>> invokeAll(
+        Map<? extends K, ? extends EntryProcessor<K, V, T>> map,
+        Object... args) throws IgniteCheckedException {
+        return invokeAllAsync(map, args).get();
+    }
+
+    /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
     @Override public <T> IgniteFuture<Map<K, EntryProcessorResult<T>>>
invokeAllAsync(
         Map<? extends K, ? extends EntryProcessor<K, V, T>> map,

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/180720f1/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoadCacheUpdaters.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoadCacheUpdaters.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoadCacheUpdaters.java
index 1b8f24a..5341b1c 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoadCacheUpdaters.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoadCacheUpdaters.java
@@ -270,17 +270,12 @@ public class GridDataLoadCacheUpdaters {
                 Integer part = e.getKey();
                 int cnt = e.getValue();
 
-                IgniteTx tx = txs.txStartPartition(cache.getName(), part, PESSIMISTIC, REPEATABLE_READ,
0, cnt);
-
-                try {
+                try (IgniteTx tx = txs.txStartPartition(cache.getName(), part, PESSIMISTIC,
REPEATABLE_READ, 0, cnt)) {
                     updateAll(cache, rmvPartMap == null ? null : rmvPartMap.get(part),
                         putPartMap == null ? null : putPartMap.get(part));
 
                     tx.commit();
                 }
-                finally {
-                    tx.close();
-                }
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/180720f1/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAtomicPrimaryWriteOrderWithStoreInvokeTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAtomicPrimaryWriteOrderWithStoreInvokeTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAtomicPrimaryWriteOrderWithStoreInvokeTest.java
index a674d76..5fa85e3 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAtomicPrimaryWriteOrderWithStoreInvokeTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAtomicPrimaryWriteOrderWithStoreInvokeTest.java
@@ -18,6 +18,6 @@ public class IgniteCacheAtomicPrimaryWriteOrderWithStoreInvokeTest extends
     IgniteCacheAtomicPrimaryWriteOrderInvokeTest {
     /** {@inheritDoc} */
     @Override protected GridCacheStore<?, ?> cacheStore() {
-        return new TestStore();
+        return new IgniteCacheAbstractTest.TestStore();
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/180720f1/modules/web/src/main/java/org/gridgain/grid/cache/websession/GridWebSessionListener.java
----------------------------------------------------------------------
diff --git a/modules/web/src/main/java/org/gridgain/grid/cache/websession/GridWebSessionListener.java
b/modules/web/src/main/java/org/gridgain/grid/cache/websession/GridWebSessionListener.java
index 03a47f4..ff0c738 100644
--- a/modules/web/src/main/java/org/gridgain/grid/cache/websession/GridWebSessionListener.java
+++ b/modules/web/src/main/java/org/gridgain/grid/cache/websession/GridWebSessionListener.java
@@ -11,10 +11,8 @@ package org.gridgain.grid.cache.websession;
 
 import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
-import org.gridgain.grid.cache.*;
 import org.gridgain.grid.util.typedef.*;
 import org.gridgain.grid.util.typedef.internal.*;
-import org.jetbrains.annotations.*;
 
 import javax.cache.*;
 import javax.cache.expiry.*;


Mime
View raw message