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 2016/01/18 12:11:58 UTC

[1/2] ignite git commit: ignite-1811 Sync get for atomic cache.

Repository: ignite
Updated Branches:
  refs/heads/ignite-1811 8611ed403 -> d41a79fa2


ignite-1811 Sync get for atomic cache.


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

Branch: refs/heads/ignite-1811
Commit: 32a167813511d9cf17eabc26d662f00b85e7148a
Parents: e81f4c4
Author: sboikov <sb...@gridgain.com>
Authored: Mon Jan 18 14:11:04 2016 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Jan 18 14:11:04 2016 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheAdapter.java      | 30 ++++++++++++++++++--
 .../dht/atomic/GridDhtAtomicCache.java          | 26 +++++++++++++++++
 2 files changed, 53 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/32a16781/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 5d4c386..2582e6c 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
@@ -4540,9 +4540,33 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
      * @return Cached value.
      * @throws IgniteCheckedException If failed.
      */
-    @Nullable public V get(K key, boolean deserializeBinary)
-        throws IgniteCheckedException {
-        return getAsync(key, deserializeBinary).get();
+    @Nullable public V get(K key, boolean deserializeBinary) throws IgniteCheckedException {
+        checkJta();
+
+        String taskName = ctx.kernalContext().job().currentTaskName();
+
+        return get(key, taskName, deserializeBinary);
+    }
+
+    /**
+     * @param key Key.
+     * @param taskName Task name.
+     * @param deserializeBinary Deserialize binary flag.
+     * @return Cached value.
+     * @throws IgniteCheckedException If failed.
+     */
+    protected V get(
+        final K key,
+        String taskName,
+        boolean deserializeBinary) throws IgniteCheckedException {
+        return getAsync(key,
+            !ctx.config().isReadFromBackup(),
+            /*skip tx*/false,
+            null,
+            taskName,
+            deserializeBinary,
+            false,
+            /*can remap*/true).get();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/32a16781/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index 393413e..81fd5d6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -317,6 +317,32 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
     }
 
     /** {@inheritDoc} */
+    @Override protected V get(K key, String taskName, boolean deserializeBinary) throws IgniteCheckedException {
+        ctx.checkSecurity(SecurityPermission.CACHE_READ);
+
+        if (keyCheck)
+            validateCacheKey(key);
+
+        CacheOperationContext opCtx = ctx.operationContextPerCall();
+
+        UUID subjId = ctx.subjectIdPerCall(null, opCtx);
+
+        final ExpiryPolicy expiryPlc = opCtx != null ? opCtx.expiry() : null;
+
+        final boolean skipStore = opCtx != null && opCtx.skipStore();
+
+        return getAsync0(ctx.toCacheKeyObject(key),
+            !ctx.config().isReadFromBackup(),
+            subjId,
+            taskName,
+            deserializeBinary,
+            expiryPlc,
+            false,
+            skipStore,
+            true).get();
+    }
+
+    /** {@inheritDoc} */
     @Override protected IgniteInternalFuture<V> getAsync(final K key,
         final boolean forcePrimary,
         final boolean skipTx,


[2/2] ignite git commit: Merge remote-tracking branch 'origin/ignite-1811' into ignite-1811

Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/ignite-1811' into ignite-1811


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

Branch: refs/heads/ignite-1811
Commit: d41a79fa2fa379ca43ac0e80be3ba097e2ce8322
Parents: 32a1678 8611ed4
Author: sboikov <sb...@gridgain.com>
Authored: Mon Jan 18 14:11:53 2016 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Jan 18 14:11:53 2016 +0300

----------------------------------------------------------------------
 .../processors/cache/IgniteCacheStoreCollectionTest.java      | 4 ++++
 .../distributed/GridCachePartitionNotLoadedEventSelfTest.java | 7 +++++--
 2 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------