ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [15/50] [abbrv] incubator-ignite git commit: #ignite-683: Add parameter enableStat to putx function in GridCacheAdapter.
Date Tue, 14 Apr 2015 14:25:31 GMT
#ignite-683: Add parameter enableStat to putx function in GridCacheAdapter.


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

Branch: refs/heads/ignite-218
Commit: bc9ae9552f869fd3c5edd54b638bd94b001441be
Parents: 4ca07ba
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Mon Apr 13 12:24:26 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Mon Apr 13 12:24:26 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/processors/cache/GridCacheAdapter.java   | 8 +++++---
 .../cache/distributed/dht/atomic/GridDhtAtomicCache.java     | 3 +--
 .../cache/distributed/near/GridNearAtomicCache.java          | 4 ++--
 .../processors/cache/local/atomic/GridLocalAtomicCache.java  | 8 ++++----
 4 files changed, 12 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc9ae955/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 d07a83c..28e4576 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
@@ -2069,20 +2069,22 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
 
     /** {@inheritDoc} */
     @Override public boolean putx(final K key, final V val) throws IgniteCheckedException
{
-        return putx(key, val, CU.empty0());
+        return putx(key, val, CU.empty0(), true);
     }
 
     /**
      * @param key Key.
      * @param val Value.
      * @param filter Filter.
+     * @param enableStat Write statistics.
      * @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();
+    public boolean putx(final K key, final V val, final CacheEntryPredicate[] filter, boolean
enableStat)
+        throws IgniteCheckedException {
+        boolean statsEnabled = ctx.config().isStatisticsEnabled() && enableStat;
 
         long start = statsEnabled ? System.nanoTime() : 0L;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc9ae955/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 dfac7f4..bc6792e 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
@@ -42,7 +42,6 @@ import org.apache.ignite.transactions.*;
 import org.jetbrains.annotations.*;
 import org.jsr166.*;
 
-import javax.cache.*;
 import javax.cache.expiry.*;
 import javax.cache.processor.*;
 import java.io.*;
@@ -302,7 +301,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
 
     /** {@inheritDoc} */
     @Override public boolean putx(K key, V val,
-        CacheEntryPredicate[] filter) throws IgniteCheckedException {
+        CacheEntryPredicate[] filter, boolean enableStat) throws IgniteCheckedException {
         return putxAsync(key, val, filter).get();
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc9ae955/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 f6211c0..219de5d 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
@@ -400,8 +400,8 @@ public class GridNearAtomicCache<K, V> extends GridNearCacheAdapter<K,
V> {
     /** {@inheritDoc} */
     @Override public boolean putx(K key,
         V val,
-        CacheEntryPredicate[] filter) throws IgniteCheckedException {
-        return dht.putx(key, val, filter);
+        CacheEntryPredicate[] filter, boolean enableStat) throws IgniteCheckedException {
+        return dht.putx(key, val, filter, true);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc9ae955/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 12bce3a..2d53f74 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
@@ -133,7 +133,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K,
V> {
     /** {@inheritDoc} */
     @Override public boolean putx(K key,
         V val,
-        CacheEntryPredicate[] filter) throws IgniteCheckedException {
+        CacheEntryPredicate[] filter, boolean enableStat) throws IgniteCheckedException {
         A.notNull(key, "key", val, "val");
 
         return (Boolean)updateAllInternal(UPDATE,
@@ -186,7 +186,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K,
V> {
 
     /** {@inheritDoc} */
     @Override public boolean putxIfAbsent(K key, V val) throws IgniteCheckedException {
-        return putx(key, val, ctx.noValArray());
+        return putx(key, val, ctx.noValArray(), true);
     }
 
     /** {@inheritDoc} */
@@ -207,7 +207,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K,
V> {
 
     /** {@inheritDoc} */
     @Override public boolean replacex(K key, V val) throws IgniteCheckedException {
-        return putx(key, val, ctx.hasValArray());
+        return putx(key, val, ctx.hasValArray(), true);
     }
 
     /** {@inheritDoc} */
@@ -219,7 +219,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K,
V> {
     @Override public boolean replace(K key, V oldVal, V newVal) throws IgniteCheckedException
{
         A.notNull(oldVal, "oldVal");
 
-        return putx(key, newVal, ctx.equalsValArray(oldVal));
+        return putx(key, newVal, ctx.equalsValArray(oldVal), true);
     }
 
     /** {@inheritDoc} */


Mime
View raw message