diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache30/DistributedNoAckRegionCCEDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache30/DistributedNoAckRegionCCEDUnitTest.java index a46811388c81..ddba9ffdfd2b 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache30/DistributedNoAckRegionCCEDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache30/DistributedNoAckRegionCCEDUnitTest.java @@ -334,13 +334,13 @@ public void run() { public void run() { CCRegion.put(invalidationKey, "initialValue"); - int invalidationCount = CCRegion.getCachePerfStats().getInvalidates(); + long invalidationCount = CCRegion.getCachePerfStats().getInvalidates(); CCRegion.invalidate(invalidationKey); CCRegion.invalidate(invalidationKey); assertEquals(invalidationCount + 1, CCRegion.getCachePerfStats().getInvalidates()); // also test destroy() while we're at it. It should throw an exception - int destroyCount = CCRegion.getCachePerfStats().getDestroys(); + long destroyCount = CCRegion.getCachePerfStats().getDestroys(); CCRegion.destroy(invalidationKey); try { CCRegion.destroy(invalidationKey); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/GIIDeltaDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/GIIDeltaDUnitTest.java index eb29023e6be8..31c3b060a5f9 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/GIIDeltaDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/GIIDeltaDUnitTest.java @@ -2292,7 +2292,7 @@ public void run() { cache.getLogger().info("Delta contains: " + size + " keys"); assertEquals(expectedKeyNum, size); - int num = stats.getDeltaGetInitialImagesCompleted(); + long num = stats.getDeltaGetInitialImagesCompleted(); cache.getLogger().info("Delta GII completed: " + num + " times"); assertEquals(expectedDeltaGIINum, num); } diff --git a/geode-core/src/integrationTest/java/org/apache/geode/TXJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/TXJUnitTest.java index 585cb363c69c..29ea1f9f1503 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/TXJUnitTest.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/TXJUnitTest.java @@ -247,9 +247,9 @@ public void testSimpleOps() throws CacheException { cmtre.setUserAttribute("uaValue1"); assertEquals("uaValue1", cmtre.getUserAttribute()); - int txRollbackChanges = stats.getTxRollbackChanges(); - int txCommitChanges = stats.getTxCommitChanges(); - int txFailureChanges = stats.getTxFailureChanges(); + long txRollbackChanges = stats.getTxRollbackChanges(); + long txCommitChanges = stats.getTxCommitChanges(); + long txFailureChanges = stats.getTxFailureChanges(); this.txMgr.begin(); Region.Entry txre = this.region.getEntry("uaKey"); assertEquals(this.region, txre.getRegion()); @@ -299,9 +299,9 @@ public void testSimpleOps() throws CacheException { } { - int txRollbackChanges = stats.getTxRollbackChanges(); - int txCommitChanges = stats.getTxCommitChanges(); - int txFailureChanges = stats.getTxFailureChanges(); + long txRollbackChanges = stats.getTxRollbackChanges(); + long txCommitChanges = stats.getTxCommitChanges(); + long txFailureChanges = stats.getTxFailureChanges(); this.region.create("key1", "value1"); this.txMgr.begin(); this.region.invalidate("key1"); @@ -432,7 +432,7 @@ public void testWriteOps() throws CacheException { @Test public void testTwoRegionTxs() throws CacheException { final CachePerfStats stats = this.cache.getCachePerfStats(); - int txCommitChanges; + long txCommitChanges; TransactionId myTxId; AttributesFactory attributesFactory = new AttributesFactory<>(); @@ -2739,7 +2739,7 @@ public int getBeforeDestroyCalls(boolean fetchLocal) { } private void doNonTxInvalidateRegionOp(CachePerfStats stats) throws Exception { - int txRollbackChanges = stats.getTxRollbackChanges(); + long txRollbackChanges = stats.getTxRollbackChanges(); this.region.create("key1", "value1"); this.region.create("key2", "value2"); this.txMgr.begin(); @@ -2771,7 +2771,7 @@ private void doNonTxInvalidateRegionOp(CachePerfStats stats) throws Exception { } private void doNonTxDestroyRegionOp(CachePerfStats stats) throws Exception { - int txRollbackChanges = stats.getTxRollbackChanges(); + long txRollbackChanges = stats.getTxRollbackChanges(); this.region.put("key1", "value1"); this.region.put("key2", "value2"); this.txMgr.begin(); @@ -4627,15 +4627,15 @@ class statsValidator { private long txSuccessLifeTime; private long txFailedLifeTime; private long txRollbackLifeTime; - private int txCommits; - private int txFailures; - private int txRollbacks; + private long txCommits; + private long txFailures; + private long txRollbacks; private long txCommitTime; private long txFailureTime; private long txRollbackTime; - private int txCommitChanges; - private int txFailureChanges; - private int txRollbackChanges; + private long txCommitChanges; + private long txFailureChanges; + private long txRollbackChanges; private CachePerfStats stats; @@ -4670,15 +4670,15 @@ private void setTxRollbackLifeTime(long txRollbackLifeTime) { this.txRollbackLifeTime = txRollbackLifeTime; } - private void setTxCommits(int txCommits) { + private void setTxCommits(long txCommits) { this.txCommits = txCommits; } - private void setTxFailures(int txFailures) { + private void setTxFailures(long txFailures) { this.txFailures = txFailures; } - private void setTxRollbacks(int txRollbacks) { + private void setTxRollbacks(long txRollbacks) { this.txRollbacks = txRollbacks; } @@ -4694,15 +4694,15 @@ private void setTxRollbackTime(long txRollbackTime) { this.txRollbackTime = txRollbackTime; } - private void setTxCommitChanges(int txCommitChanges) { + private void setTxCommitChanges(long txCommitChanges) { this.txCommitChanges = txCommitChanges; } - private void setTxFailureChanges(int txFailureChanges) { + private void setTxFailureChanges(long txFailureChanges) { this.txFailureChanges = txFailureChanges; } - private void setTxRollbackChanges(int txRollbackChanges) { + private void setTxRollbackChanges(long txRollbackChanges) { this.txRollbackChanges = txRollbackChanges; } @@ -4831,10 +4831,10 @@ private void assertValid() { public void testCacheStats() throws CacheException { CachePerfStats cacheStats = this.cache.getCachePerfStats(); // quick sanity check to make sure perf stats work non-tx - int creates; - int destroys; - int puts; - int invalidates; + long creates; + long destroys; + long puts; + long invalidates; creates = cacheStats.getCreates(); destroys = cacheStats.getDestroys(); @@ -5778,7 +5778,7 @@ public void afterRollback(TransactionEvent event) { { // distributed invalidate // first make sure invalidate is counted as a change - int txRollbackChanges = stats.getTxRollbackChanges(); + long txRollbackChanges = stats.getTxRollbackChanges(); this.region.create("key1", "value1"); this.txMgr.begin(); this.region.invalidate("key1"); @@ -5837,7 +5837,7 @@ public void afterRollback(TransactionEvent event) { { // local invalidate // first make sure invalidate is counted as a change - int txRollbackChanges = stats.getTxRollbackChanges(); + long txRollbackChanges = stats.getTxRollbackChanges(); this.region.create("key1", "value1"); this.txMgr.begin(); this.region.localInvalidate("key1"); diff --git a/geode-core/src/integrationTest/java/org/apache/geode/cache/CacheStatisticsTest.java b/geode-core/src/integrationTest/java/org/apache/geode/cache/CacheStatisticsTest.java new file mode 100644 index 000000000000..8480e6a818c5 --- /dev/null +++ b/geode-core/src/integrationTest/java/org/apache/geode/cache/CacheStatisticsTest.java @@ -0,0 +1,42 @@ +/* + * 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.geode.cache; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +import org.apache.geode.internal.cache.GemFireCacheImpl; + +public class CacheStatisticsTest { + + @Test + public void whenRegionPuts_increasesStatisticsPutCounter() { + CacheFactory cacheFactory = new CacheFactory(); + Region region = + cacheFactory.create().createRegionFactory(RegionShortcut.PARTITION) + .create("region"); + + + GemFireCacheImpl regionService = (GemFireCacheImpl) region.getRegionService(); + long oldPuts = regionService.getCachePerfStats().getPuts(); + + region.put("some", "value"); + + long newPuts = regionService.getCachePerfStats().getPuts(); + + assertEquals(oldPuts + 1, newPuts); + } +} diff --git a/geode-core/src/integrationTest/java/org/apache/geode/cache/ProxyJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/cache/ProxyJUnitTest.java index d832a321d98f..1d8ea5745c1c 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/cache/ProxyJUnitTest.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/cache/ProxyJUnitTest.java @@ -642,13 +642,11 @@ public void testRegionMethods() throws Exception { ExpectedEntryEvent expee = new ExpectedEntryEvent(); expee.r = r; expee.key = "key"; - int creates = getStats().getCreates(); - // int puts = getStats().getPuts(); - // int updates = getStats().getUpdates(); - int destroys = getStats().getDestroys(); - int invalidates = getStats().getInvalidates(); - int gets = getStats().getGets(); - int misses = getStats().getMisses(); + long creates = getStats().getCreates(); + long destroys = getStats().getDestroys(); + long invalidates = getStats().getInvalidates(); + long gets = getStats().getGets(); + long misses = getStats().getMisses(); r.put("key", "value", cbArg); expee.op = Operation.CREATE; @@ -836,13 +834,10 @@ public void testMapMethods() throws Exception { checkNoCW(); checkCL(expre); - int creates = getStats().getCreates(); - // int puts = getStats().getPuts(); - // int updates = getStats().getUpdates(); - int destroys = getStats().getDestroys(); - // int invalidates = getStats().getInvalidates(); - int gets = getStats().getGets(); - int misses = getStats().getMisses(); + long creates = getStats().getCreates(); + long destroys = getStats().getDestroys(); + long gets = getStats().getGets(); + long misses = getStats().getMisses(); ExpectedEntryEvent expee = new ExpectedEntryEvent(); expee.r = r; expee.key = "key"; @@ -928,13 +923,9 @@ public void testAllMethodsWithTX() throws Exception { checkNoTL(); checkCL(expre); - int creates = getStats().getCreates(); - // int puts = getStats().getPuts(); - // int updates = getStats().getUpdates(); - int destroys = getStats().getDestroys(); - int invalidates = getStats().getInvalidates(); - // int gets = getStats().getGets(); - // int misses = getStats().getMisses(); + long creates = getStats().getCreates(); + long destroys = getStats().getDestroys(); + long invalidates = getStats().getInvalidates(); ExpectedEntryEvent expee = new ExpectedEntryEvent(); expee.r = r; expee.key = "key"; diff --git a/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/PartitionedRegionSingleNodeOperationsJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/PartitionedRegionSingleNodeOperationsJUnitTest.java index 62935cfa8867..f8cf2ee3f7e5 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/PartitionedRegionSingleNodeOperationsJUnitTest.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/PartitionedRegionSingleNodeOperationsJUnitTest.java @@ -200,7 +200,7 @@ public void test001Destroy() throws Exception { for (int num = 0; num < 3; num++) { pr.put(new Integer(num), val); - final int initialDestroyCount = getDestroyCount(pr); + final long initialDestroyCount = getDestroyCount(pr); pr.destroy(new Integer(num)); assertEquals(initialDestroyCount + 1, getDestroyCount(pr)); } @@ -228,12 +228,12 @@ public void test001Destroy() throws Exception { } } - private int getDestroyCount(PartitionedRegion pr) { - return ((GemFireCacheImpl) pr.getCache()).getCachePerfStats().getDestroys(); + private long getDestroyCount(PartitionedRegion pr) { + return pr.getCache().getCachePerfStats().getDestroys(); } - private int getCreateCount(PartitionedRegion pr) { - return ((GemFireCacheImpl) pr.getCache()).getCachePerfStats().getCreates(); + private long getCreateCount(PartitionedRegion pr) { + return pr.getCache().getCachePerfStats().getCreates(); } /** @@ -1075,7 +1075,7 @@ public void test019Create() throws EntryExistsException { final String expectedExceptions = EntryExistsException.class.getName(); for (int num = 0; num < 3; num++) { key++; - final int initialCreates = getCreateCount(pr); + final long initialCreates = getCreateCount(pr); pr.create(new Integer(key), val + num); assertEquals(initialCreates + 1, getCreateCount(pr)); final Object getObj1 = pr.get(new Integer(key)); diff --git a/geode-core/src/integrationTest/java/org/apache/geode/management/bean/stats/MemberLevelStatsJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/management/bean/stats/MemberLevelStatsJUnitTest.java index 220f0fd375e6..f315c5453019 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/management/bean/stats/MemberLevelStatsJUnitTest.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/management/bean/stats/MemberLevelStatsJUnitTest.java @@ -513,7 +513,7 @@ private long getNetLoadsAverageLatency() { return bridge.getNetLoadsAverageLatency(); } - private int getTotalNetSearchCompleted() { + private long getTotalNetSearchCompleted() { return bridge.getTotalNetSearchCompleted(); } diff --git a/geode-core/src/integrationTest/resources/org/apache/geode/codeAnalysis/sanctionedDataSerializables.txt b/geode-core/src/integrationTest/resources/org/apache/geode/codeAnalysis/sanctionedDataSerializables.txt index 3117ff4bd869..d8325485e740 100644 --- a/geode-core/src/integrationTest/resources/org/apache/geode/codeAnalysis/sanctionedDataSerializables.txt +++ b/geode-core/src/integrationTest/resources/org/apache/geode/codeAnalysis/sanctionedDataSerializables.txt @@ -494,11 +494,13 @@ org/apache/geode/internal/admin/remote/ChangeRefreshIntervalMessage,2 fromData,16 toData,16 -org/apache/geode/internal/admin/remote/ClientHealthStats,4 +org/apache/geode/internal/admin/remote/ClientHealthStats,6 fromData,73 -fromDataPre_GFE_8_0_0_0,65 +fromDataPre_GEODE_1_9_0_0,77 +fromDataPre_GFE_8_0_0_0,69 toData,73 -toDataPre_GFE_8_0_0_0,65 +toDataPre_GEODE_1_9_0_0,77 +toDataPre_GFE_8_0_0_0,69 org/apache/geode/internal/admin/remote/CompactRequest,2 fromData,6 diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/ClientStatsManager.java b/geode-core/src/main/java/org/apache/geode/internal/admin/ClientStatsManager.java index 9ffa195e048b..0e0b4727fc0b 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/admin/ClientStatsManager.java +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/ClientStatsManager.java @@ -190,16 +190,16 @@ private static ClientHealthStats getClientHealthStats(InternalCache currentCache } ClientHealthStats stats = new ClientHealthStats(); - int gets = -1; - int puts = -1; - int misses = -1; - int cacheListenerCalls = -1; + long gets = -1; + long puts = -1; + long misses = -1; + long cacheListenerCalls = -1; if (cachePerfStats != null) { - gets = cachePerfStats.getInt("gets"); - puts = cachePerfStats.getInt("puts"); - misses = cachePerfStats.getInt("misses"); - cacheListenerCalls = cachePerfStats.getInt("cacheListenerCallsCompleted"); + gets = cachePerfStats.getLong("gets"); + puts = cachePerfStats.getLong("puts"); + misses = cachePerfStats.getLong("misses"); + cacheListenerCalls = cachePerfStats.getLong("cacheListenerCallsCompleted"); } long processCpuTime = -1; diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/ClientHealthStats.java b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/ClientHealthStats.java index 76328d07bd7e..6deab4857ea9 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/ClientHealthStats.java +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/ClientHealthStats.java @@ -36,45 +36,45 @@ public class ClientHealthStats implements DataSerializableFixedID, Serializable private static final long serialVersionUID = 4229401714870332766L; /** - * "numOfGets", IntCounter, "The total number of times a successful get has been done on this + * "numOfGets", "The total number of times a successful get has been done on this * cache." Java: CachePerfStats.gets Native: Not yet Defined */ - protected int numOfGets; + private long numOfGets; /** - * "numOfPuts", IntCounter, "The total number of times an entry is added or replaced in this cache + * "numOfPuts", "The total number of times an entry is added or replaced in this cache * as a result of a local operation (put(), create(), or get() which results in load, netsearch, * or netloading a value). Note that this only counts puts done explicitly on this cache. It does * not count updates pushed from other caches." Java: CachePerfStats.puts Native: Not yet Defined */ - protected int numOfPuts; + private long numOfPuts; /** - * Represents number of cache misses in this client. IntCounter, "Total number of times a get on + * Represents number of cache misses in this client. "Total number of times a get on * the cache did not find a value already in local memory." Java: CachePerfStats.misses */ - protected int numOfMisses; + private long numOfMisses; /** - * Represents number of cache listners calls completed. IntCounter, "Total number of times a cache + * Represents number of cache listners calls completed. "Total number of times a cache * listener call has completed." Java: CachePerfStats.cacheListenerCallsCompleted */ - protected int numOfCacheListenerCalls; + private long numOfCacheListenerCalls; /** - * Represents total number of active threads in the client VM. IntCounter, "Current number of live + * Represents total number of active threads in the client VM. "Current number of live * threads (both daemon and non-daemon) in this VM." Java: VMStats.threads **/ - protected int numOfThreads; + private int numOfThreads; /** - * Represents the CPU time used by the process (in nanoseconds). LongCounter, "CPU timed used by + * Represents the CPU time used by the process (in nanoseconds). "CPU timed used by * the process in nanoseconds." Java: VMStats.processCpuTime **/ protected long processCpuTime; /** - * Represents the number of cpus available to the java VM on its machine. IntCounter, "Number of + * Represents the number of cpus available to the java VM on its machine. "Number of * cpus available to the java VM on its machine." Java: VMStats.cpus **/ protected int cpus; @@ -83,15 +83,15 @@ public class ClientHealthStats implements DataSerializableFixedID, Serializable /** * Represents time when this snapshot of the client statistics was taken. **/ - protected Date updateTime; + private Date updateTime; /** * Represents stats for a poolName . **/ - private HashMap poolStats = new HashMap(); + private HashMap poolStats = new HashMap<>(); /** The versions in which this message was modified */ - private static final Version[] dsfidVersions = new Version[] {Version.GFE_80}; + private static final Version[] dsfidVersions = new Version[] {Version.GFE_80, Version.GEODE_190}; public ClientHealthStats() {} @@ -100,7 +100,7 @@ public ClientHealthStats() {} * * @return total number of get requests completed successfully. */ - public int getNumOfGets() { + public long getNumOfGets() { return numOfGets; } @@ -109,7 +109,7 @@ public int getNumOfGets() { * * @param numOfGets Total number of get requests to be set. */ - public void setNumOfGets(int numOfGets) { + public void setNumOfGets(long numOfGets) { this.numOfGets = numOfGets; } @@ -118,7 +118,7 @@ public void setNumOfGets(int numOfGets) { * * @return Total number of put requests completed. */ - public int getNumOfPuts() { + public long getNumOfPuts() { return numOfPuts; } @@ -127,7 +127,7 @@ public int getNumOfPuts() { * * @param numOfPuts Total number of put requests to be set. */ - public void setNumOfPuts(int numOfPuts) { + public void setNumOfPuts(long numOfPuts) { this.numOfPuts = numOfPuts; } @@ -136,7 +136,7 @@ public void setNumOfPuts(int numOfPuts) { * * @return total number of cache misses. */ - public int getNumOfMisses() { + public long getNumOfMisses() { return numOfMisses; } @@ -145,7 +145,7 @@ public int getNumOfMisses() { * * @param numOfMisses total number of cache misses. */ - public void setNumOfMisses(int numOfMisses) { + public void setNumOfMisses(long numOfMisses) { this.numOfMisses = numOfMisses; } @@ -154,7 +154,7 @@ public void setNumOfMisses(int numOfMisses) { * * @return total number of cache listener calls completed. */ - public int getNumOfCacheListenerCalls() { + public long getNumOfCacheListenerCalls() { return numOfCacheListenerCalls; } @@ -163,7 +163,7 @@ public int getNumOfCacheListenerCalls() { * * @param numOfCacheListenerCalls total number of cache listener calls completed. */ - public void setNumOfCacheListenerCalls(int numOfCacheListenerCalls) { + public void setNumOfCacheListenerCalls(long numOfCacheListenerCalls) { this.numOfCacheListenerCalls = numOfCacheListenerCalls; } @@ -221,10 +221,26 @@ public void setUpdateTime(Date updateTime) { @Override public void toData(DataOutput out) throws IOException { - DataSerializer.writePrimitiveInt(numOfGets, out); - DataSerializer.writePrimitiveInt(numOfPuts, out); - DataSerializer.writePrimitiveInt(numOfMisses, out); - DataSerializer.writePrimitiveInt(numOfCacheListenerCalls, out); + DataSerializer.writePrimitiveLong(numOfGets, out); + DataSerializer.writePrimitiveLong(numOfPuts, out); + DataSerializer.writePrimitiveLong(numOfMisses, out); + DataSerializer.writePrimitiveLong(numOfCacheListenerCalls, out); + DataSerializer.writePrimitiveInt(numOfThreads, out); + DataSerializer.writePrimitiveInt(cpus, out); + DataSerializer.writePrimitiveLong(processCpuTime, out); + DataSerializer.writeDate(updateTime, out); + DataSerializer.writeHashMap((poolStats), out); + } + + /** + * We changed some ints to longs in this version, give back the int truncation so that it's + * something like what we would have gotten before. + */ + public void toDataPre_GEODE_1_9_0_0(DataOutput out) throws IOException { + DataSerializer.writePrimitiveInt((int) numOfGets, out); + DataSerializer.writePrimitiveInt((int) numOfPuts, out); + DataSerializer.writePrimitiveInt((int) numOfMisses, out); + DataSerializer.writePrimitiveInt((int) numOfCacheListenerCalls, out); DataSerializer.writePrimitiveInt(numOfThreads, out); DataSerializer.writePrimitiveInt(cpus, out); DataSerializer.writePrimitiveLong(processCpuTime, out); @@ -233,10 +249,10 @@ public void toData(DataOutput out) throws IOException { } public void toDataPre_GFE_8_0_0_0(DataOutput out) throws IOException { - DataSerializer.writePrimitiveInt(numOfGets, out); - DataSerializer.writePrimitiveInt(numOfPuts, out); - DataSerializer.writePrimitiveInt(numOfMisses, out); - DataSerializer.writePrimitiveInt(numOfCacheListenerCalls, out); + DataSerializer.writePrimitiveInt((int) numOfGets, out); + DataSerializer.writePrimitiveInt((int) numOfPuts, out); + DataSerializer.writePrimitiveInt((int) numOfMisses, out); + DataSerializer.writePrimitiveInt((int) numOfCacheListenerCalls, out); DataSerializer.writePrimitiveInt(numOfThreads, out); DataSerializer.writePrimitiveInt(cpus, out); DataSerializer.writePrimitiveLong(processCpuTime, out); @@ -245,6 +261,18 @@ public void toDataPre_GFE_8_0_0_0(DataOutput out) throws IOException { @Override public void fromData(DataInput in) throws IOException, ClassNotFoundException { + this.numOfGets = DataSerializer.readPrimitiveLong(in); + this.numOfPuts = DataSerializer.readPrimitiveLong(in); + this.numOfMisses = DataSerializer.readPrimitiveLong(in); + this.numOfCacheListenerCalls = DataSerializer.readPrimitiveLong(in); + this.numOfThreads = DataSerializer.readPrimitiveInt(in); + this.cpus = DataSerializer.readPrimitiveInt(in); + this.processCpuTime = DataSerializer.readPrimitiveLong(in); + this.updateTime = DataSerializer.readDate(in); + this.poolStats = DataSerializer.readHashMap(in); + } + + public void fromDataPre_GEODE_1_9_0_0(DataInput in) throws IOException, ClassNotFoundException { this.numOfGets = DataSerializer.readPrimitiveInt(in); this.numOfPuts = DataSerializer.readPrimitiveInt(in); this.numOfMisses = DataSerializer.readPrimitiveInt(in); diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/CachePerfStats.java b/geode-core/src/main/java/org/apache/geode/internal/cache/CachePerfStats.java index 98a68b8bf89b..05e5ac5a256d 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/CachePerfStats.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/CachePerfStats.java @@ -334,27 +334,27 @@ public class CachePerfStats { type = f.createType("CachePerfStats", "Statistics about GemFire cache performance", new StatisticDescriptor[] { f.createIntGauge("loadsInProgress", loadsInProgressDesc, "operations"), - f.createIntCounter("loadsCompleted", loadsCompletedDesc, "operations"), + f.createLongCounter("loadsCompleted", loadsCompletedDesc, "operations"), f.createLongCounter("loadTime", loadTimeDesc, "nanoseconds", false), f.createIntGauge("netloadsInProgress", netloadsInProgressDesc, "operations"), - f.createIntCounter("netloadsCompleted", netloadsCompletedDesc, "operations"), + f.createLongCounter("netloadsCompleted", netloadsCompletedDesc, "operations"), f.createLongCounter("netloadTime", netloadTimeDesc, "nanoseconds", false), f.createIntGauge("netsearchesInProgress", netsearchesInProgressDesc, "operations"), - f.createIntCounter("netsearchesCompleted", netsearchesCompletedDesc, "operations"), + f.createLongCounter("netsearchesCompleted", netsearchesCompletedDesc, "operations"), f.createLongCounter("netsearchTime", netsearchTimeDesc, "nanoseconds"), f.createIntGauge("cacheWriterCallsInProgress", cacheWriterCallsInProgressDesc, "operations"), - f.createIntCounter("cacheWriterCallsCompleted", cacheWriterCallsCompletedDesc, + f.createLongCounter("cacheWriterCallsCompleted", cacheWriterCallsCompletedDesc, "operations"), f.createLongCounter("cacheWriterCallTime", cacheWriterCallTimeDesc, "nanoseconds"), f.createIntGauge("cacheListenerCallsInProgress", cacheListenerCallsInProgressDesc, "operations"), - f.createIntCounter("cacheListenerCallsCompleted", cacheListenerCallsCompletedDesc, + f.createLongCounter("cacheListenerCallsCompleted", cacheListenerCallsCompletedDesc, "operations"), f.createLongCounter("cacheListenerCallTime", cacheListenerCallTimeDesc, "nanoseconds"), f.createIntGauge("indexUpdateInProgress", "Current number of ops in progress", "operations"), - f.createIntCounter("indexUpdateCompleted", "Total number of ops that have completed", + f.createLongCounter("indexUpdateCompleted", "Total number of ops that have completed", "operations"), f.createLongCounter("indexUpdateTime", "Total amount of time spent doing this op", "nanoseconds"), @@ -367,27 +367,28 @@ public class CachePerfStats { f.createIntGauge("getInitialImagesInProgress", getInitialImagesInProgressDesc, "operations"), - f.createIntCounter("getInitialImagesCompleted", getInitialImagesCompletedDesc, + f.createLongCounter("getInitialImagesCompleted", getInitialImagesCompletedDesc, "operations"), - f.createIntCounter("deltaGetInitialImagesCompleted", deltaGetInitialImagesCompletedDesc, + f.createLongCounter("deltaGetInitialImagesCompleted", + deltaGetInitialImagesCompletedDesc, "operations"), f.createLongCounter("getInitialImageTime", getInitialImageTimeDesc, "nanoseconds"), f.createIntCounter("getInitialImageKeysReceived", getInitialImageKeysReceivedDesc, "keys"), f.createIntGauge("regions", regionsDesc, "regions"), f.createIntGauge("partitionedRegions", partitionedRegionsDesc, "partitionedRegions"), - f.createIntCounter("destroys", destroysDesc, "operations"), - f.createIntCounter("updates", updatesDesc, "operations"), + f.createLongCounter("destroys", destroysDesc, "operations"), + f.createLongCounter("updates", updatesDesc, "operations"), f.createLongCounter("updateTime", updateTimeDesc, "nanoseconds"), - f.createIntCounter("invalidates", invalidatesDesc, "operations"), - f.createIntCounter("gets", getsDesc, "operations"), - f.createIntCounter("misses", missesDesc, "operations"), - f.createIntCounter("creates", createsDesc, "operations"), - f.createIntCounter("puts", putsDesc, "operations"), + f.createLongCounter("invalidates", invalidatesDesc, "operations"), + f.createLongCounter("gets", getsDesc, "operations"), + f.createLongCounter("misses", missesDesc, "operations"), + f.createLongCounter("creates", createsDesc, "operations"), + f.createLongCounter("puts", putsDesc, "operations"), f.createLongCounter("putTime", putTimeDesc, "nanoseconds", false), - f.createIntCounter("putalls", putallsDesc, "operations"), + f.createLongCounter("putalls", putallsDesc, "operations"), f.createLongCounter("putallTime", putallTimeDesc, "nanoseconds", false), - f.createIntCounter("removeAlls", removeAllsDesc, "operations"), + f.createLongCounter("removeAlls", removeAllsDesc, "operations"), f.createLongCounter("removeAllTime", removeAllTimeDesc, "nanoseconds", false), f.createLongCounter("getTime", getTimeDesc, "nanoseconds", false), f.createIntGauge("eventQueueSize", eventQueueSizeDesc, "messages"), @@ -395,7 +396,7 @@ public class CachePerfStats { f.createLongCounter("eventQueueThrottleTime", eventQueueThrottleTimeDesc, "nanoseconds", false), f.createIntGauge("eventThreads", eventThreadsDesc, "threads"), - f.createIntCounter("queryExecutions", queryExecutionsDesc, "operations"), + f.createLongCounter("queryExecutions", queryExecutionsDesc, "operations"), f.createLongCounter("queryExecutionTime", queryExecutionTimeDesc, "nanoseconds"), f.createIntCounter("queryResultsHashCollisions", queryResultsHashCollisionsDesc, "operations"), @@ -404,18 +405,18 @@ public class CachePerfStats { f.createLongCounter("partitionedRegionQueryRetries", partitionedRegionOQLQueryRetriesDesc, "retries"), - f.createIntCounter("txCommits", txCommitsDesc, "commits"), - f.createIntCounter("txCommitChanges", txCommitChangesDesc, "changes"), + f.createLongCounter("txCommits", txCommitsDesc, "commits"), + f.createLongCounter("txCommitChanges", txCommitChangesDesc, "changes"), f.createLongCounter("txCommitTime", txCommitTimeDesc, "nanoseconds", false), f.createLongCounter("txSuccessLifeTime", txSuccessLifeTimeDesc, "nanoseconds", false), - f.createIntCounter("txFailures", txFailuresDesc, "failures"), - f.createIntCounter("txFailureChanges", txFailureChangesDesc, "changes"), + f.createLongCounter("txFailures", txFailuresDesc, "failures"), + f.createLongCounter("txFailureChanges", txFailureChangesDesc, "changes"), f.createLongCounter("txFailureTime", txFailureTimeDesc, "nanoseconds", false), f.createLongCounter("txFailedLifeTime", txFailedLifeTimeDesc, "nanoseconds", false), - f.createIntCounter("txRollbacks", txRollbacksDesc, "rollbacks"), - f.createIntCounter("txRollbackChanges", txRollbackChangesDesc, "changes"), + f.createLongCounter("txRollbacks", txRollbacksDesc, "rollbacks"), + f.createLongCounter("txRollbackChanges", txRollbackChangesDesc, "changes"), f.createLongCounter("txRollbackTime", txRollbackTimeDesc, "nanoseconds", false), f.createLongCounter("txRollbackLifeTime", txRollbackLifeTimeDesc, "nanoseconds", false), f.createLongCounter("txConflictCheckTime", txConflictCheckTimeDesc, "nanoseconds", @@ -438,10 +439,10 @@ public class CachePerfStats { "entries"), f.createLongCounter("eventsQueued", "Number of events attached to " + "other events for callback invocation", "events"), - f.createIntCounter("retries", + f.createLongCounter("retries", "Number of times a concurrent destroy followed by a create has caused an entry operation to need to retry.", "operations"), - f.createIntCounter("clears", clearsDesc, "operations"), + f.createLongCounter("clears", clearsDesc, "operations"), f.createIntGauge("diskTasksWaiting", "Current number of disk tasks (oplog compactions, asynchronous recoveries, etc) that are waiting for a thread to run the operation", "operations"), @@ -451,22 +452,22 @@ public class CachePerfStats { f.createLongGauge("replicatedTombstonesSize", tombstoneOverhead1Desc, "bytes"), f.createLongGauge("nonReplicatedTombstonesSize", tombstoneOverhead2Desc, "bytes"), f.createIntCounter("clearTimeouts", clearTimeoutsDesc, "timeouts"), - f.createIntGauge("evictorJobsStarted", "Number of evictor jobs started", "jobs"), - f.createIntGauge("evictorJobsCompleted", "Number of evictor jobs completed", "jobs"), + f.createLongGauge("evictorJobsStarted", "Number of evictor jobs started", "jobs"), + f.createLongGauge("evictorJobsCompleted", "Number of evictor jobs completed", "jobs"), f.createIntGauge("evictorQueueSize", "Number of jobs waiting to be picked up by evictor threads", "jobs"), f.createLongCounter("evictWorkTime", "Total time spent doing eviction work in background threads", "nanoseconds", false), f.createLongCounter("metaDataRefreshCount", metaDataRefreshCountDesc, "refreshes", false), - f.createIntCounter("deltaUpdates", deltaUpdatesDesc, "operations"), + f.createLongCounter("deltaUpdates", deltaUpdatesDesc, "operations"), f.createLongCounter("deltaUpdatesTime", deltaUpdatesTimeDesc, "nanoseconds", false), - f.createIntCounter("deltaFailedUpdates", deltaFailedUpdatesDesc, "operations"), - f.createIntCounter("deltasPrepared", deltasPreparedDesc, "operations"), + f.createLongCounter("deltaFailedUpdates", deltaFailedUpdatesDesc, "operations"), + f.createLongCounter("deltasPrepared", deltasPreparedDesc, "operations"), f.createLongCounter("deltasPreparedTime", deltasPreparedTimeDesc, "nanoseconds", false), - f.createIntCounter("deltasSent", deltasSentDesc, "operations"), - f.createIntCounter("deltaFullValuesSent", deltaFullValuesSentDesc, "operations"), - f.createIntCounter("deltaFullValuesRequested", deltaFullValuesRequestedDesc, + f.createLongCounter("deltasSent", deltasSentDesc, "operations"), + f.createLongCounter("deltaFullValuesSent", deltaFullValuesSentDesc, "operations"), + f.createLongCounter("deltaFullValuesRequested", deltaFullValuesRequestedDesc, "operations"), f.createLongCounter("importedEntries", importedEntriesCountDesc, "entries"), @@ -667,32 +668,32 @@ private long getClockTime() { return clock.getTime(); } - public int getLoadsCompleted() { - return stats.getInt(loadsCompletedId); + public long getLoadsCompleted() { + return stats.getLong(loadsCompletedId); } public long getLoadTime() { return stats.getLong(loadTimeId); } - public int getNetloadsCompleted() { - return stats.getInt(netloadsCompletedId); + public long getNetloadsCompleted() { + return stats.getLong(netloadsCompletedId); } - public int getNetsearchesCompleted() { - return stats.getInt(netsearchesCompletedId); + public long getNetsearchesCompleted() { + return stats.getLong(netsearchesCompletedId); } public long getNetsearchTime() { return stats.getLong(netsearchTimeId); } - public int getGetInitialImagesCompleted() { - return stats.getInt(getInitialImagesCompletedId); + public long getGetInitialImagesCompleted() { + return stats.getLong(getInitialImagesCompletedId); } - int getDeltaGetInitialImagesCompleted() { - return stats.getInt(deltaGetInitialImagesCompletedId); + long getDeltaGetInitialImagesCompleted() { + return stats.getLong(deltaGetInitialImagesCompletedId); } public int getGetInitialImageKeysReceived() { @@ -703,48 +704,48 @@ public int getRegions() { return stats.getInt(regionsId); } - public int getDestroys() { - return stats.getInt(destroysId); + public long getDestroys() { + return stats.getLong(destroysId); } - public int getCreates() { - return stats.getInt(createsId); + public long getCreates() { + return stats.getLong(createsId); } - public int getPuts() { - return stats.getInt(putsId); + public long getPuts() { + return stats.getLong(putsId); } public long getPutTime() { return stats.getLong(putTimeId); } - public int getPutAlls() { - return stats.getInt(putallsId); + public long getPutAlls() { + return stats.getLong(putallsId); } - int getRemoveAlls() { - return stats.getInt(removeAllsId); + long getRemoveAlls() { + return stats.getLong(removeAllsId); } - public int getUpdates() { - return stats.getInt(updatesId); + public long getUpdates() { + return stats.getLong(updatesId); } - public int getInvalidates() { - return stats.getInt(invalidatesId); + public long getInvalidates() { + return stats.getLong(invalidatesId); } - public int getGets() { - return stats.getInt(getsId); + public long getGets() { + return stats.getLong(getsId); } public long getGetTime() { return stats.getLong(getTimeId); } - public int getMisses() { - return stats.getInt(missesId); + public long getMisses() { + return stats.getLong(missesId); } public int getReliableQueuedOps() { @@ -807,36 +808,36 @@ public void incQueuedEvents(int inc) { stats.incLong(eventsQueuedId, inc); } - int getDeltaUpdates() { - return stats.getInt(deltaUpdatesId); + long getDeltaUpdates() { + return stats.getLong(deltaUpdatesId); } long getDeltaUpdatesTime() { return stats.getLong(deltaUpdatesTimeId); } - public int getDeltaFailedUpdates() { - return stats.getInt(deltaFailedUpdatesId); + public long getDeltaFailedUpdates() { + return stats.getLong(deltaFailedUpdatesId); } - int getDeltasPrepared() { - return stats.getInt(deltasPreparedId); + long getDeltasPrepared() { + return stats.getLong(deltasPreparedId); } long getDeltasPreparedTime() { return stats.getLong(deltasPreparedTimeId); } - public int getDeltasSent() { - return stats.getInt(deltasSentId); + public long getDeltasSent() { + return stats.getLong(deltasSentId); } - public int getDeltaFullValuesSent() { - return stats.getInt(deltaFullValuesSentId); + public long getDeltaFullValuesSent() { + return stats.getLong(deltaFullValuesSentId); } - int getDeltaFullValuesRequested() { - return stats.getInt(deltaFullValuesRequestedId); + long getDeltaFullValuesRequested() { + return stats.getLong(deltaFullValuesRequestedId); } public long getTotalCompressionTime() { @@ -904,7 +905,7 @@ public void endLoad(long start) { long ts = NanoTimer.getTime(); // don't use getStatTime so always enabled stats.incLong(loadTimeId, ts - start); stats.incInt(loadsInProgressId, -1); - stats.incInt(loadsCompletedId, 1); + stats.incLong(loadsCompletedId, 1); } /** @@ -923,7 +924,7 @@ public void endNetload(long start) { stats.incLong(netloadTimeId, getClockTime() - start); } stats.incInt(netloadsInProgressId, -1); - stats.incInt(netloadsCompletedId, 1); + stats.incLong(netloadsCompletedId, 1); } /** @@ -943,7 +944,7 @@ public void endNetsearch(long start) { long ts = NanoTimer.getTime(); // don't use getStatTime so always enabled stats.incLong(netsearchTimeId, ts - start); stats.incInt(netsearchesInProgressId, -1); - stats.incInt(netsearchesCompletedId, 1); + stats.incLong(netsearchesCompletedId, 1); } /** @@ -962,11 +963,11 @@ public void endCacheWriterCall(long start) { stats.incLong(cacheWriterCallTimeId, getClockTime() - start); } stats.incInt(cacheWriterCallsInProgressId, -1); - stats.incInt(cacheWriterCallsCompletedId, 1); + stats.incLong(cacheWriterCallsCompletedId, 1); } - int getCacheWriterCallsCompleted() { - return stats.getInt(cacheWriterCallsCompletedId); + long getCacheWriterCallsCompleted() { + return stats.getLong(cacheWriterCallsCompletedId); } /** @@ -987,11 +988,11 @@ public void endCacheListenerCall(long start) { stats.incLong(cacheListenerCallTimeId, getClockTime() - start); } stats.incInt(cacheListenerCallsInProgressId, -1); - stats.incInt(cacheListenerCallsCompletedId, 1); + stats.incLong(cacheListenerCallsCompletedId, 1); } - int getCacheListenerCallsCompleted() { - return stats.getInt(cacheListenerCallsCompletedId); + long getCacheListenerCallsCompleted() { + return stats.getLong(cacheListenerCallsCompletedId); } /** @@ -1010,7 +1011,7 @@ public void endGetInitialImage(long start) { stats.incLong(getInitialImageTimeId, getClockTime() - start); } stats.incInt(getInitialImagesInProgressId, -1); - stats.incInt(getInitialImagesCompletedId, 1); + stats.incLong(getInitialImagesCompletedId, 1); } /** @@ -1024,7 +1025,7 @@ public void endNoGIIDone(long start) { } void incDeltaGIICompleted() { - stats.incInt(deltaGetInitialImagesCompletedId, 1); + stats.incLong(deltaGetInitialImagesCompletedId, 1); } public void incGetInitialImageKeysReceived() { @@ -1040,11 +1041,11 @@ public void endIndexUpdate(long start) { long ts = getClockTime(); stats.incLong(indexUpdateTimeId, ts - start); stats.incInt(indexUpdateInProgressId, -1); - stats.incInt(indexUpdateCompletedId, 1); + stats.incLong(indexUpdateCompletedId, 1); } - int getIndexUpdateCompleted() { - return stats.getInt(indexUpdateCompletedId); + long getIndexUpdateCompleted() { + return stats.getLong(indexUpdateCompletedId); } long startIndexInitialization() { @@ -1072,15 +1073,15 @@ public void incPartitionedRegions(int inc) { } public void incDestroys() { - stats.incInt(destroysId, 1); + stats.incLong(destroysId, 1); } public void incCreates() { - stats.incInt(createsId, 1); + stats.incLong(createsId, 1); } public void incInvalidates() { - stats.incInt(invalidatesId, 1); + stats.incLong(invalidatesId, 1); } /** @@ -1098,9 +1099,9 @@ public void endGet(long start, boolean miss) { long delta = getClockTime() - start; stats.incLong(getTimeId, delta); } - stats.incInt(getsId, 1); + stats.incLong(getsId, 1); if (miss) { - stats.incInt(missesId, 1); + stats.incLong(missesId, 1); } } @@ -1111,13 +1112,13 @@ public void endGet(long start, boolean miss) { public long endPut(long start, boolean isUpdate) { long total = 0; if (isUpdate) { - stats.incInt(updatesId, 1); + stats.incLong(updatesId, 1); if (enableClockStats) { total = getClockTime() - start; stats.incLong(updateTimeId, total); } } else { - stats.incInt(putsId, 1); + stats.incLong(putsId, 1); if (enableClockStats) { total = getClockTime() - start; stats.incLong(putTimeId, total); @@ -1127,26 +1128,26 @@ public long endPut(long start, boolean isUpdate) { } public void endPutAll(long start) { - stats.incInt(putallsId, 1); + stats.incLong(putallsId, 1); if (enableClockStats) stats.incLong(putallTimeId, getClockTime() - start); } public void endRemoveAll(long start) { - stats.incInt(removeAllsId, 1); + stats.incLong(removeAllsId, 1); if (enableClockStats) stats.incLong(removeAllTimeId, getClockTime() - start); } public void endQueryExecution(long executionTime) { - stats.incInt(queryExecutionsId, 1); + stats.incLong(queryExecutionsId, 1); if (enableClockStats) { stats.incLong(queryExecutionTimeId, executionTime); } } - public int getQueryExecutions() { - return stats.getInt(queryExecutionsId); + public long getQueryExecutions() { + return stats.getLong(queryExecutionsId); } public void endQueryResultsHashCollisionProbe(long start) { @@ -1159,12 +1160,12 @@ public void incQueryResultsHashCollisions() { stats.incInt(queryResultsHashCollisionsId, 1); } - public int getTxCommits() { - return stats.getInt(txCommitsId); + public long getTxCommits() { + return stats.getLong(txCommitsId); } - public int getTxCommitChanges() { - return stats.getInt(txCommitChangesId); + public long getTxCommitChanges() { + return stats.getLong(txCommitChangesId); } public long getTxCommitTime() { @@ -1175,12 +1176,12 @@ public long getTxSuccessLifeTime() { return stats.getLong(txSuccessLifeTimeId); } - public int getTxFailures() { - return stats.getInt(txFailuresId); + public long getTxFailures() { + return stats.getLong(txFailuresId); } - public int getTxFailureChanges() { - return stats.getInt(txFailureChangesId); + public long getTxFailureChanges() { + return stats.getLong(txFailureChangesId); } public long getTxFailureTime() { @@ -1191,12 +1192,12 @@ public long getTxFailedLifeTime() { return stats.getLong(txFailedLifeTimeId); } - public int getTxRollbacks() { - return stats.getInt(txRollbacksId); + public long getTxRollbacks() { + return stats.getLong(txRollbacksId); } - public int getTxRollbackChanges() { - return stats.getInt(txRollbackChangesId); + public long getTxRollbackChanges() { + return stats.getLong(txRollbackChangesId); } public long getTxRollbackTime() { @@ -1212,54 +1213,54 @@ public void incTxConflictCheckTime(long delta) { } public void txSuccess(long opTime, long txLifeTime, int txChanges) { - stats.incInt(txCommitsId, 1); - stats.incInt(txCommitChangesId, txChanges); + stats.incLong(txCommitsId, 1); + stats.incLong(txCommitChangesId, txChanges); stats.incLong(txCommitTimeId, opTime); stats.incLong(txSuccessLifeTimeId, txLifeTime); } public void txFailure(long opTime, long txLifeTime, int txChanges) { - stats.incInt(txFailuresId, 1); - stats.incInt(txFailureChangesId, txChanges); + stats.incLong(txFailuresId, 1); + stats.incLong(txFailureChangesId, txChanges); stats.incLong(txFailureTimeId, opTime); stats.incLong(txFailedLifeTimeId, txLifeTime); } public void txRollback(long opTime, long txLifeTime, int txChanges) { - stats.incInt(txRollbacksId, 1); - stats.incInt(txRollbackChangesId, txChanges); + stats.incLong(txRollbacksId, 1); + stats.incLong(txRollbackChangesId, txChanges); stats.incLong(txRollbackTimeId, opTime); stats.incLong(txRollbackLifeTimeId, txLifeTime); } void endDeltaUpdate(long start) { - stats.incInt(deltaUpdatesId, 1); + stats.incLong(deltaUpdatesId, 1); if (enableClockStats) { stats.incLong(deltaUpdatesTimeId, getClockTime() - start); } } public void incDeltaFailedUpdates() { - stats.incInt(deltaFailedUpdatesId, 1); + stats.incLong(deltaFailedUpdatesId, 1); } public void endDeltaPrepared(long start) { - stats.incInt(deltasPreparedId, 1); + stats.incLong(deltasPreparedId, 1); if (enableClockStats) { stats.incLong(deltasPreparedTimeId, getClockTime() - start); } } public void incDeltasSent() { - stats.incInt(deltasSentId, 1); + stats.incLong(deltasSentId, 1); } public void incDeltaFullValuesSent() { - stats.incInt(deltaFullValuesSentId, 1); + stats.incLong(deltaFullValuesSentId, 1); } public void incDeltaFullValuesRequested() { - stats.incInt(deltaFullValuesRequestedId, 1); + stats.incLong(deltaFullValuesRequestedId, 1); } /** @@ -1310,11 +1311,11 @@ public long getEntries() { } public void incRetries() { - stats.incInt(retriesId, 1); + stats.incLong(retriesId, 1); } - public int getRetries() { - return stats.getInt(retriesId); + public long getRetries() { + return stats.getLong(retriesId); } public void incDiskTasksWaiting() { @@ -1334,19 +1335,19 @@ public void decDiskTasksWaiting(int count) { } public void incEvictorJobsStarted() { - stats.incInt(evictorJobsStartedId, 1); + stats.incLong(evictorJobsStartedId, 1); } - int getEvictorJobsStarted() { - return stats.getInt(evictorJobsStartedId); + long getEvictorJobsStarted() { + return stats.getLong(evictorJobsStartedId); } public void incEvictorJobsCompleted() { - stats.incInt(evictorJobsCompletedId, 1); + stats.incLong(evictorJobsCompletedId, 1); } - int getEvictorJobsCompleted() { - return stats.getInt(evictorJobsCompletedId); + long getEvictorJobsCompleted() { + return stats.getLong(evictorJobsCompletedId); } public void incEvictorQueueSize(int delta) { @@ -1386,12 +1387,12 @@ public void endJob() { }; } - public int getClearCount() { - return stats.getInt(clearsId); + public long getClearCount() { + return stats.getLong(clearsId); } public void incClearCount() { - stats.incInt(clearsId, 1); + stats.incLong(clearsId, 1); } public long getConflatedEventsCount() { diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/DummyCachePerfStats.java b/geode-core/src/main/java/org/apache/geode/internal/cache/DummyCachePerfStats.java index b5042e9d175e..394eecf3beb8 100755 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/DummyCachePerfStats.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/DummyCachePerfStats.java @@ -32,7 +32,7 @@ public DummyCachePerfStats() {} // //////////////////// Accessing Stats ////////////////////// @Override - public int getLoadsCompleted() { + public long getLoadsCompleted() { return 0; } @@ -42,12 +42,12 @@ public long getLoadTime() { } @Override - public int getNetloadsCompleted() { + public long getNetloadsCompleted() { return 0; } @Override - public int getNetsearchesCompleted() { + public long getNetsearchesCompleted() { return 0; } @@ -57,7 +57,7 @@ public long getNetsearchTime() { } @Override - public int getGetInitialImagesCompleted() { + public long getGetInitialImagesCompleted() { return 0; } @@ -72,42 +72,42 @@ public int getRegions() { } @Override - public int getDestroys() { + public long getDestroys() { return 0; } @Override - public int getCreates() { + public long getCreates() { return 0; } @Override - public int getPuts() { + public long getPuts() { return 0; } @Override - public int getPutAlls() { + public long getPutAlls() { return 0; } @Override - public int getUpdates() { + public long getUpdates() { return 0; } @Override - public int getInvalidates() { + public long getInvalidates() { return 0; } @Override - public int getGets() { + public long getGets() { return 0; } @Override - public int getMisses() { + public long getMisses() { return 0; } @@ -257,12 +257,12 @@ public void endPutAll(long start) {} public void endQueryExecution(long executionTime) {} @Override - public int getTxCommits() { + public long getTxCommits() { return 0; } @Override - public int getTxCommitChanges() { + public long getTxCommitChanges() { return 0; } @@ -277,12 +277,12 @@ public long getTxSuccessLifeTime() { } @Override - public int getTxFailures() { + public long getTxFailures() { return 0; } @Override - public int getTxFailureChanges() { + public long getTxFailureChanges() { return 0; } @@ -297,12 +297,12 @@ public long getTxFailedLifeTime() { } @Override - public int getTxRollbacks() { + public long getTxRollbacks() { return 0; } @Override - public int getTxRollbackChanges() { + public long getTxRollbackChanges() { return 0; } diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java index 3610fbd93d04..2a9235843f6b 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java @@ -11073,7 +11073,7 @@ public void endLoad(long start) { long ts = NanoTimer.getTime(); this.stats.incLong(loadTimeId, ts - start); this.stats.incInt(loadsInProgressId, -1); - this.stats.incInt(loadsCompletedId, 1); + this.stats.incLong(loadsCompletedId, 1); // need to think about timings this.cachePerfStats.endLoad(start); @@ -11098,7 +11098,7 @@ public void endNetload(long start) { this.stats.incLong(netloadTimeId, getStatTime() - start); } this.stats.incInt(netloadsInProgressId, -1); - this.stats.incInt(netloadsCompletedId, 1); + this.stats.incLong(netloadsCompletedId, 1); this.cachePerfStats.endNetload(start); } @@ -11123,7 +11123,7 @@ public void endNetsearch(long start) { long ts = NanoTimer.getTime(); this.stats.incLong(netsearchTimeId, ts - start); this.stats.incInt(netsearchesInProgressId, -1); - this.stats.incInt(netsearchesCompletedId, 1); + this.stats.incLong(netsearchesCompletedId, 1); this.cachePerfStats.endNetsearch(start); } @@ -11146,7 +11146,7 @@ public void endCacheWriterCall(long start) { this.stats.incLong(cacheWriterCallTimeId, getStatTime() - start); } this.stats.incInt(cacheWriterCallsInProgressId, -1); - this.stats.incInt(cacheWriterCallsCompletedId, 1); + this.stats.incLong(cacheWriterCallsCompletedId, 1); this.cachePerfStats.endCacheWriterCall(start); } @@ -11171,7 +11171,7 @@ public void endCacheListenerCall(long start) { this.stats.incLong(cacheListenerCallTimeId, getStatTime() - start); } this.stats.incInt(cacheListenerCallsInProgressId, -1); - this.stats.incInt(cacheListenerCallsCompletedId, 1); + this.stats.incLong(cacheListenerCallsCompletedId, 1); this.cachePerfStats.endCacheListenerCall(start); } @@ -11194,7 +11194,7 @@ public void endGetInitialImage(long start) { this.stats.incLong(getInitialImageTimeId, getStatTime() - start); } this.stats.incInt(getInitialImagesInProgressId, -1); - this.stats.incInt(getInitialImagesCompletedId, 1); + this.stats.incLong(getInitialImagesCompletedId, 1); this.cachePerfStats.endGetInitialImage(start); } @@ -11228,7 +11228,7 @@ public void endIndexUpdate(long start) { long ts = getStatTime(); this.stats.incLong(indexUpdateTimeId, ts - start); this.stats.incInt(indexUpdateInProgressId, -1); - this.stats.incInt(indexUpdateCompletedId, 1); + this.stats.incLong(indexUpdateCompletedId, 1); this.cachePerfStats.endIndexUpdate(start); } @@ -11247,19 +11247,19 @@ public void incPartitionedRegions(int inc) { @Override public void incDestroys() { - this.stats.incInt(destroysId, 1); + this.stats.incLong(destroysId, 1); this.cachePerfStats.incDestroys(); } @Override public void incCreates() { - this.stats.incInt(createsId, 1); + this.stats.incLong(createsId, 1); this.cachePerfStats.incCreates(); } @Override public void incInvalidates() { - this.stats.incInt(invalidatesId, 1); + this.stats.incLong(invalidatesId, 1); this.cachePerfStats.incInvalidates(); } @@ -11295,9 +11295,9 @@ public void endGet(long start, boolean miss) { if (enableClockStats) { this.stats.incLong(getTimeId, getStatTime() - start); } - this.stats.incInt(getsId, 1); + this.stats.incLong(getsId, 1); if (miss) { - this.stats.incInt(missesId, 1); + this.stats.incLong(missesId, 1); } this.cachePerfStats.endGet(start, miss); } @@ -11310,13 +11310,13 @@ public void endGet(long start, boolean miss) { public long endPut(long start, boolean isUpdate) { long total = 0; if (isUpdate) { - this.stats.incInt(updatesId, 1); + this.stats.incLong(updatesId, 1); if (enableClockStats) { total = getStatTime() - start; this.stats.incLong(updateTimeId, total); } } else { - this.stats.incInt(putsId, 1); + this.stats.incLong(putsId, 1); if (enableClockStats) { total = getStatTime() - start; this.stats.incLong(putTimeId, total); @@ -11328,7 +11328,7 @@ public long endPut(long start, boolean isUpdate) { @Override public void endPutAll(long start) { - this.stats.incInt(putallsId, 1); + this.stats.incLong(putallsId, 1); if (enableClockStats) { this.stats.incLong(putallTimeId, getStatTime() - start); } @@ -11337,7 +11337,7 @@ public void endPutAll(long start) { @Override public void endQueryExecution(long executionTime) { - this.stats.incInt(queryExecutionsId, 1); + this.stats.incLong(queryExecutionsId, 1); if (enableClockStats) { this.stats.incLong(queryExecutionTimeId, executionTime); } @@ -11366,8 +11366,8 @@ public void incTxConflictCheckTime(long delta) { @Override public void txSuccess(long opTime, long txLifeTime, int txChanges) { - this.stats.incInt(txCommitsId, 1); - this.stats.incInt(txCommitChangesId, txChanges); + this.stats.incLong(txCommitsId, 1); + this.stats.incLong(txCommitChangesId, txChanges); this.stats.incLong(txCommitTimeId, opTime); this.stats.incLong(txSuccessLifeTimeId, txLifeTime); this.cachePerfStats.txSuccess(opTime, txLifeTime, txChanges); @@ -11375,8 +11375,8 @@ public void txSuccess(long opTime, long txLifeTime, int txChanges) { @Override public void txFailure(long opTime, long txLifeTime, int txChanges) { - this.stats.incInt(txFailuresId, 1); - this.stats.incInt(txFailureChangesId, txChanges); + this.stats.incLong(txFailuresId, 1); + this.stats.incLong(txFailureChangesId, txChanges); this.stats.incLong(txFailureTimeId, opTime); this.stats.incLong(txFailedLifeTimeId, txLifeTime); this.cachePerfStats.txFailure(opTime, txLifeTime, txChanges); @@ -11384,8 +11384,8 @@ public void txFailure(long opTime, long txLifeTime, int txChanges) { @Override public void txRollback(long opTime, long txLifeTime, int txChanges) { - this.stats.incInt(txRollbacksId, 1); - this.stats.incInt(txRollbackChangesId, txChanges); + this.stats.incLong(txRollbacksId, 1); + this.stats.incLong(txRollbackChangesId, txChanges); this.stats.incLong(txRollbackTimeId, opTime); this.stats.incLong(txRollbackLifeTimeId, txLifeTime); this.cachePerfStats.txRollback(opTime, txLifeTime, txChanges); @@ -11423,7 +11423,7 @@ public void incEntryCount(int delta) { @Override public void incRetries() { - this.stats.incInt(retriesId, 1); + this.stats.incLong(retriesId, 1); this.cachePerfStats.incRetries(); } @@ -11447,13 +11447,13 @@ public void decDiskTasksWaiting(int count) { @Override public void incEvictorJobsStarted() { - this.stats.incInt(evictorJobsStartedId, 1); + this.stats.incLong(evictorJobsStartedId, 1); this.cachePerfStats.incEvictorJobsStarted(); } @Override public void incEvictorJobsCompleted() { - this.stats.incInt(evictorJobsCompletedId, 1); + this.stats.incLong(evictorJobsCompletedId, 1); this.cachePerfStats.incEvictorJobsCompleted(); } @@ -11471,7 +11471,7 @@ public void incEvictWorkTime(long delta) { @Override public void incClearCount() { - this.stats.incInt(clearsId, 1); + this.stats.incLong(clearsId, 1); this.cachePerfStats.incClearCount(); } diff --git a/geode-core/src/main/java/org/apache/geode/management/ClientHealthStatus.java b/geode-core/src/main/java/org/apache/geode/management/ClientHealthStatus.java index 500e084892e1..fa528776040a 100644 --- a/geode-core/src/main/java/org/apache/geode/management/ClientHealthStatus.java +++ b/geode-core/src/main/java/org/apache/geode/management/ClientHealthStatus.java @@ -45,7 +45,7 @@ public class ClientHealthStatus { * "numOfGets", IntCounter, "The total number of times a successful get has been done on this * cache." Java: CachePerfStats.gets Native: Not yet Defined */ - private int numOfGets; + private long numOfGets; /** * "numOfPuts", IntCounter, "The total number of times an entry is added or replaced in this cache @@ -53,19 +53,19 @@ public class ClientHealthStatus { * or netloading a value). Note that this only counts puts done explicitly on this cache. It does * not count updates pushed from other caches." Java: CachePerfStats.puts Native: Not yet Defined */ - private int numOfPuts; + private long numOfPuts; /** * Represents number of cache misses in this client. IntCounter, "Total number of times a get on * the cache did not find a value already in local memory." Java: CachePerfStats.misses */ - private int numOfMisses; + private long numOfMisses; /** * Represents number of cache listners calls completed. IntCounter, "Total number of times a cache * listener call has completed." Java: CachePerfStats.cacheListenerCallsCompleted */ - private int numOfCacheListenerCalls; + private long numOfCacheListenerCalls; /** * Represents total number of active threads in the client VM. IntCounter, "Current number of live @@ -119,7 +119,7 @@ public class ClientHealthStatus { /** * Returns the number of times a successful get operation has occurred. */ - public int getNumOfGets() { + public long getNumOfGets() { return numOfGets; } @@ -129,21 +129,21 @@ public int getNumOfGets() { * searching, or net loading a value. The count only includes operations done explicitly on this * cache, not those that are pushed from other caches. */ - public int getNumOfPuts() { + public long getNumOfPuts() { return numOfPuts; } /** * Returns the number of times a cache miss has occurred. */ - public int getNumOfMisses() { + public long getNumOfMisses() { return numOfMisses; } /** * Returns the number of times a cache listener call has completed. */ - public int getNumOfCacheListenerCalls() { + public long getNumOfCacheListenerCalls() { return numOfCacheListenerCalls; } @@ -185,7 +185,7 @@ public String getClientId() { /** * Sets the number of times a successful get operation has occurred. */ - public void setNumOfGets(int numOfGets) { + public void setNumOfGets(long numOfGets) { this.numOfGets = numOfGets; } @@ -193,21 +193,21 @@ public void setNumOfGets(int numOfGets) { * Set the number of times an entry was added or replaced in this cache as a result of a local * operation. */ - public void setNumOfPuts(int numOfPuts) { + public void setNumOfPuts(long numOfPuts) { this.numOfPuts = numOfPuts; } /** * Sets the number of times a cache miss has occurred. */ - public void setNumOfMisses(int numOfMisses) { + public void setNumOfMisses(long numOfMisses) { this.numOfMisses = numOfMisses; } /** * Sets the number of times a cache listener call has completed. */ - public void setNumOfCacheListenerCalls(int numOfCacheListenerCalls) { + public void setNumOfCacheListenerCalls(long numOfCacheListenerCalls) { this.numOfCacheListenerCalls = numOfCacheListenerCalls; } diff --git a/geode-core/src/main/java/org/apache/geode/management/MemberMXBean.java b/geode-core/src/main/java/org/apache/geode/management/MemberMXBean.java index a24010680370..c1b3bcfe2ad4 100644 --- a/geode-core/src/main/java/org/apache/geode/management/MemberMXBean.java +++ b/geode-core/src/main/java/org/apache/geode/management/MemberMXBean.java @@ -555,7 +555,7 @@ String processCommand(String commandString, Map env, /** * Returns the total number of times that a network search initiated by this cache has completed. */ - int getTotalNetSearchCompleted(); + long getTotalNetSearchCompleted(); /** * Returns the net search average latency. diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/beans/MemberMBean.java b/geode-core/src/main/java/org/apache/geode/management/internal/beans/MemberMBean.java index fd6a2227be7c..6687ea586384 100644 --- a/geode-core/src/main/java/org/apache/geode/management/internal/beans/MemberMBean.java +++ b/geode-core/src/main/java/org/apache/geode/management/internal/beans/MemberMBean.java @@ -519,7 +519,7 @@ public int getTotalNetLoadsCompleted() { } @Override - public int getTotalNetSearchCompleted() { + public long getTotalNetSearchCompleted() { return bridge.getTotalNetSearchCompleted(); } diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/beans/MemberMBeanBridge.java b/geode-core/src/main/java/org/apache/geode/management/internal/beans/MemberMBeanBridge.java index f2e1ae3a7167..94f417a8e419 100644 --- a/geode-core/src/main/java/org/apache/geode/management/internal/beans/MemberMBeanBridge.java +++ b/geode-core/src/main/java/org/apache/geode/management/internal/beans/MemberMBeanBridge.java @@ -1395,8 +1395,8 @@ public long getNetLoadsAverageLatency() { return netLoadsAverageLatency.getAverageLatency(); } - public int getTotalNetSearchCompleted() { - return getMemberLevelStatistic(StatsKey.NET_SEARCH_COMPLETED).intValue(); + public long getTotalNetSearchCompleted() { + return getMemberLevelStatistic(StatsKey.NET_SEARCH_COMPLETED).longValue(); } public long getNetSearchAverageLatency() { diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/CachePerfStatsTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/CachePerfStatsTest.java index aef2a9ee7060..11f6677d59e9 100644 --- a/geode-core/src/test/java/org/apache/geode/internal/cache/CachePerfStatsTest.java +++ b/geode-core/src/test/java/org/apache/geode/internal/cache/CachePerfStatsTest.java @@ -98,7 +98,7 @@ public void setUp() { @Test public void getPutsDelegatesToStatistics() { - statistics.incInt(putsId, Integer.MAX_VALUE); + statistics.incLong(putsId, Integer.MAX_VALUE); assertThat(cachePerfStats.getPuts()).isEqualTo(Integer.MAX_VALUE); } @@ -111,24 +111,21 @@ public void getPutsDelegatesToStatistics() { public void endPutIncrementsPuts() { cachePerfStats.endPut(0, false); - assertThat(statistics.getInt(putsId)).isEqualTo(1); + assertThat(statistics.getLong(putsId)).isEqualTo(1); } - /** - * Characterization test: {@code puts} currently wraps to negative from max integer value. - */ @Test - public void putsWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(putsId, Integer.MAX_VALUE); + public void putsWrapsFromMaxIntegerStaysPositive() { + statistics.incLong(putsId, Integer.MAX_VALUE); cachePerfStats.endPut(0, false); - assertThat(cachePerfStats.getPuts()).isNegative(); + assertThat(cachePerfStats.getPuts()).isPositive(); } @Test public void getGetsDelegatesToStatistics() { - statistics.incInt(getsId, Integer.MAX_VALUE); + statistics.incLong(getsId, Integer.MAX_VALUE); assertThat(cachePerfStats.getGets()).isEqualTo(Integer.MAX_VALUE); } @@ -141,19 +138,16 @@ public void getGetsDelegatesToStatistics() { public void endGetIncrementsGets() { cachePerfStats.endGet(0, false); - assertThat(statistics.getInt(getsId)).isEqualTo(1); + assertThat(statistics.getLong(getsId)).isEqualTo(1); } - /** - * Characterization test: {@code gets} currently wraps to negative from max integer value. - */ @Test - public void getsWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(getsId, Integer.MAX_VALUE); + public void getsWrapsFromMaxIntegerStaysPositive() { + statistics.incLong(getsId, Integer.MAX_VALUE); cachePerfStats.endGet(0, false); - assertThat(cachePerfStats.getGets()).isNegative(); + assertThat(cachePerfStats.getGets()).isPositive(); } @Test @@ -161,7 +155,6 @@ public void getPutTimeDelegatesToStatistics() { statistics.incLong(putTimeId, Long.MAX_VALUE); assertThat(cachePerfStats.getPutTime()).isEqualTo(Long.MAX_VALUE); - } /** @@ -196,7 +189,7 @@ public void endGetIncrementsGetTime() { @Test public void getDestroysDelegatesToStatistics() { - statistics.incInt(destroysId, Integer.MAX_VALUE); + statistics.incLong(destroysId, Integer.MAX_VALUE); assertThat(cachePerfStats.getDestroys()).isEqualTo(Integer.MAX_VALUE); } @@ -205,24 +198,21 @@ public void getDestroysDelegatesToStatistics() { public void incDestroysIncrementsDestroys() { cachePerfStats.incDestroys(); - assertThat(statistics.getInt(destroysId)).isEqualTo(1); + assertThat(statistics.getLong(destroysId)).isEqualTo(1); } - /** - * Characterization test: {@code destroys} currently wraps to negative from max integer value. - */ @Test - public void destroysWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(destroysId, Integer.MAX_VALUE); + public void destroysWrapsFromMaxIntegerStaysPositive() { + statistics.incLong(destroysId, Integer.MAX_VALUE); cachePerfStats.incDestroys(); - assertThat(cachePerfStats.getDestroys()).isNegative(); + assertThat(cachePerfStats.getDestroys()).isPositive(); } @Test public void getCreatesDelegatesToStatistics() { - statistics.incInt(createsId, Integer.MAX_VALUE); + statistics.incLong(createsId, Integer.MAX_VALUE); assertThat(cachePerfStats.getCreates()).isEqualTo(Integer.MAX_VALUE); } @@ -231,24 +221,21 @@ public void getCreatesDelegatesToStatistics() { public void incCreatesIncrementsDestroys() { cachePerfStats.incCreates(); - assertThat(statistics.getInt(createsId)).isEqualTo(1); + assertThat(statistics.getLong(createsId)).isEqualTo(1); } - /** - * Characterization test: {@code creates} currently wraps to negative from max integer value. - */ @Test - public void createsWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(createsId, Integer.MAX_VALUE); + public void createsWrapsFromMaxIntegerStaysPositive() { + statistics.incLong(createsId, Integer.MAX_VALUE); cachePerfStats.incCreates(); - assertThat(cachePerfStats.getCreates()).isNegative(); + assertThat(cachePerfStats.getCreates()).isPositive(); } @Test public void getPutAllsDelegatesToStatistics() { - statistics.incInt(putallsId, Integer.MAX_VALUE); + statistics.incLong(putallsId, Integer.MAX_VALUE); assertThat(cachePerfStats.getPutAlls()).isEqualTo(Integer.MAX_VALUE); } @@ -261,24 +248,21 @@ public void getPutAllsDelegatesToStatistics() { public void endPutAllIncrementsDestroys() { cachePerfStats.endPutAll(0); - assertThat(statistics.getInt(putallsId)).isEqualTo(1); + assertThat(statistics.getLong(putallsId)).isEqualTo(1); } - /** - * Characterization test: {@code putAlls} currently wraps to negative from max integer value. - */ @Test - public void putAllsWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(putallsId, Integer.MAX_VALUE); + public void putAllsWrapsFromMaxIntegerStaysPositive() { + statistics.incLong(putallsId, Integer.MAX_VALUE); cachePerfStats.endPutAll(0); - assertThat(cachePerfStats.getPutAlls()).isNegative(); + assertThat(cachePerfStats.getPutAlls()).isPositive(); } @Test public void getRemoveAllsDelegatesToStatistics() { - statistics.incInt(removeAllsId, Integer.MAX_VALUE); + statistics.incLong(removeAllsId, Integer.MAX_VALUE); assertThat(cachePerfStats.getRemoveAlls()).isEqualTo(Integer.MAX_VALUE); } @@ -291,24 +275,21 @@ public void getRemoveAllsDelegatesToStatistics() { public void endRemoveAllIncrementsDestroys() { cachePerfStats.endRemoveAll(0); - assertThat(statistics.getInt(removeAllsId)).isEqualTo(1); + assertThat(statistics.getLong(removeAllsId)).isEqualTo(1); } - /** - * Characterization test: {@code removeAlls} currently wraps to negative from max integer value. - */ @Test - public void removeAllsWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(removeAllsId, Integer.MAX_VALUE); + public void removeAllsWrapsFromMaxIntegerStaysPositive() { + statistics.incLong(removeAllsId, Integer.MAX_VALUE); cachePerfStats.endRemoveAll(0); - assertThat(cachePerfStats.getRemoveAlls()).isNegative(); + assertThat(cachePerfStats.getRemoveAlls()).isPositive(); } @Test public void getUpdatesDelegatesToStatistics() { - statistics.incInt(updatesId, Integer.MAX_VALUE); + statistics.incLong(updatesId, Integer.MAX_VALUE); assertThat(cachePerfStats.getUpdates()).isEqualTo(Integer.MAX_VALUE); } @@ -321,24 +302,21 @@ public void getUpdatesDelegatesToStatistics() { public void endPutIncrementsUpdates() { cachePerfStats.endPut(0, true); - assertThat(statistics.getInt(updatesId)).isEqualTo(1); + assertThat(statistics.getLong(updatesId)).isEqualTo(1); } - /** - * Characterization test: {@code updates} currently wraps to negative from max integer value. - */ @Test - public void updatesWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(updatesId, Integer.MAX_VALUE); + public void updatesWrapsFromMaxIntegerStaysPositive() { + statistics.incLong(updatesId, Integer.MAX_VALUE); cachePerfStats.endPut(0, true); - assertThat(cachePerfStats.getUpdates()).isNegative(); + assertThat(cachePerfStats.getUpdates()).isPositive(); } @Test public void getInvalidatesDelegatesToStatistics() { - statistics.incInt(invalidatesId, Integer.MAX_VALUE); + statistics.incLong(invalidatesId, Integer.MAX_VALUE); assertThat(cachePerfStats.getInvalidates()).isEqualTo(Integer.MAX_VALUE); } @@ -347,24 +325,21 @@ public void getInvalidatesDelegatesToStatistics() { public void incInvalidatesIncrementsInvalidates() { cachePerfStats.incInvalidates(); - assertThat(statistics.getInt(invalidatesId)).isEqualTo(1); + assertThat(statistics.getLong(invalidatesId)).isEqualTo(1); } - /** - * Characterization test: {@code invalidates} currently wraps to negative from max integer value. - */ @Test - public void invalidatesWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(invalidatesId, Integer.MAX_VALUE); + public void invalidatesWrapsFromMaxIntegerStaysPositive() { + statistics.incLong(invalidatesId, Integer.MAX_VALUE); cachePerfStats.incInvalidates(); - assertThat(cachePerfStats.getInvalidates()).isNegative(); + assertThat(cachePerfStats.getInvalidates()).isPositive(); } @Test public void getMissesDelegatesToStatistics() { - statistics.incInt(missesId, Integer.MAX_VALUE); + statistics.incLong(missesId, Integer.MAX_VALUE); assertThat(cachePerfStats.getMisses()).isEqualTo(Integer.MAX_VALUE); } @@ -377,24 +352,21 @@ public void getMissesDelegatesToStatistics() { public void endGetIncrementsMisses() { cachePerfStats.endGet(0, true); - assertThat(statistics.getInt(missesId)).isEqualTo(1); + assertThat(statistics.getLong(missesId)).isEqualTo(1); } - /** - * Characterization test: {@code misses} currently wraps to negative from max integer value. - */ @Test - public void missesWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(missesId, Integer.MAX_VALUE); + public void missesWrapsFromMaxIntegerStaysPositive() { + statistics.incLong(missesId, Integer.MAX_VALUE); cachePerfStats.endGet(0, true); - assertThat(cachePerfStats.getMisses()).isNegative(); + assertThat(cachePerfStats.getMisses()).isPositive(); } @Test public void getRetriesDelegatesToStatistics() { - statistics.incInt(retriesId, Integer.MAX_VALUE); + statistics.incLong(retriesId, Integer.MAX_VALUE); assertThat(cachePerfStats.getRetries()).isEqualTo(Integer.MAX_VALUE); } @@ -403,24 +375,21 @@ public void getRetriesDelegatesToStatistics() { public void incRetriesIncrementsRetries() { cachePerfStats.incRetries(); - assertThat(statistics.getInt(retriesId)).isEqualTo(1); + assertThat(statistics.getLong(retriesId)).isEqualTo(1); } - /** - * Characterization test: {@code retries} currently wraps to negative from max integer value. - */ @Test - public void retriesWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(retriesId, Integer.MAX_VALUE); + public void retriesWrapsFromMaxIntegerStaysPositive() { + statistics.incLong(retriesId, Integer.MAX_VALUE); cachePerfStats.incRetries(); - assertThat(cachePerfStats.getRetries()).isNegative(); + assertThat(cachePerfStats.getRetries()).isPositive(); } @Test public void getClearsDelegatesToStatistics() { - statistics.incInt(clearsId, Integer.MAX_VALUE); + statistics.incLong(clearsId, Integer.MAX_VALUE); assertThat(cachePerfStats.getClearCount()).isEqualTo(Integer.MAX_VALUE); } @@ -429,24 +398,21 @@ public void getClearsDelegatesToStatistics() { public void incClearCountIncrementsClears() { cachePerfStats.incClearCount(); - assertThat(statistics.getInt(clearsId)).isEqualTo(1); + assertThat(statistics.getLong(clearsId)).isEqualTo(1); } - /** - * Characterization test: {@code clears} currently wraps to negative from max integer value. - */ @Test - public void clearsWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(clearsId, Integer.MAX_VALUE); + public void clearsWrapsFromMaxIntegerStaysPositive() { + statistics.incLong(clearsId, Integer.MAX_VALUE); cachePerfStats.incClearCount(); - assertThat(cachePerfStats.getClearCount()).isNegative(); + assertThat(cachePerfStats.getClearCount()).isPositive(); } @Test public void getLoadsCompletedDelegatesToStatistics() { - statistics.incInt(loadsCompletedId, Integer.MAX_VALUE); + statistics.incLong(loadsCompletedId, Integer.MAX_VALUE); assertThat(cachePerfStats.getLoadsCompleted()).isEqualTo(Integer.MAX_VALUE); } @@ -456,27 +422,24 @@ public void getLoadsCompletedDelegatesToStatistics() { * {@code endLoad}. */ @Test - public void endLoadIncrementsMisses() { + public void endLoadIncrementsLoadsCompleted() { cachePerfStats.endLoad(0); - assertThat(statistics.getInt(loadsCompletedId)).isEqualTo(1); + assertThat(statistics.getLong(loadsCompletedId)).isEqualTo(1); } - /** - * Characterization test: {@code loads} currently wraps to negative from max integer value. - */ @Test - public void loadsCompletedWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(loadsCompletedId, Integer.MAX_VALUE); + public void loadsCompletedWrapsFromMaxIntegerStaysPositive() { + statistics.incLong(loadsCompletedId, Integer.MAX_VALUE); cachePerfStats.endLoad(0); - assertThat(cachePerfStats.getLoadsCompleted()).isNegative(); + assertThat(cachePerfStats.getLoadsCompleted()).isPositive(); } @Test public void getNetloadsCompletedDelegatesToStatistics() { - statistics.incInt(netloadsCompletedId, Integer.MAX_VALUE); + statistics.incLong(netloadsCompletedId, Integer.MAX_VALUE); assertThat(cachePerfStats.getNetloadsCompleted()).isEqualTo(Integer.MAX_VALUE); } @@ -489,25 +452,21 @@ public void getNetloadsCompletedDelegatesToStatistics() { public void endNetloadIncrementsNetloadsCompleted() { cachePerfStats.endNetload(0); - assertThat(statistics.getInt(netloadsCompletedId)).isEqualTo(1); + assertThat(statistics.getLong(netloadsCompletedId)).isEqualTo(1); } - /** - * Characterization test: {@code netloadsComplete} currently wraps to negative from max integer - * value. - */ @Test - public void netloadsCompletedWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(netloadsCompletedId, Integer.MAX_VALUE); + public void netloadsCompletedWrapsFromMaxIntegerStaysPositive() { + statistics.incLong(netloadsCompletedId, Integer.MAX_VALUE); cachePerfStats.endNetload(0); - assertThat(cachePerfStats.getNetloadsCompleted()).isNegative(); + assertThat(cachePerfStats.getNetloadsCompleted()).isPositive(); } @Test public void getNetsearchesCompletedDelegatesToStatistics() { - statistics.incInt(netsearchesCompletedId, Integer.MAX_VALUE); + statistics.incLong(netsearchesCompletedId, Integer.MAX_VALUE); assertThat(cachePerfStats.getNetsearchesCompleted()).isEqualTo(Integer.MAX_VALUE); } @@ -520,25 +479,21 @@ public void getNetsearchesCompletedDelegatesToStatistics() { public void endLoadIncrementsNetsearchesCompleted() { cachePerfStats.endNetsearch(0); - assertThat(statistics.getInt(netsearchesCompletedId)).isEqualTo(1); + assertThat(statistics.getLong(netsearchesCompletedId)).isEqualTo(1); } - /** - * Characterization test: {@code netsearchesCompleted} currently wraps to negative from max - * integer value. - */ @Test - public void netsearchesCompletedWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(netsearchesCompletedId, Integer.MAX_VALUE); + public void netsearchesCompletedWrapsFromMaxIntegerStaysPositive() { + statistics.incLong(netsearchesCompletedId, Integer.MAX_VALUE); cachePerfStats.endNetsearch(0); - assertThat(cachePerfStats.getNetsearchesCompleted()).isNegative(); + assertThat(cachePerfStats.getNetsearchesCompleted()).isPositive(); } @Test public void getCacheWriterCallsCompletedDelegatesToStatistics() { - statistics.incInt(cacheWriterCallsCompletedId, Integer.MAX_VALUE); + statistics.incLong(cacheWriterCallsCompletedId, Integer.MAX_VALUE); assertThat(cachePerfStats.getCacheWriterCallsCompleted()).isEqualTo(Integer.MAX_VALUE); } @@ -551,25 +506,21 @@ public void getCacheWriterCallsCompletedDelegatesToStatistics() { public void endCacheWriterCallIncrementsCacheWriterCallsCompleted() { cachePerfStats.endCacheWriterCall(0); - assertThat(statistics.getInt(cacheWriterCallsCompletedId)).isEqualTo(1); + assertThat(statistics.getLong(cacheWriterCallsCompletedId)).isEqualTo(1); } - /** - * Characterization test: {@code cacheWriterCallsCompleted} currently wraps to negative from max - * integer value. - */ @Test - public void cacheWriterCallsCompletedWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(cacheWriterCallsCompletedId, Integer.MAX_VALUE); + public void cacheWriterCallsCompletedWrapsFromMaxIntegerStaysPositive() { + statistics.incLong(cacheWriterCallsCompletedId, Integer.MAX_VALUE); cachePerfStats.endCacheWriterCall(0); - assertThat(cachePerfStats.getCacheWriterCallsCompleted()).isNegative(); + assertThat(cachePerfStats.getCacheWriterCallsCompleted()).isPositive(); } @Test public void getCacheListenerCallsCompletedDelegatesToStatistics() { - statistics.incInt(cacheListenerCallsCompletedId, Integer.MAX_VALUE); + statistics.incLong(cacheListenerCallsCompletedId, Integer.MAX_VALUE); assertThat(cachePerfStats.getCacheListenerCallsCompleted()).isEqualTo(Integer.MAX_VALUE); } @@ -582,25 +533,21 @@ public void getCacheListenerCallsCompletedDelegatesToStatistics() { public void endCacheWriterCallIncrementsCacheListenerCallsCompleted() { cachePerfStats.endCacheListenerCall(0); - assertThat(statistics.getInt(cacheListenerCallsCompletedId)).isEqualTo(1); + assertThat(statistics.getLong(cacheListenerCallsCompletedId)).isEqualTo(1); } - /** - * Characterization test: {@code cacheListenerCallsCompleted} currently wraps to negative from max - * integer value. - */ @Test - public void cacheListenerCallsCompletedWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(cacheListenerCallsCompletedId, Integer.MAX_VALUE); + public void cacheListenerCallsCompletedWrapsFromMaxIntegerStaysPositive() { + statistics.incLong(cacheListenerCallsCompletedId, Integer.MAX_VALUE); cachePerfStats.endCacheListenerCall(0); - assertThat(cachePerfStats.getCacheListenerCallsCompleted()).isNegative(); + assertThat(cachePerfStats.getCacheListenerCallsCompleted()).isPositive(); } @Test public void getGetInitialImagesCompletedDelegatesToStatistics() { - statistics.incInt(getInitialImagesCompletedId, Integer.MAX_VALUE); + statistics.incLong(getInitialImagesCompletedId, Integer.MAX_VALUE); assertThat(cachePerfStats.getGetInitialImagesCompleted()).isEqualTo(Integer.MAX_VALUE); } @@ -610,28 +557,24 @@ public void getGetInitialImagesCompletedDelegatesToStatistics() { * is to invoke {@code endGetInitialImage}. */ @Test - public void endCacheWriterCallIncrementsGetInitialImagesCompleted() { + public void endGetInitialImageIncrementsGetInitialImagesCompleted() { cachePerfStats.endGetInitialImage(0); - assertThat(statistics.getInt(getInitialImagesCompletedId)).isEqualTo(1); + assertThat(statistics.getLong(getInitialImagesCompletedId)).isEqualTo(1); } - /** - * Characterization test: {@code getInitialImagesCompleted} currently wraps to negative from max - * integer value. - */ @Test - public void getInitialImagesCompletedCallsCompletedWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(getInitialImagesCompletedId, Integer.MAX_VALUE); + public void getInitialImagesCompletedWrapsFromMaxIntegerStaysPositive() { + statistics.incLong(getInitialImagesCompletedId, Integer.MAX_VALUE); cachePerfStats.endGetInitialImage(0); - assertThat(cachePerfStats.getGetInitialImagesCompleted()).isNegative(); + assertThat(cachePerfStats.getGetInitialImagesCompleted()).isPositive(); } @Test public void getDeltaGetInitialImagesCompletedDelegatesToStatistics() { - statistics.incInt(deltaGetInitialImagesCompletedId, Integer.MAX_VALUE); + statistics.incLong(deltaGetInitialImagesCompletedId, Integer.MAX_VALUE); assertThat(cachePerfStats.getDeltaGetInitialImagesCompleted()).isEqualTo(Integer.MAX_VALUE); } @@ -640,25 +583,21 @@ public void getDeltaGetInitialImagesCompletedDelegatesToStatistics() { public void incDeltaGIICompletedIncrementsDeltaGetInitialImagesCompleted() { cachePerfStats.incDeltaGIICompleted(); - assertThat(statistics.getInt(deltaGetInitialImagesCompletedId)).isEqualTo(1); + assertThat(statistics.getLong(deltaGetInitialImagesCompletedId)).isEqualTo(1); } - /** - * Characterization test: {@code deltaGetInitialImagesCompleted} currently wraps to negative from - * max integer value. - */ @Test - public void deltaGetInitialImagesCompletedWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(deltaGetInitialImagesCompletedId, Integer.MAX_VALUE); + public void deltaGetInitialImagesCompletedWrapsFromMaxIntegerStaysPositive() { + statistics.incLong(deltaGetInitialImagesCompletedId, Integer.MAX_VALUE); cachePerfStats.incDeltaGIICompleted(); - assertThat(cachePerfStats.getDeltaGetInitialImagesCompleted()).isNegative(); + assertThat(cachePerfStats.getDeltaGetInitialImagesCompleted()).isPositive(); } @Test public void getQueryExecutionsDelegatesToStatistics() { - statistics.incInt(queryExecutionsId, Integer.MAX_VALUE); + statistics.incLong(queryExecutionsId, Integer.MAX_VALUE); assertThat(cachePerfStats.getQueryExecutions()).isEqualTo(Integer.MAX_VALUE); } @@ -671,25 +610,21 @@ public void getQueryExecutionsDelegatesToStatistics() { public void endQueryExecutionIncrementsQueryExecutions() { cachePerfStats.endQueryExecution(1); - assertThat(statistics.getInt(queryExecutionsId)).isEqualTo(1); + assertThat(statistics.getLong(queryExecutionsId)).isEqualTo(1); } - /** - * Characterization test: {@code queryExecutions} currently wraps to negative from max integer - * value. - */ @Test - public void queryExecutionsWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(queryExecutionsId, Integer.MAX_VALUE); + public void queryExecutionsWrapsFromMaxIntegerStaysPositive() { + statistics.incLong(queryExecutionsId, Integer.MAX_VALUE); cachePerfStats.endQueryExecution(1); - assertThat(cachePerfStats.getQueryExecutions()).isNegative(); + assertThat(cachePerfStats.getQueryExecutions()).isPositive(); } @Test public void getTxCommitsDelegatesToStatistics() { - statistics.incInt(txCommitsId, Integer.MAX_VALUE); + statistics.incLong(txCommitsId, Integer.MAX_VALUE); assertThat(cachePerfStats.getTxCommits()).isEqualTo(Integer.MAX_VALUE); } @@ -702,24 +637,21 @@ public void getTxCommitsDelegatesToStatistics() { public void txSuccessIncrementsTxCommits() { cachePerfStats.txSuccess(1, 1, 1); - assertThat(statistics.getInt(txCommitsId)).isEqualTo(1); + assertThat(statistics.getLong(txCommitsId)).isEqualTo(1); } - /** - * Characterization test: {@code txCommits} currently wraps to negative from max integer value. - */ @Test - public void txCommitsWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(txCommitsId, Integer.MAX_VALUE); + public void txCommitsWrapsFromMaxIntegerStaysPositive() { + statistics.incLong(txCommitsId, Integer.MAX_VALUE); cachePerfStats.txSuccess(1, 1, 1); - assertThat(cachePerfStats.getTxCommits()).isNegative(); + assertThat(cachePerfStats.getTxCommits()).isPositive(); } @Test public void getTxFailuresDelegatesToStatistics() { - statistics.incInt(txFailuresId, Integer.MAX_VALUE); + statistics.incLong(txFailuresId, Integer.MAX_VALUE); assertThat(cachePerfStats.getTxFailures()).isEqualTo(Integer.MAX_VALUE); } @@ -732,24 +664,21 @@ public void getTxFailuresDelegatesToStatistics() { public void txFailureIncrementsTxFailures() { cachePerfStats.txFailure(1, 1, 1); - assertThat(statistics.getInt(txFailuresId)).isEqualTo(1); + assertThat(statistics.getLong(txFailuresId)).isEqualTo(1); } - /** - * Characterization test: {@code txFailures} currently wraps to negative from max integer value. - */ @Test - public void txFailuresWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(txFailuresId, Integer.MAX_VALUE); + public void txFailuresWrapsFromMaxIntegerStaysPositive() { + statistics.incLong(txFailuresId, Integer.MAX_VALUE); cachePerfStats.txFailure(1, 1, 1); - assertThat(cachePerfStats.getTxFailures()).isNegative(); + assertThat(cachePerfStats.getTxFailures()).isPositive(); } @Test public void getTxRollbacksDelegatesToStatistics() { - statistics.incInt(txRollbacksId, Integer.MAX_VALUE); + statistics.incLong(txRollbacksId, Integer.MAX_VALUE); assertThat(cachePerfStats.getTxRollbacks()).isEqualTo(Integer.MAX_VALUE); } @@ -762,24 +691,21 @@ public void getTxRollbacksDelegatesToStatistics() { public void txRollbackIncrementsTxRollbacks() { cachePerfStats.txRollback(1, 1, 1); - assertThat(statistics.getInt(txRollbacksId)).isEqualTo(1); + assertThat(statistics.getLong(txRollbacksId)).isEqualTo(1); } - /** - * Characterization test: {@code txRollbacks} currently wraps to negative from max integer value. - */ @Test - public void txRollbacksWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(txRollbacksId, Integer.MAX_VALUE); + public void txRollbacksWrapsFromMaxIntegerStaysPositive() { + statistics.incLong(txRollbacksId, Integer.MAX_VALUE); cachePerfStats.txRollback(1, 1, 1); - assertThat(cachePerfStats.getTxRollbacks()).isNegative(); + assertThat(cachePerfStats.getTxRollbacks()).isPositive(); } @Test public void getTxCommitChangesDelegatesToStatistics() { - statistics.incInt(txCommitChangesId, Integer.MAX_VALUE); + statistics.incLong(txCommitChangesId, Integer.MAX_VALUE); assertThat(cachePerfStats.getTxCommitChanges()).isEqualTo(Integer.MAX_VALUE); } @@ -792,25 +718,21 @@ public void getTxCommitChangesDelegatesToStatistics() { public void txSuccessIncrementsTxCommitChanges() { cachePerfStats.txSuccess(1, 1, 1); - assertThat(statistics.getInt(txCommitChangesId)).isEqualTo(1); + assertThat(statistics.getLong(txCommitChangesId)).isEqualTo(1); } - /** - * Characterization test: {@code txCommitChanges} currently wraps to negative from max integer - * value. - */ @Test - public void txCommitChangesWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(txCommitChangesId, Integer.MAX_VALUE); + public void txCommitChangesWrapsFromMaxIntegerStaysPositive() { + statistics.incLong(txCommitChangesId, Integer.MAX_VALUE); cachePerfStats.txSuccess(1, 1, 1); - assertThat(cachePerfStats.getTxCommitChanges()).isNegative(); + assertThat(cachePerfStats.getTxCommitChanges()).isPositive(); } @Test public void getTxFailureChangesDelegatesToStatistics() { - statistics.incInt(txFailureChangesId, Integer.MAX_VALUE); + statistics.incLong(txFailureChangesId, Integer.MAX_VALUE); assertThat(cachePerfStats.getTxFailureChanges()).isEqualTo(Integer.MAX_VALUE); } @@ -823,25 +745,21 @@ public void getTxFailureChangesDelegatesToStatistics() { public void txFailureIncrementsTxFailureChanges() { cachePerfStats.txFailure(1, 1, 1); - assertThat(statistics.getInt(txFailureChangesId)).isEqualTo(1); + assertThat(statistics.getLong(txFailureChangesId)).isEqualTo(1); } - /** - * Characterization test: {@code txFailureChanges} currently wraps to negative from max integer - * value. - */ @Test - public void txFailureChangesWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(txFailureChangesId, Integer.MAX_VALUE); + public void txFailureChangesWrapsFromMaxIntegerStaysPositive() { + statistics.incLong(txFailureChangesId, Integer.MAX_VALUE); cachePerfStats.txFailure(1, 1, 1); - assertThat(cachePerfStats.getTxFailureChanges()).isNegative(); + assertThat(cachePerfStats.getTxFailureChanges()).isPositive(); } @Test public void getTxRollbackChangesDelegatesToStatistics() { - statistics.incInt(txRollbackChangesId, Integer.MAX_VALUE); + statistics.incLong(txRollbackChangesId, Integer.MAX_VALUE); assertThat(cachePerfStats.getTxRollbackChanges()).isEqualTo(Integer.MAX_VALUE); } @@ -854,25 +772,21 @@ public void getTxRollbackChangesDelegatesToStatistics() { public void txRollbackIncrementsTxRollbackChanges() { cachePerfStats.txRollback(1, 1, 1); - assertThat(statistics.getInt(txRollbackChangesId)).isEqualTo(1); + assertThat(statistics.getLong(txRollbackChangesId)).isEqualTo(1); } - /** - * Characterization test: {@code txRollbackChanges} currently wraps to negative from max integer - * value. - */ @Test - public void txRollbackChangesWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(txRollbackChangesId, Integer.MAX_VALUE); + public void txRollbackChangesWrapsFromMaxIntegerStaysPositive() { + statistics.incLong(txRollbackChangesId, Integer.MAX_VALUE); cachePerfStats.txRollback(1, 1, 1); - assertThat(cachePerfStats.getTxRollbackChanges()).isNegative(); + assertThat(cachePerfStats.getTxRollbackChanges()).isPositive(); } @Test public void getEvictorJobsStartedChangesDelegatesToStatistics() { - statistics.incInt(evictorJobsStartedId, Integer.MAX_VALUE); + statistics.incLong(evictorJobsStartedId, Integer.MAX_VALUE); assertThat(cachePerfStats.getEvictorJobsStarted()).isEqualTo(Integer.MAX_VALUE); } @@ -881,25 +795,21 @@ public void getEvictorJobsStartedChangesDelegatesToStatistics() { public void incEvictorJobsStartedIncrementsEvictorJobsStarted() { cachePerfStats.incEvictorJobsStarted(); - assertThat(statistics.getInt(evictorJobsStartedId)).isEqualTo(1); + assertThat(statistics.getLong(evictorJobsStartedId)).isEqualTo(1); } - /** - * Characterization test: {@code evictorJobsStarted} currently wraps to negative from max integer - * value. - */ @Test - public void evictorJobsStartedWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(evictorJobsStartedId, Integer.MAX_VALUE); + public void evictorJobsStartedWrapsFromMaxIntegerStaysPositive() { + statistics.incLong(evictorJobsStartedId, Integer.MAX_VALUE); cachePerfStats.incEvictorJobsStarted(); - assertThat(cachePerfStats.getEvictorJobsStarted()).isNegative(); + assertThat(cachePerfStats.getEvictorJobsStarted()).isPositive(); } @Test public void getEvictorJobsCompletedChangesDelegatesToStatistics() { - statistics.incInt(evictorJobsCompletedId, Integer.MAX_VALUE); + statistics.incLong(evictorJobsCompletedId, Integer.MAX_VALUE); assertThat(cachePerfStats.getEvictorJobsCompleted()).isEqualTo(Integer.MAX_VALUE); } @@ -908,25 +818,21 @@ public void getEvictorJobsCompletedChangesDelegatesToStatistics() { public void incEvictorJobsCompletedIncrementsEvictorJobsCompleted() { cachePerfStats.incEvictorJobsCompleted(); - assertThat(statistics.getInt(evictorJobsCompletedId)).isEqualTo(1); + assertThat(statistics.getLong(evictorJobsCompletedId)).isEqualTo(1); } - /** - * Characterization test: {@code evictorJobsCompleted} currently wraps to negative from max - * integer value. - */ @Test - public void evictorJobsCompletedWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(evictorJobsCompletedId, Integer.MAX_VALUE); + public void evictorJobsCompletedWrapsFromMaxIntegerStaysPositive() { + statistics.incLong(evictorJobsCompletedId, Integer.MAX_VALUE); cachePerfStats.incEvictorJobsCompleted(); - assertThat(cachePerfStats.getEvictorJobsCompleted()).isNegative(); + assertThat(cachePerfStats.getEvictorJobsCompleted()).isPositive(); } @Test public void getIndexUpdateCompletedChangesDelegatesToStatistics() { - statistics.incInt(indexUpdateCompletedId, Integer.MAX_VALUE); + statistics.incLong(indexUpdateCompletedId, Integer.MAX_VALUE); assertThat(cachePerfStats.getIndexUpdateCompleted()).isEqualTo(Integer.MAX_VALUE); } @@ -936,28 +842,24 @@ public void getIndexUpdateCompletedChangesDelegatesToStatistics() { * invoke {@code endIndexUpdate}. */ @Test - public void endIndexUpdateIncrementsEvictorJobsCompleted() { + public void endIndexUpdateIncrementsIndexUpdateCompleted() { cachePerfStats.endIndexUpdate(1); - assertThat(statistics.getInt(indexUpdateCompletedId)).isEqualTo(1); + assertThat(statistics.getLong(indexUpdateCompletedId)).isEqualTo(1); } - /** - * Characterization test: {@code indexUpdateCompleted} currently wraps to negative from max - * integer value. - */ @Test - public void indexUpdateCompletedWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(indexUpdateCompletedId, Integer.MAX_VALUE); + public void indexUpdateCompletedWrapsFromMaxIntegerStaysPositive() { + statistics.incLong(indexUpdateCompletedId, Integer.MAX_VALUE); cachePerfStats.endIndexUpdate(1); - assertThat(cachePerfStats.getIndexUpdateCompleted()).isNegative(); + assertThat(cachePerfStats.getIndexUpdateCompleted()).isPositive(); } @Test public void getDeltaUpdatesDelegatesToStatistics() { - statistics.incInt(deltaUpdatesId, Integer.MAX_VALUE); + statistics.incLong(deltaUpdatesId, Integer.MAX_VALUE); assertThat(cachePerfStats.getDeltaUpdates()).isEqualTo(Integer.MAX_VALUE); } @@ -970,25 +872,21 @@ public void getDeltaUpdatesDelegatesToStatistics() { public void endDeltaUpdateIncrementsDeltaUpdates() { cachePerfStats.endDeltaUpdate(1); - assertThat(statistics.getInt(deltaUpdatesId)).isEqualTo(1); + assertThat(statistics.getLong(deltaUpdatesId)).isEqualTo(1); } - /** - * Characterization test: {@code deltaUpdatesId} currently wraps to negative from max integer - * value. - */ @Test - public void deltaUpdatesWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(deltaUpdatesId, Integer.MAX_VALUE); + public void deltaUpdatesWrapsFromMaxIntegerStaysPositive() { + statistics.incLong(deltaUpdatesId, Integer.MAX_VALUE); cachePerfStats.endDeltaUpdate(1); - assertThat(cachePerfStats.getDeltaUpdates()).isNegative(); + assertThat(cachePerfStats.getDeltaUpdates()).isPositive(); } @Test public void getDeltaFailedUpdatesDelegatesToStatistics() { - statistics.incInt(deltaFailedUpdatesId, Integer.MAX_VALUE); + statistics.incLong(deltaFailedUpdatesId, Integer.MAX_VALUE); assertThat(cachePerfStats.getDeltaFailedUpdates()).isEqualTo(Integer.MAX_VALUE); } @@ -997,25 +895,21 @@ public void getDeltaFailedUpdatesDelegatesToStatistics() { public void incDeltaFailedUpdatesIncrementsDeltaFailedUpdates() { cachePerfStats.incDeltaFailedUpdates(); - assertThat(statistics.getInt(deltaFailedUpdatesId)).isEqualTo(1); + assertThat(statistics.getLong(deltaFailedUpdatesId)).isEqualTo(1); } - /** - * Characterization test: {@code deltaFailedUpdates} currently wraps to negative from max - * integer value. - */ @Test - public void deltaFailedUpdatesWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(deltaFailedUpdatesId, Integer.MAX_VALUE); + public void deltaFailedUpdatesWrapsFromMaxIntegerStaysPositive() { + statistics.incLong(deltaFailedUpdatesId, Integer.MAX_VALUE); cachePerfStats.incDeltaFailedUpdates(); - assertThat(cachePerfStats.getDeltaFailedUpdates()).isNegative(); + assertThat(cachePerfStats.getDeltaFailedUpdates()).isPositive(); } @Test public void getDeltasPreparedUpdatesDelegatesToStatistics() { - statistics.incInt(deltasPreparedId, Integer.MAX_VALUE); + statistics.incLong(deltasPreparedId, Integer.MAX_VALUE); assertThat(cachePerfStats.getDeltasPrepared()).isEqualTo(Integer.MAX_VALUE); } @@ -1028,25 +922,21 @@ public void getDeltasPreparedUpdatesDelegatesToStatistics() { public void endDeltaPreparedIncrementsDeltasPrepared() { cachePerfStats.endDeltaPrepared(1); - assertThat(statistics.getInt(deltasPreparedId)).isEqualTo(1); + assertThat(statistics.getLong(deltasPreparedId)).isEqualTo(1); } - /** - * Characterization test: {@code deltasPrepared} currently wraps to negative from max - * integer value. - */ @Test - public void deltasPreparedWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(deltasPreparedId, Integer.MAX_VALUE); + public void deltasPreparedWrapsFromMaxIntegerStaysPositive() { + statistics.incLong(deltasPreparedId, Integer.MAX_VALUE); cachePerfStats.endDeltaPrepared(1); - assertThat(cachePerfStats.getDeltasPrepared()).isNegative(); + assertThat(cachePerfStats.getDeltasPrepared()).isPositive(); } @Test public void getDeltasSentDelegatesToStatistics() { - statistics.incInt(deltasSentId, Integer.MAX_VALUE); + statistics.incLong(deltasSentId, Integer.MAX_VALUE); assertThat(cachePerfStats.getDeltasSent()).isEqualTo(Integer.MAX_VALUE); } @@ -1055,24 +945,21 @@ public void getDeltasSentDelegatesToStatistics() { public void incDeltasSentPreparedIncrementsDeltasSent() { cachePerfStats.incDeltasSent(); - assertThat(statistics.getInt(deltasSentId)).isEqualTo(1); + assertThat(statistics.getLong(deltasSentId)).isEqualTo(1); } - /** - * Characterization test: {@code deltasSent} currently wraps to negative from max integer value. - */ @Test - public void deltasSentWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(deltasSentId, Integer.MAX_VALUE); + public void deltasSentWrapsFromMaxIntegerStaysPositive() { + statistics.incLong(deltasSentId, Integer.MAX_VALUE); cachePerfStats.incDeltasSent(); - assertThat(cachePerfStats.getDeltasSent()).isNegative(); + assertThat(cachePerfStats.getDeltasSent()).isPositive(); } @Test public void getDeltaFullValuesSentDelegatesToStatistics() { - statistics.incInt(deltaFullValuesSentId, Integer.MAX_VALUE); + statistics.incLong(deltaFullValuesSentId, Integer.MAX_VALUE); assertThat(cachePerfStats.getDeltaFullValuesSent()).isEqualTo(Integer.MAX_VALUE); } @@ -1081,25 +968,21 @@ public void getDeltaFullValuesSentDelegatesToStatistics() { public void incDeltaFullValuesSentIncrementsDeltaFullValuesSent() { cachePerfStats.incDeltaFullValuesSent(); - assertThat(statistics.getInt(deltaFullValuesSentId)).isEqualTo(1); + assertThat(statistics.getLong(deltaFullValuesSentId)).isEqualTo(1); } - /** - * Characterization test: {@code deltaFullValuesSent} currently wraps to negative from max integer - * value. - */ @Test - public void deltaFullValuesSentWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(deltaFullValuesSentId, Integer.MAX_VALUE); + public void deltaFullValuesSentWrapsFromMaxIntegerStaysPositive() { + statistics.incLong(deltaFullValuesSentId, Integer.MAX_VALUE); cachePerfStats.incDeltaFullValuesSent(); - assertThat(cachePerfStats.getDeltaFullValuesSent()).isNegative(); + assertThat(cachePerfStats.getDeltaFullValuesSent()).isPositive(); } @Test public void getDeltaFullValuesRequestedDelegatesToStatistics() { - statistics.incInt(deltaFullValuesRequestedId, Integer.MAX_VALUE); + statistics.incLong(deltaFullValuesRequestedId, Integer.MAX_VALUE); assertThat(cachePerfStats.getDeltaFullValuesRequested()).isEqualTo(Integer.MAX_VALUE); } @@ -1108,19 +991,15 @@ public void getDeltaFullValuesRequestedDelegatesToStatistics() { public void incDeltaFullValuesRequestedIncrementsDeltaFullValuesRequested() { cachePerfStats.incDeltaFullValuesRequested(); - assertThat(statistics.getInt(deltaFullValuesRequestedId)).isEqualTo(1); + assertThat(statistics.getLong(deltaFullValuesRequestedId)).isEqualTo(1); } - /** - * Characterization test: {@code deltaFullValuesRequested} currently wraps to negative from max - * integer value. - */ @Test - public void deltaFullValuesRequestedWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(deltaFullValuesRequestedId, Integer.MAX_VALUE); + public void deltaFullValuesRequestedWrapsFromMaxIntegerStaysPositive() { + statistics.incLong(deltaFullValuesRequestedId, Integer.MAX_VALUE); cachePerfStats.incDeltaFullValuesRequested(); - assertThat(cachePerfStats.getDeltaFullValuesRequested()).isNegative(); + assertThat(cachePerfStats.getDeltaFullValuesRequested()).isPositive(); } } diff --git a/geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/dunit/CqQueryOptimizedExecuteDUnitTest.java b/geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/dunit/CqQueryOptimizedExecuteDUnitTest.java index c309b32e370b..06c0e550e869 100644 --- a/geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/dunit/CqQueryOptimizedExecuteDUnitTest.java +++ b/geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/dunit/CqQueryOptimizedExecuteDUnitTest.java @@ -28,8 +28,6 @@ import org.apache.geode.cache30.CacheSerializableRunnable; import org.apache.geode.distributed.internal.DistributionConfig; import org.apache.geode.internal.AvailablePortHelper; -import org.apache.geode.internal.cache.GemFireCacheImpl; -import org.apache.geode.test.dunit.Host; import org.apache.geode.test.dunit.Invoke; import org.apache.geode.test.dunit.LogWriterUtils; import org.apache.geode.test.dunit.NetworkUtils; @@ -50,7 +48,7 @@ public CqQueryOptimizedExecuteDUnitTest() { } @Override - protected final void postSetUpCqQueryDUnitTest() throws Exception { + protected final void postSetUpCqQueryDUnitTest() { Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") { @Override public void run() { @@ -60,7 +58,7 @@ public void run() { } @Override - public final void preTearDownCacheTestCase() throws Exception { + public final void preTearDownCacheTestCase() { Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") { @Override public void run() { @@ -71,10 +69,9 @@ public void run() { } @Test - public void testCqExecuteWithoutQueryExecution() throws Exception { - final Host host = Host.getHost(0); - final VM server = host.getVM(0); - final VM client = host.getVM(1); + public void testCqExecuteWithoutQueryExecution() { + final VM server = VM.getVM(0); + final VM client = VM.getVM(1); final int numOfEntries = 10; final String cqName = "testCqExecuteWithoutQueryExecution_1"; @@ -82,8 +79,8 @@ public void testCqExecuteWithoutQueryExecution() throws Exception { // Create values. createValues(server, regions[0], numOfEntries); - final int thePort = server.invoke(() -> CqQueryDUnitTest.getCacheServerPort()); - final String host0 = NetworkUtils.getServerHostName(server.getHost()); + final int thePort = server.invoke(CqQueryDUnitTest::getCacheServerPort); + final String host0 = NetworkUtils.getServerHostName(); // Create client. createClient(client, thePort, host0); @@ -100,7 +97,7 @@ public void testCqExecuteWithoutQueryExecution() throws Exception { public void run2() throws CacheException { assertFalse("CqServiceImpl.EXECUTE_QUERY_DURING_INIT flag should be false ", CqServiceImpl.EXECUTE_QUERY_DURING_INIT); - int numOfQueryExecutions = (Integer) ((GemFireCacheImpl) getCache()).getCachePerfStats() + long numOfQueryExecutions = (long) getCache().getCachePerfStats() .getStats().get("queryExecutions"); assertEquals("Number of query executions for cq.execute should be 0 ", 0, numOfQueryExecutions); @@ -123,9 +120,8 @@ public void run2() throws CacheException { waitForCreated(client, cqName, KEY + numOfEntries * 2); - validateCQ(client, cqName, /* resultSize: */ noTest, /* creates: */ numOfEntries, - /* updates: */ 0, /* deletes; */ 0, /* queryInserts: */ numOfEntries, /* queryUpdates: */ 0, - /* queryDeletes: */ 0, /* totalEvents: */ numOfEntries); + validateCQ(client, cqName, noTest, numOfEntries, 0, 0, numOfEntries, + 0, 0, numOfEntries); // Update values. createValues(server, regions[0], 5); @@ -135,27 +131,24 @@ public void run2() throws CacheException { // validate Update events. - validateCQ(client, cqName, /* resultSize: */ noTest, /* creates: */ numOfEntries, - /* updates: */ 15, /* deletes; */ 0, /* queryInserts: */ numOfEntries, - /* queryUpdates: */ 15, /* queryDeletes: */ 0, /* totalEvents: */ numOfEntries + 15); + validateCQ(client, cqName, noTest, numOfEntries, 15, 0, numOfEntries, + 15, 0, numOfEntries + 15); // Validate delete events. deleteValues(server, regions[0], 5); waitForDestroyed(client, cqName, KEY + 5); - validateCQ(client, cqName, /* resultSize: */ noTest, /* creates: */ numOfEntries, - /* updates: */ 15, /* deletes; */5, /* queryInserts: */ numOfEntries, - /* queryUpdates: */ 15, /* queryDeletes: */ 5, /* totalEvents: */ numOfEntries + 15 + 5); + validateCQ(client, cqName, noTest, numOfEntries, 15, 5, numOfEntries, + 15, 5, numOfEntries + 15 + 5); closeClient(client); closeServer(server); } @Test - public void testCqExecuteWithoutQueryExecutionAndNoRSCaching() throws Exception { - final Host host = Host.getHost(0); - final VM server = host.getVM(0); - final VM client = host.getVM(1); + public void testCqExecuteWithoutQueryExecutionAndNoRSCaching() { + final VM server = VM.getVM(0); + final VM client = VM.getVM(1); final int numOfEntries = 10; final String cqName = "testCqExecuteWithoutQueryExecution_1"; @@ -170,8 +163,8 @@ public void run2() throws CacheException { // Create values. createValues(server, regions[0], numOfEntries); - final int thePort = server.invoke(() -> CqQueryDUnitTest.getCacheServerPort()); - final String host0 = NetworkUtils.getServerHostName(server.getHost()); + final int thePort = server.invoke(CqQueryDUnitTest::getCacheServerPort); + final String host0 = NetworkUtils.getServerHostName(); // Create client. createClient(client, thePort, host0); @@ -190,7 +183,7 @@ public void run2() throws CacheException { CqServiceImpl.EXECUTE_QUERY_DURING_INIT); assertFalse(DistributionConfig.GEMFIRE_PREFIX + "cq.MAINTAIN_KEYS flag should be false ", CqServiceProvider.MAINTAIN_KEYS); - int numOfQueryExecutions = (Integer) ((GemFireCacheImpl) getCache()).getCachePerfStats() + long numOfQueryExecutions = (long) getCache().getCachePerfStats() .getStats().get("queryExecutions"); assertEquals("Number of query executions for cq.execute should be 0 ", 0, numOfQueryExecutions); @@ -212,9 +205,8 @@ public void run2() throws CacheException { waitForCreated(client, cqName, KEY + numOfEntries * 2); - validateCQ(client, cqName, /* resultSize: */ noTest, /* creates: */ numOfEntries, - /* updates: */ 0, /* deletes; */ 0, /* queryInserts: */ numOfEntries, /* queryUpdates: */ 0, - /* queryDeletes: */ 0, /* totalEvents: */ numOfEntries); + validateCQ(client, cqName, noTest, numOfEntries, 0, 0, numOfEntries, + 0, 0, numOfEntries); // Update values. createValues(server, regions[0], 5); @@ -224,17 +216,15 @@ public void run2() throws CacheException { // validate Update events. - validateCQ(client, cqName, /* resultSize: */ noTest, /* creates: */ numOfEntries, - /* updates: */ 15, /* deletes; */ 0, /* queryInserts: */ numOfEntries, - /* queryUpdates: */ 15, /* queryDeletes: */ 0, /* totalEvents: */ numOfEntries + 15); + validateCQ(client, cqName, noTest, numOfEntries, 15, 0, numOfEntries, + 15, 0, numOfEntries + 15); // Validate delete events. deleteValues(server, regions[0], 5); waitForDestroyed(client, cqName, KEY + 5); - validateCQ(client, cqName, /* resultSize: */ noTest, /* creates: */ numOfEntries, - /* updates: */ 15, /* deletes; */5, /* queryInserts: */ numOfEntries, - /* queryUpdates: */ 15, /* queryDeletes: */ 5, /* totalEvents: */ numOfEntries + 15 + 5); + validateCQ(client, cqName, noTest, numOfEntries, 15, 5, numOfEntries, + 15, 5, numOfEntries + 15 + 5); closeClient(client); closeServer(server); @@ -247,20 +237,19 @@ public void run2() throws CacheException { // when their respective servers are shutdown @Override @Test - public void testCQAllServersLeaveMultiplePool() throws Exception { - final Host host = Host.getHost(0); - VM server1 = host.getVM(1); - VM server2 = host.getVM(2); - VM client = host.getVM(3); + public void testCQAllServersLeaveMultiplePool() { + VM server1 = VM.getVM(1); + VM server2 = VM.getVM(2); + VM client = VM.getVM(3); createServer(server1); - final int port1 = server1.invoke(() -> CqQueryDUnitTest.getCacheServerPort()); - final String host0 = NetworkUtils.getServerHostName(server1.getHost()); + final int port1 = server1.invoke(CqQueryDUnitTest::getCacheServerPort); + final String host0 = NetworkUtils.getServerHostName(); final int[] ports = AvailablePortHelper.getRandomAvailableTCPPorts(1); createServer(server2, ports[0]); - final int thePort2 = server2.invoke(() -> CqQueryDUnitTest.getCacheServerPort()); + final int thePort2 = server2.invoke(CqQueryDUnitTest::getCacheServerPort); Wait.pause(8 * 1000); // Create client diff --git a/geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/dunit/PartitionedRegionCqQueryOptimizedExecuteDUnitTest.java b/geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/dunit/PartitionedRegionCqQueryOptimizedExecuteDUnitTest.java index 3991481fc033..35399431c4bf 100644 --- a/geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/dunit/PartitionedRegionCqQueryOptimizedExecuteDUnitTest.java +++ b/geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/dunit/PartitionedRegionCqQueryOptimizedExecuteDUnitTest.java @@ -27,8 +27,6 @@ import org.apache.geode.cache.query.internal.cq.CqServiceProvider; import org.apache.geode.cache30.CacheSerializableRunnable; import org.apache.geode.distributed.internal.DistributionConfig; -import org.apache.geode.internal.cache.GemFireCacheImpl; -import org.apache.geode.test.dunit.Host; import org.apache.geode.test.dunit.Invoke; import org.apache.geode.test.dunit.LogWriterUtils; import org.apache.geode.test.dunit.NetworkUtils; @@ -45,7 +43,7 @@ public PartitionedRegionCqQueryOptimizedExecuteDUnitTest() { } @Override - public final void postSetUp() throws Exception { + public final void postSetUp() { Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") { @Override public void run() { @@ -55,7 +53,7 @@ public void run() { } @Override - public final void preTearDownCacheTestCase() throws Exception { + public final void preTearDownCacheTestCase() { Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") { @Override public void run() { @@ -66,10 +64,9 @@ public void run() { } @Test - public void testCqExecuteWithoutQueryExecution() throws Exception { - final Host host = Host.getHost(0); - final VM server = host.getVM(0); - final VM client = host.getVM(1); + public void testCqExecuteWithoutQueryExecution() { + final VM server = VM.getVM(0); + final VM client = VM.getVM(1); final int numOfEntries = 10; final String cqName = "testCqExecuteWithoutQueryExecution_1"; @@ -78,8 +75,8 @@ public void testCqExecuteWithoutQueryExecution() throws Exception { createValues(server, regions[0], numOfEntries); final int thePort = - server.invoke(() -> PartitionedRegionCqQueryOptimizedExecuteDUnitTest.getCacheServerPort()); - final String host0 = NetworkUtils.getServerHostName(server.getHost()); + server.invoke(PartitionedRegionCqQueryOptimizedExecuteDUnitTest::getCacheServerPort); + final String host0 = NetworkUtils.getServerHostName(); // Create client. createClient(client, thePort, host0); @@ -96,7 +93,7 @@ public void testCqExecuteWithoutQueryExecution() throws Exception { public void run2() throws CacheException { assertFalse("CqServiceImpl.EXECUTE_QUERY_DURING_INIT flag should be false ", CqServiceImpl.EXECUTE_QUERY_DURING_INIT); - int numOfQueryExecutions = (Integer) ((GemFireCacheImpl) getCache()).getCachePerfStats() + long numOfQueryExecutions = (long) getCache().getCachePerfStats() .getStats().get("queryExecutions"); assertEquals("Number of query executions for cq.execute should be 0 ", 0, numOfQueryExecutions); @@ -118,10 +115,8 @@ public void run2() throws CacheException { cqHelper.waitForCreated(client, cqName, KEY + numOfEntries * 2); - cqHelper.validateCQ(client, cqName, /* resultSize: */ cqHelper.noTest, - /* creates: */ numOfEntries, /* updates: */ 0, /* deletes; */ 0, - /* queryInserts: */ numOfEntries, /* queryUpdates: */ 0, /* queryDeletes: */ 0, - /* totalEvents: */ numOfEntries); + cqHelper.validateCQ(client, cqName, CqQueryDUnitTest.noTest, numOfEntries, 0, 0, + numOfEntries, 0, 0, numOfEntries); // Update values. createValues(server, regions[0], 5); @@ -131,29 +126,24 @@ public void run2() throws CacheException { // validate Update events. - cqHelper.validateCQ(client, cqName, /* resultSize: */ cqHelper.noTest, - /* creates: */ numOfEntries, /* updates: */ 15, /* deletes; */ 0, - /* queryInserts: */ numOfEntries, /* queryUpdates: */ 15, /* queryDeletes: */ 0, - /* totalEvents: */ numOfEntries + 15); + cqHelper.validateCQ(client, cqName, CqQueryDUnitTest.noTest, numOfEntries, 15, 0, + numOfEntries, 15, 0, numOfEntries + 15); // Validate delete events. cqHelper.deleteValues(server, regions[0], 5); cqHelper.waitForDestroyed(client, cqName, KEY + 5); - cqHelper.validateCQ(client, cqName, /* resultSize: */ cqHelper.noTest, - /* creates: */ numOfEntries, /* updates: */ 15, /* deletes; */5, - /* queryInserts: */ numOfEntries, /* queryUpdates: */ 15, /* queryDeletes: */ 5, - /* totalEvents: */ numOfEntries + 15 + 5); + cqHelper.validateCQ(client, cqName, CqQueryDUnitTest.noTest, numOfEntries, 15, 5, + numOfEntries, 15, 5, numOfEntries + 15 + 5); cqHelper.closeClient(client); cqHelper.closeServer(server); } @Test - public void testCqExecuteWithoutQueryExecutionAndNoRSCaching() throws Exception { - final Host host = Host.getHost(0); - final VM server = host.getVM(0); - final VM client = host.getVM(1); + public void testCqExecuteWithoutQueryExecutionAndNoRSCaching() { + final VM server = VM.getVM(0); + final VM client = VM.getVM(1); final int numOfEntries = 10; final String cqName = "testCqExecuteWithoutQueryExecution_1"; @@ -168,8 +158,8 @@ public void run2() throws CacheException { // Create values. createValues(server, regions[0], numOfEntries); - final int thePort = server.invoke(() -> PartitionedRegionCqQueryDUnitTest.getCacheServerPort()); - final String host0 = NetworkUtils.getServerHostName(server.getHost()); + final int thePort = server.invoke(PartitionedRegionCqQueryDUnitTest::getCacheServerPort); + final String host0 = NetworkUtils.getServerHostName(); // Create client. createClient(client, thePort, host0); @@ -188,7 +178,7 @@ public void run2() throws CacheException { CqServiceImpl.EXECUTE_QUERY_DURING_INIT); assertFalse(DistributionConfig.GEMFIRE_PREFIX + "cq.MAINTAIN_KEYS flag should be false ", CqServiceProvider.MAINTAIN_KEYS); - int numOfQueryExecutions = (Integer) ((GemFireCacheImpl) getCache()).getCachePerfStats() + long numOfQueryExecutions = (long) getCache().getCachePerfStats() .getStats().get("queryExecutions"); assertEquals("Number of query executions for cq.execute should be 0 ", 0, numOfQueryExecutions); @@ -210,10 +200,8 @@ public void run2() throws CacheException { cqHelper.waitForCreated(client, cqName, KEY + numOfEntries * 2); - cqHelper.validateCQ(client, cqName, /* resultSize: */ cqHelper.noTest, - /* creates: */ numOfEntries, /* updates: */ 0, /* deletes; */ 0, - /* queryInserts: */ numOfEntries, /* queryUpdates: */ 0, /* queryDeletes: */ 0, - /* totalEvents: */ numOfEntries); + cqHelper.validateCQ(client, cqName, CqQueryDUnitTest.noTest, numOfEntries, 0, 0, + numOfEntries, 0, 0, numOfEntries); // Update values. createValues(server, regions[0], 5); @@ -223,19 +211,15 @@ public void run2() throws CacheException { // validate Update events. - cqHelper.validateCQ(client, cqName, /* resultSize: */ cqHelper.noTest, - /* creates: */ numOfEntries, /* updates: */ 15, /* deletes; */ 0, - /* queryInserts: */ numOfEntries, /* queryUpdates: */ 15, /* queryDeletes: */ 0, - /* totalEvents: */ numOfEntries + 15); + cqHelper.validateCQ(client, cqName, CqQueryDUnitTest.noTest, numOfEntries, 15, 0, + numOfEntries, 15, 0, numOfEntries + 15); // Validate delete events. cqHelper.deleteValues(server, regions[0], 5); cqHelper.waitForDestroyed(client, cqName, KEY + 5); - cqHelper.validateCQ(client, cqName, /* resultSize: */ cqHelper.noTest, - /* creates: */ numOfEntries, /* updates: */ 15, /* deletes; */5, - /* queryInserts: */ numOfEntries, /* queryUpdates: */ 15, /* queryDeletes: */ 5, - /* totalEvents: */ numOfEntries + 15 + 5); + cqHelper.validateCQ(client, cqName, CqQueryDUnitTest.noTest, numOfEntries, 15, 5, + numOfEntries, 15, 5, numOfEntries + 15 + 5); cqHelper.closeClient(client); cqHelper.closeServer(server); diff --git a/geode-dunit/src/main/java/org/apache/geode/cache30/RegionTestCase.java b/geode-dunit/src/main/java/org/apache/geode/cache30/RegionTestCase.java index 2bbbde9a0eec..cf628f9f12b3 100644 --- a/geode-dunit/src/main/java/org/apache/geode/cache30/RegionTestCase.java +++ b/geode-dunit/src/main/java/org/apache/geode/cache30/RegionTestCase.java @@ -1035,16 +1035,14 @@ public void testInvalidateEntry() throws CacheException { Region region = createRegion(name); region.put(key, value); - int beforeInvalidates = ((org.apache.geode.internal.cache.GemFireCacheImpl) getCache()) - .getCachePerfStats().getInvalidates(); + long beforeInvalidates = getCache().getCachePerfStats().getInvalidates(); Region.Entry entry = region.getEntry(key); region.invalidate(key); if (entry.isLocal()) { assertNull(entry.getValue()); } assertNull(region.get(key)); - int afterInvalidates = ((org.apache.geode.internal.cache.GemFireCacheImpl) getCache()) - .getCachePerfStats().getInvalidates(); + long afterInvalidates = getCache().getCachePerfStats().getInvalidates(); assertEquals("Invalidate CachePerfStats incorrect", beforeInvalidates + 1, afterInvalidates); } diff --git a/geode-dunit/src/main/java/org/apache/geode/internal/cache/tier/sockets/ClientServerMiscDUnitTestBase.java b/geode-dunit/src/main/java/org/apache/geode/internal/cache/tier/sockets/ClientServerMiscDUnitTestBase.java index c3deb6dee416..0dbd44f520f6 100755 --- a/geode-dunit/src/main/java/org/apache/geode/internal/cache/tier/sockets/ClientServerMiscDUnitTestBase.java +++ b/geode-dunit/src/main/java/org/apache/geode/internal/cache/tier/sockets/ClientServerMiscDUnitTestBase.java @@ -75,7 +75,6 @@ import org.apache.geode.internal.AvailablePort; import org.apache.geode.internal.OSProcess; import org.apache.geode.internal.cache.CacheServerImpl; -import org.apache.geode.internal.cache.GemFireCacheImpl; import org.apache.geode.internal.cache.LocalRegion; import org.apache.geode.internal.cache.ha.ThreadIdentifier; import org.apache.geode.internal.logging.LogService; @@ -412,12 +411,8 @@ public void run2() throws CacheException { // replace with null oldvalue matches invalidated entry pr.putIfAbsent("otherKeyForNull", null); - int puts = ((GemFireCacheImpl) pr.getCache()).getCachePerfStats().getPuts(); boolean success = pr.replace("otherKeyForNull", null, "no longer invalid"); assertTrue(success); - int newputs = ((GemFireCacheImpl) pr.getCache()).getCachePerfStats().getPuts(); - assertEquals("stats not updated properly or replace malfunctioned", newputs, puts + 1); - } }); }