You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by av...@apache.org on 2018/06/22 14:37:02 UTC
ignite git commit: IGNITE-8709
CacheMBStatisticsBeanTest.testPutIfAbsent failed
Repository: ignite
Updated Branches:
refs/heads/master 2dca70dc1 -> ea05dc509
IGNITE-8709 CacheMBStatisticsBeanTest.testPutIfAbsent failed
Signed-off-by: Anton Vinogradov <av...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ea05dc50
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ea05dc50
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ea05dc50
Branch: refs/heads/master
Commit: ea05dc509f8afafc07c565807fa6f2ffff56b91e
Parents: 2dca70d
Author: Alexander Menshikov <sh...@gmail.com>
Authored: Fri Jun 22 17:36:51 2018 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Fri Jun 22 17:36:51 2018 +0300
----------------------------------------------------------------------
.../internal/processors/cache/GridCacheMapEntry.java | 12 +++---------
...ridCacheAtomicPartitionedTckMetricsSelfTestImpl.java | 4 ++++
.../GridCacheAtomicLocalTckMetricsSelfTestImpl.java | 4 ++++
3 files changed, 11 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/ea05dc50/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index faf4460..cd984bd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
@@ -1434,11 +1434,8 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
}
// Apply metrics.
- if (metrics && cctx.statisticsEnabled() && needVal) {
- // PutIfAbsent methods mustn't update hit/miss statistics
- if (op != GridCacheOperation.UPDATE || F.isEmpty(filter) || !cctx.putIfAbsentFilter(filter))
- cctx.cache().metrics0().onRead(old != null);
- }
+ if (metrics && cctx.statisticsEnabled() && needVal)
+ cctx.cache().metrics0().onRead(old != null);
// Check filter inside of synchronization.
if (!F.isEmpty(filter)) {
@@ -1769,11 +1766,8 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
if (metrics &&
updateRes.outcome().updateReadMetrics() &&
cctx.statisticsEnabled() &&
- needVal) {
- // PutIfAbsent methods must not update hit/miss statistics.
- if (op != GridCacheOperation.UPDATE || F.isEmpty(filter) || !cctx.putIfAbsentFilter(filter))
+ needVal)
cctx.cache().metrics0().onRead(oldVal != null);
- }
switch (updateRes.outcome()) {
case VERSION_CHECK_FAILED: {
http://git-wip-us.apache.org/repos/asf/ignite/blob/ea05dc50/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPartitionedTckMetricsSelfTestImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPartitionedTckMetricsSelfTestImpl.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPartitionedTckMetricsSelfTestImpl.java
index 7f59079..da0c7a9 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPartitionedTckMetricsSelfTestImpl.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPartitionedTckMetricsSelfTestImpl.java
@@ -168,6 +168,8 @@ public class GridCacheAtomicPartitionedTckMetricsSelfTestImpl extends GridCacheA
boolean result = cache.putIfAbsent(1, 1);
++putCount;
+ ++missCount;
+
assertTrue(result);
assertEquals(missCount, cache.localMetrics().getCacheMisses());
@@ -175,6 +177,8 @@ public class GridCacheAtomicPartitionedTckMetricsSelfTestImpl extends GridCacheA
assertEquals(putCount, cache.localMetrics().getCachePuts());
result = cache.putIfAbsent(1, 1);
+
+ ++hitCount;
cache.containsKey(123);
http://git-wip-us.apache.org/repos/asf/ignite/blob/ea05dc50/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheAtomicLocalTckMetricsSelfTestImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheAtomicLocalTckMetricsSelfTestImpl.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheAtomicLocalTckMetricsSelfTestImpl.java
index 1f42a6f..23e7a8b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheAtomicLocalTckMetricsSelfTestImpl.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheAtomicLocalTckMetricsSelfTestImpl.java
@@ -163,6 +163,8 @@ public class GridCacheAtomicLocalTckMetricsSelfTestImpl extends GridCacheAtomicL
boolean result = cache.putIfAbsent(1, 1);
++putCount;
+ ++missCount;
+
assertTrue(result);
assertEquals(missCount, cache.localMetrics().getCacheMisses());
@@ -171,6 +173,8 @@ public class GridCacheAtomicLocalTckMetricsSelfTestImpl extends GridCacheAtomicL
result = cache.putIfAbsent(1, 1);
+ ++hitCount;
+
assertFalse(result);
assertEquals(hitCount, cache.localMetrics().getCacheHits());
assertEquals(putCount, cache.localMetrics().getCachePuts());