You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by nt...@apache.org on 2016/03/29 11:28:55 UTC
[1/8] ignite git commit: Divide test suite.
Repository: ignite
Updated Branches:
refs/heads/ignite-2630 8a9a048c9 -> 2586dbb69
Divide test suite.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/7a5024cb
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/7a5024cb
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/7a5024cb
Branch: refs/heads/ignite-2630
Commit: 7a5024cb47938932739d8cc469c61ae05621ab04
Parents: 35fd10d
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Mon Mar 28 16:59:56 2016 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Mon Mar 28 17:04:42 2016 +0300
----------------------------------------------------------------------
...acheContinuousQueryRandomOperationsTest.java | 8 ++--
.../IgniteBinaryCacheQueryTestSuite4.java | 39 ++++++++++++++++
.../IgniteCacheQuerySelfTestSuite3.java | 22 ---------
.../IgniteCacheQuerySelfTestSuite4.java | 49 ++++++++++++++++++++
4 files changed, 92 insertions(+), 26 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/7a5024cb/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryRandomOperationsTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryRandomOperationsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryRandomOperationsTest.java
index b1316ab..e9fbf70 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryRandomOperationsTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryRandomOperationsTest.java
@@ -146,13 +146,13 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
* @throws Exception If failed.
*/
public void testFilterAndFactoryProvided() throws Exception {
- CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
+ final CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
1,
ATOMIC,
ONHEAP_TIERED,
false);
- final IgniteCache<Object, Object> cache = grid(0).getOrCreateCache(ccfg);
+ grid(0).createCache(ccfg);
try {
final ContinuousQuery qry = new ContinuousQuery();
@@ -177,13 +177,13 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract
GridTestUtils.assertThrows(log, new Callable<Object>() {
@Override public Object call() throws Exception {
- return cache.query(qry);
+ return grid(0).cache(ccfg.getName()).query(qry);
}
}, IgniteException.class, null);
}
finally {
- cache.destroy();
+ grid(0).destroyCache(ccfg.getName());
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/7a5024cb/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite4.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite4.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite4.java
new file mode 100644
index 0000000..32a693f
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite4.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.testsuites;
+
+import junit.framework.TestSuite;
+import org.apache.ignite.internal.binary.BinaryMarshaller;
+import org.apache.ignite.testframework.config.GridTestProperties;
+
+/**
+ * Cache query suite with binary marshaller.
+ */
+public class IgniteBinaryCacheQueryTestSuite4 extends TestSuite {
+ /**
+ * @return Suite.
+ * @throws Exception In case of error.
+ */
+ public static TestSuite suite() throws Exception {
+ GridTestProperties.setProperty(GridTestProperties.MARSH_CLASS_NAME, BinaryMarshaller.class.getName());
+
+ TestSuite suite = IgniteCacheQuerySelfTestSuite4.suite();
+
+ return suite;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/7a5024cb/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite3.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite3.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite3.java
index b2cb50b..73c856b 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite3.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite3.java
@@ -20,17 +20,7 @@ package org.apache.ignite.testsuites;
import junit.framework.TestSuite;
import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousBatchAckTest;
import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousBatchForceServerModeAckTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryCounterPartitionedAtomicTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryCounterPartitionedTxTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryCounterReplicatedAtomicTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryCounterReplicatedTxTest;
import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFactoryFilterTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverAtomicPrimaryWriteOrderOffheapTieredTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverAtomicPrimaryWriteOrderSelfTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverAtomicReplicatedSelfTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverTxOffheapTieredTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverTxReplicatedSelfTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverTxSelfTest;
import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryOperationP2PTest;
import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryRandomOperationsTest;
import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryRandomOperationsTwoNodesTest;
@@ -58,7 +48,6 @@ import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheCon
import org.apache.ignite.internal.processors.cache.query.continuous.IgniteCacheContinuousQueryClientReconnectTest;
import org.apache.ignite.internal.processors.cache.query.continuous.IgniteCacheContinuousQueryClientTest;
import org.apache.ignite.internal.processors.cache.query.continuous.IgniteCacheContinuousQueryClientTxReconnectTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.IgniteCacheContinuousQueryReconnectTest;
/**
* Test suite for cache queries.
@@ -93,19 +82,8 @@ public class IgniteCacheQuerySelfTestSuite3 extends TestSuite {
suite.addTestSuite(GridCacheContinuousQueryPartitionTxOneNodeTest.class);
suite.addTestSuite(GridCacheContinuousQueryPartitionAtomicOneNodeTest.class);
suite.addTestSuite(IgniteCacheContinuousQueryClientTest.class);
- suite.addTestSuite(IgniteCacheContinuousQueryReconnectTest.class);
suite.addTestSuite(IgniteCacheContinuousQueryClientReconnectTest.class);
suite.addTestSuite(IgniteCacheContinuousQueryClientTxReconnectTest.class);
- suite.addTestSuite(CacheContinuousQueryFailoverAtomicPrimaryWriteOrderSelfTest.class);
- suite.addTestSuite(CacheContinuousQueryFailoverAtomicReplicatedSelfTest.class);
- suite.addTestSuite(CacheContinuousQueryFailoverTxSelfTest.class);
- suite.addTestSuite(CacheContinuousQueryFailoverTxReplicatedSelfTest.class);
- suite.addTestSuite(CacheContinuousQueryCounterPartitionedAtomicTest.class);
- suite.addTestSuite(CacheContinuousQueryCounterPartitionedTxTest.class);
- suite.addTestSuite(CacheContinuousQueryCounterReplicatedAtomicTest.class);
- suite.addTestSuite(CacheContinuousQueryCounterReplicatedTxTest.class);
- suite.addTestSuite(CacheContinuousQueryFailoverAtomicPrimaryWriteOrderOffheapTieredTest.class);
- suite.addTestSuite(CacheContinuousQueryFailoverTxOffheapTieredTest.class);
suite.addTestSuite(CacheContinuousQueryRandomOperationsTest.class);
suite.addTestSuite(CacheContinuousQueryRandomOperationsTwoNodesTest.class);
suite.addTestSuite(CacheContinuousQueryFactoryFilterTest.class);
http://git-wip-us.apache.org/repos/asf/ignite/blob/7a5024cb/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite4.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite4.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite4.java
new file mode 100644
index 0000000..fa4e642
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite4.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.testsuites;
+
+import junit.framework.TestSuite;
+import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverAtomicPrimaryWriteOrderOffheapTieredTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverAtomicPrimaryWriteOrderSelfTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverAtomicReplicatedSelfTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverTxOffheapTieredTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverTxReplicatedSelfTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryFailoverTxSelfTest;
+
+/**
+ * Test suite for cache queries.
+ */
+public class IgniteCacheQuerySelfTestSuite4 extends TestSuite {
+ /**
+ * @return Test suite.
+ * @throws Exception If failed.
+ */
+ public static TestSuite suite() throws Exception {
+ TestSuite suite = new TestSuite("Ignite Cache Queries Test Suite 4");
+
+ // Continuous queries failover tests.
+ suite.addTestSuite(CacheContinuousQueryFailoverAtomicPrimaryWriteOrderSelfTest.class);
+ suite.addTestSuite(CacheContinuousQueryFailoverAtomicReplicatedSelfTest.class);
+ suite.addTestSuite(CacheContinuousQueryFailoverTxSelfTest.class);
+ suite.addTestSuite(CacheContinuousQueryFailoverTxReplicatedSelfTest.class);
+ suite.addTestSuite(CacheContinuousQueryFailoverAtomicPrimaryWriteOrderOffheapTieredTest.class);
+ suite.addTestSuite(CacheContinuousQueryFailoverTxOffheapTieredTest.class);
+
+ return suite;
+ }
+}
[6/8] ignite git commit: IGNITE-2900: CPP: Fixed metadata write
routine. This closes #581.
Posted by nt...@apache.org.
IGNITE-2900: CPP: Fixed metadata write routine. This closes #581.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/732abda9
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/732abda9
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/732abda9
Branch: refs/heads/ignite-2630
Commit: 732abda9ed471ae7c8b80da7676838709ed3dc2b
Parents: fc34e51
Author: isapego <is...@gridgain.com>
Authored: Tue Mar 29 10:06:04 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Tue Mar 29 10:06:04 2016 +0300
----------------------------------------------------------------------
.../cpp/core/src/impl/binary/binary_type_updater_impl.cpp | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/732abda9/modules/platforms/cpp/core/src/impl/binary/binary_type_updater_impl.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/src/impl/binary/binary_type_updater_impl.cpp b/modules/platforms/cpp/core/src/impl/binary/binary_type_updater_impl.cpp
index 6c3bf7f..aedd73b 100644
--- a/modules/platforms/cpp/core/src/impl/binary/binary_type_updater_impl.cpp
+++ b/modules/platforms/cpp/core/src/impl/binary/binary_type_updater_impl.cpp
@@ -80,6 +80,8 @@ namespace ignite
rawWriter.WriteBool(false); // Enums are not supported for now.
+ rawWriter.WriteInt32(0); // Schema size. Compact schema footer is not yet supported.
+
out.Synchronize();
long long res = env.Get()->Context()->TargetInStreamOutLong(javaRef, OP_METADATA, mem.Get()->PointerLong(), &jniErr);
[3/8] ignite git commit: IGNITE-1071 IgniteCache.metrics() method
returns local metrics
Posted by nt...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTransactionalAbstractMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTransactionalAbstractMetricsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTransactionalAbstractMetricsSelfTest.java
index 4bd4c59..b227364 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTransactionalAbstractMetricsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTransactionalAbstractMetricsSelfTest.java
@@ -231,7 +231,7 @@ public abstract class GridCacheTransactionalAbstractMetricsSelfTest extends Grid
for (int i = 0; i < gridCount(); i++) {
TransactionMetrics metrics = grid(i).transactions().metrics();
- CacheMetrics cacheMetrics = grid(i).cache(null).metrics();
+ CacheMetrics cacheMetrics = grid(i).cache(null).localMetrics();
if (i == 0) {
assertEquals(TX_CNT, metrics.txCommits());
@@ -276,7 +276,7 @@ public abstract class GridCacheTransactionalAbstractMetricsSelfTest extends Grid
for (int i = 0; i < gridCount(); i++) {
TransactionMetrics metrics = grid(i).transactions().metrics();
- CacheMetrics cacheMetrics = grid(i).cache(null).metrics();
+ CacheMetrics cacheMetrics = grid(i).cache(null).localMetrics();
assertEquals(0, metrics.txCommits());
assertEquals(0, cacheMetrics.getCacheTxCommits());
http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java
index 463c2c0..aa7f6fa 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java
@@ -476,7 +476,7 @@ public class GridCacheColocatedDebugTest extends GridCommonAbstractTest {
if (tx != null)
tx.commit();
- System.out.println(cache.metrics());
+ System.out.println(cache.localMetrics());
assertEquals("Hello", cache.get(1));
assertEquals("World", cache.get(2));
http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledMetricsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledMetricsSelfTest.java
index 3ace98d..16aa72d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledMetricsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledMetricsSelfTest.java
@@ -107,7 +107,7 @@ public class GridCachePartitionedNearDisabledMetricsSelfTest extends GridCacheAb
long misses = 0;
for (int i = 0; i < gridCount(); i++) {
- CacheMetrics m = grid(i).cache(null).metrics();
+ CacheMetrics m = grid(i).cache(null).localMetrics();
removes += m.getCacheRemovals();
reads += m.getCacheGets();
http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/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 d94fe68..9e4be22 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
@@ -50,19 +50,19 @@ public class GridCacheAtomicPartitionedTckMetricsSelfTestImpl extends GridCacheA
}
});
- assertEquals(1L, cache.metrics().getCachePuts());
+ assertEquals(1L, cache.localMetrics().getCachePuts());
assertEquals(20, result);
- assertEquals(1L, cache.metrics().getCacheHits());
- assertEquals(100.0f, cache.metrics().getCacheHitPercentage());
- assertEquals(0L, cache.metrics().getCacheMisses());
- assertEquals(0f, cache.metrics().getCacheMissPercentage());
- assertEquals(1L, cache.metrics().getCachePuts());
- assertEquals(1L, cache.metrics().getCacheRemovals());
- assertEquals(0L, cache.metrics().getCacheEvictions());
- assert cache.metrics().getAveragePutTime() >= 0;
- assert cache.metrics().getAverageGetTime() >= 0;
- assert cache.metrics().getAverageRemoveTime() >= 0;
+ assertEquals(1L, cache.localMetrics().getCacheHits());
+ assertEquals(100.0f, cache.localMetrics().getCacheHitPercentage());
+ assertEquals(0L, cache.localMetrics().getCacheMisses());
+ assertEquals(0f, cache.localMetrics().getCacheMissPercentage());
+ assertEquals(1L, cache.localMetrics().getCachePuts());
+ assertEquals(1L, cache.localMetrics().getCacheRemovals());
+ assertEquals(0L, cache.localMetrics().getCacheEvictions());
+ assert cache.localMetrics().getAveragePutTime() >= 0;
+ assert cache.localMetrics().getAverageGetTime() >= 0;
+ assert cache.localMetrics().getAverageRemoveTime() >= 0;
}
/**
@@ -73,36 +73,36 @@ public class GridCacheAtomicPartitionedTckMetricsSelfTestImpl extends GridCacheA
cache.put(1, 10);
- assertEquals(0, cache.metrics().getCacheRemovals());
- assertEquals(1, cache.metrics().getCachePuts());
+ assertEquals(0, cache.localMetrics().getCacheRemovals());
+ assertEquals(1, cache.localMetrics().getCachePuts());
cache.remove(1);
- assertEquals(0, cache.metrics().getCacheHits());
- assertEquals(1, cache.metrics().getCacheRemovals());
- assertEquals(1, cache.metrics().getCachePuts());
+ assertEquals(0, cache.localMetrics().getCacheHits());
+ assertEquals(1, cache.localMetrics().getCacheRemovals());
+ assertEquals(1, cache.localMetrics().getCachePuts());
cache.remove(1);
- assertEquals(0, cache.metrics().getCacheHits());
- assertEquals(0, cache.metrics().getCacheMisses());
- assertEquals(1, cache.metrics().getCacheRemovals());
- assertEquals(1, cache.metrics().getCachePuts());
+ assertEquals(0, cache.localMetrics().getCacheHits());
+ assertEquals(0, cache.localMetrics().getCacheMisses());
+ assertEquals(1, cache.localMetrics().getCacheRemovals());
+ assertEquals(1, cache.localMetrics().getCachePuts());
cache.put(1, 10);
assertTrue(cache.remove(1, 10));
- assertEquals(1, cache.metrics().getCacheHits());
- assertEquals(0, cache.metrics().getCacheMisses());
- assertEquals(2, cache.metrics().getCacheRemovals());
- assertEquals(2, cache.metrics().getCachePuts());
+ assertEquals(1, cache.localMetrics().getCacheHits());
+ assertEquals(0, cache.localMetrics().getCacheMisses());
+ assertEquals(2, cache.localMetrics().getCacheRemovals());
+ assertEquals(2, cache.localMetrics().getCachePuts());
assertFalse(cache.remove(1, 10));
- assertEquals(1, cache.metrics().getCacheHits());
- assertEquals(1, cache.metrics().getCacheMisses());
- assertEquals(2, cache.metrics().getCacheRemovals());
- assertEquals(2, cache.metrics().getCachePuts());
+ assertEquals(1, cache.localMetrics().getCacheHits());
+ assertEquals(1, cache.localMetrics().getCacheMisses());
+ assertEquals(2, cache.localMetrics().getCacheRemovals());
+ assertEquals(2, cache.localMetrics().getCachePuts());
}
/**
@@ -120,18 +120,18 @@ public class GridCacheAtomicPartitionedTckMetricsSelfTestImpl extends GridCacheA
++missCount;
assertFalse(result);
- assertEquals(missCount, cache.metrics().getCacheMisses());
- assertEquals(hitCount, cache.metrics().getCacheHits());
- assertEquals(putCount, cache.metrics().getCachePuts());
+ assertEquals(missCount, cache.localMetrics().getCacheMisses());
+ assertEquals(hitCount, cache.localMetrics().getCacheHits());
+ assertEquals(putCount, cache.localMetrics().getCachePuts());
assertNull(cache.localPeek(1));
cache.put(1, 10);
++putCount;
- assertEquals(missCount, cache.metrics().getCacheMisses());
- assertEquals(hitCount, cache.metrics().getCacheHits());
- assertEquals(putCount, cache.metrics().getCachePuts());
+ assertEquals(missCount, cache.localMetrics().getCacheMisses());
+ assertEquals(hitCount, cache.localMetrics().getCacheHits());
+ assertEquals(putCount, cache.localMetrics().getCachePuts());
assertNotNull(cache.localPeek(1));
@@ -141,18 +141,18 @@ public class GridCacheAtomicPartitionedTckMetricsSelfTestImpl extends GridCacheA
++hitCount;
++putCount;
- assertEquals(missCount, cache.metrics().getCacheMisses());
- assertEquals(hitCount, cache.metrics().getCacheHits());
- assertEquals(putCount, cache.metrics().getCachePuts());
+ assertEquals(missCount, cache.localMetrics().getCacheMisses());
+ assertEquals(hitCount, cache.localMetrics().getCacheHits());
+ assertEquals(putCount, cache.localMetrics().getCachePuts());
result = cache.replace(1, 40, 50);
assertFalse(result);
++hitCount;
- assertEquals(hitCount, cache.metrics().getCacheHits());
- assertEquals(putCount, cache.metrics().getCachePuts());
- assertEquals(missCount, cache.metrics().getCacheMisses());
+ assertEquals(hitCount, cache.localMetrics().getCacheHits());
+ assertEquals(putCount, cache.localMetrics().getCachePuts());
+ assertEquals(missCount, cache.localMetrics().getCacheMisses());
}
/**
@@ -170,17 +170,17 @@ public class GridCacheAtomicPartitionedTckMetricsSelfTestImpl extends GridCacheA
++putCount;
assertTrue(result);
- assertEquals(missCount, cache.metrics().getCacheMisses());
- assertEquals(hitCount, cache.metrics().getCacheHits());
- assertEquals(putCount, cache.metrics().getCachePuts());
+ assertEquals(missCount, cache.localMetrics().getCacheMisses());
+ assertEquals(hitCount, cache.localMetrics().getCacheHits());
+ assertEquals(putCount, cache.localMetrics().getCachePuts());
result = cache.putIfAbsent(1, 1);
cache.containsKey(123);
assertFalse(result);
- assertEquals(hitCount, cache.metrics().getCacheHits());
- assertEquals(putCount, cache.metrics().getCachePuts());
- assertEquals(missCount, cache.metrics().getCacheMisses());
+ assertEquals(hitCount, cache.localMetrics().getCacheHits());
+ assertEquals(putCount, cache.localMetrics().getCachePuts());
+ assertEquals(missCount, cache.localMetrics().getCacheMisses());
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearMetricsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearMetricsSelfTest.java
index 01ed157..09ff519 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearMetricsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearMetricsSelfTest.java
@@ -72,7 +72,7 @@ public class GridCacheNearMetricsSelfTest extends GridCacheAbstractSelfTest {
assert g.cache(null).localSize() == 0;
- g.cache(null).mxBean().clear();
+ g.cache(null).localMxBean().clear();
}
}
@@ -116,8 +116,8 @@ public class GridCacheNearMetricsSelfTest extends GridCacheAbstractSelfTest {
key = i;
- info("Puts: " + cache0.metrics().getCachePuts());
- info("Reads: " + cache0.metrics().getCacheGets());
+ info("Puts: " + cache0.localMetrics().getCachePuts());
+ info("Reads: " + cache0.localMetrics().getCacheGets());
info("Affinity nodes: " + U.nodes2names(affinity(cache0).mapKeyToPrimaryAndBackups(i)));
break;
@@ -131,23 +131,23 @@ public class GridCacheNearMetricsSelfTest extends GridCacheAbstractSelfTest {
IgniteCache<Object, Object> jcache = g.cache(null);
- info("Puts: " + jcache.metrics().getCachePuts());
- info("Reads: " + jcache.metrics().getCacheGets());
+ info("Puts: " + jcache.localMetrics().getCachePuts());
+ info("Reads: " + jcache.localMetrics().getCacheGets());
if (affinity(jcache).isPrimaryOrBackup(g.cluster().localNode(), key))
- assertEquals(1, jcache.metrics().getCachePuts());
+ assertEquals(1, jcache.localMetrics().getCachePuts());
else
- assertEquals(0, jcache.metrics().getCachePuts());
+ assertEquals(0, jcache.localMetrics().getCachePuts());
if (affinity(jcache).isPrimary(g.cluster().localNode(), key)) {
- assertEquals(2, jcache.metrics().getCacheGets());
- assertEquals(1, jcache.metrics().getCacheHits());
- assertEquals(1, jcache.metrics().getCacheMisses());
+ assertEquals(2, jcache.localMetrics().getCacheGets());
+ assertEquals(1, jcache.localMetrics().getCacheHits());
+ assertEquals(1, jcache.localMetrics().getCacheMisses());
}
else {
- assertEquals(0, jcache.metrics().getCacheGets());
- assertEquals(0, jcache.metrics().getCacheHits());
- assertEquals(0, jcache.metrics().getCacheMisses());
+ assertEquals(0, jcache.localMetrics().getCacheGets());
+ assertEquals(0, jcache.localMetrics().getCacheHits());
+ assertEquals(0, jcache.localMetrics().getCacheMisses());
}
}
}
@@ -171,8 +171,8 @@ public class GridCacheNearMetricsSelfTest extends GridCacheAbstractSelfTest {
key = i;
- info("Puts: " + cache0.metrics().getCachePuts());
- info("Reads: " + cache0.metrics().getCacheGets());
+ info("Puts: " + cache0.localMetrics().getCachePuts());
+ info("Reads: " + cache0.localMetrics().getCacheGets());
info("Affinity nodes: " + U.nodes2names(affinity(cache0).mapKeyToPrimaryAndBackups(i)));
break;
@@ -184,24 +184,24 @@ public class GridCacheNearMetricsSelfTest extends GridCacheAbstractSelfTest {
IgniteCache<Object, Object> jcache = g.cache(null);
if (affinity(jcache).isPrimaryOrBackup(g.cluster().localNode(), key))
- assertEquals(1, jcache.metrics().getCachePuts());
+ assertEquals(1, jcache.localMetrics().getCachePuts());
else
- assertEquals(0, jcache.metrics().getCachePuts());
+ assertEquals(0, jcache.localMetrics().getCachePuts());
if (affinity(jcache).isPrimary(g.cluster().localNode(), key)) {
- assertEquals(1, jcache.metrics().getCacheGets());
- assertEquals(0, jcache.metrics().getCacheHits());
- assertEquals(1, jcache.metrics().getCacheMisses());
+ assertEquals(1, jcache.localMetrics().getCacheGets());
+ assertEquals(0, jcache.localMetrics().getCacheHits());
+ assertEquals(1, jcache.localMetrics().getCacheMisses());
}
else if (affinity(jcache).isBackup(g.cluster().localNode(), key)){
- assertEquals(1, jcache.metrics().getCacheGets());
- assertEquals(1, jcache.metrics().getCacheHits());
- assertEquals(0, jcache.metrics().getCacheMisses());
+ assertEquals(1, jcache.localMetrics().getCacheGets());
+ assertEquals(1, jcache.localMetrics().getCacheHits());
+ assertEquals(0, jcache.localMetrics().getCacheMisses());
}
else {
- assertEquals(0, jcache.metrics().getCacheGets());
- assertEquals(0, jcache.metrics().getCacheHits());
- assertEquals(0, jcache.metrics().getCacheMisses());
+ assertEquals(0, jcache.localMetrics().getCacheGets());
+ assertEquals(0, jcache.localMetrics().getCacheHits());
+ assertEquals(0, jcache.localMetrics().getCacheMisses());
}
}
}
@@ -225,8 +225,8 @@ public class GridCacheNearMetricsSelfTest extends GridCacheAbstractSelfTest {
key = i;
- info("Writes: " + cache0.metrics().getCachePuts());
- info("Reads: " + cache0.metrics().getCacheGets());
+ info("Writes: " + cache0.localMetrics().getCachePuts());
+ info("Reads: " + cache0.localMetrics().getCacheGets());
info("Affinity nodes: " + U.nodes2names(affinity(cache0).mapKeyToPrimaryAndBackups(i)));
break;
@@ -238,22 +238,22 @@ public class GridCacheNearMetricsSelfTest extends GridCacheAbstractSelfTest {
IgniteCache<Object, Object> jcache = g.cache(null);
- assertEquals(1, jcache.metrics().getCachePuts());
+ assertEquals(1, jcache.localMetrics().getCachePuts());
if (affinity(jcache).isPrimary(g.cluster().localNode(), key)) {
- assertEquals(1, jcache.metrics().getCacheGets());
- assertEquals(0, jcache.metrics().getCacheHits());
- assertEquals(1, jcache.metrics().getCacheMisses());
+ assertEquals(1, jcache.localMetrics().getCacheGets());
+ assertEquals(0, jcache.localMetrics().getCacheHits());
+ assertEquals(1, jcache.localMetrics().getCacheMisses());
}
else if (affinity(jcache).isBackup(g.cluster().localNode(), key)){
- assertEquals(0, jcache.metrics().getCacheGets());
- assertEquals(0, jcache.metrics().getCacheHits());
- assertEquals(0, jcache.metrics().getCacheMisses());
+ assertEquals(0, jcache.localMetrics().getCacheGets());
+ assertEquals(0, jcache.localMetrics().getCacheHits());
+ assertEquals(0, jcache.localMetrics().getCacheMisses());
}
else {
- assertEquals(1, jcache.metrics().getCacheGets());
- assertEquals(1, jcache.metrics().getCacheHits());
- assertEquals(0, jcache.metrics().getCacheMisses());
+ assertEquals(1, jcache.localMetrics().getCacheGets());
+ assertEquals(1, jcache.localMetrics().getCacheHits());
+ assertEquals(0, jcache.localMetrics().getCacheMisses());
}
}
}
@@ -275,14 +275,14 @@ public class GridCacheNearMetricsSelfTest extends GridCacheAbstractSelfTest {
key = i;
- info("Writes: " + cache0.metrics().getCachePuts());
- info("Reads: " + cache0.metrics().getCacheGets());
+ info("Writes: " + cache0.localMetrics().getCachePuts());
+ info("Reads: " + cache0.localMetrics().getCacheGets());
info("Affinity nodes: " + U.nodes2names(affinity(cache0).mapKeyToPrimaryAndBackups(i)));
cache0.get(i); // +1 read.
- info("Writes: " + cache0.metrics().getCachePuts());
- info("Reads: " + cache0.metrics().getCacheGets());
+ info("Writes: " + cache0.localMetrics().getCachePuts());
+ info("Reads: " + cache0.localMetrics().getCacheGets());
info("Affinity nodes: " + U.nodes2names(affinity(cache0).mapKeyToPrimaryAndBackups(i)));
break;
@@ -296,20 +296,20 @@ public class GridCacheNearMetricsSelfTest extends GridCacheAbstractSelfTest {
IgniteCache<Object, Object> jcache = g.cache(null);
- info("Writes: " + jcache.metrics().getCachePuts());
- info("Reads: " + jcache.metrics().getCacheGets());
+ info("Writes: " + jcache.localMetrics().getCachePuts());
+ info("Reads: " + jcache.localMetrics().getCacheGets());
- assertEquals(0, jcache.metrics().getCachePuts());
+ assertEquals(0, jcache.localMetrics().getCachePuts());
if (affinity(jcache).isPrimary(g.cluster().localNode(), key)) {
- assertEquals(2, jcache.metrics().getCacheGets());
- assertEquals(0, jcache.metrics().getCacheHits());
- assertEquals(2, jcache.metrics().getCacheMisses());
+ assertEquals(2, jcache.localMetrics().getCacheGets());
+ assertEquals(0, jcache.localMetrics().getCacheHits());
+ assertEquals(2, jcache.localMetrics().getCacheMisses());
}
else {
- assertEquals(0, jcache.metrics().getCacheGets());
- assertEquals(0, jcache.metrics().getCacheHits());
- assertEquals(0, jcache.metrics().getCacheMisses());
+ assertEquals(0, jcache.localMetrics().getCacheGets());
+ assertEquals(0, jcache.localMetrics().getCacheHits());
+ assertEquals(0, jcache.localMetrics().getCacheMisses());
}
}
}
@@ -331,14 +331,14 @@ public class GridCacheNearMetricsSelfTest extends GridCacheAbstractSelfTest {
key = i;
- info("Writes: " + cache0.metrics().getCachePuts());
- info("Reads: " + cache0.metrics().getCacheGets());
+ info("Writes: " + cache0.localMetrics().getCachePuts());
+ info("Reads: " + cache0.localMetrics().getCacheGets());
info("Affinity nodes: " + U.nodes2names(affinity(cache0).mapKeyToPrimaryAndBackups(i)));
cache0.get(i); // +1 read.
- info("Writes: " + cache0.metrics().getCachePuts());
- info("Reads: " + cache0.metrics().getCacheGets());
+ info("Writes: " + cache0.localMetrics().getCachePuts());
+ info("Reads: " + cache0.localMetrics().getCacheGets());
info("Affinity nodes: " + U.nodes2names(affinity(cache0).mapKeyToPrimaryAndBackups(i)));
break;
@@ -350,17 +350,17 @@ public class GridCacheNearMetricsSelfTest extends GridCacheAbstractSelfTest {
IgniteCache<Object, Object> jcache = g.cache(null);
- assertEquals(0, jcache.metrics().getCachePuts());
+ assertEquals(0, jcache.localMetrics().getCachePuts());
if (affinity(jcache).isPrimaryOrBackup(g.cluster().localNode(), key)) {
- assertEquals(2, jcache.metrics().getCacheGets());
- assertEquals(0, jcache.metrics().getCacheHits());
- assertEquals(2, jcache.metrics().getCacheMisses());
+ assertEquals(2, jcache.localMetrics().getCacheGets());
+ assertEquals(0, jcache.localMetrics().getCacheHits());
+ assertEquals(2, jcache.localMetrics().getCacheMisses());
}
else {
- assertEquals(0, jcache.metrics().getCacheGets());
- assertEquals(0, jcache.metrics().getCacheHits());
- assertEquals(0, jcache.metrics().getCacheMisses());
+ assertEquals(0, jcache.localMetrics().getCacheGets());
+ assertEquals(0, jcache.localMetrics().getCacheHits());
+ assertEquals(0, jcache.localMetrics().getCacheMisses());
}
}
}
@@ -383,10 +383,10 @@ public class GridCacheNearMetricsSelfTest extends GridCacheAbstractSelfTest {
key = i;
- info("Writes: " + cache0.metrics().getCachePuts());
- info("Reads: " + cache0.metrics().getCacheGets());
- info("Hits: " + cache0.metrics().getCacheHits());
- info("Misses: " + cache0.metrics().getCacheMisses());
+ info("Writes: " + cache0.localMetrics().getCachePuts());
+ info("Reads: " + cache0.localMetrics().getCacheGets());
+ info("Hits: " + cache0.localMetrics().getCacheHits());
+ info("Misses: " + cache0.localMetrics().getCacheMisses());
info("Affinity nodes: " + U.nodes2names(affinity(cache0).mapKeyToPrimaryAndBackups(i)));
break;
@@ -398,22 +398,22 @@ public class GridCacheNearMetricsSelfTest extends GridCacheAbstractSelfTest {
IgniteCache<Object, Object> jcache = g.cache(null);
- assertEquals(0, jcache.metrics().getCachePuts());
+ assertEquals(0, jcache.localMetrics().getCachePuts());
if (affinity(jcache).isPrimary(g.cluster().localNode(), key)) {
- assertEquals(2, jcache.metrics().getCacheGets());
- assertEquals(0, jcache.metrics().getCacheHits());
- assertEquals(2, jcache.metrics().getCacheMisses());
+ assertEquals(2, jcache.localMetrics().getCacheGets());
+ assertEquals(0, jcache.localMetrics().getCacheHits());
+ assertEquals(2, jcache.localMetrics().getCacheMisses());
}
else if (affinity(jcache).isBackup(g.cluster().localNode(), key)){
- assertEquals(0, jcache.metrics().getCacheGets());
- assertEquals(0, jcache.metrics().getCacheHits());
- assertEquals(0, jcache.metrics().getCacheMisses());
+ assertEquals(0, jcache.localMetrics().getCacheGets());
+ assertEquals(0, jcache.localMetrics().getCacheHits());
+ assertEquals(0, jcache.localMetrics().getCacheMisses());
}
else {
- assertEquals(2, jcache.metrics().getCacheGets());
- assertEquals(0, jcache.metrics().getCacheHits());
- assertEquals(2, jcache.metrics().getCacheMisses());
+ assertEquals(2, jcache.localMetrics().getCacheGets());
+ assertEquals(0, jcache.localMetrics().getCacheHits());
+ assertEquals(2, jcache.localMetrics().getCacheMisses());
}
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedHitsAndMissesSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedHitsAndMissesSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedHitsAndMissesSelfTest.java
index 02eb9d8..16faa45 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedHitsAndMissesSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedHitsAndMissesSelfTest.java
@@ -114,7 +114,7 @@ public class GridCachePartitionedHitsAndMissesSelfTest extends GridCommonAbstrac
long misses = 0;
for (int i = 0; i < GRID_CNT; i++) {
- CacheMetrics m = grid(i).cache(null).metrics();
+ CacheMetrics m = grid(i).cache(null).localMetrics();
hits += m.getCacheHits();
misses += m.getCacheMisses();
http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/CacheLocalOffHeapAndSwapMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/CacheLocalOffHeapAndSwapMetricsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/CacheLocalOffHeapAndSwapMetricsSelfTest.java
index b638236..15ac96e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/CacheLocalOffHeapAndSwapMetricsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/CacheLocalOffHeapAndSwapMetricsSelfTest.java
@@ -113,74 +113,74 @@ public class CacheLocalOffHeapAndSwapMetricsSelfTest extends GridCommonAbstractT
printStat();
- assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getOffHeapPuts());
- assertEquals(KEYS_CNT, cache.metrics().getOffHeapGets());
- assertEquals(0, cache.metrics().getOffHeapHits());
- assertEquals(0f, cache.metrics().getOffHeapHitPercentage());
- assertEquals(KEYS_CNT, cache.metrics().getOffHeapMisses());
- assertEquals(100f, cache.metrics().getOffHeapMissPercentage());
- assertEquals(0, cache.metrics().getOffHeapRemovals());
-
- assertEquals(0, cache.metrics().getOffHeapEvictions());
- assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getOffHeapEntriesCount());
- assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getOffHeapPrimaryEntriesCount());
- assertEquals(0, cache.metrics().getOffHeapBackupEntriesCount());
+ assertEquals(cache.localMetrics().getCacheEvictions(), cache.localMetrics().getOffHeapPuts());
+ assertEquals(KEYS_CNT, cache.localMetrics().getOffHeapGets());
+ assertEquals(0, cache.localMetrics().getOffHeapHits());
+ assertEquals(0f, cache.localMetrics().getOffHeapHitPercentage());
+ assertEquals(KEYS_CNT, cache.localMetrics().getOffHeapMisses());
+ assertEquals(100f, cache.localMetrics().getOffHeapMissPercentage());
+ assertEquals(0, cache.localMetrics().getOffHeapRemovals());
+
+ assertEquals(0, cache.localMetrics().getOffHeapEvictions());
+ assertEquals(cache.localMetrics().getCacheEvictions(), cache.localMetrics().getOffHeapEntriesCount());
+ assertEquals(cache.localMetrics().getCacheEvictions(), cache.localMetrics().getOffHeapPrimaryEntriesCount());
+ assertEquals(0, cache.localMetrics().getOffHeapBackupEntriesCount());
for (int i = 0; i < KEYS_CNT; i++)
cache.get(i);
printStat();
- assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getOffHeapPuts());
- assertEquals(KEYS_CNT * 2, cache.metrics().getOffHeapGets());
- assertEquals(KEYS_CNT, cache.metrics().getOffHeapHits());
- assertEquals(100 * KEYS_CNT / (KEYS_CNT * 2.0), cache.metrics().getOffHeapHitPercentage(), 0.1);
- assertEquals(KEYS_CNT, cache.metrics().getOffHeapMisses());
- assertEquals(100 * KEYS_CNT / (KEYS_CNT * 2.0), cache.metrics().getOffHeapMissPercentage(), 0.1);
- assertEquals(KEYS_CNT, cache.metrics().getOffHeapRemovals());
+ assertEquals(cache.localMetrics().getCacheEvictions(), cache.localMetrics().getOffHeapPuts());
+ assertEquals(KEYS_CNT * 2, cache.localMetrics().getOffHeapGets());
+ assertEquals(KEYS_CNT, cache.localMetrics().getOffHeapHits());
+ assertEquals(100 * KEYS_CNT / (KEYS_CNT * 2.0), cache.localMetrics().getOffHeapHitPercentage(), 0.1);
+ assertEquals(KEYS_CNT, cache.localMetrics().getOffHeapMisses());
+ assertEquals(100 * KEYS_CNT / (KEYS_CNT * 2.0), cache.localMetrics().getOffHeapMissPercentage(), 0.1);
+ assertEquals(KEYS_CNT, cache.localMetrics().getOffHeapRemovals());
- assertEquals(0, cache.metrics().getOffHeapEvictions());
- assertEquals(KEYS_CNT - MAX_SIZE, cache.metrics().getOffHeapEntriesCount());
- assertEquals(KEYS_CNT - MAX_SIZE, cache.metrics().getOffHeapPrimaryEntriesCount());
- assertEquals(0, cache.metrics().getOffHeapBackupEntriesCount());
+ assertEquals(0, cache.localMetrics().getOffHeapEvictions());
+ assertEquals(KEYS_CNT - MAX_SIZE, cache.localMetrics().getOffHeapEntriesCount());
+ assertEquals(KEYS_CNT - MAX_SIZE, cache.localMetrics().getOffHeapPrimaryEntriesCount());
+ assertEquals(0, cache.localMetrics().getOffHeapBackupEntriesCount());
for (int i = KEYS_CNT; i < KEYS_CNT * 2; i++)
cache.get(i);
printStat();
- assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getOffHeapPuts());
- assertEquals(KEYS_CNT * 3, cache.metrics().getOffHeapGets());
- assertEquals(KEYS_CNT, cache.metrics().getOffHeapHits());
- assertEquals(100 / 3.0, cache.metrics().getOffHeapHitPercentage(), 0.1);
- assertEquals(KEYS_CNT * 2, cache.metrics().getOffHeapMisses());
- assertEquals(100 - (100 / 3.0), cache.metrics().getOffHeapMissPercentage(), 0.1);
- assertEquals(KEYS_CNT, cache.metrics().getOffHeapRemovals());
+ assertEquals(cache.localMetrics().getCacheEvictions(), cache.localMetrics().getOffHeapPuts());
+ assertEquals(KEYS_CNT * 3, cache.localMetrics().getOffHeapGets());
+ assertEquals(KEYS_CNT, cache.localMetrics().getOffHeapHits());
+ assertEquals(100 / 3.0, cache.localMetrics().getOffHeapHitPercentage(), 0.1);
+ assertEquals(KEYS_CNT * 2, cache.localMetrics().getOffHeapMisses());
+ assertEquals(100 - (100 / 3.0), cache.localMetrics().getOffHeapMissPercentage(), 0.1);
+ assertEquals(KEYS_CNT, cache.localMetrics().getOffHeapRemovals());
- assertEquals(0, cache.metrics().getOffHeapEvictions());
- assertEquals(KEYS_CNT - MAX_SIZE, cache.metrics().getOffHeapEntriesCount());
- assertEquals(KEYS_CNT - MAX_SIZE, cache.metrics().getOffHeapPrimaryEntriesCount());
- assertEquals(0, cache.metrics().getOffHeapBackupEntriesCount());
+ assertEquals(0, cache.localMetrics().getOffHeapEvictions());
+ assertEquals(KEYS_CNT - MAX_SIZE, cache.localMetrics().getOffHeapEntriesCount());
+ assertEquals(KEYS_CNT - MAX_SIZE, cache.localMetrics().getOffHeapPrimaryEntriesCount());
+ assertEquals(0, cache.localMetrics().getOffHeapBackupEntriesCount());
for (int i = 0; i < KEYS_CNT; i++)
cache.remove(i);
printStat();
- assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getOffHeapPuts());
- assertEquals(KEYS_CNT * 4 - MAX_SIZE, cache.metrics().getOffHeapGets());
- assertEquals(KEYS_CNT * 2 - MAX_SIZE, cache.metrics().getOffHeapHits());
+ assertEquals(cache.localMetrics().getCacheEvictions(), cache.localMetrics().getOffHeapPuts());
+ assertEquals(KEYS_CNT * 4 - MAX_SIZE, cache.localMetrics().getOffHeapGets());
+ assertEquals(KEYS_CNT * 2 - MAX_SIZE, cache.localMetrics().getOffHeapHits());
assertEquals(100 * (KEYS_CNT * 2.0 - MAX_SIZE) / (KEYS_CNT * 4.0 - MAX_SIZE),
- cache.metrics().getOffHeapHitPercentage(), 0.1);
- assertEquals(KEYS_CNT * 2, cache.metrics().getOffHeapMisses());
+ cache.localMetrics().getOffHeapHitPercentage(), 0.1);
+ assertEquals(KEYS_CNT * 2, cache.localMetrics().getOffHeapMisses());
assertEquals(100 * KEYS_CNT * 2.0 / (KEYS_CNT * 4.0 - MAX_SIZE),
- cache.metrics().getOffHeapMissPercentage(), 0.1);
- assertEquals(KEYS_CNT * 2 - MAX_SIZE, cache.metrics().getOffHeapRemovals());
+ cache.localMetrics().getOffHeapMissPercentage(), 0.1);
+ assertEquals(KEYS_CNT * 2 - MAX_SIZE, cache.localMetrics().getOffHeapRemovals());
- assertEquals(0, cache.metrics().getOffHeapEvictions());
- assertEquals(0, cache.metrics().getOffHeapEntriesCount());
- assertEquals(0, cache.metrics().getOffHeapPrimaryEntriesCount());
- assertEquals(0, cache.metrics().getOffHeapBackupEntriesCount());
+ assertEquals(0, cache.localMetrics().getOffHeapEvictions());
+ assertEquals(0, cache.localMetrics().getOffHeapEntriesCount());
+ assertEquals(0, cache.localMetrics().getOffHeapPrimaryEntriesCount());
+ assertEquals(0, cache.localMetrics().getOffHeapBackupEntriesCount());
}
/**
@@ -194,62 +194,62 @@ public class CacheLocalOffHeapAndSwapMetricsSelfTest extends GridCommonAbstractT
printStat();
- assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getSwapPuts());
- assertEquals(KEYS_CNT, cache.metrics().getSwapGets());
- assertEquals(0, cache.metrics().getSwapHits());
- assertEquals(0f, cache.metrics().getSwapHitPercentage());
- assertEquals(KEYS_CNT, cache.metrics().getSwapMisses());
- assertEquals(100f, cache.metrics().getSwapMissPercentage());
- assertEquals(0, cache.metrics().getSwapRemovals());
+ assertEquals(cache.localMetrics().getCacheEvictions(), cache.localMetrics().getSwapPuts());
+ assertEquals(KEYS_CNT, cache.localMetrics().getSwapGets());
+ assertEquals(0, cache.localMetrics().getSwapHits());
+ assertEquals(0f, cache.localMetrics().getSwapHitPercentage());
+ assertEquals(KEYS_CNT, cache.localMetrics().getSwapMisses());
+ assertEquals(100f, cache.localMetrics().getSwapMissPercentage());
+ assertEquals(0, cache.localMetrics().getSwapRemovals());
- assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getSwapEntriesCount());
+ assertEquals(cache.localMetrics().getCacheEvictions(), cache.localMetrics().getSwapEntriesCount());
for (int i = 0; i < KEYS_CNT; i++)
cache.get(i);
printStat();
- assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getSwapPuts());
- assertEquals(KEYS_CNT * 2, cache.metrics().getSwapGets());
- assertEquals(KEYS_CNT, cache.metrics().getSwapHits());
- assertEquals(100 * KEYS_CNT / (KEYS_CNT * 2.0), cache.metrics().getSwapHitPercentage(), 0.1);
- assertEquals(KEYS_CNT, cache.metrics().getSwapMisses());
- assertEquals(100 * KEYS_CNT / (KEYS_CNT * 2.0), cache.metrics().getSwapMissPercentage(), 0.1);
- assertEquals(KEYS_CNT, cache.metrics().getSwapRemovals());
+ assertEquals(cache.localMetrics().getCacheEvictions(), cache.localMetrics().getSwapPuts());
+ assertEquals(KEYS_CNT * 2, cache.localMetrics().getSwapGets());
+ assertEquals(KEYS_CNT, cache.localMetrics().getSwapHits());
+ assertEquals(100 * KEYS_CNT / (KEYS_CNT * 2.0), cache.localMetrics().getSwapHitPercentage(), 0.1);
+ assertEquals(KEYS_CNT, cache.localMetrics().getSwapMisses());
+ assertEquals(100 * KEYS_CNT / (KEYS_CNT * 2.0), cache.localMetrics().getSwapMissPercentage(), 0.1);
+ assertEquals(KEYS_CNT, cache.localMetrics().getSwapRemovals());
- assertEquals(KEYS_CNT - MAX_SIZE, cache.metrics().getSwapEntriesCount());
+ assertEquals(KEYS_CNT - MAX_SIZE, cache.localMetrics().getSwapEntriesCount());
for (int i = KEYS_CNT; i < KEYS_CNT * 2; i++)
cache.get(i);
printStat();
- assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getSwapPuts());
- assertEquals(KEYS_CNT * 3, cache.metrics().getSwapGets());
- assertEquals(KEYS_CNT, cache.metrics().getSwapHits());
- assertEquals(100 / 3.0, cache.metrics().getSwapHitPercentage(), 0.1);
- assertEquals(KEYS_CNT * 2, cache.metrics().getSwapMisses());
- assertEquals(100 - (100 / 3.0), cache.metrics().getSwapMissPercentage(), 0.1);
- assertEquals(KEYS_CNT, cache.metrics().getSwapRemovals());
+ assertEquals(cache.localMetrics().getCacheEvictions(), cache.localMetrics().getSwapPuts());
+ assertEquals(KEYS_CNT * 3, cache.localMetrics().getSwapGets());
+ assertEquals(KEYS_CNT, cache.localMetrics().getSwapHits());
+ assertEquals(100 / 3.0, cache.localMetrics().getSwapHitPercentage(), 0.1);
+ assertEquals(KEYS_CNT * 2, cache.localMetrics().getSwapMisses());
+ assertEquals(100 - (100 / 3.0), cache.localMetrics().getSwapMissPercentage(), 0.1);
+ assertEquals(KEYS_CNT, cache.localMetrics().getSwapRemovals());
- assertEquals(KEYS_CNT - MAX_SIZE, cache.metrics().getSwapEntriesCount());
+ assertEquals(KEYS_CNT - MAX_SIZE, cache.localMetrics().getSwapEntriesCount());
for (int i = 0; i < KEYS_CNT; i++)
cache.remove(i);
printStat();
- assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getSwapPuts());
- assertEquals(KEYS_CNT * 4 - MAX_SIZE, cache.metrics().getSwapGets());
- assertEquals(KEYS_CNT * 2 - MAX_SIZE, cache.metrics().getSwapHits());
+ assertEquals(cache.localMetrics().getCacheEvictions(), cache.localMetrics().getSwapPuts());
+ assertEquals(KEYS_CNT * 4 - MAX_SIZE, cache.localMetrics().getSwapGets());
+ assertEquals(KEYS_CNT * 2 - MAX_SIZE, cache.localMetrics().getSwapHits());
assertEquals(100 * (KEYS_CNT * 2.0 - MAX_SIZE) / (KEYS_CNT * 4.0 - MAX_SIZE),
- cache.metrics().getSwapHitPercentage(), 0.1);
- assertEquals(KEYS_CNT * 2, cache.metrics().getSwapMisses());
+ cache.localMetrics().getSwapHitPercentage(), 0.1);
+ assertEquals(KEYS_CNT * 2, cache.localMetrics().getSwapMisses());
assertEquals(100 * KEYS_CNT * 2.0 / (KEYS_CNT * 4.0 - MAX_SIZE),
- cache.metrics().getSwapMissPercentage(), 0.1);
- assertEquals(KEYS_CNT * 2 - MAX_SIZE, cache.metrics().getSwapRemovals());
+ cache.localMetrics().getSwapMissPercentage(), 0.1);
+ assertEquals(KEYS_CNT * 2 - MAX_SIZE, cache.localMetrics().getSwapRemovals());
- assertEquals(0, cache.metrics().getSwapEntriesCount());
+ assertEquals(0, cache.localMetrics().getSwapEntriesCount());
}
/**
@@ -263,116 +263,116 @@ public class CacheLocalOffHeapAndSwapMetricsSelfTest extends GridCommonAbstractT
printStat();
- assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getOffHeapPuts());
- assertEquals(KEYS_CNT, cache.metrics().getOffHeapGets());
- assertEquals(0, cache.metrics().getOffHeapHits());
- assertEquals(0f, cache.metrics().getOffHeapHitPercentage());
- assertEquals(KEYS_CNT, cache.metrics().getOffHeapMisses());
- assertEquals(100f, cache.metrics().getOffHeapMissPercentage());
- assertEquals(0, cache.metrics().getOffHeapRemovals());
-
- assertEquals(KEYS_CNT - MAX_SIZE - OFFHEAP_MAX_CNT, cache.metrics().getOffHeapEvictions());
- assertEquals(OFFHEAP_MAX_CNT, cache.metrics().getOffHeapEntriesCount());
- assertEquals(OFFHEAP_MAX_CNT, cache.metrics().getOffHeapPrimaryEntriesCount());
- assertEquals(0, cache.metrics().getOffHeapBackupEntriesCount());
-
- assertEquals(cache.metrics().getOffHeapEvictions(), cache.metrics().getSwapPuts());
- assertEquals(KEYS_CNT, cache.metrics().getSwapGets());
- assertEquals(0, cache.metrics().getSwapHits());
- assertEquals(0f, cache.metrics().getSwapHitPercentage());
- assertEquals(KEYS_CNT, cache.metrics().getSwapMisses());
- assertEquals(100f, cache.metrics().getSwapMissPercentage());
- assertEquals(0, cache.metrics().getSwapRemovals());
-
- assertEquals(cache.metrics().getOffHeapEvictions(), cache.metrics().getSwapEntriesCount());
+ assertEquals(cache.localMetrics().getCacheEvictions(), cache.localMetrics().getOffHeapPuts());
+ assertEquals(KEYS_CNT, cache.localMetrics().getOffHeapGets());
+ assertEquals(0, cache.localMetrics().getOffHeapHits());
+ assertEquals(0f, cache.localMetrics().getOffHeapHitPercentage());
+ assertEquals(KEYS_CNT, cache.localMetrics().getOffHeapMisses());
+ assertEquals(100f, cache.localMetrics().getOffHeapMissPercentage());
+ assertEquals(0, cache.localMetrics().getOffHeapRemovals());
+
+ assertEquals(KEYS_CNT - MAX_SIZE - OFFHEAP_MAX_CNT, cache.localMetrics().getOffHeapEvictions());
+ assertEquals(OFFHEAP_MAX_CNT, cache.localMetrics().getOffHeapEntriesCount());
+ assertEquals(OFFHEAP_MAX_CNT, cache.localMetrics().getOffHeapPrimaryEntriesCount());
+ assertEquals(0, cache.localMetrics().getOffHeapBackupEntriesCount());
+
+ assertEquals(cache.localMetrics().getOffHeapEvictions(), cache.localMetrics().getSwapPuts());
+ assertEquals(KEYS_CNT, cache.localMetrics().getSwapGets());
+ assertEquals(0, cache.localMetrics().getSwapHits());
+ assertEquals(0f, cache.localMetrics().getSwapHitPercentage());
+ assertEquals(KEYS_CNT, cache.localMetrics().getSwapMisses());
+ assertEquals(100f, cache.localMetrics().getSwapMissPercentage());
+ assertEquals(0, cache.localMetrics().getSwapRemovals());
+
+ assertEquals(cache.localMetrics().getOffHeapEvictions(), cache.localMetrics().getSwapEntriesCount());
for (int i = 0; i < KEYS_CNT; i++)
cache.get(i);
printStat();
- assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getOffHeapPuts());
- assertEquals(KEYS_CNT * 2, cache.metrics().getOffHeapGets());
- assertEquals(0, cache.metrics().getOffHeapHits());
- assertEquals(0.0, cache.metrics().getOffHeapHitPercentage(), 0.1);
- assertEquals(KEYS_CNT * 2, cache.metrics().getOffHeapMisses());
- assertEquals(100.0, cache.metrics().getOffHeapMissPercentage(), 0.1);
- assertEquals(0, cache.metrics().getOffHeapRemovals());
-
- assertEquals(cache.metrics().getCacheEvictions() - OFFHEAP_MAX_CNT, cache.metrics().getOffHeapEvictions());
- assertEquals(OFFHEAP_MAX_CNT, cache.metrics().getOffHeapEntriesCount());
- assertEquals(OFFHEAP_MAX_CNT, cache.metrics().getOffHeapPrimaryEntriesCount());
- assertEquals(0, cache.metrics().getOffHeapBackupEntriesCount());
-
- assertEquals(cache.metrics().getOffHeapEvictions(), cache.metrics().getSwapPuts());
- assertEquals(KEYS_CNT * 2, cache.metrics().getSwapGets());
- assertEquals(KEYS_CNT, cache.metrics().getSwapHits());
- assertEquals(100 * KEYS_CNT / (KEYS_CNT * 2.0), cache.metrics().getSwapHitPercentage(), 0.1);
- assertEquals(KEYS_CNT, cache.metrics().getSwapMisses());
- assertEquals(100 * KEYS_CNT / (KEYS_CNT * 2.0), cache.metrics().getSwapMissPercentage(), 0.1);
- assertEquals(KEYS_CNT, cache.metrics().getSwapRemovals());
-
- assertEquals(KEYS_CNT - MAX_SIZE - OFFHEAP_MAX_CNT, cache.metrics().getSwapEntriesCount());
+ assertEquals(cache.localMetrics().getCacheEvictions(), cache.localMetrics().getOffHeapPuts());
+ assertEquals(KEYS_CNT * 2, cache.localMetrics().getOffHeapGets());
+ assertEquals(0, cache.localMetrics().getOffHeapHits());
+ assertEquals(0.0, cache.localMetrics().getOffHeapHitPercentage(), 0.1);
+ assertEquals(KEYS_CNT * 2, cache.localMetrics().getOffHeapMisses());
+ assertEquals(100.0, cache.localMetrics().getOffHeapMissPercentage(), 0.1);
+ assertEquals(0, cache.localMetrics().getOffHeapRemovals());
+
+ assertEquals(cache.localMetrics().getCacheEvictions() - OFFHEAP_MAX_CNT, cache.localMetrics().getOffHeapEvictions());
+ assertEquals(OFFHEAP_MAX_CNT, cache.localMetrics().getOffHeapEntriesCount());
+ assertEquals(OFFHEAP_MAX_CNT, cache.localMetrics().getOffHeapPrimaryEntriesCount());
+ assertEquals(0, cache.localMetrics().getOffHeapBackupEntriesCount());
+
+ assertEquals(cache.localMetrics().getOffHeapEvictions(), cache.localMetrics().getSwapPuts());
+ assertEquals(KEYS_CNT * 2, cache.localMetrics().getSwapGets());
+ assertEquals(KEYS_CNT, cache.localMetrics().getSwapHits());
+ assertEquals(100 * KEYS_CNT / (KEYS_CNT * 2.0), cache.localMetrics().getSwapHitPercentage(), 0.1);
+ assertEquals(KEYS_CNT, cache.localMetrics().getSwapMisses());
+ assertEquals(100 * KEYS_CNT / (KEYS_CNT * 2.0), cache.localMetrics().getSwapMissPercentage(), 0.1);
+ assertEquals(KEYS_CNT, cache.localMetrics().getSwapRemovals());
+
+ assertEquals(KEYS_CNT - MAX_SIZE - OFFHEAP_MAX_CNT, cache.localMetrics().getSwapEntriesCount());
for (int i = KEYS_CNT; i < KEYS_CNT * 2; i++)
cache.get(i);
printStat();
- assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getOffHeapPuts());
- assertEquals(KEYS_CNT * 3, cache.metrics().getOffHeapGets());
- assertEquals(0, cache.metrics().getOffHeapHits());
- assertEquals(0.0, cache.metrics().getOffHeapHitPercentage(), 0.1);
- assertEquals(KEYS_CNT * 3, cache.metrics().getOffHeapMisses());
- assertEquals(100.0, cache.metrics().getOffHeapMissPercentage(), 0.1);
- assertEquals(0, cache.metrics().getOffHeapRemovals());
-
- assertEquals(cache.metrics().getCacheEvictions() - OFFHEAP_MAX_CNT, cache.metrics().getOffHeapEvictions());
- assertEquals(OFFHEAP_MAX_CNT, cache.metrics().getOffHeapEntriesCount());
- assertEquals(OFFHEAP_MAX_CNT, cache.metrics().getOffHeapPrimaryEntriesCount());
- assertEquals(0, cache.metrics().getOffHeapBackupEntriesCount());
-
- assertEquals(cache.metrics().getOffHeapEvictions(), cache.metrics().getSwapPuts());
- assertEquals(KEYS_CNT * 3, cache.metrics().getSwapGets());
- assertEquals(KEYS_CNT, cache.metrics().getSwapHits());
- assertEquals(100 / 3.0, cache.metrics().getSwapHitPercentage(), 0.1);
- assertEquals(KEYS_CNT * 2, cache.metrics().getSwapMisses());
- assertEquals(100 - (100 / 3.0), cache.metrics().getSwapMissPercentage(), 0.1);
- assertEquals(KEYS_CNT, cache.metrics().getSwapRemovals());
-
- assertEquals(KEYS_CNT - MAX_SIZE - OFFHEAP_MAX_CNT, cache.metrics().getSwapEntriesCount());
+ assertEquals(cache.localMetrics().getCacheEvictions(), cache.localMetrics().getOffHeapPuts());
+ assertEquals(KEYS_CNT * 3, cache.localMetrics().getOffHeapGets());
+ assertEquals(0, cache.localMetrics().getOffHeapHits());
+ assertEquals(0.0, cache.localMetrics().getOffHeapHitPercentage(), 0.1);
+ assertEquals(KEYS_CNT * 3, cache.localMetrics().getOffHeapMisses());
+ assertEquals(100.0, cache.localMetrics().getOffHeapMissPercentage(), 0.1);
+ assertEquals(0, cache.localMetrics().getOffHeapRemovals());
+
+ assertEquals(cache.localMetrics().getCacheEvictions() - OFFHEAP_MAX_CNT, cache.localMetrics().getOffHeapEvictions());
+ assertEquals(OFFHEAP_MAX_CNT, cache.localMetrics().getOffHeapEntriesCount());
+ assertEquals(OFFHEAP_MAX_CNT, cache.localMetrics().getOffHeapPrimaryEntriesCount());
+ assertEquals(0, cache.localMetrics().getOffHeapBackupEntriesCount());
+
+ assertEquals(cache.localMetrics().getOffHeapEvictions(), cache.localMetrics().getSwapPuts());
+ assertEquals(KEYS_CNT * 3, cache.localMetrics().getSwapGets());
+ assertEquals(KEYS_CNT, cache.localMetrics().getSwapHits());
+ assertEquals(100 / 3.0, cache.localMetrics().getSwapHitPercentage(), 0.1);
+ assertEquals(KEYS_CNT * 2, cache.localMetrics().getSwapMisses());
+ assertEquals(100 - (100 / 3.0), cache.localMetrics().getSwapMissPercentage(), 0.1);
+ assertEquals(KEYS_CNT, cache.localMetrics().getSwapRemovals());
+
+ assertEquals(KEYS_CNT - MAX_SIZE - OFFHEAP_MAX_CNT, cache.localMetrics().getSwapEntriesCount());
for (int i = 0; i < KEYS_CNT; i++)
cache.remove(i);
printStat();
- assertEquals(cache.metrics().getCacheEvictions(), cache.metrics().getOffHeapPuts());
- assertEquals(KEYS_CNT * 4 - MAX_SIZE, cache.metrics().getOffHeapGets());
- assertEquals(OFFHEAP_MAX_CNT, cache.metrics().getOffHeapHits());
+ assertEquals(cache.localMetrics().getCacheEvictions(), cache.localMetrics().getOffHeapPuts());
+ assertEquals(KEYS_CNT * 4 - MAX_SIZE, cache.localMetrics().getOffHeapGets());
+ assertEquals(OFFHEAP_MAX_CNT, cache.localMetrics().getOffHeapHits());
assertEquals(100 * OFFHEAP_MAX_CNT / (KEYS_CNT * 4.0 - MAX_SIZE),
- cache.metrics().getOffHeapHitPercentage(), 0.1);
- assertEquals(KEYS_CNT * 4 - OFFHEAP_MAX_CNT - MAX_SIZE, cache.metrics().getOffHeapMisses());
+ cache.localMetrics().getOffHeapHitPercentage(), 0.1);
+ assertEquals(KEYS_CNT * 4 - OFFHEAP_MAX_CNT - MAX_SIZE, cache.localMetrics().getOffHeapMisses());
assertEquals(100 * (KEYS_CNT * 4 - OFFHEAP_MAX_CNT - MAX_SIZE) / (KEYS_CNT * 4.0 - MAX_SIZE),
- cache.metrics().getOffHeapMissPercentage(), 0.1);
- assertEquals(OFFHEAP_MAX_CNT, cache.metrics().getOffHeapRemovals());
+ cache.localMetrics().getOffHeapMissPercentage(), 0.1);
+ assertEquals(OFFHEAP_MAX_CNT, cache.localMetrics().getOffHeapRemovals());
- assertEquals(cache.metrics().getCacheEvictions() - OFFHEAP_MAX_CNT, cache.metrics().getOffHeapEvictions());
- assertEquals(0, cache.metrics().getOffHeapEntriesCount());
- assertEquals(0, cache.metrics().getOffHeapPrimaryEntriesCount());
- assertEquals(0, cache.metrics().getOffHeapBackupEntriesCount());
+ assertEquals(cache.localMetrics().getCacheEvictions() - OFFHEAP_MAX_CNT, cache.localMetrics().getOffHeapEvictions());
+ assertEquals(0, cache.localMetrics().getOffHeapEntriesCount());
+ assertEquals(0, cache.localMetrics().getOffHeapPrimaryEntriesCount());
+ assertEquals(0, cache.localMetrics().getOffHeapBackupEntriesCount());
- assertEquals(cache.metrics().getOffHeapEvictions(), cache.metrics().getSwapPuts());
- assertEquals(KEYS_CNT * 4 - MAX_SIZE - OFFHEAP_MAX_CNT, cache.metrics().getSwapGets());
- assertEquals(KEYS_CNT * 2 - MAX_SIZE - OFFHEAP_MAX_CNT, cache.metrics().getSwapHits());
+ assertEquals(cache.localMetrics().getOffHeapEvictions(), cache.localMetrics().getSwapPuts());
+ assertEquals(KEYS_CNT * 4 - MAX_SIZE - OFFHEAP_MAX_CNT, cache.localMetrics().getSwapGets());
+ assertEquals(KEYS_CNT * 2 - MAX_SIZE - OFFHEAP_MAX_CNT, cache.localMetrics().getSwapHits());
assertEquals(100 * (KEYS_CNT * 2.0 - MAX_SIZE - OFFHEAP_MAX_CNT) / (KEYS_CNT * 4.0 - MAX_SIZE - OFFHEAP_MAX_CNT),
- cache.metrics().getSwapHitPercentage(), 0.1);
- assertEquals(KEYS_CNT * 2, cache.metrics().getSwapMisses());
+ cache.localMetrics().getSwapHitPercentage(), 0.1);
+ assertEquals(KEYS_CNT * 2, cache.localMetrics().getSwapMisses());
assertEquals(100 * KEYS_CNT * 2.0 / (KEYS_CNT * 4.0 - MAX_SIZE - OFFHEAP_MAX_CNT),
- cache.metrics().getSwapMissPercentage(), 0.1);
- assertEquals(KEYS_CNT * 2 - MAX_SIZE - OFFHEAP_MAX_CNT, cache.metrics().getSwapRemovals());
+ cache.localMetrics().getSwapMissPercentage(), 0.1);
+ assertEquals(KEYS_CNT * 2 - MAX_SIZE - OFFHEAP_MAX_CNT, cache.localMetrics().getSwapRemovals());
- assertEquals(0, cache.metrics().getSwapEntriesCount());
+ assertEquals(0, cache.localMetrics().getSwapEntriesCount());
}
/**
@@ -380,36 +380,36 @@ public class CacheLocalOffHeapAndSwapMetricsSelfTest extends GridCommonAbstractT
*/
protected void printStat() {
System.out.println("!!! -------------------------------------------------------");
- System.out.println("!!! Puts: cache = " + cache.metrics().getCachePuts() +
- ", offheap = " + cache.metrics().getOffHeapPuts() +
- ", swap = " + cache.metrics().getSwapPuts());
- System.out.println("!!! Gets: cache = " + cache.metrics().getCacheGets() +
- ", offheap = " + cache.metrics().getOffHeapGets() +
- ", swap = " + cache.metrics().getSwapGets());
- System.out.println("!!! Removes: cache = " + cache.metrics().getCacheRemovals() +
- ", offheap = " + cache.metrics().getOffHeapRemovals() +
- ", swap = " + cache.metrics().getSwapRemovals());
- System.out.println("!!! Evictions: cache = " + cache.metrics().getCacheEvictions() +
- ", offheap = " + cache.metrics().getOffHeapEvictions() +
+ System.out.println("!!! Puts: cache = " + cache.localMetrics().getCachePuts() +
+ ", offheap = " + cache.localMetrics().getOffHeapPuts() +
+ ", swap = " + cache.localMetrics().getSwapPuts());
+ System.out.println("!!! Gets: cache = " + cache.localMetrics().getCacheGets() +
+ ", offheap = " + cache.localMetrics().getOffHeapGets() +
+ ", swap = " + cache.localMetrics().getSwapGets());
+ System.out.println("!!! Removes: cache = " + cache.localMetrics().getCacheRemovals() +
+ ", offheap = " + cache.localMetrics().getOffHeapRemovals() +
+ ", swap = " + cache.localMetrics().getSwapRemovals());
+ System.out.println("!!! Evictions: cache = " + cache.localMetrics().getCacheEvictions() +
+ ", offheap = " + cache.localMetrics().getOffHeapEvictions() +
", swap = none" );
- System.out.println("!!! Hits: cache = " + cache.metrics().getCacheHits() +
- ", offheap = " + cache.metrics().getOffHeapHits() +
- ", swap = " + cache.metrics().getSwapHits());
- System.out.println("!!! Hit(%): cache = " + cache.metrics().getCacheHitPercentage() +
- ", offheap = " + cache.metrics().getOffHeapHitPercentage() +
- ", swap = " + cache.metrics().getSwapHitPercentage());
- System.out.println("!!! Misses: cache = " + cache.metrics().getCacheMisses() +
- ", offheap = " + cache.metrics().getOffHeapMisses() +
- ", swap = " + cache.metrics().getSwapMisses());
- System.out.println("!!! Miss(%): cache = " + cache.metrics().getCacheMissPercentage() +
- ", offheap = " + cache.metrics().getOffHeapMissPercentage() +
- ", swap = " + cache.metrics().getSwapMissPercentage());
- System.out.println("!!! Entries: cache = " + cache.metrics().getSize() +
- ", offheap = " + cache.metrics().getOffHeapEntriesCount() +
- ", swap = " + cache.metrics().getSwapEntriesCount());
+ System.out.println("!!! Hits: cache = " + cache.localMetrics().getCacheHits() +
+ ", offheap = " + cache.localMetrics().getOffHeapHits() +
+ ", swap = " + cache.localMetrics().getSwapHits());
+ System.out.println("!!! Hit(%): cache = " + cache.localMetrics().getCacheHitPercentage() +
+ ", offheap = " + cache.localMetrics().getOffHeapHitPercentage() +
+ ", swap = " + cache.localMetrics().getSwapHitPercentage());
+ System.out.println("!!! Misses: cache = " + cache.localMetrics().getCacheMisses() +
+ ", offheap = " + cache.localMetrics().getOffHeapMisses() +
+ ", swap = " + cache.localMetrics().getSwapMisses());
+ System.out.println("!!! Miss(%): cache = " + cache.localMetrics().getCacheMissPercentage() +
+ ", offheap = " + cache.localMetrics().getOffHeapMissPercentage() +
+ ", swap = " + cache.localMetrics().getSwapMissPercentage());
+ System.out.println("!!! Entries: cache = " + cache.localMetrics().getSize() +
+ ", offheap = " + cache.localMetrics().getOffHeapEntriesCount() +
+ ", swap = " + cache.localMetrics().getSwapEntriesCount());
System.out.println("!!! Size: cache = none" +
- ", offheap = " + cache.metrics().getOffHeapAllocatedSize() +
- ", swap = " + cache.metrics().getSwapSize());
+ ", offheap = " + cache.localMetrics().getOffHeapAllocatedSize() +
+ ", swap = " + cache.localMetrics().getSwapSize());
System.out.println();
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/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 0cc2377..fa21de9 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
@@ -45,19 +45,19 @@ public class GridCacheAtomicLocalTckMetricsSelfTestImpl extends GridCacheAtomicL
}
});
- assertEquals(1L, cache.metrics().getCachePuts());
+ assertEquals(1L, cache.localMetrics().getCachePuts());
assertEquals(20, result);
- assertEquals(1L, cache.metrics().getCacheHits());
- assertEquals(100.0f, cache.metrics().getCacheHitPercentage());
- assertEquals(0L, cache.metrics().getCacheMisses());
- assertEquals(0f, cache.metrics().getCacheMissPercentage());
- assertEquals(1L, cache.metrics().getCachePuts());
- assertEquals(1L, cache.metrics().getCacheRemovals());
- assertEquals(0L, cache.metrics().getCacheEvictions());
- assert cache.metrics().getAveragePutTime() >= 0;
- assert cache.metrics().getAverageGetTime() >= 0;
- assert cache.metrics().getAverageRemoveTime() >= 0;
+ assertEquals(1L, cache.localMetrics().getCacheHits());
+ assertEquals(100.0f, cache.localMetrics().getCacheHitPercentage());
+ assertEquals(0L, cache.localMetrics().getCacheMisses());
+ assertEquals(0f, cache.localMetrics().getCacheMissPercentage());
+ assertEquals(1L, cache.localMetrics().getCachePuts());
+ assertEquals(1L, cache.localMetrics().getCacheRemovals());
+ assertEquals(0L, cache.localMetrics().getCacheEvictions());
+ assert cache.localMetrics().getAveragePutTime() >= 0;
+ assert cache.localMetrics().getAverageGetTime() >= 0;
+ assert cache.localMetrics().getAverageRemoveTime() >= 0;
}
/**
@@ -68,36 +68,36 @@ public class GridCacheAtomicLocalTckMetricsSelfTestImpl extends GridCacheAtomicL
cache.put(1, 10);
- assertEquals(0, cache.metrics().getCacheRemovals());
- assertEquals(1, cache.metrics().getCachePuts());
+ assertEquals(0, cache.localMetrics().getCacheRemovals());
+ assertEquals(1, cache.localMetrics().getCachePuts());
cache.remove(1);
- assertEquals(0, cache.metrics().getCacheHits());
- assertEquals(1, cache.metrics().getCacheRemovals());
- assertEquals(1, cache.metrics().getCachePuts());
+ assertEquals(0, cache.localMetrics().getCacheHits());
+ assertEquals(1, cache.localMetrics().getCacheRemovals());
+ assertEquals(1, cache.localMetrics().getCachePuts());
cache.remove(1);
- assertEquals(0, cache.metrics().getCacheHits());
- assertEquals(0, cache.metrics().getCacheMisses());
- assertEquals(1, cache.metrics().getCacheRemovals());
- assertEquals(1, cache.metrics().getCachePuts());
+ assertEquals(0, cache.localMetrics().getCacheHits());
+ assertEquals(0, cache.localMetrics().getCacheMisses());
+ assertEquals(1, cache.localMetrics().getCacheRemovals());
+ assertEquals(1, cache.localMetrics().getCachePuts());
cache.put(1, 10);
assertTrue(cache.remove(1, 10));
- assertEquals(1, cache.metrics().getCacheHits());
- assertEquals(0, cache.metrics().getCacheMisses());
- assertEquals(2, cache.metrics().getCacheRemovals());
- assertEquals(2, cache.metrics().getCachePuts());
+ assertEquals(1, cache.localMetrics().getCacheHits());
+ assertEquals(0, cache.localMetrics().getCacheMisses());
+ assertEquals(2, cache.localMetrics().getCacheRemovals());
+ assertEquals(2, cache.localMetrics().getCachePuts());
assertFalse(cache.remove(1, 10));
- assertEquals(1, cache.metrics().getCacheHits());
- assertEquals(1, cache.metrics().getCacheMisses());
- assertEquals(2, cache.metrics().getCacheRemovals());
- assertEquals(2, cache.metrics().getCachePuts());
+ assertEquals(1, cache.localMetrics().getCacheHits());
+ assertEquals(1, cache.localMetrics().getCacheMisses());
+ assertEquals(2, cache.localMetrics().getCacheRemovals());
+ assertEquals(2, cache.localMetrics().getCachePuts());
}
/**
@@ -115,18 +115,18 @@ public class GridCacheAtomicLocalTckMetricsSelfTestImpl extends GridCacheAtomicL
++missCount;
assertFalse(result);
- assertEquals(missCount, cache.metrics().getCacheMisses());
- assertEquals(hitCount, cache.metrics().getCacheHits());
- assertEquals(putCount, cache.metrics().getCachePuts());
+ assertEquals(missCount, cache.localMetrics().getCacheMisses());
+ assertEquals(hitCount, cache.localMetrics().getCacheHits());
+ assertEquals(putCount, cache.localMetrics().getCachePuts());
assertNull(cache.localPeek(1));
cache.put(1, 10);
++putCount;
- assertEquals(missCount, cache.metrics().getCacheMisses());
- assertEquals(hitCount, cache.metrics().getCacheHits());
- assertEquals(putCount, cache.metrics().getCachePuts());
+ assertEquals(missCount, cache.localMetrics().getCacheMisses());
+ assertEquals(hitCount, cache.localMetrics().getCacheHits());
+ assertEquals(putCount, cache.localMetrics().getCachePuts());
assertNotNull(cache.localPeek(1));
@@ -136,18 +136,18 @@ public class GridCacheAtomicLocalTckMetricsSelfTestImpl extends GridCacheAtomicL
++hitCount;
++putCount;
- assertEquals(missCount, cache.metrics().getCacheMisses());
- assertEquals(hitCount, cache.metrics().getCacheHits());
- assertEquals(putCount, cache.metrics().getCachePuts());
+ assertEquals(missCount, cache.localMetrics().getCacheMisses());
+ assertEquals(hitCount, cache.localMetrics().getCacheHits());
+ assertEquals(putCount, cache.localMetrics().getCachePuts());
result = cache.replace(1, 40, 50);
assertFalse(result);
++hitCount;
- assertEquals(hitCount, cache.metrics().getCacheHits());
- assertEquals(putCount, cache.metrics().getCachePuts());
- assertEquals(missCount, cache.metrics().getCacheMisses());
+ assertEquals(hitCount, cache.localMetrics().getCacheHits());
+ assertEquals(putCount, cache.localMetrics().getCachePuts());
+ assertEquals(missCount, cache.localMetrics().getCacheMisses());
}
/**
@@ -165,15 +165,15 @@ public class GridCacheAtomicLocalTckMetricsSelfTestImpl extends GridCacheAtomicL
++putCount;
assertTrue(result);
- assertEquals(missCount, cache.metrics().getCacheMisses());
- assertEquals(hitCount, cache.metrics().getCacheHits());
- assertEquals(putCount, cache.metrics().getCachePuts());
+ assertEquals(missCount, cache.localMetrics().getCacheMisses());
+ assertEquals(hitCount, cache.localMetrics().getCacheHits());
+ assertEquals(putCount, cache.localMetrics().getCachePuts());
result = cache.putIfAbsent(1, 1);
assertFalse(result);
- assertEquals(hitCount, cache.metrics().getCacheHits());
- assertEquals(putCount, cache.metrics().getCachePuts());
- assertEquals(missCount, cache.metrics().getCacheMisses());
+ assertEquals(hitCount, cache.localMetrics().getCacheHits());
+ assertEquals(putCount, cache.localMetrics().getCachePuts());
+ assertEquals(missCount, cache.localMetrics().getCacheMisses());
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
index 7286fb3..205dc83 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
@@ -439,11 +439,19 @@ public class IgniteCacheProcessProxy<K, V> implements IgniteCache<K, V> {
throw new UnsupportedOperationException("Method should be supported.");
}
+ @Override public CacheMetrics localMetrics() {
+ throw new UnsupportedOperationException("Method should be supported.");
+ }
+
/** {@inheritDoc} */
@Override public CacheMetricsMXBean mxBean() {
throw new UnsupportedOperationException("Method should be supported.");
}
+ @Override public CacheMetricsMXBean localMxBean() {
+ throw new UnsupportedOperationException("Method should be supported.");
+ }
+
/** {@inheritDoc} */
@Override public <K1, V1> IgniteCache<K1, V1> withKeepBinary() {
throw new UnsupportedOperationException("Method should be supported.");
[2/8] ignite git commit: NPE fix (in case cache creation failed)
Posted by nt...@apache.org.
NPE fix (in case cache creation failed)
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/134f26e0
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/134f26e0
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/134f26e0
Branch: refs/heads/ignite-2630
Commit: 134f26e0d020bad9cc6dbff046bb2c38a939c018
Parents: 7a5024c
Author: Anton Vinogradov <av...@apache.org>
Authored: Mon Mar 28 17:42:42 2016 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Mon Mar 28 17:42:42 2016 +0300
----------------------------------------------------------------------
.../processors/cache/GridCachePartitionExchangeManager.java | 2 +-
.../ignite/internal/processors/cache/GridCacheProcessor.java | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/134f26e0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
index 1681f2f..54580fd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
@@ -1258,7 +1258,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
boolean preloadFinished = true;
for (GridCacheContext cacheCtx : cctx.cacheContexts()) {
- preloadFinished &= cacheCtx.preloader().syncFuture().isDone();
+ preloadFinished &= cacheCtx.preloader() != null && cacheCtx.preloader().syncFuture().isDone();
if (!preloadFinished)
break;
http://git-wip-us.apache.org/repos/asf/ignite/blob/134f26e0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index c0fc32a..f5ebc0d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -1721,7 +1721,8 @@ public class GridCacheProcessor extends GridProcessorAdapter {
GridCacheContext<?, ?> cacheCtx = cache.context();
if (F.eq(cacheCtx.startTopologyVersion(), topVer)) {
- cacheCtx.preloader().onInitialExchangeComplete(err);
+ if (cacheCtx.preloader() != null)
+ cacheCtx.preloader().onInitialExchangeComplete(err);
String masked = maskNull(cacheCtx.name());
[8/8] ignite git commit: IGNITE-2004 Added tests.
Posted by nt...@apache.org.
IGNITE-2004 Added tests.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/2586dbb6
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2586dbb6
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2586dbb6
Branch: refs/heads/ignite-2630
Commit: 2586dbb69ed4d742edf8e43280df21a579e7a6cd
Parents: 440354d
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Tue Mar 29 12:28:34 2016 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Tue Mar 29 12:28:34 2016 +0300
----------------------------------------------------------------------
...torPartitionCounterRandomOperationsTest.java | 85 +++++++++++++++++++-
1 file changed, 83 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/2586dbb6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheInterceptorPartitionCounterRandomOperationsTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheInterceptorPartitionCounterRandomOperationsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheInterceptorPartitionCounterRandomOperationsTest.java
index eaae7c5..d034af0 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheInterceptorPartitionCounterRandomOperationsTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheInterceptorPartitionCounterRandomOperationsTest.java
@@ -145,6 +145,7 @@ public class CacheInterceptorPartitionCounterRandomOperationsTest extends GridCo
new BlockingArrayQueue<Cache.Entry<QueryTestKey, QueryTestValue>>());
}
}
+
/**
* @throws Exception If failed.
*/
@@ -161,6 +162,19 @@ public class CacheInterceptorPartitionCounterRandomOperationsTest extends GridCo
/**
* @throws Exception If failed.
*/
+ public void testAtomicWithStore() throws Exception {
+ CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
+ 1,
+ ATOMIC,
+ ONHEAP_TIERED,
+ true);
+
+ doTestPartitionCounterOperation(ccfg);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
public void testAtomicReplicated() throws Exception {
CacheConfiguration<Object, Object> ccfg = cacheConfiguration(REPLICATED,
0,
@@ -174,6 +188,19 @@ public class CacheInterceptorPartitionCounterRandomOperationsTest extends GridCo
/**
* @throws Exception If failed.
*/
+ public void testAtomicReplicatedWithStore() throws Exception {
+ CacheConfiguration<Object, Object> ccfg = cacheConfiguration(REPLICATED,
+ 0,
+ ATOMIC,
+ ONHEAP_TIERED,
+ true);
+
+ doTestPartitionCounterOperation(ccfg);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
public void testAtomicOffheapValues() throws Exception {
CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
1,
@@ -187,6 +214,19 @@ public class CacheInterceptorPartitionCounterRandomOperationsTest extends GridCo
/**
* @throws Exception If failed.
*/
+ public void testAtomicOffheapValuesWithStore() throws Exception {
+ CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
+ 1,
+ ATOMIC,
+ OFFHEAP_VALUES,
+ true);
+
+ doTestPartitionCounterOperation(ccfg);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
public void testAtomicOffheapTiered() throws Exception {
CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
1,
@@ -226,6 +266,19 @@ public class CacheInterceptorPartitionCounterRandomOperationsTest extends GridCo
/**
* @throws Exception If failed.
*/
+ public void testTxWithStore() throws Exception {
+ CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
+ 1,
+ TRANSACTIONAL,
+ ONHEAP_TIERED,
+ true);
+
+ doTestPartitionCounterOperation(ccfg);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
public void testTxExplicit() throws Exception {
CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
1,
@@ -252,6 +305,19 @@ public class CacheInterceptorPartitionCounterRandomOperationsTest extends GridCo
/**
* @throws Exception If failed.
*/
+ public void testTxReplicatedWithStore() throws Exception {
+ CacheConfiguration<Object, Object> ccfg = cacheConfiguration(REPLICATED,
+ 0,
+ TRANSACTIONAL,
+ ONHEAP_TIERED,
+ true);
+
+ doTestPartitionCounterOperation(ccfg);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
public void testTxOffheapValues() throws Exception {
CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
1,
@@ -317,6 +383,19 @@ public class CacheInterceptorPartitionCounterRandomOperationsTest extends GridCo
/**
* @throws Exception If failed.
*/
+ public void testTxNoBackupsWithStore() throws Exception {
+ CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
+ 0,
+ TRANSACTIONAL,
+ ONHEAP_TIERED,
+ true);
+
+ doTestPartitionCounterOperation(ccfg);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
public void testTxNoBackupsExplicit() throws Exception {
CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
0,
@@ -372,7 +451,7 @@ public class CacheInterceptorPartitionCounterRandomOperationsTest extends GridCo
Map<Integer, Long> partCntr,
IgniteCache<Object, Object> cache)
throws Exception {
- Object key = new QueryTestKey(rnd.nextInt(1));
+ Object key = new QueryTestKey(rnd.nextInt(KEYS));
Object newVal = value(rnd);
Object oldVal = expData.get(key);
@@ -616,7 +695,9 @@ public class CacheInterceptorPartitionCounterRandomOperationsTest extends GridCo
boolean rmv
) {
Collection<ClusterNode> nodes =
- Collections.singletonList(affinity(cache).mapKeyToPrimaryAndBackups(key).iterator().next());
+ cache.getConfiguration(CacheConfiguration.class).getAtomicityMode() == TRANSACTIONAL ?
+ affinity(cache).mapKeyToPrimaryAndBackups(key) :
+ Collections.singletonList(affinity(cache).mapKeyToPrimaryAndBackups(key).iterator().next());
List<BlockingQueue<Cache.Entry<QueryTestKey, QueryTestValue>>> queues = new ArrayList<>();
[5/8] ignite git commit: IGNITE-2550: .NET: Simplified examples
configuration. This closes #570.
Posted by nt...@apache.org.
IGNITE-2550: .NET: Simplified examples configuration. This closes #570.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/fc34e51a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/fc34e51a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/fc34e51a
Branch: refs/heads/ignite-2630
Commit: fc34e51a265e73675ff8768526c9f22c9cd9b6fb
Parents: f17b2ae
Author: Pavel Tupitsyn <pt...@gridgain.com>
Authored: Tue Mar 29 10:04:30 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Tue Mar 29 10:04:30 2016 +0300
----------------------------------------------------------------------
modules/platforms/dotnet/Apache.Ignite.sln | 5 +-
.../Compute/ClosureExample.cs | 4 +-
.../Compute/TaskExample.cs | 4 +-
.../Datagrid/ContinuousQueryExample.cs | 11 +-
.../Datagrid/DataStreamerExample.cs | 8 +-
.../Datagrid/PutGetExample.cs | 6 +-
.../Datagrid/QueryExample.cs | 20 +++-
.../Datagrid/StoreExample.cs | 16 ++-
.../Datagrid/TransactionExample.cs | 14 ++-
.../Events/EventsExample.cs | 6 +-
.../Messaging/MessagingExample.cs | 4 +-
.../Misc/LifecycleExample.cs | 2 +-
.../Services/ServicesExample.cs | 6 +-
.../Apache.Ignite.ExamplesDll.csproj | 1 +
.../Apache.Ignite.ExamplesDll/Binary/Account.cs | 1 -
.../Apache.Ignite.ExamplesDll/Binary/Address.cs | 5 +-
.../Binary/Employee.cs | 4 +
.../Binary/EmployeeKey.cs | 4 +-
.../Binary/Organization.cs | 11 +-
.../Binary/OrganizationType.cs | 3 -
.../Datagrid/EmployeeStoreFactory.cs | 38 ++++++
.../examples/Config/example-cache-query.xml | 118 -------------------
.../examples/Config/example-cache-store.xml | 59 ----------
.../dotnet/examples/Config/example-cache.xml | 87 --------------
.../dotnet/examples/Config/example-compute.xml | 70 -----------
.../dotnet/examples/Config/examples-config.xml | 98 +++++++++++++++
26 files changed, 217 insertions(+), 388 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/Apache.Ignite.sln
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.sln b/modules/platforms/dotnet/Apache.Ignite.sln
index a28d714..12fd82b 100644
--- a/modules/platforms/dotnet/Apache.Ignite.sln
+++ b/modules/platforms/dotnet/Apache.Ignite.sln
@@ -28,10 +28,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
Apache.Ignite.sln.TeamCity.DotSettings = Apache.Ignite.sln.TeamCity.DotSettings
build.bat = build.bat
DEVNOTES.txt = DEVNOTES.txt
- examples\Config\example-cache-query.xml = examples\Config\example-cache-query.xml
- examples\Config\example-cache-store.xml = examples\Config\example-cache-store.xml
- examples\Config\example-cache.xml = examples\Config\example-cache.xml
- examples\Config\example-compute.xml = examples\Config\example-compute.xml
+ examples\Config\examples-config.xml = examples\Config\examples-config.xml
README.txt = README.txt
EndProjectSection
EndProject
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/ClosureExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/ClosureExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/ClosureExample.cs
index e1194f8..7675b7e 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/ClosureExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/ClosureExample.cs
@@ -34,7 +34,7 @@ namespace Apache.Ignite.Examples.Compute
/// <para />
/// This example can be run with standalone Apache Ignite.NET node:
/// 1) Run %IGNITE_HOME%/platforms/dotnet/bin/Apache.Ignite.exe:
- /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\example-compute.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
+ /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\examples-config.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
/// 2) Start example.
/// </summary>
public class ClosureExample
@@ -47,7 +47,7 @@ namespace Apache.Ignite.Examples.Compute
{
var cfg = new IgniteConfiguration
{
- SpringConfigUrl = @"platforms\dotnet\examples\config\example-compute.xml",
+ SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml",
JvmOptions = new List<string> { "-Xms512m", "-Xmx512m" }
};
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/TaskExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/TaskExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/TaskExample.cs
index f0bcf13..7934e82 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/TaskExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/TaskExample.cs
@@ -35,7 +35,7 @@ namespace Apache.Ignite.Examples.Compute
/// <para />
/// This example can be run with standalone Apache Ignite.NET node:
/// 1) Run %IGNITE_HOME%/platforms/dotnet/bin/Apache.Ignite.exe:
- /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\example-compute.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
+ /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\examples-config.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
/// 2) Start example.
/// </summary>
public class TaskExample
@@ -48,7 +48,7 @@ namespace Apache.Ignite.Examples.Compute
{
var cfg = new IgniteConfiguration
{
- SpringConfigUrl = @"platforms\dotnet\examples\config\example-compute.xml",
+ SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml",
JvmOptions = new List<string> { "-Xms512m", "-Xmx512m" }
};
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/ContinuousQueryExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/ContinuousQueryExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/ContinuousQueryExample.cs
index 8dad1f4..b253b3f 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/ContinuousQueryExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/ContinuousQueryExample.cs
@@ -36,11 +36,14 @@ namespace Apache.Ignite.Examples.Datagrid
/// <para />
/// This example can be run with standalone Apache Ignite.NET node:
/// 1) Run %IGNITE_HOME%/platforms/dotnet/bin/Apache.Ignite.exe:
- /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\example-cache.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
+ /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\examples-config.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
/// 2) Start example.
/// </summary>
public class ContinuousQueryExample
{
+ /// <summary>Cache name.</summary>
+ private const string CacheName = "dotnet_cache_continuous_query";
+
/// <summary>
/// Runs the example.
/// </summary>
@@ -49,8 +52,8 @@ namespace Apache.Ignite.Examples.Datagrid
{
var cfg = new IgniteConfiguration
{
- SpringConfigUrl = @"platforms\dotnet\examples\config\example-cache.xml",
- JvmOptions = new List<string> {"-Xms512m", "-Xmx512m" }
+ SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml",
+ JvmOptions = new List<string> { "-Xms512m", "-Xmx512m" }
};
using (var ignite = Ignition.Start(cfg))
@@ -58,7 +61,7 @@ namespace Apache.Ignite.Examples.Datagrid
Console.WriteLine();
Console.WriteLine(">>> Cache continuous query example started.");
- var cache = ignite.GetOrCreateCache<int, string>("cache_continuous_query");
+ var cache = ignite.GetOrCreateCache<int, string>(CacheName);
// Clean up caches on all nodes before run.
cache.Clear();
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/DataStreamerExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/DataStreamerExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/DataStreamerExample.cs
index 08a670f..9315f02 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/DataStreamerExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/DataStreamerExample.cs
@@ -38,7 +38,7 @@ namespace Apache.Ignite.Examples.Datagrid
/// <para />
/// This example can be run with standalone Apache Ignite.NET node:
/// 1) Run %IGNITE_HOME%/platforms/dotnet/bin/Apache.Ignite.exe:
- /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\example-cache.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
+ /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\examples-config.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
/// 2) Start example.
/// </summary>
public class DataStreamerExample
@@ -47,7 +47,7 @@ namespace Apache.Ignite.Examples.Datagrid
private const int EntryCount = 500000;
/// <summary>Cache name.</summary>
- private const string CacheName = "cache_data_streamer";
+ private const string CacheName = "dotnet_cache_data_streamer";
/// <summary>
/// Runs the example.
@@ -57,8 +57,8 @@ namespace Apache.Ignite.Examples.Datagrid
{
var cfg = new IgniteConfiguration
{
- SpringConfigUrl = @"platforms\dotnet\examples\config\example-cache.xml",
- JvmOptions = new List<string> {"-Xms512m", "-Xmx512m" }
+ SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml",
+ JvmOptions = new List<string> { "-Xms512m", "-Xmx512m" }
};
using (var ignite = Ignition.Start(cfg))
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/PutGetExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/PutGetExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/PutGetExample.cs
index e2502e8..7d5ade6 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/PutGetExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/PutGetExample.cs
@@ -38,13 +38,13 @@ namespace Apache.Ignite.Examples.Datagrid
/// <para />
/// This example can be run with standalone Apache Ignite.NET node:
/// 1) Run %IGNITE_HOME%/platforms/dotnet/bin/Apache.Ignite.exe:
- /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\example-cache.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
+ /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\examples-config.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
/// 2) Start example.
/// </summary>
public class PutGetExample
{
/// <summary>Cache name.</summary>
- private const string CacheName = "cache_put_get";
+ private const string CacheName = "dotnet_cache_put_get";
/// <summary>
/// Runs the example.
@@ -54,7 +54,7 @@ namespace Apache.Ignite.Examples.Datagrid
{
var cfg = new IgniteConfiguration
{
- SpringConfigUrl = @"platforms\dotnet\examples\config\example-cache.xml",
+ SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml",
JvmOptions = new List<string> { "-Xms512m", "-Xmx512m" }
};
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/QueryExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/QueryExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/QueryExample.cs
index 809eb65..c9166b2 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/QueryExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/QueryExample.cs
@@ -24,6 +24,7 @@ using Apache.Ignite.Core.Cache.Query;
namespace Apache.Ignite.Examples.Datagrid
{
+ using Apache.Ignite.Core.Cache.Configuration;
using Apache.Ignite.ExamplesDll.Binary;
/// <summary>
@@ -38,17 +39,20 @@ namespace Apache.Ignite.Examples.Datagrid
/// <para />
/// This example can be run with standalone Apache Ignite.NET node:
/// 1) Run %IGNITE_HOME%/platforms/dotnet/bin/Apache.Ignite.exe:
- /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\example-cache-query.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
+ /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\examples-config.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
/// 2) Start example.
/// </summary>
public class QueryExample
{
+ /// <summary>Cache name.</summary>
+ private const string CacheName = "dotnet_cache_query";
+
[STAThread]
public static void Main()
{
var cfg = new IgniteConfiguration
{
- SpringConfigUrl = @"platforms\dotnet\examples\config\example-cache-query.xml",
+ SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml",
JvmOptions = new List<string> { "-Xms512m", "-Xmx512m" }
};
@@ -57,7 +61,15 @@ namespace Apache.Ignite.Examples.Datagrid
Console.WriteLine();
Console.WriteLine(">>> Cache query example started.");
- var cache = ignite.GetCache<object, object>(null);
+ var cache = ignite.GetOrCreateCache<object, object>(new CacheConfiguration
+ {
+ Name = CacheName,
+ QueryEntities = new[]
+ {
+ new QueryEntity(typeof(int), typeof(Organization)),
+ new QueryEntity(typeof(EmployeeKey), typeof(Employee))
+ }
+ });
// Clean up caches on all nodes before run.
cache.Clear();
@@ -66,7 +78,7 @@ namespace Apache.Ignite.Examples.Datagrid
PopulateCache(cache);
// Create cache that will work with specific types.
- var employeeCache = ignite.GetCache<EmployeeKey, Employee>(null);
+ var employeeCache = ignite.GetCache<EmployeeKey, Employee>(CacheName);
// Run SQL query example.
SqlQueryExample(employeeCache);
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/StoreExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/StoreExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/StoreExample.cs
index 1654b41..e3ccecc 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/StoreExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/StoreExample.cs
@@ -22,6 +22,7 @@ using Apache.Ignite.ExamplesDll.Datagrid;
namespace Apache.Ignite.Examples.Datagrid
{
+ using Apache.Ignite.Core.Cache.Configuration;
using Apache.Ignite.ExamplesDll.Binary;
/// <summary>
@@ -35,11 +36,14 @@ namespace Apache.Ignite.Examples.Datagrid
/// <para />
/// This example can be run with standalone Apache Ignite.NET node:
/// 1) Run %IGNITE_HOME%/platforms/dotnet/bin/Apache.Ignite.exe:
- /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\example-cache-store.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
+ /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\examples-config.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
/// 2) Start example.
/// </summary>
class StoreExample
{
+ /// <summary>Cache name.</summary>
+ private const string CacheName = "dotnet_cache_with_store";
+
/// <summary>
/// Runs the example.
/// </summary>
@@ -48,7 +52,7 @@ namespace Apache.Ignite.Examples.Datagrid
{
var cfg = new IgniteConfiguration
{
- SpringConfigUrl = @"platforms\dotnet\examples\config\example-cache-store.xml",
+ SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml",
JvmOptions = new List<string> { "-Xms512m", "-Xmx512m" }
};
@@ -57,7 +61,13 @@ namespace Apache.Ignite.Examples.Datagrid
Console.WriteLine();
Console.WriteLine(">>> Cache store example started.");
- var cache = ignite.GetCache<int, Employee>(null);
+ var cache = ignite.GetOrCreateCache<int, Employee>(new CacheConfiguration
+ {
+ Name = CacheName,
+ ReadThrough = true,
+ WriteThrough = true,
+ CacheStoreFactory = new EmployeeStoreFactory()
+ });
// Clean up caches on all nodes before run.
cache.Clear();
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/TransactionExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/TransactionExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/TransactionExample.cs
index e814f8c..2aa5fd7 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/TransactionExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/TransactionExample.cs
@@ -22,6 +22,7 @@ using Apache.Ignite.Core.Transactions;
namespace Apache.Ignite.Examples.Datagrid
{
+ using Apache.Ignite.Core.Cache.Configuration;
using Apache.Ignite.ExamplesDll.Binary;
/// <summary>
@@ -35,11 +36,14 @@ namespace Apache.Ignite.Examples.Datagrid
/// <para />
/// This example can be run with standalone Apache Ignite.NET node:
/// 1) Run %IGNITE_HOME%/platforms/dotnet/bin/Apache.Ignite.exe:
- /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\example-cache.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
+ /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\examples-config.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
/// 2) Start example.
/// </summary>
class TransactionExample
{
+ /// <summary>Cache name.</summary>
+ private const string CacheName = "dotnet_cache_tx";
+
/// <summary>
/// Runs the example.
/// </summary>
@@ -48,7 +52,7 @@ namespace Apache.Ignite.Examples.Datagrid
{
var cfg = new IgniteConfiguration
{
- SpringConfigUrl = @"platforms\dotnet\examples\config\example-cache.xml",
+ SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml",
JvmOptions = new List<string> { "-Xms512m", "-Xmx512m" }
};
@@ -57,7 +61,11 @@ namespace Apache.Ignite.Examples.Datagrid
Console.WriteLine();
Console.WriteLine(">>> Transaction example started.");
- var cache = ignite.GetCache<int, Account>("tx");
+ var cache = ignite.GetOrCreateCache<int, Account>(new CacheConfiguration
+ {
+ Name = CacheName,
+ AtomicityMode = CacheAtomicityMode.Transactional
+ });
// Clean up caches on all nodes before run.
cache.Clear();
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Events/EventsExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Events/EventsExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Events/EventsExample.cs
index 3b068e8..f571db5 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Events/EventsExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Events/EventsExample.cs
@@ -38,7 +38,7 @@ namespace Apache.Ignite.Examples.Events
/// <para />
/// This example can be run with standalone Apache Ignite.NET node:
/// 1) Run %IGNITE_HOME%/platforms/dotnet/bin/Apache.Ignite.exe:
- /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\example-compute.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
+ /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\examples-config.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
/// 2) Start example.
/// </summary>
public class EventsExample
@@ -51,8 +51,8 @@ namespace Apache.Ignite.Examples.Events
{
var cfg = new IgniteConfiguration
{
- SpringConfigUrl = @"platforms\dotnet\examples\config\example-compute.xml",
- JvmOptions = new List<string> {"-Xms512m", "-Xmx512m" }
+ SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml",
+ JvmOptions = new List<string> { "-Xms512m", "-Xmx512m" }
};
using (var ignite = Ignition.Start(cfg))
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Messaging/MessagingExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Messaging/MessagingExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Messaging/MessagingExample.cs
index 6438b95..0c94a7b 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Messaging/MessagingExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Messaging/MessagingExample.cs
@@ -29,7 +29,7 @@ namespace Apache.Ignite.Examples.Messaging
/// 1) Build the project Apache.Ignite.ExamplesDll (select it -> right-click -> Build).
/// Apache.Ignite.ExamplesDll.dll must appear in %IGNITE_HOME%/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/bin/${Platform]/${Configuration} folder;
/// 2) Run %IGNITE_HOME%/platforms/dotnet/bin/Apache.Ignite.exe:
- /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\example-compute.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
+ /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\examples-config.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
/// 3) Set this class as startup object (Apache.Ignite.Examples project -> right-click -> Properties ->
/// Application -> Startup object);
/// 4) Start example (F5 or Ctrl+F5).
@@ -44,7 +44,7 @@ namespace Apache.Ignite.Examples.Messaging
{
var cfg = new IgniteConfiguration
{
- SpringConfigUrl = @"platforms\dotnet\examples\config\example-compute.xml",
+ SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml",
JvmOptions = new List<string> { "-Xms512m", "-Xmx512m" }
};
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Misc/LifecycleExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Misc/LifecycleExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Misc/LifecycleExample.cs
index bba6719..3dc5820 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Misc/LifecycleExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Misc/LifecycleExample.cs
@@ -50,7 +50,7 @@ namespace Apache.Ignite.Examples.Misc
var cfg = new IgniteConfiguration
{
- SpringConfigUrl = @"platforms\dotnet\examples\config\example-compute.xml",
+ SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml",
JvmOptions = new List<string> { "-Xms512m", "-Xmx512m" },
LifecycleBeans = new List<ILifecycleBean> { lifecycleExampleBean }
};
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Services/ServicesExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Services/ServicesExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Services/ServicesExample.cs
index e57774c..c6c71dd 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Services/ServicesExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Services/ServicesExample.cs
@@ -33,7 +33,7 @@ namespace Apache.Ignite.Examples.Services
/// <para />
/// This example can be run with standalone Apache Ignite.NET node:
/// 1) Run %IGNITE_HOME%/platforms/dotnet/bin/Apache.Ignite.exe:
- /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\example-compute.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
+ /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\examples-config.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
/// 2) Start example.
/// </summary>
public class ServicesExample
@@ -46,8 +46,8 @@ namespace Apache.Ignite.Examples.Services
{
var cfg = new IgniteConfiguration
{
- SpringConfigUrl = @"platforms\dotnet\examples\config\example-compute.xml",
- JvmOptions = new List<string> {"-Xms512m", "-Xmx512m"}
+ SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml",
+ JvmOptions = new List<string> { "-Xms512m", "-Xmx512m" }
};
using (var ignite = Ignition.Start(cfg))
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Apache.Ignite.ExamplesDll.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Apache.Ignite.ExamplesDll.csproj b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Apache.Ignite.ExamplesDll.csproj
index ccbdf4b..1cf729b 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Apache.Ignite.ExamplesDll.csproj
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Apache.Ignite.ExamplesDll.csproj
@@ -55,6 +55,7 @@
<Compile Include="Compute\AverageSalaryTask.cs" />
<Compile Include="Compute\CharacterCountClosure.cs" />
<Compile Include="Compute\CharacterCountReducer.cs" />
+ <Compile Include="Datagrid\EmployeeStoreFactory.cs" />
<Compile Include="Datagrid\EmployeeStorePredicate.cs" />
<Compile Include="Datagrid\ContinuousQueryFilter.cs" />
<Compile Include="Datagrid\EmployeeStore.cs" />
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Account.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Account.cs b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Account.cs
index f51c3c2..4d3fc35 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Account.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Account.cs
@@ -22,7 +22,6 @@ namespace Apache.Ignite.ExamplesDll.Binary
/// <summary>
/// Account object. Used in transaction example.
/// </summary>
- [Serializable]
public class Account
{
/// <summary>
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Address.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Address.cs b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Address.cs
index 0490f24..bb6ed7f 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Address.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Address.cs
@@ -19,6 +19,7 @@ namespace Apache.Ignite.ExamplesDll.Binary
{
using System;
using Apache.Ignite.Core.Binary;
+ using Apache.Ignite.Core.Cache.Configuration;
/// <summary>
/// Address.
@@ -36,15 +37,17 @@ namespace Apache.Ignite.ExamplesDll.Binary
Street = street;
Zip = zip;
}
-
+
/// <summary>
/// Street.
/// </summary>
+ [QueryTextField]
public string Street { get; set; }
/// <summary>
/// ZIP code.
/// </summary>
+ [QuerySqlField(IsIndexed = true)]
public int Zip { get; set; }
/// <summary>
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Employee.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Employee.cs b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Employee.cs
index 7d0af08..44a3f11 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Employee.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Employee.cs
@@ -20,6 +20,7 @@ namespace Apache.Ignite.ExamplesDll.Binary
using System;
using System.Collections.Generic;
using System.Linq;
+ using Apache.Ignite.Core.Cache.Configuration;
/// <summary>
/// Employee.
@@ -45,16 +46,19 @@ namespace Apache.Ignite.ExamplesDll.Binary
/// <summary>
/// Name.
/// </summary>
+ [QuerySqlField]
public string Name { get; set; }
/// <summary>
/// Salary.
/// </summary>
+ [QuerySqlField]
public long Salary { get; set; }
/// <summary>
/// Address.
/// </summary>
+ [QuerySqlField]
public Address Address { get; set; }
/// <summary>
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/EmployeeKey.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/EmployeeKey.cs b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/EmployeeKey.cs
index 16e5469..9c1d8cc 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/EmployeeKey.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/EmployeeKey.cs
@@ -17,13 +17,12 @@
namespace Apache.Ignite.ExamplesDll.Binary
{
- using System;
using Apache.Ignite.Core.Cache.Affinity;
+ using Apache.Ignite.Core.Cache.Configuration;
/// <summary>
/// Employee key. Used in query example to co-locate employees with their organizations.
/// </summary>
- [Serializable]
public class EmployeeKey
{
/// <summary>
@@ -46,6 +45,7 @@ namespace Apache.Ignite.ExamplesDll.Binary
/// Organization ID.
/// </summary>
[AffinityKeyMapped]
+ [QuerySqlField(IsIndexed = true)]
public int OrganizationId { get; private set; }
/// <summary>
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Organization.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Organization.cs b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Organization.cs
index 060966a..16d4113 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Organization.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Organization.cs
@@ -18,22 +18,14 @@
namespace Apache.Ignite.ExamplesDll.Binary
{
using System;
+ using Apache.Ignite.Core.Cache.Configuration;
/// <summary>
/// Organization.
/// </summary>
- [Serializable]
public class Organization
{
/// <summary>
- /// Default constructor.
- /// </summary>
- public Organization()
- {
- // No-op.
- }
-
- /// <summary>
/// Constructor.
/// </summary>
/// <param name="name">Name.</param>
@@ -51,6 +43,7 @@ namespace Apache.Ignite.ExamplesDll.Binary
/// <summary>
/// Name.
/// </summary>
+ [QuerySqlField(IsIndexed = true)]
public string Name { get; set; }
/// <summary>
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/OrganizationType.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/OrganizationType.cs b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/OrganizationType.cs
index 9ff0c3a..098fab9 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/OrganizationType.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/OrganizationType.cs
@@ -17,12 +17,9 @@
namespace Apache.Ignite.ExamplesDll.Binary
{
- using System;
-
/// <summary>
/// Organization type.
/// </summary>
- [Serializable]
public enum OrganizationType
{
/// <summary>
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Datagrid/EmployeeStoreFactory.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Datagrid/EmployeeStoreFactory.cs b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Datagrid/EmployeeStoreFactory.cs
new file mode 100644
index 0000000..643fc44
--- /dev/null
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Datagrid/EmployeeStoreFactory.cs
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+namespace Apache.Ignite.ExamplesDll.Datagrid
+{
+ using System;
+ using Apache.Ignite.Core.Cache.Store;
+ using Apache.Ignite.Core.Common;
+
+ /// <summary>
+ /// Employee store factory.
+ /// </summary>
+ [Serializable]
+ public class EmployeeStoreFactory : IFactory<ICacheStore>
+ {
+ /// <summary>
+ /// Creates an instance of the cache store.
+ /// </summary>
+ public ICacheStore CreateInstance()
+ {
+ return new EmployeeStore();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Config/example-cache-query.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Config/example-cache-query.xml b/modules/platforms/dotnet/examples/Config/example-cache-query.xml
deleted file mode 100644
index 5bc9399..0000000
--- a/modules/platforms/dotnet/examples/Config/example-cache-query.xml
+++ /dev/null
@@ -1,118 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:util="http://www.springframework.org/schema/util"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/util
- http://www.springframework.org/schema/util/spring-util.xsd">
- <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
-
- <property name="platformConfiguration">
- <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetConfiguration">
- <property name="binaryConfiguration">
- <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetBinaryConfiguration">
- <property name="types">
- <list>
- <value>Apache.Ignite.ExamplesDll.Binary.Account</value>
- <value>Apache.Ignite.ExamplesDll.Binary.Address</value>
- <value>Apache.Ignite.ExamplesDll.Binary.Employee</value>
- <value>Apache.Ignite.ExamplesDll.Binary.EmployeeKey</value>
- <value>Apache.Ignite.ExamplesDll.Binary.Organization</value>
- </list>
- </property>
- <property name="typesConfiguration">
- <list>
- <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetBinaryTypeConfiguration">
- <property name="typeName" value="Apache.Ignite.ExamplesDll.Binary.OrganizationType" />
- <property name="enum" value="true" />
- </bean>
- </list>
- </property>
- </bean>
- </property>
- </bean>
- </property>
-
- <!-- Cache configurations (all properties are optional). -->
- <property name="cacheConfiguration">
- <list>
- <bean class="org.apache.ignite.configuration.CacheConfiguration">
- <property name="atomicityMode" value="ATOMIC"/>
- <property name="backups" value="1"/>
-
- <!-- Configure type metadata to enable queries. -->
- <property name="typeMetadata">
- <list>
- <bean class="org.apache.ignite.cache.CacheTypeMetadata">
- <property name="keyType" value="java.lang.Integer"/>
- <property name="valueType" value="Organization"/>
- <property name="ascendingFields">
- <map>
- <entry key="name" value="java.lang.String"/>
- </map>
- </property>
- </bean>
- <bean class="org.apache.ignite.cache.CacheTypeMetadata">
- <property name="keyType" value="EmployeeKey"/>
- <property name="valueType" value="Employee"/>
- <property name="ascendingFields">
- <map>
- <entry key="organizationId" value="java.lang.Integer"/>
- <entry key="address.zip" value="java.lang.Integer"/>
- </map>
- </property>
- <property name="queryFields">
- <map>
- <entry key="name" value="java.lang.String"/>
- <entry key="salary" value="java.lang.Long"/>
- </map>
- </property>
- <property name="textFields">
- <list>
- <value>address.street</value>
- </list>
- </property>
- </bean>
- </list>
- </property>
- </bean>
- </list>
- </property>
-
- <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
- <property name="discoverySpi">
- <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
- <property name="ipFinder">
- <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
- <property name="addresses">
- <list>
- <!-- In distributed environment, replace with actual host IP address. -->
- <value>127.0.0.1:47500..47501</value>
- </list>
- </property>
- </bean>
- </property>
- </bean>
- </property>
- </bean>
-</beans>
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Config/example-cache-store.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Config/example-cache-store.xml b/modules/platforms/dotnet/examples/Config/example-cache-store.xml
deleted file mode 100644
index 2c20531..0000000
--- a/modules/platforms/dotnet/examples/Config/example-cache-store.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:util="http://www.springframework.org/schema/util"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/util
- http://www.springframework.org/schema/util/spring-util.xsd">
- <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
- <property name="cacheConfiguration">
- <list>
- <bean class="org.apache.ignite.configuration.CacheConfiguration">
- <property name="writeThrough" value="true"/>
- <property name="readThrough" value="true"/>
- <property name="cacheStoreFactory">
- <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetCacheStoreFactory">
- <property name="typeName" value="Apache.Ignite.ExamplesDll.Datagrid.EmployeeStore, Apache.Ignite.ExamplesDll"/>
- </bean>
- </property>
- </bean>
- </list>
- </property>
-
- <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
- <property name="discoverySpi">
- <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
- <property name="ipFinder">
- <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
- <property name="addresses">
- <list>
- <!-- In distributed environment, replace with actual host IP address. -->
- <value>127.0.0.1:47500..47501</value>
- </list>
- </property>
- </bean>
- </property>
- </bean>
- </property>
- </bean>
-</beans>
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Config/example-cache.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Config/example-cache.xml b/modules/platforms/dotnet/examples/Config/example-cache.xml
deleted file mode 100644
index 949f3a4..0000000
--- a/modules/platforms/dotnet/examples/Config/example-cache.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:util="http://www.springframework.org/schema/util"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/util
- http://www.springframework.org/schema/util/spring-util.xsd">
- <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
- <property name="platformConfiguration">
- <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetConfiguration">
- <property name="binaryConfiguration">
- <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetBinaryConfiguration">
- <property name="types">
- <list>
- <value>Apache.Ignite.ExamplesDll.Binary.Account</value>
- <value>Apache.Ignite.ExamplesDll.Binary.Address</value>
- <value>Apache.Ignite.ExamplesDll.Binary.Employee</value>
- <value>Apache.Ignite.ExamplesDll.Binary.EmployeeKey</value>
- <value>Apache.Ignite.ExamplesDll.Binary.Organization</value>
- </list>
- </property>
- <property name="typesConfiguration">
- <list>
- <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetBinaryTypeConfiguration">
- <property name="typeName" value="Apache.Ignite.ExamplesDll.Binary.OrganizationType" />
- <property name="enum" value="true" />
- </bean>
- </list>
- </property>
- </bean>
- </property>
- </bean>
- </property>
-
- <property name="cacheConfiguration">
- <list>
- <bean class="org.apache.ignite.configuration.CacheConfiguration">
- <property name="name" value="cache*"/>
- <property name="atomicityMode" value="ATOMIC"/>
- <property name="backups" value="1"/>
- </bean>
-
- <bean class="org.apache.ignite.configuration.CacheConfiguration">
- <property name="name" value="tx"/>
- <property name="atomicityMode" value="TRANSACTIONAL"/>
- <property name="backups" value="1"/>
- </bean>
- </list>
- </property>
-
- <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
- <property name="discoverySpi">
- <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
- <property name="ipFinder">
- <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
- <property name="addresses">
- <list>
- <!-- In distributed environment, replace with actual host IP address. -->
- <value>127.0.0.1:47500..47501</value>
- </list>
- </property>
- </bean>
- </property>
- </bean>
- </property>
- </bean>
-</beans>
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Config/example-compute.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Config/example-compute.xml b/modules/platforms/dotnet/examples/Config/example-compute.xml
deleted file mode 100644
index bbc6550..0000000
--- a/modules/platforms/dotnet/examples/Config/example-compute.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:util="http://www.springframework.org/schema/util"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/util
- http://www.springframework.org/schema/util/spring-util.xsd">
- <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
- <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
- <property name="discoverySpi">
- <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
- <property name="ipFinder">
- <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
- <property name="addresses">
- <list>
- <!-- In distributed environment, replace with actual host IP address. -->
- <value>127.0.0.1:47500..47501</value>
- </list>
- </property>
- </bean>
- </property>
- </bean>
- </property>
-
- <!-- Enable task execution events for examples. -->
- <property name="includeEventTypes">
- <list>
- <!-- Task execution events -->
- <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_STARTED"/>
- <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_FINISHED"/>
- <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_FAILED"/>
- <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_TIMEDOUT"/>
- <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_SESSION_ATTR_SET"/>
- <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_REDUCED"/>
-
- <!-- Job execution events -->
- <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_MAPPED"/>
- <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_RESULTED"/>
- <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_FAILED_OVER"/>
- <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_STARTED"/>
- <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_FINISHED"/>
- <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_TIMEDOUT"/>
- <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_REJECTED"/>
- <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_FAILED"/>
- <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_QUEUED"/>
- <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_CANCELLED"/>
- </list>
- </property>
- </bean>
-</beans>
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Config/examples-config.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Config/examples-config.xml b/modules/platforms/dotnet/examples/Config/examples-config.xml
new file mode 100644
index 0000000..04e6a26
--- /dev/null
+++ b/modules/platforms/dotnet/examples/Config/examples-config.xml
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:util="http://www.springframework.org/schema/util"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/util
+ http://www.springframework.org/schema/util/spring-util.xsd">
+ <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
+ <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
+ <property name="discoverySpi">
+ <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
+ <property name="ipFinder">
+ <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
+ <property name="addresses">
+ <list>
+ <!-- In distributed environment, replace with actual host IP address. -->
+ <value>127.0.0.1:47500..47501</value>
+ </list>
+ </property>
+ </bean>
+ </property>
+ </bean>
+ </property>
+
+ <!-- Configure binarizable types. -->
+ <property name="platformConfiguration">
+ <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetConfiguration">
+ <property name="binaryConfiguration">
+ <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetBinaryConfiguration">
+ <property name="types">
+ <list>
+ <value>Apache.Ignite.ExamplesDll.Binary.Account</value>
+ <value>Apache.Ignite.ExamplesDll.Binary.Address</value>
+ <value>Apache.Ignite.ExamplesDll.Binary.Employee</value>
+ <value>Apache.Ignite.ExamplesDll.Binary.EmployeeKey</value>
+ <value>Apache.Ignite.ExamplesDll.Binary.Organization</value>
+ </list>
+ </property>
+ <property name="typesConfiguration">
+ <list>
+ <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetBinaryTypeConfiguration">
+ <property name="typeName" value="Apache.Ignite.ExamplesDll.Binary.OrganizationType" />
+ <property name="enum" value="true" />
+ </bean>
+ </list>
+ </property>
+ </bean>
+ </property>
+ </bean>
+ </property>
+
+
+ <!-- Enable task execution events for examples. -->
+ <property name="includeEventTypes">
+ <list>
+ <!-- Task execution events -->
+ <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_STARTED"/>
+ <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_FINISHED"/>
+ <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_FAILED"/>
+ <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_TIMEDOUT"/>
+ <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_SESSION_ATTR_SET"/>
+ <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_REDUCED"/>
+
+ <!-- Job execution events -->
+ <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_MAPPED"/>
+ <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_RESULTED"/>
+ <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_FAILED_OVER"/>
+ <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_STARTED"/>
+ <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_FINISHED"/>
+ <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_TIMEDOUT"/>
+ <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_REJECTED"/>
+ <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_FAILED"/>
+ <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_QUEUED"/>
+ <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_CANCELLED"/>
+ </list>
+ </property>
+ </bean>
+</beans>
[7/8] ignite git commit: Merge branch 'master' into ignite-2630
Posted by nt...@apache.org.
Merge branch 'master' into ignite-2630
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/440354d7
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/440354d7
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/440354d7
Branch: refs/heads/ignite-2630
Commit: 440354d72f35045cebebf443d64edcf61b3e038d
Parents: 8a9a048 732abda
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Tue Mar 29 11:27:40 2016 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Tue Mar 29 11:27:40 2016 +0300
----------------------------------------------------------------------
.../rest/RestBinaryProtocolSelfTest.java | 4 +-
.../rest/RestMemcacheProtocolSelfTest.java | 4 +-
.../java/org/apache/ignite/IgniteCache.java | 20 +-
.../discovery/GridDiscoveryManager.java | 2 +-
.../cache/CacheClusterMetricsMXBeanImpl.java | 410 +++++++++++++++++++
.../cache/CacheLocalMetricsMXBeanImpl.java | 410 +++++++++++++++++++
.../cache/CacheMetricsMXBeanImpl.java | 410 -------------------
.../processors/cache/GridCacheAdapter.java | 43 +-
.../GridCachePartitionExchangeManager.java | 2 +-
.../processors/cache/GridCacheProcessor.java | 15 +-
.../processors/cache/GridCacheProxyImpl.java | 45 +-
.../processors/cache/IgniteCacheProxy.java | 39 +-
.../processors/cache/IgniteInternalCache.java | 31 +-
.../platform/cache/PlatformCache.java | 2 +-
.../handlers/cache/GridCacheCommandHandler.java | 2 +-
.../internal/visor/cache/VisorCacheMetrics.java | 2 +-
.../visor/cache/VisorCacheResetMetricsTask.java | 2 +-
.../CacheMetricsForClusterGroupSelfTest.java | 2 +-
.../cache/CacheSwapUnswapGetTest.java | 4 +-
.../cache/GridCacheAbstractMetricsSelfTest.java | 124 +++---
.../GridCacheOffHeapValuesEvictionSelfTest.java | 18 +-
...cheTransactionalAbstractMetricsSelfTest.java | 4 +-
.../dht/GridCacheColocatedDebugTest.java | 2 +-
...ePartitionedNearDisabledMetricsSelfTest.java | 2 +-
...AtomicPartitionedTckMetricsSelfTestImpl.java | 92 ++---
.../near/GridCacheNearMetricsSelfTest.java | 152 +++----
...idCachePartitionedHitsAndMissesSelfTest.java | 2 +-
...CacheLocalOffHeapAndSwapMetricsSelfTest.java | 380 ++++++++---------
...dCacheAtomicLocalTckMetricsSelfTestImpl.java | 92 ++---
...acheContinuousQueryRandomOperationsTest.java | 8 +-
.../multijvm/IgniteCacheProcessProxy.java | 8 +
.../IgniteBinaryCacheQueryTestSuite4.java | 39 ++
.../IgniteCacheQuerySelfTestSuite3.java | 22 -
.../IgniteCacheQuerySelfTestSuite4.java | 49 +++
.../impl/binary/binary_type_updater_impl.cpp | 2 +
modules/platforms/dotnet/Apache.Ignite.sln | 5 +-
.../Compute/ClosureExample.cs | 4 +-
.../Compute/TaskExample.cs | 4 +-
.../Datagrid/ContinuousQueryExample.cs | 11 +-
.../Datagrid/DataStreamerExample.cs | 8 +-
.../Datagrid/PutGetExample.cs | 6 +-
.../Datagrid/QueryExample.cs | 20 +-
.../Datagrid/StoreExample.cs | 16 +-
.../Datagrid/TransactionExample.cs | 14 +-
.../Events/EventsExample.cs | 6 +-
.../Messaging/MessagingExample.cs | 4 +-
.../Misc/LifecycleExample.cs | 2 +-
.../Services/ServicesExample.cs | 6 +-
.../Apache.Ignite.ExamplesDll.csproj | 1 +
.../Apache.Ignite.ExamplesDll/Binary/Account.cs | 1 -
.../Apache.Ignite.ExamplesDll/Binary/Address.cs | 5 +-
.../Binary/Employee.cs | 4 +
.../Binary/EmployeeKey.cs | 4 +-
.../Binary/Organization.cs | 11 +-
.../Binary/OrganizationType.cs | 3 -
.../Datagrid/EmployeeStoreFactory.cs | 38 ++
.../examples/Config/example-cache-query.xml | 118 ------
.../examples/Config/example-cache-store.xml | 59 ---
.../dotnet/examples/Config/example-cache.xml | 87 ----
.../dotnet/examples/Config/example-compute.xml | 70 ----
.../dotnet/examples/Config/examples-config.xml | 98 +++++
61 files changed, 1745 insertions(+), 1305 deletions(-)
----------------------------------------------------------------------
[4/8] ignite git commit: IGNITE-1071 IgniteCache.metrics() method
returns local metrics
Posted by nt...@apache.org.
IGNITE-1071 IgniteCache.metrics() method returns local metrics
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f17b2ae0
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f17b2ae0
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f17b2ae0
Branch: refs/heads/ignite-2630
Commit: f17b2ae0ea150a2803584f80276ada527db54b5a
Parents: 134f26e
Author: Anton Vinogradov <av...@apache.org>
Authored: Mon Mar 28 19:19:26 2016 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Mon Mar 28 19:34:29 2016 +0300
----------------------------------------------------------------------
.../rest/RestBinaryProtocolSelfTest.java | 4 +-
.../rest/RestMemcacheProtocolSelfTest.java | 4 +-
.../java/org/apache/ignite/IgniteCache.java | 20 +-
.../discovery/GridDiscoveryManager.java | 2 +-
.../cache/CacheClusterMetricsMXBeanImpl.java | 410 +++++++++++++++++++
.../cache/CacheLocalMetricsMXBeanImpl.java | 410 +++++++++++++++++++
.../cache/CacheMetricsMXBeanImpl.java | 410 -------------------
.../processors/cache/GridCacheAdapter.java | 43 +-
.../processors/cache/GridCacheProcessor.java | 12 +-
.../processors/cache/GridCacheProxyImpl.java | 45 +-
.../processors/cache/IgniteCacheProxy.java | 39 +-
.../processors/cache/IgniteInternalCache.java | 31 +-
.../platform/cache/PlatformCache.java | 2 +-
.../handlers/cache/GridCacheCommandHandler.java | 2 +-
.../internal/visor/cache/VisorCacheMetrics.java | 2 +-
.../visor/cache/VisorCacheResetMetricsTask.java | 2 +-
.../CacheMetricsForClusterGroupSelfTest.java | 2 +-
.../cache/CacheSwapUnswapGetTest.java | 4 +-
.../cache/GridCacheAbstractMetricsSelfTest.java | 124 +++---
.../GridCacheOffHeapValuesEvictionSelfTest.java | 18 +-
...cheTransactionalAbstractMetricsSelfTest.java | 4 +-
.../dht/GridCacheColocatedDebugTest.java | 2 +-
...ePartitionedNearDisabledMetricsSelfTest.java | 2 +-
...AtomicPartitionedTckMetricsSelfTestImpl.java | 92 ++---
.../near/GridCacheNearMetricsSelfTest.java | 152 +++----
...idCachePartitionedHitsAndMissesSelfTest.java | 2 +-
...CacheLocalOffHeapAndSwapMetricsSelfTest.java | 380 ++++++++---------
...dCacheAtomicLocalTckMetricsSelfTestImpl.java | 92 ++---
.../multijvm/IgniteCacheProcessProxy.java | 8 +
29 files changed, 1431 insertions(+), 889 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestBinaryProtocolSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestBinaryProtocolSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestBinaryProtocolSelfTest.java
index 7629afb..251e184 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestBinaryProtocolSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestBinaryProtocolSelfTest.java
@@ -412,9 +412,9 @@ public class RestBinaryProtocolSelfTest extends GridCommonAbstractTest {
IgniteCache<Object, Object> jcacheDft = grid().cache(null);
IgniteCache<Object, Object> jcacheName = grid().cache(CACHE_NAME);
- jcacheDft.mxBean().clear();
+ jcacheDft.localMxBean().clear();
- jcacheName.mxBean().clear();
+ jcacheName.localMxBean().clear();
jcacheDft.put("key1", "val");
jcacheDft.put("key2", "val");
http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestMemcacheProtocolSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestMemcacheProtocolSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestMemcacheProtocolSelfTest.java
index fbaee9e..2797387 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestMemcacheProtocolSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestMemcacheProtocolSelfTest.java
@@ -205,8 +205,8 @@ public class RestMemcacheProtocolSelfTest extends GridCommonAbstractTest {
* @throws Exception If failed.
*/
public void testMetrics() throws Exception {
- grid().cache(null).mxBean().clear();
- grid().cache(CACHE_NAME).mxBean().clear();
+ grid().cache(null).localMxBean().clear();
+ grid().cache(CACHE_NAME).localMxBean().clear();
grid().cache(null).put("key1", "val");
grid().cache(null).put("key2", "val");
http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
index a791e38..581f091 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
@@ -715,14 +715,14 @@ public interface IgniteCache<K, V> extends javax.cache.Cache<K, V>, IgniteAsyncS
public IgniteFuture<?> rebalance();
/**
- * Gets snapshot metrics (statistics) for this cache.
+ * Gets whole cluster snapshot metrics (statistics) for this cache.
*
* @return Cache metrics.
*/
public CacheMetrics metrics();
/**
- * Gets snapshot metrics for caches in cluster group.
+ * Gets cluster group snapshot metrics for caches in cluster group.
*
* @param grp Cluster group.
* @return Cache metrics.
@@ -730,9 +730,23 @@ public interface IgniteCache<K, V> extends javax.cache.Cache<K, V>, IgniteAsyncS
public CacheMetrics metrics(ClusterGroup grp);
/**
- * Gets MxBean for this cache.
+ * Gets local snapshot metrics (statistics) for this cache.
+ *
+ * @return Cache metrics.
+ */
+ public CacheMetrics localMetrics();
+
+ /**
+ * Gets whole cluster MxBean for this cache.
*
* @return MxBean.
*/
public CacheMetricsMXBean mxBean();
+
+ /**
+ * Gets local MxBean for this cache.
+ *
+ * @return MxBean.
+ */
+ public CacheMetricsMXBean localMxBean();
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
index 7b795d5..a254b73 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
@@ -908,7 +908,7 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
if (metrics == null)
metrics = U.newHashMap(caches.size());
- metrics.put(cache.context().cacheId(), cache.metrics());
+ metrics.put(cache.context().cacheId(), cache.localMetrics());
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheClusterMetricsMXBeanImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheClusterMetricsMXBeanImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheClusterMetricsMXBeanImpl.java
new file mode 100644
index 0000000..519d07b
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheClusterMetricsMXBeanImpl.java
@@ -0,0 +1,410 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.mxbean.CacheMetricsMXBean;
+
+/**
+ * Management bean that provides access to {@link IgniteCache IgniteCache}.
+ */
+class CacheClusterMetricsMXBeanImpl implements CacheMetricsMXBean {
+ /** Cache. */
+ private GridCacheAdapter<?, ?> cache;
+
+ /**
+ * Creates MBean;
+ *
+ * @param cache Cache.
+ */
+ CacheClusterMetricsMXBeanImpl(GridCacheAdapter<?, ?> cache) {
+ assert cache != null;
+
+ this.cache = cache;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String name() {
+ return cache.clusterMetrics().name();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOverflowSize() {
+ return cache.clusterMetrics().getOverflowSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapGets() {
+ return cache.clusterMetrics().getOffHeapGets();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapPuts() {
+ return cache.clusterMetrics().getOffHeapPuts();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapRemovals() {
+ return cache.clusterMetrics().getOffHeapRemovals();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapEvictions() {
+ return cache.clusterMetrics().getOffHeapEvictions();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapHits() {
+ return cache.clusterMetrics().getOffHeapHits();
+ }
+
+ /** {@inheritDoc} */
+ @Override public float getOffHeapHitPercentage() {
+ return cache.clusterMetrics().getOffHeapHitPercentage();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapMisses() {
+ return cache.clusterMetrics().getOffHeapMisses();
+ }
+
+ /** {@inheritDoc} */
+ @Override public float getOffHeapMissPercentage() {
+ return cache.clusterMetrics().getOffHeapMissPercentage();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapEntriesCount() {
+ return cache.clusterMetrics().getOffHeapEntriesCount();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapPrimaryEntriesCount() {
+ return cache.clusterMetrics().getOffHeapPrimaryEntriesCount();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapBackupEntriesCount() {
+ return cache.clusterMetrics().getOffHeapBackupEntriesCount();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapAllocatedSize() {
+ return cache.clusterMetrics().getOffHeapAllocatedSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapMaxSize() {
+ return cache.clusterMetrics().getOffHeapMaxSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getSwapGets() {
+ return cache.clusterMetrics().getSwapGets();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getSwapPuts() {
+ return cache.clusterMetrics().getSwapPuts();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getSwapRemovals() {
+ return cache.clusterMetrics().getSwapRemovals();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getSwapHits() {
+ return cache.clusterMetrics().getSwapHits();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getSwapMisses() {
+ return cache.clusterMetrics().getSwapMisses();
+ }
+
+ /** {@inheritDoc} */
+ @Override public float getSwapHitPercentage() {
+ return cache.clusterMetrics().getSwapHitPercentage();
+ }
+
+ /** {@inheritDoc} */
+ @Override public float getSwapMissPercentage() {
+ return cache.clusterMetrics().getSwapMissPercentage();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getSwapEntriesCount() {
+ return cache.clusterMetrics().getSwapEntriesCount();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getSwapSize() {
+ return cache.clusterMetrics().getSwapSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getSize() {
+ return cache.clusterMetrics().getSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getKeySize() {
+ return cache.clusterMetrics().getKeySize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean isEmpty() {
+ return cache.clusterMetrics().isEmpty();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getDhtEvictQueueCurrentSize() {
+ return cache.clusterMetrics().getDhtEvictQueueCurrentSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getTxCommitQueueSize() {
+ return cache.clusterMetrics().getTxCommitQueueSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getTxThreadMapSize() {
+ return cache.clusterMetrics().getTxThreadMapSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getTxXidMapSize() {
+ return cache.clusterMetrics().getTxXidMapSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getTxPrepareQueueSize() {
+ return cache.clusterMetrics().getTxPrepareQueueSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getTxStartVersionCountsSize() {
+ return cache.clusterMetrics().getTxStartVersionCountsSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getTxCommittedVersionsSize() {
+ return cache.clusterMetrics().getTxCommittedVersionsSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getTxRolledbackVersionsSize() {
+ return cache.clusterMetrics().getTxRolledbackVersionsSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getTxDhtThreadMapSize() {
+ return cache.clusterMetrics().getTxDhtThreadMapSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getTxDhtXidMapSize() {
+ return cache.clusterMetrics().getTxDhtXidMapSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getTxDhtCommitQueueSize() {
+ return cache.clusterMetrics().getTxDhtCommitQueueSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getTxDhtPrepareQueueSize() {
+ return cache.clusterMetrics().getTxDhtPrepareQueueSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getTxDhtStartVersionCountsSize() {
+ return cache.clusterMetrics().getTxDhtStartVersionCountsSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getTxDhtCommittedVersionsSize() {
+ return cache.clusterMetrics().getTxDhtCommittedVersionsSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getTxDhtRolledbackVersionsSize() {
+ return cache.clusterMetrics().getTxDhtRolledbackVersionsSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean isWriteBehindEnabled() {
+ return cache.clusterMetrics().isWriteBehindEnabled();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getWriteBehindFlushSize() {
+ return cache.clusterMetrics().getWriteBehindFlushSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getWriteBehindFlushThreadCount() {
+ return cache.clusterMetrics().getWriteBehindFlushThreadCount();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getWriteBehindFlushFrequency() {
+ return cache.clusterMetrics().getWriteBehindFlushFrequency();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getWriteBehindStoreBatchSize() {
+ return cache.clusterMetrics().getWriteBehindStoreBatchSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getWriteBehindTotalCriticalOverflowCount() {
+ return cache.clusterMetrics().getWriteBehindTotalCriticalOverflowCount();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getWriteBehindCriticalOverflowCount() {
+ return cache.clusterMetrics().getWriteBehindCriticalOverflowCount();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getWriteBehindErrorRetryCount() {
+ return cache.clusterMetrics().getWriteBehindErrorRetryCount();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getWriteBehindBufferSize() {
+ return cache.clusterMetrics().getWriteBehindBufferSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public void clear() {
+ throw new UnsupportedOperationException("Cluster metrics can't be cleared. Use local metrics clear instead.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getCacheHits() {
+ return cache.clusterMetrics().getCacheHits();
+ }
+
+ /** {@inheritDoc} */
+ @Override public float getCacheHitPercentage() {
+ return cache.clusterMetrics().getCacheHitPercentage();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getCacheMisses() {
+ return cache.clusterMetrics().getCacheMisses();
+ }
+
+ /** {@inheritDoc} */
+ @Override public float getCacheMissPercentage() {
+ return cache.clusterMetrics().getCacheMissPercentage();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getCacheGets() {
+ return cache.clusterMetrics().getCacheGets();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getCachePuts() {
+ return cache.clusterMetrics().getCachePuts();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getCacheRemovals() {
+ return cache.clusterMetrics().getCacheRemovals();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getCacheEvictions() {
+ return cache.clusterMetrics().getCacheEvictions();
+ }
+
+ /** {@inheritDoc} */
+ @Override public float getAverageGetTime() {
+ return cache.clusterMetrics().getAverageGetTime();
+ }
+
+ /** {@inheritDoc} */
+ @Override public float getAveragePutTime() {
+ return cache.clusterMetrics().getAveragePutTime();
+ }
+
+ /** {@inheritDoc} */
+ @Override public float getAverageRemoveTime() {
+ return cache.clusterMetrics().getAverageRemoveTime();
+ }
+
+ /** {@inheritDoc} */
+ @Override public float getAverageTxCommitTime() {
+ return cache.clusterMetrics().getAverageTxCommitTime();
+ }
+
+ /** {@inheritDoc} */
+ @Override public float getAverageTxRollbackTime() {
+ return cache.clusterMetrics().getAverageTxRollbackTime();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getCacheTxCommits() {
+ return cache.clusterMetrics().getCacheTxCommits();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getCacheTxRollbacks() {
+ return cache.clusterMetrics().getCacheTxRollbacks();
+ }
+
+ /** {@inheritDoc} */
+ @Override public String getKeyType() {
+ return cache.clusterMetrics().getKeyType();
+ }
+
+ /** {@inheritDoc} */
+ @Override public String getValueType() {
+ return cache.clusterMetrics().getValueType();
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean isStoreByValue() {
+ return cache.clusterMetrics().isStoreByValue();
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean isStatisticsEnabled() {
+ return cache.clusterMetrics().isStatisticsEnabled();
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean isManagementEnabled() {
+ return cache.clusterMetrics().isManagementEnabled();
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean isReadThrough() {
+ return cache.clusterMetrics().isReadThrough();
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean isWriteThrough() {
+ return cache.clusterMetrics().isWriteThrough();
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLocalMetricsMXBeanImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLocalMetricsMXBeanImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLocalMetricsMXBeanImpl.java
new file mode 100644
index 0000000..5284ca0
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLocalMetricsMXBeanImpl.java
@@ -0,0 +1,410 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.mxbean.CacheMetricsMXBean;
+
+/**
+ * Management bean that provides access to {@link IgniteCache IgniteCache}.
+ */
+class CacheLocalMetricsMXBeanImpl implements CacheMetricsMXBean {
+ /** Cache. */
+ private GridCacheAdapter<?, ?> cache;
+
+ /**
+ * Creates MBean;
+ *
+ * @param cache Cache.
+ */
+ CacheLocalMetricsMXBeanImpl(GridCacheAdapter<?, ?> cache) {
+ assert cache != null;
+
+ this.cache = cache;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String name() {
+ return cache.metrics0().name();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOverflowSize() {
+ return cache.metrics0().getOverflowSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapGets() {
+ return cache.metrics0().getOffHeapGets();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapPuts() {
+ return cache.metrics0().getOffHeapPuts();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapRemovals() {
+ return cache.metrics0().getOffHeapRemovals();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapEvictions() {
+ return cache.metrics0().getOffHeapEvictions();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapHits() {
+ return cache.metrics0().getOffHeapHits();
+ }
+
+ /** {@inheritDoc} */
+ @Override public float getOffHeapHitPercentage() {
+ return cache.metrics0().getOffHeapHitPercentage();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapMisses() {
+ return cache.metrics0().getOffHeapMisses();
+ }
+
+ /** {@inheritDoc} */
+ @Override public float getOffHeapMissPercentage() {
+ return cache.metrics0().getOffHeapMissPercentage();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapEntriesCount() {
+ return cache.metrics0().getOffHeapEntriesCount();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapPrimaryEntriesCount() {
+ return cache.metrics0().getOffHeapPrimaryEntriesCount();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapBackupEntriesCount() {
+ return cache.metrics0().getOffHeapBackupEntriesCount();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapAllocatedSize() {
+ return cache.metrics0().getOffHeapAllocatedSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getOffHeapMaxSize() {
+ return cache.metrics0().getOffHeapMaxSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getSwapGets() {
+ return cache.metrics0().getSwapGets();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getSwapPuts() {
+ return cache.metrics0().getSwapPuts();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getSwapRemovals() {
+ return cache.metrics0().getSwapRemovals();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getSwapHits() {
+ return cache.metrics0().getSwapHits();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getSwapMisses() {
+ return cache.metrics0().getSwapMisses();
+ }
+
+ /** {@inheritDoc} */
+ @Override public float getSwapHitPercentage() {
+ return cache.metrics0().getSwapHitPercentage();
+ }
+
+ /** {@inheritDoc} */
+ @Override public float getSwapMissPercentage() {
+ return cache.metrics0().getSwapMissPercentage();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getSwapEntriesCount() {
+ return cache.metrics0().getSwapEntriesCount();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getSwapSize() {
+ return cache.metrics0().getSwapSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getSize() {
+ return cache.metrics0().getSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getKeySize() {
+ return cache.metrics0().getKeySize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean isEmpty() {
+ return cache.metrics0().isEmpty();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getDhtEvictQueueCurrentSize() {
+ return cache.metrics0().getDhtEvictQueueCurrentSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getTxCommitQueueSize() {
+ return cache.metrics0().getTxCommitQueueSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getTxThreadMapSize() {
+ return cache.metrics0().getTxThreadMapSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getTxXidMapSize() {
+ return cache.metrics0().getTxXidMapSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getTxPrepareQueueSize() {
+ return cache.metrics0().getTxPrepareQueueSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getTxStartVersionCountsSize() {
+ return cache.metrics0().getTxStartVersionCountsSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getTxCommittedVersionsSize() {
+ return cache.metrics0().getTxCommittedVersionsSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getTxRolledbackVersionsSize() {
+ return cache.metrics0().getTxRolledbackVersionsSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getTxDhtThreadMapSize() {
+ return cache.metrics0().getTxDhtThreadMapSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getTxDhtXidMapSize() {
+ return cache.metrics0().getTxDhtXidMapSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getTxDhtCommitQueueSize() {
+ return cache.metrics0().getTxDhtCommitQueueSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getTxDhtPrepareQueueSize() {
+ return cache.metrics0().getTxDhtPrepareQueueSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getTxDhtStartVersionCountsSize() {
+ return cache.metrics0().getTxDhtStartVersionCountsSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getTxDhtCommittedVersionsSize() {
+ return cache.metrics0().getTxDhtCommittedVersionsSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getTxDhtRolledbackVersionsSize() {
+ return cache.metrics0().getTxDhtRolledbackVersionsSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean isWriteBehindEnabled() {
+ return cache.metrics0().isWriteBehindEnabled();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getWriteBehindFlushSize() {
+ return cache.metrics0().getWriteBehindFlushSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getWriteBehindFlushThreadCount() {
+ return cache.metrics0().getWriteBehindFlushThreadCount();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getWriteBehindFlushFrequency() {
+ return cache.metrics0().getWriteBehindFlushFrequency();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getWriteBehindStoreBatchSize() {
+ return cache.metrics0().getWriteBehindStoreBatchSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getWriteBehindTotalCriticalOverflowCount() {
+ return cache.metrics0().getWriteBehindTotalCriticalOverflowCount();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getWriteBehindCriticalOverflowCount() {
+ return cache.metrics0().getWriteBehindCriticalOverflowCount();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getWriteBehindErrorRetryCount() {
+ return cache.metrics0().getWriteBehindErrorRetryCount();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getWriteBehindBufferSize() {
+ return cache.metrics0().getWriteBehindBufferSize();
+ }
+
+ /** {@inheritDoc} */
+ @Override public void clear() {
+ cache.metrics0().clear();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getCacheHits() {
+ return cache.metrics0().getCacheHits();
+ }
+
+ /** {@inheritDoc} */
+ @Override public float getCacheHitPercentage() {
+ return cache.metrics0().getCacheHitPercentage();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getCacheMisses() {
+ return cache.metrics0().getCacheMisses();
+ }
+
+ /** {@inheritDoc} */
+ @Override public float getCacheMissPercentage() {
+ return cache.metrics0().getCacheMissPercentage();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getCacheGets() {
+ return cache.metrics0().getCacheGets();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getCachePuts() {
+ return cache.metrics0().getCachePuts();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getCacheRemovals() {
+ return cache.metrics0().getCacheRemovals();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getCacheEvictions() {
+ return cache.metrics0().getCacheEvictions();
+ }
+
+ /** {@inheritDoc} */
+ @Override public float getAverageGetTime() {
+ return cache.metrics0().getAverageGetTime();
+ }
+
+ /** {@inheritDoc} */
+ @Override public float getAveragePutTime() {
+ return cache.metrics0().getAveragePutTime();
+ }
+
+ /** {@inheritDoc} */
+ @Override public float getAverageRemoveTime() {
+ return cache.metrics0().getAverageRemoveTime();
+ }
+
+ /** {@inheritDoc} */
+ @Override public float getAverageTxCommitTime() {
+ return cache.metrics0().getAverageTxCommitTime();
+ }
+
+ /** {@inheritDoc} */
+ @Override public float getAverageTxRollbackTime() {
+ return cache.metrics0().getAverageTxRollbackTime();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getCacheTxCommits() {
+ return cache.metrics0().getCacheTxCommits();
+ }
+
+ /** {@inheritDoc} */
+ @Override public long getCacheTxRollbacks() {
+ return cache.metrics0().getCacheTxRollbacks();
+ }
+
+ /** {@inheritDoc} */
+ @Override public String getKeyType() {
+ return cache.metrics0().getKeyType();
+ }
+
+ /** {@inheritDoc} */
+ @Override public String getValueType() {
+ return cache.metrics0().getValueType();
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean isStoreByValue() {
+ return cache.metrics0().isStoreByValue();
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean isStatisticsEnabled() {
+ return cache.metrics0().isStatisticsEnabled();
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean isManagementEnabled() {
+ return cache.metrics0().isManagementEnabled();
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean isReadThrough() {
+ return cache.metrics0().isReadThrough();
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean isWriteThrough() {
+ return cache.metrics0().isWriteThrough();
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsMXBeanImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsMXBeanImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsMXBeanImpl.java
deleted file mode 100644
index 822240e..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsMXBeanImpl.java
+++ /dev/null
@@ -1,410 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.processors.cache;
-
-import org.apache.ignite.IgniteCache;
-import org.apache.ignite.mxbean.CacheMetricsMXBean;
-
-/**
- * Management bean that provides access to {@link IgniteCache IgniteCache}.
- */
-class CacheMetricsMXBeanImpl implements CacheMetricsMXBean {
- /** Cache. */
- private GridCacheAdapter<?, ?> cache;
-
- /**
- * Creates MBean;
- *
- * @param cache Cache.
- */
- CacheMetricsMXBeanImpl(GridCacheAdapter<?, ?> cache) {
- assert cache != null;
-
- this.cache = cache;
- }
-
- /** {@inheritDoc} */
- @Override public String name() {
- return cache.metrics0().name();
- }
-
- /** {@inheritDoc} */
- @Override public long getOverflowSize() {
- return cache.metrics0().getOverflowSize();
- }
-
- /** {@inheritDoc} */
- @Override public long getOffHeapGets() {
- return cache.metrics0().getOffHeapGets();
- }
-
- /** {@inheritDoc} */
- @Override public long getOffHeapPuts() {
- return cache.metrics0().getOffHeapPuts();
- }
-
- /** {@inheritDoc} */
- @Override public long getOffHeapRemovals() {
- return cache.metrics0().getOffHeapRemovals();
- }
-
- /** {@inheritDoc} */
- @Override public long getOffHeapEvictions() {
- return cache.metrics0().getOffHeapEvictions();
- }
-
- /** {@inheritDoc} */
- @Override public long getOffHeapHits() {
- return cache.metrics0().getOffHeapHits();
- }
-
- /** {@inheritDoc} */
- @Override public float getOffHeapHitPercentage() {
- return cache.metrics0().getOffHeapHitPercentage();
- }
-
- /** {@inheritDoc} */
- @Override public long getOffHeapMisses() {
- return cache.metrics0().getOffHeapMisses();
- }
-
- /** {@inheritDoc} */
- @Override public float getOffHeapMissPercentage() {
- return cache.metrics0().getOffHeapMissPercentage();
- }
-
- /** {@inheritDoc} */
- @Override public long getOffHeapEntriesCount() {
- return cache.metrics0().getOffHeapEntriesCount();
- }
-
- /** {@inheritDoc} */
- @Override public long getOffHeapPrimaryEntriesCount() {
- return cache.metrics0().getOffHeapPrimaryEntriesCount();
- }
-
- /** {@inheritDoc} */
- @Override public long getOffHeapBackupEntriesCount() {
- return cache.metrics0().getOffHeapBackupEntriesCount();
- }
-
- /** {@inheritDoc} */
- @Override public long getOffHeapAllocatedSize() {
- return cache.metrics0().getOffHeapAllocatedSize();
- }
-
- /** {@inheritDoc} */
- @Override public long getOffHeapMaxSize() {
- return cache.metrics0().getOffHeapMaxSize();
- }
-
- /** {@inheritDoc} */
- @Override public long getSwapGets() {
- return cache.metrics0().getSwapGets();
- }
-
- /** {@inheritDoc} */
- @Override public long getSwapPuts() {
- return cache.metrics0().getSwapPuts();
- }
-
- /** {@inheritDoc} */
- @Override public long getSwapRemovals() {
- return cache.metrics0().getSwapRemovals();
- }
-
- /** {@inheritDoc} */
- @Override public long getSwapHits() {
- return cache.metrics0().getSwapHits();
- }
-
- /** {@inheritDoc} */
- @Override public long getSwapMisses() {
- return cache.metrics0().getSwapMisses();
- }
-
- /** {@inheritDoc} */
- @Override public float getSwapHitPercentage() {
- return cache.metrics0().getSwapHitPercentage();
- }
-
- /** {@inheritDoc} */
- @Override public float getSwapMissPercentage() {
- return cache.metrics0().getSwapMissPercentage();
- }
-
- /** {@inheritDoc} */
- @Override public long getSwapEntriesCount() {
- return cache.metrics0().getSwapEntriesCount();
- }
-
- /** {@inheritDoc} */
- @Override public long getSwapSize() {
- return cache.metrics0().getSwapSize();
- }
-
- /** {@inheritDoc} */
- @Override public int getSize() {
- return cache.metrics0().getSize();
- }
-
- /** {@inheritDoc} */
- @Override public int getKeySize() {
- return cache.metrics0().getKeySize();
- }
-
- /** {@inheritDoc} */
- @Override public boolean isEmpty() {
- return cache.metrics0().isEmpty();
- }
-
- /** {@inheritDoc} */
- @Override public int getDhtEvictQueueCurrentSize() {
- return cache.metrics0().getDhtEvictQueueCurrentSize();
- }
-
- /** {@inheritDoc} */
- @Override public int getTxCommitQueueSize() {
- return cache.metrics0().getTxCommitQueueSize();
- }
-
- /** {@inheritDoc} */
- @Override public int getTxThreadMapSize() {
- return cache.metrics0().getTxThreadMapSize();
- }
-
- /** {@inheritDoc} */
- @Override public int getTxXidMapSize() {
- return cache.metrics0().getTxXidMapSize();
- }
-
- /** {@inheritDoc} */
- @Override public int getTxPrepareQueueSize() {
- return cache.metrics0().getTxPrepareQueueSize();
- }
-
- /** {@inheritDoc} */
- @Override public int getTxStartVersionCountsSize() {
- return cache.metrics0().getTxStartVersionCountsSize();
- }
-
- /** {@inheritDoc} */
- @Override public int getTxCommittedVersionsSize() {
- return cache.metrics0().getTxCommittedVersionsSize();
- }
-
- /** {@inheritDoc} */
- @Override public int getTxRolledbackVersionsSize() {
- return cache.metrics0().getTxRolledbackVersionsSize();
- }
-
- /** {@inheritDoc} */
- @Override public int getTxDhtThreadMapSize() {
- return cache.metrics0().getTxDhtThreadMapSize();
- }
-
- /** {@inheritDoc} */
- @Override public int getTxDhtXidMapSize() {
- return cache.metrics0().getTxDhtXidMapSize();
- }
-
- /** {@inheritDoc} */
- @Override public int getTxDhtCommitQueueSize() {
- return cache.metrics0().getTxDhtCommitQueueSize();
- }
-
- /** {@inheritDoc} */
- @Override public int getTxDhtPrepareQueueSize() {
- return cache.metrics0().getTxDhtPrepareQueueSize();
- }
-
- /** {@inheritDoc} */
- @Override public int getTxDhtStartVersionCountsSize() {
- return cache.metrics0().getTxDhtStartVersionCountsSize();
- }
-
- /** {@inheritDoc} */
- @Override public int getTxDhtCommittedVersionsSize() {
- return cache.metrics0().getTxDhtCommittedVersionsSize();
- }
-
- /** {@inheritDoc} */
- @Override public int getTxDhtRolledbackVersionsSize() {
- return cache.metrics0().getTxDhtRolledbackVersionsSize();
- }
-
- /** {@inheritDoc} */
- @Override public boolean isWriteBehindEnabled() {
- return cache.metrics0().isWriteBehindEnabled();
- }
-
- /** {@inheritDoc} */
- @Override public int getWriteBehindFlushSize() {
- return cache.metrics0().getWriteBehindFlushSize();
- }
-
- /** {@inheritDoc} */
- @Override public int getWriteBehindFlushThreadCount() {
- return cache.metrics0().getWriteBehindFlushThreadCount();
- }
-
- /** {@inheritDoc} */
- @Override public long getWriteBehindFlushFrequency() {
- return cache.metrics0().getWriteBehindFlushFrequency();
- }
-
- /** {@inheritDoc} */
- @Override public int getWriteBehindStoreBatchSize() {
- return cache.metrics0().getWriteBehindStoreBatchSize();
- }
-
- /** {@inheritDoc} */
- @Override public int getWriteBehindTotalCriticalOverflowCount() {
- return cache.metrics0().getWriteBehindTotalCriticalOverflowCount();
- }
-
- /** {@inheritDoc} */
- @Override public int getWriteBehindCriticalOverflowCount() {
- return cache.metrics0().getWriteBehindCriticalOverflowCount();
- }
-
- /** {@inheritDoc} */
- @Override public int getWriteBehindErrorRetryCount() {
- return cache.metrics0().getWriteBehindErrorRetryCount();
- }
-
- /** {@inheritDoc} */
- @Override public int getWriteBehindBufferSize() {
- return cache.metrics0().getWriteBehindBufferSize();
- }
-
- /** {@inheritDoc} */
- @Override public void clear() {
- cache.metrics0().clear();
- }
-
- /** {@inheritDoc} */
- @Override public long getCacheHits() {
- return cache.metrics0().getCacheHits();
- }
-
- /** {@inheritDoc} */
- @Override public float getCacheHitPercentage() {
- return cache.metrics0().getCacheHitPercentage();
- }
-
- /** {@inheritDoc} */
- @Override public long getCacheMisses() {
- return cache.metrics0().getCacheMisses();
- }
-
- /** {@inheritDoc} */
- @Override public float getCacheMissPercentage() {
- return cache.metrics0().getCacheMissPercentage();
- }
-
- /** {@inheritDoc} */
- @Override public long getCacheGets() {
- return cache.metrics0().getCacheGets();
- }
-
- /** {@inheritDoc} */
- @Override public long getCachePuts() {
- return cache.metrics0().getCachePuts();
- }
-
- /** {@inheritDoc} */
- @Override public long getCacheRemovals() {
- return cache.metrics0().getCacheRemovals();
- }
-
- /** {@inheritDoc} */
- @Override public long getCacheEvictions() {
- return cache.metrics0().getCacheEvictions();
- }
-
- /** {@inheritDoc} */
- @Override public float getAverageGetTime() {
- return cache.metrics0().getAverageGetTime();
- }
-
- /** {@inheritDoc} */
- @Override public float getAveragePutTime() {
- return cache.metrics0().getAveragePutTime();
- }
-
- /** {@inheritDoc} */
- @Override public float getAverageRemoveTime() {
- return cache.metrics0().getAverageRemoveTime();
- }
-
- /** {@inheritDoc} */
- @Override public float getAverageTxCommitTime() {
- return cache.metrics0().getAverageTxCommitTime();
- }
-
- /** {@inheritDoc} */
- @Override public float getAverageTxRollbackTime() {
- return cache.metrics0().getAverageTxRollbackTime();
- }
-
- /** {@inheritDoc} */
- @Override public long getCacheTxCommits() {
- return cache.metrics0().getCacheTxCommits();
- }
-
- /** {@inheritDoc} */
- @Override public long getCacheTxRollbacks() {
- return cache.metrics0().getCacheTxRollbacks();
- }
-
- /** {@inheritDoc} */
- @Override public String getKeyType() {
- return cache.metrics0().getKeyType();
- }
-
- /** {@inheritDoc} */
- @Override public String getValueType() {
- return cache.metrics0().getValueType();
- }
-
- /** {@inheritDoc} */
- @Override public boolean isStoreByValue() {
- return cache.metrics0().isStoreByValue();
- }
-
- /** {@inheritDoc} */
- @Override public boolean isStatisticsEnabled() {
- return cache.metrics0().isStatisticsEnabled();
- }
-
- /** {@inheritDoc} */
- @Override public boolean isManagementEnabled() {
- return cache.metrics0().isManagementEnabled();
- }
-
- /** {@inheritDoc} */
- @Override public boolean isReadThrough() {
- return cache.metrics0().isReadThrough();
- }
-
- /** {@inheritDoc} */
- @Override public boolean isWriteThrough() {
- return cache.metrics0().isWriteThrough();
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/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 a1f0f28..44c8b57 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
@@ -137,6 +137,7 @@ import org.apache.ignite.mxbean.CacheMetricsMXBean;
import org.apache.ignite.plugin.security.SecurityPermission;
import org.apache.ignite.resources.IgniteInstanceResource;
import org.apache.ignite.resources.JobContextResource;
+import org.apache.ignite.spi.discovery.tcp.internal.TcpDiscoveryNode;
import org.apache.ignite.transactions.Transaction;
import org.apache.ignite.transactions.TransactionConcurrency;
import org.apache.ignite.transactions.TransactionIsolation;
@@ -253,8 +254,11 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
/** Cache metrics. */
protected CacheMetricsImpl metrics;
+ /** Cache localMxBean. */
+ protected CacheMetricsMXBean localMxBean;
+
/** Cache mxBean. */
- protected CacheMetricsMXBean mxBean;
+ protected CacheMetricsMXBean clusterMxBean;
/** Logger. */
protected IgniteLogger log;
@@ -324,7 +328,8 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
metrics = new CacheMetricsImpl(ctx);
- mxBean = new CacheMetricsMXBeanImpl(this);
+ localMxBean = new CacheLocalMetricsMXBeanImpl(this);
+ clusterMxBean = new CacheClusterMetricsMXBeanImpl(this);
FileSystemConfiguration[] igfsCfgs = gridCfg.getFileSystemConfiguration();
@@ -3294,13 +3299,41 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
}
/** {@inheritDoc} */
- @Override public CacheMetrics metrics() {
+ @Override public CacheMetrics clusterMetrics() {
+ return clusterMetrics(ctx.grid().cluster().forCacheNodes(ctx.name()));
+ }
+
+ /** {@inheritDoc} */
+ @Override public CacheMetrics clusterMetrics(ClusterGroup grp) {
+ List<CacheMetrics> metrics = new ArrayList<>(grp.nodes().size());
+
+ for (ClusterNode node : grp.nodes()) {
+ Map<Integer, CacheMetrics> nodeCacheMetrics = ((TcpDiscoveryNode)node).cacheMetrics();
+
+ if (nodeCacheMetrics != null) {
+ CacheMetrics e = nodeCacheMetrics.get(context().cacheId());
+
+ if (e != null)
+ metrics.add(e);
+ }
+ }
+
+ return new CacheMetricsSnapshot(ctx.cache().localMetrics(), metrics);
+ }
+
+ /** {@inheritDoc} */
+ @Override public CacheMetrics localMetrics() {
return new CacheMetricsSnapshot(metrics);
}
/** {@inheritDoc} */
- @Override public CacheMetricsMXBean mxBean() {
- return mxBean;
+ @Override public CacheMetricsMXBean localMxBean() {
+ return localMxBean;
+ }
+
+ /** {@inheritDoc} */
+ @Override public CacheMetricsMXBean clusterMxBean() {
+ return clusterMxBean;
}
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index f5ebc0d..67d6a6c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -549,8 +549,10 @@ public class GridCacheProcessor extends GridProcessorAdapter {
cleanup(cfg, cfg.getAffinityMapper(), false);
cleanup(cfg, cctx.store().configuredStore(), false);
- if (!CU.isUtilityCache(cfg.getName()) && !CU.isSystemCache(cfg.getName()))
- unregisterMbean(cctx.cache().mxBean(), cfg.getName(), false);
+ if (!CU.isUtilityCache(cfg.getName()) && !CU.isSystemCache(cfg.getName())) {
+ unregisterMbean(cctx.cache().localMxBean(), cfg.getName(), false);
+ unregisterMbean(cctx.cache().clusterMxBean(), cfg.getName(), false);
+ }
NearCacheConfiguration nearCfg = cfg.getNearConfiguration();
@@ -1488,8 +1490,10 @@ public class GridCacheProcessor extends GridProcessorAdapter {
cacheCtx.cache(dht);
}
- if (!CU.isUtilityCache(cache.name()) && !CU.isSystemCache(cache.name()))
- registerMbean(cache.mxBean(), cache.name(), false);
+ if (!CU.isUtilityCache(cache.name()) && !CU.isSystemCache(cache.name())) {
+ registerMbean(cache.localMxBean(), cache.name(), false);
+ registerMbean(cache.clusterMxBean(), cache.name(), false);
+ }
return ret;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
index 9b4aff3..cbe16c6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
@@ -35,6 +35,7 @@ import org.apache.ignite.cache.CacheEntry;
import org.apache.ignite.cache.CacheMetrics;
import org.apache.ignite.cache.CachePeekMode;
import org.apache.ignite.cache.affinity.Affinity;
+import org.apache.ignite.cluster.ClusterGroup;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
@@ -143,16 +144,52 @@ public class GridCacheProxyImpl<K, V> implements IgniteInternalCache<K, V>, Exte
}
/** {@inheritDoc} */
+ @Override public CacheMetrics clusterMetrics() {
+ CacheOperationContext prev = gate.enter(opCtx);
+
+ try {
+ return delegate.clusterMetrics();
+ }
+ finally {
+ gate.leave(prev);
+ }
+ }
+
+ /** {@inheritDoc} */
+ @Override public CacheMetrics clusterMetrics(ClusterGroup grp) {
+ CacheOperationContext prev = gate.enter(opCtx);
+
+ try {
+ return delegate.clusterMetrics(grp);
+ }
+ finally {
+ gate.leave(prev);
+ }
+ }
+
+ /** {@inheritDoc} */
@Override public CacheConfiguration configuration() {
return delegate.configuration();
}
/** {@inheritDoc} */
- @Override public CacheMetrics metrics() {
+ @Override public CacheMetrics localMetrics() {
+ CacheOperationContext prev = gate.enter(opCtx);
+
+ try {
+ return delegate.localMetrics();
+ }
+ finally {
+ gate.leave(prev);
+ }
+ }
+
+ /** {@inheritDoc} */
+ @Override public CacheMetricsMXBean clusterMxBean() {
CacheOperationContext prev = gate.enter(opCtx);
try {
- return delegate.metrics();
+ return delegate.clusterMxBean();
}
finally {
gate.leave(prev);
@@ -160,11 +197,11 @@ public class GridCacheProxyImpl<K, V> implements IgniteInternalCache<K, V>, Exte
}
/** {@inheritDoc} */
- @Override public CacheMetricsMXBean mxBean() {
+ @Override public CacheMetricsMXBean localMxBean() {
CacheOperationContext prev = gate.enter(opCtx);
try {
- return delegate.mxBean();
+ return delegate.localMxBean();
}
finally {
gate.leave(prev);
http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/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 6e8bcbf..5b78271 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
@@ -222,7 +222,7 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V
CacheOperationContext prev = onEnter(gate, opCtx);
try {
- return ctx.cache().metrics();
+ return ctx.cache().clusterMetrics();
}
finally {
onLeave(gate, prev);
@@ -236,20 +236,20 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V
CacheOperationContext prev = onEnter(gate, opCtx);
try {
- List<CacheMetrics> metrics = new ArrayList<>(grp.nodes().size());
-
- for (ClusterNode node : grp.nodes()) {
- Map<Integer, CacheMetrics> nodeCacheMetrics = ((TcpDiscoveryNode)node).cacheMetrics();
+ return ctx.cache().clusterMetrics(grp);
+ }
+ finally {
+ onLeave(gate, prev);
+ }
+ }
- if (nodeCacheMetrics != null) {
- CacheMetrics e = nodeCacheMetrics.get(context().cacheId());
+ @Override public CacheMetrics localMetrics() {
+ GridCacheGateway<K, V> gate = this.gate;
- if (e != null)
- metrics.add(e);
- }
- }
+ CacheOperationContext prev = onEnter(gate, opCtx);
- return new CacheMetricsSnapshot(ctx.cache().metrics(), metrics);
+ try {
+ return ctx.cache().localMetrics();
}
finally {
onLeave(gate, prev);
@@ -263,7 +263,20 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V
CacheOperationContext prev = onEnter(gate, opCtx);
try {
- return ctx.cache().mxBean();
+ return ctx.cache().clusterMxBean();
+ }
+ finally {
+ onLeave(gate, prev);
+ }
+ }
+
+ @Override public CacheMetricsMXBean localMxBean() {
+ GridCacheGateway<K, V> gate = this.gate;
+
+ CacheOperationContext prev = onEnter(gate, opCtx);
+
+ try {
+ return ctx.cache().localMxBean();
}
finally {
onLeave(gate, prev);
http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
index 68d0f06..d2e0101 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
@@ -38,6 +38,7 @@ import org.apache.ignite.cache.CachePeekMode;
import org.apache.ignite.cache.affinity.Affinity;
import org.apache.ignite.cache.affinity.AffinityKeyMapped;
import org.apache.ignite.cache.store.CacheStore;
+import org.apache.ignite.cluster.ClusterGroup;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.internal.IgniteInternalFuture;
@@ -1543,18 +1544,40 @@ public interface IgniteInternalCache<K, V> extends Iterable<Cache.Entry<K, V>> {
public Affinity<K> affinity();
/**
- * Gets metrics (statistics) for this cache.
+ * Gets whole cluster metrics (statistics) for this cache.
*
* @return Cache metrics.
*/
- public CacheMetrics metrics();
+ public CacheMetrics clusterMetrics();
/**
- * Gets metrics (statistics) for this cache.
+ * Gets cluster group metrics (statistics) for this cache.
*
+ * @param grp Cluster group.
* @return Cache metrics.
*/
- public CacheMetricsMXBean mxBean();
+ public CacheMetrics clusterMetrics(ClusterGroup grp);
+
+ /**
+ * Gets local metrics (statistics) for this cache.
+ *
+ * @return Cache metrics.
+ */
+ public CacheMetrics localMetrics();
+
+ /**
+ * Gets whole cluster metrics (statistics) for this cache.
+ *
+ * @return Cache metrics.
+ */
+ public CacheMetricsMXBean clusterMxBean();
+
+ /**
+ * Gets local metrics (statistics) for this cache.
+ *
+ * @return Cache metrics.
+ */
+ public CacheMetricsMXBean localMxBean();
/**
* Gets size (in bytes) of all entries swapped to disk.
http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java
index 35ccd19..75683a8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java
@@ -482,7 +482,7 @@ public class PlatformCache extends PlatformAbstractTarget {
break;
case OP_METRICS:
- CacheMetrics metrics = cache.metrics();
+ CacheMetrics metrics = cache.localMetrics();
writer.writeLong(metrics.getCacheGets());
writer.writeLong(metrics.getCachePuts());
http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java
index a89913f..85611de 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java
@@ -1486,7 +1486,7 @@ public class GridCacheCommandHandler extends GridRestCommandHandlerAdapter {
/** {@inheritDoc} */
@Override public IgniteInternalFuture<?> applyx(IgniteInternalCache<Object, Object> c, GridKernalContext ctx) {
- CacheMetrics metrics = c.cache().metrics();
+ CacheMetrics metrics = c.cache().localMetrics();
assert metrics != null;
http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java
index 1a88813..0a77dc4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java
@@ -179,7 +179,7 @@ public class VisorCacheMetrics implements Serializable {
mode = cacheProcessor.cacheMode(cacheName);
sys = cacheProcessor.systemCache(cacheName);
- CacheMetrics m = c.metrics();
+ CacheMetrics m = c.localMetrics();
size = m.getSize();
keySize = m.getKeySize();
http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheResetMetricsTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheResetMetricsTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheResetMetricsTask.java
index 9ff4dae..ccec241 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheResetMetricsTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheResetMetricsTask.java
@@ -56,7 +56,7 @@ public class VisorCacheResetMetricsTask extends VisorOneNodeTask<String, Void> {
IgniteInternalCache cache = ignite.cachex(cacheName);
if (cache != null)
- cache.mxBean().clear();
+ cache.localMxBean().clear();
return null;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsForClusterGroupSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsForClusterGroupSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsForClusterGroupSelfTest.java
index c0075ad..9c24feb 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsForClusterGroupSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsForClusterGroupSelfTest.java
@@ -213,7 +213,7 @@ public class CacheMetricsForClusterGroupSelfTest extends GridCommonAbstractTest
CacheMetrics metrics = cache.metrics(grid(i).cluster().forCacheNodes(cache.getName()));
for (int j = 0; j < GRID_CNT; j++)
- ms[j] = grid(j).cache(cache.getName()).metrics();
+ ms[j] = grid(j).cache(cache.getName()).localMetrics();
// Static metrics
for (int j = 0; j < GRID_CNT; j++)
http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheSwapUnswapGetTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheSwapUnswapGetTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheSwapUnswapGetTest.java
index 214beb6..7fe1f34 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheSwapUnswapGetTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheSwapUnswapGetTest.java
@@ -264,7 +264,7 @@ public class CacheSwapUnswapGetTest extends GridCommonAbstractTest {
", offheap=" + cache.localSize(CachePeekMode.OFFHEAP) +
", swap=" + cache.localSize(CachePeekMode.SWAP) +
", total=" + cache.localSize() +
- ", offheapMem=" + cache.metrics().getOffHeapAllocatedSize() + ']');
+ ", offheapMem=" + cache.localMetrics().getOffHeapAllocatedSize() + ']');
}
done.set(true);
@@ -282,7 +282,7 @@ public class CacheSwapUnswapGetTest extends GridCommonAbstractTest {
int offheapSize = cache.localSize(CachePeekMode.OFFHEAP);
int swapSize = cache.localSize(CachePeekMode.SWAP);
int total = cache.localSize();
- long offheapMem = cache.metrics().getOffHeapAllocatedSize();
+ long offheapMem = cache.localMetrics().getOffHeapAllocatedSize();
log.info("Cache size [heap=" + onheapSize +
", offheap=" + offheapSize +
http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java
index 4c04df0..13bd081 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java
@@ -97,7 +97,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
for (int i = 0; i < gridCount(); i++) {
Ignite g = grid(i);
- g.cache(null).mxBean().clear();
+ g.cache(null).localMxBean().clear();
g.transactions().resetMetrics();
}
@@ -141,7 +141,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
// Assert that statistics is clear.
for (int i = 0; i < gridCount(); i++) {
- CacheMetrics m = grid(i).cache(null).metrics();
+ CacheMetrics m = grid(i).cache(null).localMetrics();
assertEquals(m.getCacheGets(), 0);
assertEquals(m.getCachePuts(), 0);
@@ -162,7 +162,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
public void testGetMetricsSnapshot() throws Exception {
IgniteCache<Object, Object> cache = grid(0).cache(null);
- assertNotSame("Method metrics() should return snapshot.", cache.metrics(), cache.metrics());
+ assertNotSame("Method metrics() should return snapshot.", cache.localMetrics(), cache.localMetrics());
}
/**
@@ -176,7 +176,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
for (int i = 0; i < KEY_CNT; i++)
cache.put(i, i);
- assertEquals(cache.metrics().getAverageRemoveTime(), 0.0, 0.0);
+ assertEquals(cache.localMetrics().getAverageRemoveTime(), 0.0, 0.0);
for (int i = 0; i < KEY_CNT; i++) {
cacheAsync.getAndRemove(i);
@@ -186,7 +186,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
fut.get();
}
- assert cache.metrics().getAverageRemoveTime() > 0;
+ assert cache.localMetrics().getAverageRemoveTime() > 0;
}
/**
@@ -206,7 +206,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
}
}
- assertEquals(cache.metrics().getAverageRemoveTime(), 0.0, 0.0);
+ assertEquals(cache.localMetrics().getAverageRemoveTime(), 0.0, 0.0);
cache.put(key, key);
@@ -216,7 +216,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
assertTrue(fut.get());
- assert cache.metrics().getAverageRemoveTime() >= 0;
+ assert cache.localMetrics().getAverageRemoveTime() >= 0;
}
/**
@@ -228,12 +228,12 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
for (int i = 0; i < KEY_CNT; i++)
cache.put(i, i);
- assertEquals(cache.metrics().getAverageRemoveTime(), 0.0, 0.0);
+ assertEquals(cache.localMetrics().getAverageRemoveTime(), 0.0, 0.0);
for (int i = 0; i < KEY_CNT; i++)
cache.remove(i);
- assert cache.metrics().getAverageRemoveTime() > 0;
+ assert cache.localMetrics().getAverageRemoveTime() > 0;
}
/**
@@ -246,7 +246,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
cache.put(2, 2);
cache.put(3, 3);
- assertEquals(cache.metrics().getAverageRemoveTime(), 0.0, 0.0);
+ assertEquals(cache.localMetrics().getAverageRemoveTime(), 0.0, 0.0);
Set<Integer> keys = new HashSet<>(4, 1);
keys.add(1);
@@ -255,7 +255,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
cache.removeAll(keys);
- float averageRemoveTime = cache.metrics().getAverageRemoveTime();
+ float averageRemoveTime = cache.localMetrics().getAverageRemoveTime();
assert averageRemoveTime >= 0;
}
@@ -280,7 +280,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
}
}
- assertEquals(cache.metrics().getAverageRemoveTime(), 0.0, 0.0);
+ assertEquals(cache.localMetrics().getAverageRemoveTime(), 0.0, 0.0);
cacheAsync.removeAll(keys);
@@ -288,7 +288,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
fut.get();
- assert cache.metrics().getAverageRemoveTime() >= 0;
+ assert cache.localMetrics().getAverageRemoveTime() >= 0;
}
@@ -300,17 +300,17 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
cache.put(1, 1);
- assertEquals(0.0, cache.metrics().getAverageGetTime(), 0.0);
+ assertEquals(0.0, cache.localMetrics().getAverageGetTime(), 0.0);
cache.get(1);
- float averageGetTime = cache.metrics().getAverageGetTime();
+ float averageGetTime = cache.localMetrics().getAverageGetTime();
assert averageGetTime > 0;
cache.get(2);
- assert cache.metrics().getAverageGetTime() > 0;
+ assert cache.localMetrics().getAverageGetTime() > 0;
}
/**
@@ -319,13 +319,13 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
public void testGetAllAvgTime() throws Exception {
IgniteCache<Integer, Integer> cache = grid(0).cache(null);
- assertEquals(0.0, cache.metrics().getAverageGetTime(), 0.0);
+ assertEquals(0.0, cache.localMetrics().getAverageGetTime(), 0.0);
cache.put(1, 1);
cache.put(2, 2);
cache.put(3, 3);
- assertEquals(0.0, cache.metrics().getAverageGetTime(), 0.0);
+ assertEquals(0.0, cache.localMetrics().getAverageGetTime(), 0.0);
Set<Integer> keys = new TreeSet<>();
keys.add(1);
@@ -334,7 +334,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
cache.getAll(keys);
- assert cache.metrics().getAverageGetTime() > 0;
+ assert cache.localMetrics().getAverageGetTime() > 0;
}
/**
@@ -344,13 +344,13 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
IgniteCache<Object, Object> cache = grid(0).cache(null);
IgniteCache<Object, Object> cacheAsync = cache.withAsync();
- assertEquals(0.0, cache.metrics().getAverageGetTime(), 0.0);
+ assertEquals(0.0, cache.localMetrics().getAverageGetTime(), 0.0);
cache.put(1, 1);
cache.put(2, 2);
cache.put(3, 3);
- assertEquals(0.0, cache.metrics().getAverageGetTime(), 0.0);
+ assertEquals(0.0, cache.localMetrics().getAverageGetTime(), 0.0);
Set<Integer> keys = new TreeSet<>();
keys.add(1);
@@ -365,24 +365,24 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
TimeUnit.MILLISECONDS.sleep(100L);
- assert cache.metrics().getAverageGetTime() > 0;
+ assert cache.localMetrics().getAverageGetTime() > 0;
}
/**
* @throws Exception If failed.
*/
public void testPutAvgTime() throws Exception {
- IgniteCache<Integer, Integer> cache = grid(0).cache(null);
+ final IgniteCache<Integer, Integer> cache = grid(0).cache(null);
- assertEquals(0.0, cache.metrics().getAveragePutTime(), 0.0);
- assertEquals(0, cache.metrics().getCachePuts());
+ assertEquals(0.0, cache.localMetrics().getAveragePutTime(), 0.0);
+ assertEquals(0, cache.localMetrics().getCachePuts());
for (int i = 0; i < KEY_CNT; i++)
cache.put(i, i);
- assert cache.metrics().getAveragePutTime() > 0;
+ assert cache.localMetrics().getAveragePutTime() > 0;
- assertEquals(KEY_CNT, cache.metrics().getCachePuts());
+ assertEquals(KEY_CNT, cache.localMetrics().getCachePuts());
}
/**
@@ -392,8 +392,8 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
IgniteCache<Object, Object> cache = grid(0).cache(null);
IgniteCache<Object, Object> cacheAsync = cache.withAsync();
- assertEquals(0.0, cache.metrics().getAveragePutTime(), 0.0);
- assertEquals(0, cache.metrics().getCachePuts());
+ assertEquals(0.0, cache.localMetrics().getAveragePutTime(), 0.0);
+ assertEquals(0, cache.localMetrics().getCachePuts());
cacheAsync.put(1, 1);
@@ -401,7 +401,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
TimeUnit.MILLISECONDS.sleep(100L);
- assert cache.metrics().getAveragePutTime() > 0;
+ assert cache.localMetrics().getAveragePutTime() > 0;
}
/**
@@ -421,8 +421,8 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
}
}
- assertEquals(0.0, cache.metrics().getAveragePutTime(), 0.0);
- assertEquals(0.0, cache.metrics().getAverageGetTime(), 0.0);
+ assertEquals(0.0, cache.localMetrics().getAveragePutTime(), 0.0);
+ assertEquals(0.0, cache.localMetrics().getAverageGetTime(), 0.0);
cacheAsync.getAndPut(key, key);
@@ -432,8 +432,8 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
TimeUnit.MILLISECONDS.sleep(100L);
- assert cache.metrics().getAveragePutTime() > 0;
- assert cache.metrics().getAverageGetTime() > 0;
+ assert cache.localMetrics().getAveragePutTime() > 0;
+ assert cache.localMetrics().getAverageGetTime() > 0;
}
/**
@@ -453,7 +453,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
}
}
- assertEquals(0.0f, cache.metrics().getAveragePutTime());
+ assertEquals(0.0f, cache.localMetrics().getAveragePutTime());
cacheAsync.putIfAbsent(key, key);
@@ -463,7 +463,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
TimeUnit.MILLISECONDS.sleep(100L);
- assert cache.metrics().getAveragePutTime() > 0;
+ assert cache.localMetrics().getAveragePutTime() > 0;
}
/**
@@ -483,7 +483,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
}
}
- assertEquals(0.0f, cache.metrics().getAveragePutTime());
+ assertEquals(0.0f, cache.localMetrics().getAveragePutTime());
cacheAsync.getAndPutIfAbsent(key, key);
@@ -493,7 +493,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
TimeUnit.MILLISECONDS.sleep(100L);
- assert cache.metrics().getAveragePutTime() > 0;
+ assert cache.localMetrics().getAveragePutTime() > 0;
}
/**
@@ -502,8 +502,8 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
public void testPutAllAvgTime() throws Exception {
IgniteCache<Integer, Integer> cache = grid(0).cache(null);
- assertEquals(0.0, cache.metrics().getAveragePutTime(), 0.0);
- assertEquals(0, cache.metrics().getCachePuts());
+ assertEquals(0.0, cache.localMetrics().getAveragePutTime(), 0.0);
+ assertEquals(0, cache.localMetrics().getCachePuts());
Map<Integer, Integer> values = new HashMap<>();
@@ -513,10 +513,10 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
cache.putAll(values);
- float averagePutTime = cache.metrics().getAveragePutTime();
+ float averagePutTime = cache.localMetrics().getAveragePutTime();
assert averagePutTime >= 0;
- assertEquals(values.size(), cache.metrics().getCachePuts());
+ assertEquals(values.size(), cache.localMetrics().getCachePuts());
}
/**
@@ -539,12 +539,12 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
expReads += expectedReadsPerPut(isPrimary);
expMisses += expectedMissesPerPut(isPrimary);
- info("Puts: " + cache0.metrics().getCachePuts());
+ info("Puts: " + cache0.localMetrics().getCachePuts());
for (int j = 0; j < gridCount(); j++) {
IgniteCache<Integer, Integer> cache = grid(j).cache(null);
- int cacheWrites = (int)cache.metrics().getCachePuts();
+ int cacheWrites = (int)cache.localMetrics().getCachePuts();
assertEquals("Wrong cache metrics [i=" + i + ", grid=" + j + ']', i + 1, cacheWrites);
}
@@ -561,7 +561,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
int misses = 0;
for (int i = 0; i < gridCount(); i++) {
- CacheMetrics m = grid(i).cache(null).metrics();
+ CacheMetrics m = grid(i).cache(null).localMetrics();
puts += m.getCachePuts();
reads += m.getCacheGets();
@@ -583,18 +583,18 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
public void testMissHitPercentage() throws Exception {
IgniteCache<Integer, Integer> cache0 = grid(0).cache(null);
- int keyCnt = keyCount();
+ final int keyCnt = keyCount();
// Put and get a few keys.
for (int i = 0; i < keyCnt; i++) {
cache0.getAndPut(i, i); // +1 read
- info("Puts: " + cache0.metrics().getCachePuts());
+ info("Puts: " + cache0.localMetrics().getCachePuts());
for (int j = 0; j < gridCount(); j++) {
IgniteCache<Integer, Integer> cache = grid(j).cache(null);
- long cacheWrites = cache.metrics().getCachePuts();
+ long cacheWrites = cache.localMetrics().getCachePuts();
assertEquals("Wrong cache metrics [i=" + i + ", grid=" + j + ']', i + 1, cacheWrites);
}
@@ -604,7 +604,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
// Check metrics for the whole cache.
for (int i = 0; i < gridCount(); i++) {
- CacheMetrics m = grid(i).cache(null).metrics();
+ CacheMetrics m = grid(i).cache(null).localMetrics();
assertEquals(m.getCacheHits() * 100f / m.getCacheGets(), m.getCacheHitPercentage(), 0.1f);
assertEquals(m.getCacheMisses() * 100f / m.getCacheGets(), m.getCacheMissPercentage(), 0.1f);
@@ -639,7 +639,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
long misses = 0;
for (int i = 0; i < gridCount(); i++) {
- CacheMetrics m = grid(i).cache(null).metrics();
+ CacheMetrics m = grid(i).cache(null).localMetrics();
puts += m.getCachePuts();
reads += m.getCacheGets();
@@ -659,8 +659,8 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
public void testMissesOnEmptyCache() throws Exception {
IgniteCache<Integer, Integer> cache = grid(0).cache(null);
- assertEquals("Expected 0 read", 0, cache.metrics().getCacheGets());
- assertEquals("Expected 0 miss", 0, cache.metrics().getCacheMisses());
+ assertEquals("Expected 0 read", 0, cache.localMetrics().getCacheGets());
+ assertEquals("Expected 0 miss", 0, cache.localMetrics().getCacheMisses());
Integer key = null;
@@ -676,19 +676,19 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
cache.get(key);
- assertEquals("Expected 1 read", 1, cache.metrics().getCacheGets());
- assertEquals("Expected 1 miss", 1, cache.metrics().getCacheMisses());
+ assertEquals("Expected 1 read", 1, cache.localMetrics().getCacheGets());
+ assertEquals("Expected 1 miss", 1, cache.localMetrics().getCacheMisses());
cache.getAndPut(key, key); // +1 read, +1 miss.
- assertEquals("Expected 2 reads", 2, cache.metrics().getCacheGets());
+ assertEquals("Expected 2 reads", 2, cache.localMetrics().getCacheGets());
cache.get(key);
- assertEquals("Expected 1 write", 1, cache.metrics().getCachePuts());
- assertEquals("Expected 3 reads", 3, cache.metrics().getCacheGets());
- assertEquals("Expected 2 misses", 2, cache.metrics().getCacheMisses());
- assertEquals("Expected 1 hit", 1, cache.metrics().getCacheHits());
+ assertEquals("Expected 1 write", 1, cache.localMetrics().getCachePuts());
+ assertEquals("Expected 3 reads", 3, cache.localMetrics().getCacheGets());
+ assertEquals("Expected 2 misses", 2, cache.localMetrics().getCacheMisses());
+ assertEquals("Expected 1 hit", 1, cache.localMetrics().getCacheHits());
}
/**
@@ -702,7 +702,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
// +1 remove
cache.remove(1);
- assertEquals(1L, cache.metrics().getCacheRemovals());
+ assertEquals(1L, cache.localMetrics().getCacheRemovals());
}
/**
@@ -718,8 +718,8 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
cache.localEvict(Collections.singleton(1));
- assertEquals(0L, cache.metrics().getCacheRemovals());
- assertEquals(1L, cache.metrics().getCacheEvictions());
+ assertEquals(0L, cache.localMetrics().getCacheRemovals());
+ assertEquals(1L, cache.localMetrics().getCacheEvictions());
}
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapValuesEvictionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapValuesEvictionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapValuesEvictionSelfTest.java
index a3cc785..108ee90 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapValuesEvictionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapValuesEvictionSelfTest.java
@@ -103,9 +103,9 @@ public class GridCacheOffHeapValuesEvictionSelfTest extends GridCacheAbstractSel
assertTrue(MAX_VALS_AMOUNT - 5 <= cache.size(CachePeekMode.ONHEAP));
assertEquals(cache.size(CachePeekMode.ALL) - cache.size(CachePeekMode.ONHEAP), cache.size(CachePeekMode.SWAP));
- assertTrue((MAX_VALS_AMOUNT + 5) * VAL_SIZE > cache.metrics().getOffHeapAllocatedSize());
- assertTrue((MAX_VALS_AMOUNT - 5) * VAL_SIZE < cache.metrics().getOffHeapAllocatedSize());
- assertTrue(cache.metrics().getOffHeapAllocatedSize() >= cache.size(CachePeekMode.ONHEAP) * VAL_SIZE);
+ assertTrue((MAX_VALS_AMOUNT + 5) * VAL_SIZE > cache.localMetrics().getOffHeapAllocatedSize());
+ assertTrue((MAX_VALS_AMOUNT - 5) * VAL_SIZE < cache.localMetrics().getOffHeapAllocatedSize());
+ assertTrue(cache.localMetrics().getOffHeapAllocatedSize() >= cache.size(CachePeekMode.ONHEAP) * VAL_SIZE);
}
/**
@@ -143,9 +143,9 @@ public class GridCacheOffHeapValuesEvictionSelfTest extends GridCacheAbstractSel
assertEquals(cache.size(CachePeekMode.ALL) - cache.size(CachePeekMode.ONHEAP) - cache.size(CachePeekMode.OFFHEAP),
cache.size(CachePeekMode.SWAP));
- assertTrue((MAX_VALS_AMOUNT + 5) * VAL_SIZE > cache.metrics().getOffHeapAllocatedSize());
- assertTrue((MAX_VALS_AMOUNT - 5) * VAL_SIZE < cache.metrics().getOffHeapAllocatedSize());
- assertTrue(cache.metrics().getOffHeapAllocatedSize() >= cache.size(CachePeekMode.OFFHEAP) * VAL_SIZE);
+ assertTrue((MAX_VALS_AMOUNT + 5) * VAL_SIZE > cache.localMetrics().getOffHeapAllocatedSize());
+ assertTrue((MAX_VALS_AMOUNT - 5) * VAL_SIZE < cache.localMetrics().getOffHeapAllocatedSize());
+ assertTrue(cache.localMetrics().getOffHeapAllocatedSize() >= cache.size(CachePeekMode.OFFHEAP) * VAL_SIZE);
}
/**
@@ -181,9 +181,9 @@ public class GridCacheOffHeapValuesEvictionSelfTest extends GridCacheAbstractSel
assertTrue(MAX_VALS_AMOUNT >= cache.size(CachePeekMode.OFFHEAP));
assertTrue(MAX_VALS_AMOUNT - 5 <= cache.size(CachePeekMode.OFFHEAP));
- assertTrue((MAX_VALS_AMOUNT + 5) * VAL_SIZE > cache.metrics().getOffHeapAllocatedSize());
- assertTrue((MAX_VALS_AMOUNT - 5) * VAL_SIZE < cache.metrics().getOffHeapAllocatedSize());
- assertTrue(cache.metrics().getOffHeapAllocatedSize() >= cache.size(CachePeekMode.OFFHEAP) * VAL_SIZE);
+ assertTrue((MAX_VALS_AMOUNT + 5) * VAL_SIZE > cache.localMetrics().getOffHeapAllocatedSize());
+ assertTrue((MAX_VALS_AMOUNT - 5) * VAL_SIZE < cache.localMetrics().getOffHeapAllocatedSize());
+ assertTrue(cache.localMetrics().getOffHeapAllocatedSize() >= cache.size(CachePeekMode.OFFHEAP) * VAL_SIZE);
}
/** Fill cache with values. */