This is an automated email from the ASF dual-hosted git repository.
agura pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/master by this push:
new 06c8a51 IGNITE-12336 Fixed creation of redundant CacheMetricsImpl
instance in case of near cache is configured
06c8a51 is described below
commit 06c8a51f2acdf12088738d0468af94cde6bf611f
Author: Andrey Gura <[email protected]>
AuthorDate: Tue Oct 29 16:53:37 2019 +0300
IGNITE-12336 Fixed creation of redundant CacheMetricsImpl instance in case
of near cache is configured
---
.../internal/processors/cache/distributed/dht/GridDhtCache.java | 7 ++-----
.../cache/distributed/dht/atomic/GridDhtAtomicCache.java | 7 ++-----
2 files changed, 4 insertions(+), 10 deletions(-)
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCache.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCache.java
index a60bb2a..7889163 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCache.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCache.java
@@ -19,7 +19,6 @@ package
org.apache.ignite.internal.processors.cache.distributed.dht;
import java.io.Externalizable;
import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.internal.processors.cache.CacheMetricsImpl;
import org.apache.ignite.internal.processors.cache.GridCacheConcurrentMap;
import org.apache.ignite.internal.processors.cache.GridCacheContext;
import
org.apache.ignite.internal.processors.cache.distributed.near.GridNearTransactionalCache;
@@ -72,11 +71,9 @@ public class GridDhtCache<K, V> extends
GridDhtTransactionalCacheAdapter<K, V> {
/** {@inheritDoc} */
@Override public void start() throws IgniteCheckedException {
- CacheMetricsImpl m = new CacheMetricsImpl(ctx);
+ assert metrics != null : "Cache metrics instance isn't initialized.";
- m.delegate(ctx.dht().near().metrics0());
-
- metrics = m;
+ metrics.delegate(ctx.dht().near().metrics0());
ctx.dr().resetMetrics();
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 926530d..c944862 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
@@ -49,7 +49,6 @@ import
org.apache.ignite.internal.processors.cache.CacheEntryPredicate;
import org.apache.ignite.internal.processors.cache.CacheInvokeEntry;
import org.apache.ignite.internal.processors.cache.CacheInvokeResult;
import org.apache.ignite.internal.processors.cache.CacheLazyEntry;
-import org.apache.ignite.internal.processors.cache.CacheMetricsImpl;
import org.apache.ignite.internal.processors.cache.CacheObject;
import org.apache.ignite.internal.processors.cache.CacheOperationContext;
import org.apache.ignite.internal.processors.cache.CacheStoppedException;
@@ -230,12 +229,10 @@ public class GridDhtAtomicCache<K, V> extends
GridDhtCacheAdapter<K, V> {
@Override public void start() throws IgniteCheckedException {
super.start();
- CacheMetricsImpl m = new CacheMetricsImpl(ctx);
+ assert metrics != null : "Cache metrics instance isn't initialized.";
if (ctx.dht().near() != null)
- m.delegate(ctx.dht().near().metrics0());
-
- metrics = m;
+ metrics.delegate(ctx.dht().near().metrics0());
ctx.io().addCacheHandler(
ctx.cacheId(),