From 245c280cd3c6e55dcba0741656e010ac737fc235 Mon Sep 17 00:00:00 2001 From: Mark Hanson Date: Mon, 19 Apr 2021 13:34:56 -0700 Subject: [PATCH 1/8] first cut --- .../geode/ClusterCommunicationsDUnitTest.java | 2 +- .../DistributedMulticastRegionDUnitTest.java | 12 +- ...lticastRegionWithUDPSecurityDUnitTest.java | 2 +- .../geode/cache30/QueueMsgDUnitTest.java | 2 +- .../geode/cache30/SlowRecDUnitTest.java | 4 +- .../internal/cache/GIIDeltaDUnitTest.java | 4 +- .../PartitionedRegionStatsTest.java | 1 + .../java/org/apache/geode/TXJUnitTest.java | 48 +- .../PartitionedRegionStatsJUnitTest.java | 26 + .../internal/AbstractHealthEvaluator.java | 4 +- .../admin/internal/MemberHealthEvaluator.java | 16 +- .../internal/ClusterOperationExecutors.java | 26 +- .../geode/distributed/internal/DMStats.java | 94 +-- .../internal/DistributionStats.java | 538 +++++++++--------- .../internal/LonerDistributionManager.java | 307 +++++----- .../distributed/internal/QueueStatHelper.java | 2 +- .../internal/locks/DLockStats.java | 304 +++++----- .../internal/locks/DistributedLockStats.java | 100 ++-- .../internal/locks/DummyDLockStats.java | 102 ++-- .../geode/internal/cache/CachePerfStats.java | 451 +++++++-------- .../internal/cache/DummyCachePerfStats.java | 152 ++--- .../cache/PartitionedRegionStats.java | 98 ++-- .../geode/internal/cache/RegionPerfStats.java | 156 ++--- .../geode/internal/cache/RegionStats.java | 44 +- .../cache/control/ResourceManagerStats.java | 246 ++++---- .../internal/statistics/StatisticsImpl.java | 18 +- .../geode/internal/tcp/ConnectionTable.java | 2 +- .../internal/beans/MemberMBeanBridge.java | 2 +- .../internal/DistributionStatsTest.java | 4 +- .../internal/cache/CachePerfStatsTest.java | 210 +++---- .../internal/net/NioPlainEngineTest.java | 2 +- .../membership/api/MembershipStatistics.java | 8 +- .../gms/DefaultMembershipStatistics.java | 8 +- 33 files changed, 1523 insertions(+), 1472 deletions(-) diff --git a/geode-core/src/distributedTest/java/org/apache/geode/ClusterCommunicationsDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/ClusterCommunicationsDUnitTest.java index fc72cd228c7d..c474093c24f9 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/ClusterCommunicationsDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/ClusterCommunicationsDUnitTest.java @@ -326,7 +326,7 @@ private void performUpdate(VM memberVM) { memberVM.invoke("perform update", () -> { DMStats stats = ((InternalDistributedSystem) cache.getDistributedSystem()) .getDistributionManager().getStats(); - int reconnectAttempts = stats.getReconnectAttempts(); + long reconnectAttempts = stats.getReconnectAttempts(); cache.getRegion(regionName).put("testKey", "updatedTestValue"); assertThat(stats.getReconnectAttempts()).isEqualTo(reconnectAttempts); }); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache30/DistributedMulticastRegionDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache30/DistributedMulticastRegionDUnitTest.java index 3b8143978230..ef848aecb419 100755 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache30/DistributedMulticastRegionDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache30/DistributedMulticastRegionDUnitTest.java @@ -296,8 +296,8 @@ public Properties getDistributedSystemProperties() { protected void addDSProps(Properties p) {} protected void validateMulticastOpsAfterRegionOps() { - int writes = getGemfireCache().getDistributionManager().getStats().getMcastWrites(); - int reads = getGemfireCache().getDistributionManager().getStats().getMcastReads(); + long writes = getGemfireCache().getDistributionManager().getStats().getMcastWrites(); + long reads = getGemfireCache().getDistributionManager().getStats().getMcastReads(); assertTrue("Should have multicast writes or reads. Writes= " + writes + " ,read= " + reads, writes > 0 || reads > 0); @@ -306,7 +306,7 @@ protected void validateMulticastOpsAfterRegionOps() { protected void validateUDPEncryptionStats() { long encrptTime = - getGemfireCache().getDistributionManager().getStats().getUDPMsgEncryptionTiime(); + getGemfireCache().getDistributionManager().getStats().getUDPMsgEncryptionTime(); long decryptTime = getGemfireCache().getDistributionManager().getStats().getUDPMsgDecryptionTime(); assertTrue("Should have multicast writes or reads. encrptTime= " + encrptTime @@ -314,9 +314,9 @@ protected void validateUDPEncryptionStats() { } private void validateMulticastOpsBeforeRegionOps() { - int writes = getGemfireCache().getDistributionManager().getStats().getMcastWrites(); - int reads = getGemfireCache().getDistributionManager().getStats().getMcastReads(); - int total = writes + reads; + long writes = getGemfireCache().getDistributionManager().getStats().getMcastWrites(); + long reads = getGemfireCache().getDistributionManager().getStats().getMcastReads(); + long total = writes + reads; assertTrue("Should not have any multicast writes or reads before region ops. Writes= " + writes + " ,read= " + reads, total == 0); } diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache30/DistributedMulticastRegionWithUDPSecurityDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache30/DistributedMulticastRegionWithUDPSecurityDUnitTest.java index 6f0df4bd572d..32432f382f87 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache30/DistributedMulticastRegionWithUDPSecurityDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache30/DistributedMulticastRegionWithUDPSecurityDUnitTest.java @@ -29,7 +29,7 @@ protected void addDSProps(Properties p) { @Override protected void validateUDPEncryptionStats() { long encrptTime = - getGemfireCache().getDistributionManager().getStats().getUDPMsgEncryptionTiime(); + getGemfireCache().getDistributionManager().getStats().getUDPMsgEncryptionTime(); long decryptTime = getGemfireCache().getDistributionManager().getStats().getUDPMsgDecryptionTime(); assertTrue("Should have multicast writes or reads. encrptTime= " + encrptTime diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache30/QueueMsgDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache30/QueueMsgDUnitTest.java index a98832d485d8..b06ae1446fee 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache30/QueueMsgDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache30/QueueMsgDUnitTest.java @@ -74,7 +74,7 @@ public void testQueueWhenRoleMissing() throws Exception { factory.setScope(DISTRIBUTED_ACK); DistributedRegion r = (DistributedRegion) createRootRegion(factory.create()); final CachePerfStats stats = r.getCachePerfStats(); - int queuedOps = stats.getReliableQueuedOps(); + long queuedOps = stats.getReliableQueuedOps(); r.create("createKey", "createValue", "createCBArg"); r.invalidate("createKey", "invalidateCBArg"); r.put("createKey", "putValue", "putCBArg"); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache30/SlowRecDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache30/SlowRecDUnitTest.java index e07b28d20678..32add073f9fb 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache30/SlowRecDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache30/SlowRecDUnitTest.java @@ -604,7 +604,7 @@ public void run2() throws CacheException { // updates to a non-conflating are not. LogWriterUtils.getLogWriter().info("[testConflationSequence] conflate & no-conflate regions"); forceQueuing(r); - final int initialAsyncSocketWrites = stats.getAsyncSocketWrites(); + final long initialAsyncSocketWrites = stats.getAsyncSocketWrites(); value = "count=" + count; lastValue = value; @@ -1228,7 +1228,7 @@ private void doTestDisconnectCleanup() throws Exception { // set others before vm0 connects final Set others = dm.getOtherDistributionManagerIds(); long initialQueuedMsgs = stats.getAsyncQueuedMsgs(); - final int initialQueues = stats.getAsyncQueues(); + final long initialQueues = stats.getAsyncQueues(); // create receiver in vm0 with queuing enabled final Properties p = new Properties(); 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 1f3fcc1e6649..3c8a3d09abde 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 @@ -2376,11 +2376,11 @@ public void run() { CachePerfStats stats = lr.getRegionPerfStats(); // we saved GII completed count in RegionPerfStats only - int size = stats.getGetInitialImageKeysReceived(); + long size = stats.getGetInitialImageKeysReceived(); 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/distributedTest/java/org/apache/geode/management/PartitionedRegionStatsTest.java b/geode-core/src/distributedTest/java/org/apache/geode/management/PartitionedRegionStatsTest.java index 578cd783a3b3..b394f4678728 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/management/PartitionedRegionStatsTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/management/PartitionedRegionStatsTest.java @@ -73,4 +73,5 @@ public void testGetsRate() throws Exception { assertThat(cacheStats.getMisses()).isEqualTo(1); } + } 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 d2e3377c92ab..d766df69ba15 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/TXJUnitTest.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/TXJUnitTest.java @@ -249,9 +249,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()); @@ -301,9 +301,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"); @@ -434,7 +434,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<>(); @@ -2741,7 +2741,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(); @@ -2773,7 +2773,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(); @@ -4629,17 +4629,17 @@ 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; + private final CachePerfStats stats; private statsValidator(CachePerfStats stats) { this.stats = stats; @@ -4672,15 +4672,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; } @@ -4696,15 +4696,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; } @@ -5780,7 +5780,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"); @@ -5839,7 +5839,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/internal/cache/PartitionedRegionStatsJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/PartitionedRegionStatsJUnitTest.java index d0d59b8da94f..a3f6bab69ea7 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/PartitionedRegionStatsJUnitTest.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/PartitionedRegionStatsJUnitTest.java @@ -19,6 +19,9 @@ */ package org.apache.geode.internal.cache; +import static org.apache.geode.internal.cache.PartitionedRegionStats.regionClearLocalDurationId; +import static org.apache.geode.internal.cache.PartitionedRegionStats.regionClearTotalDurationId; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -477,4 +480,27 @@ private long getMemBytes(PartitionedRegion pr) { return bytes; } + + @Test + public void incPartitionedRegionClearLocalDurationIncrementsPartitionedRegionClearLocalDuration() { + String regionname = "testStats"; + int localMaxMemory = 100; + PartitionedRegion pr = createPR(regionname + 1, localMaxMemory, 0); + PartitionedRegionStats partitionedRegionStats = pr.getPrStats(); + partitionedRegionStats.incPartitionedRegionClearLocalDuration(100L); + assertThat(partitionedRegionStats.getStats().getLong(regionClearLocalDurationId)) + .isEqualTo(100L); + } + + @Test + public void incPartitionedRegionClearTotalDurationIncrementsPartitionedRegionClearTotalDuration() { + String regionname = "testStats"; + int localMaxMemory = 100; + PartitionedRegion pr = createPR(regionname + 1, localMaxMemory, 0); + PartitionedRegionStats partitionedRegionStats = pr.getPrStats(); + partitionedRegionStats.incPartitionedRegionClearTotalDuration(100L); + + assertThat(partitionedRegionStats.getStats().getLong(regionClearTotalDurationId)) + .isEqualTo(100L); + } } diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/AbstractHealthEvaluator.java b/geode-core/src/main/java/org/apache/geode/admin/internal/AbstractHealthEvaluator.java index f1654936e66e..8326228e46e7 100644 --- a/geode-core/src/main/java/org/apache/geode/admin/internal/AbstractHealthEvaluator.java +++ b/geode-core/src/main/java/org/apache/geode/admin/internal/AbstractHealthEvaluator.java @@ -68,7 +68,7 @@ protected AbstractHealthEvaluator(GemFireHealthConfig config, DistributionManage * @param status A list of {@link AbstractHealthEvaluator.HealthStatus HealthStatus} objects that * is populated when ill health is detected. */ - public void evaluate(List status) { + public void evaluate(List status) { this.numEvaluations++; check(status); } @@ -78,7 +78,7 @@ public void evaluate(List status) { * * @see #evaluate */ - protected abstract void check(List status); + protected abstract void check(List status); /** * Returns whether or not this is the first evaluation diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/MemberHealthEvaluator.java b/geode-core/src/main/java/org/apache/geode/admin/internal/MemberHealthEvaluator.java index 2f457d917da2..1cce4913ab59 100644 --- a/geode-core/src/main/java/org/apache/geode/admin/internal/MemberHealthEvaluator.java +++ b/geode-core/src/main/java/org/apache/geode/admin/internal/MemberHealthEvaluator.java @@ -90,7 +90,7 @@ protected String getDescription() { * than the {@linkplain MemberHealthConfig#getMaxVMProcessSize threshold}. If not, the status is * "okay" health. */ - void checkVMProcessSize(List status) { + void checkVMProcessSize(List status) { // There is no need to check isFirstEvaluation() if (this.processStats == null) { return; @@ -112,7 +112,7 @@ void checkVMProcessSize(List status) { * {@linkplain MemberHealthConfig#getMaxMessageQueueSize threshold}. If not, the status is "okay" * health. */ - private void checkMessageQueueSize(List status) { + private void checkMessageQueueSize(List status) { long threshold = this.config.getMaxMessageQueueSize(); long overflowSize = this.dmStats.getOverflowQueueSize(); if (overflowSize > threshold) { @@ -128,7 +128,7 @@ private void checkMessageQueueSize(List status) { * does not exceed the {@linkplain MemberHealthConfig#getMaxReplyTimeouts threshold}. If not, the * status is "okay" health. */ - private void checkReplyTimeouts(List status) { + private void checkReplyTimeouts(List status) { if (isFirstEvaluation()) { return; } @@ -147,7 +147,7 @@ private void checkReplyTimeouts(List status) { * The function keeps updating the health of the cache based on roles required by the regions and * their reliability policies. */ - private void checkCacheRequiredRolesMeet(List status) { + private void checkCacheRequiredRolesMeet(List status) { // will have to call here okayHealth() or poorHealth() try { @@ -156,21 +156,21 @@ private void checkCacheRequiredRolesMeet(List status) { if (cPStats.getReliableRegionsMissingFullAccess() > 0) { // health is okay. - int numRegions = cPStats.getReliableRegionsMissingFullAccess(); + long numRegions = cPStats.getReliableRegionsMissingFullAccess(); status.add(okayHealth( String.format( "There are %s regions missing required roles; however, they are configured for full access.", numRegions))); } else if (cPStats.getReliableRegionsMissingLimitedAccess() > 0) { // health is poor - int numRegions = cPStats.getReliableRegionsMissingLimitedAccess(); + long numRegions = cPStats.getReliableRegionsMissingLimitedAccess(); status.add(poorHealth( String.format( "There are %s regions missing required roles and configured with limited access.", numRegions))); } else if (cPStats.getReliableRegionsMissingNoAccess() > 0) { // health is poor - int numRegions = cPStats.getReliableRegionsMissingNoAccess(); + long numRegions = cPStats.getReliableRegionsMissingNoAccess(); status.add(poorHealth( String.format( "There are %s regions missing required roles and configured without access.", @@ -188,7 +188,7 @@ private void updatePrevious() { } @Override - protected void check(List status) { + protected void check(List status) { checkVMProcessSize(status); checkMessageQueueSize(status); checkReplyTimeouts(status); diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/ClusterOperationExecutors.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/ClusterOperationExecutors.java index e041f77eaeca..50025d6cc7d5 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/ClusterOperationExecutors.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/ClusterOperationExecutors.java @@ -111,22 +111,20 @@ public class ClusterOperationExecutors implements OperationExecutors { * * @see ViewAckMessage */ - public static final int VIEW_EXECUTOR = 79; + private final InternalDistributedSystem system; - private InternalDistributedSystem system; - - private DistributionStats stats; + private final DistributionStats stats; /** Message processing thread pool */ - private ExecutorService threadPool; + private final ExecutorService threadPool; /** * High Priority processing thread pool, used for initializing messages such as UpdateAttributes * and CreateRegion messages */ - private ExecutorService highPriorityPool; + private final ExecutorService highPriorityPool; /** * Waiting Pool, used for messages that may have to wait on something. Use this separate pool with @@ -134,9 +132,9 @@ public class ClusterOperationExecutors implements OperationExecutors { * Used for threads that will most likely have to wait for a region to be finished initializing * before it can proceed */ - private ExecutorService waitingPool; + private final ExecutorService waitingPool; - private ExecutorService prMetaDataCleanupThreadPool; + private final ExecutorService prMetaDataCleanupThreadPool; /** * Thread used to decouple {@link org.apache.geode.internal.cache.partitioned.PartitionMessage}s @@ -152,7 +150,7 @@ public class ClusterOperationExecutors implements OperationExecutors { private ExecutorService functionExecutionPool; /** Message processing executor for serial, ordered, messages. */ - private ExecutorService serialThread; + private final ExecutorService serialThread; /** * If using a throttling queue for the serialThread, we cache the queue here so we can see if @@ -165,7 +163,7 @@ public class ClusterOperationExecutors implements OperationExecutors { * * @see org.apache.geode.internal.monitoring.ThreadsMonitoring */ - private ThreadsMonitoring threadMonitor; + private final ThreadsMonitoring threadMonitor; private SerialQueuedExecutorPool serialQueuedExecutorPool; @@ -302,7 +300,7 @@ public Executor getExecutor(int processorType, InternalDistributedMember sender) case WAITING_POOL_EXECUTOR: return getWaitingThreadPool(); case PARTITIONED_REGION_EXECUTOR: - return getPartitionedRegionExcecutor(); + return getPartitionedRegionExecutor(); case REGION_FUNCTION_EXECUTION_EXECUTOR: return getFunctionExecutor(); default: @@ -331,7 +329,7 @@ public ExecutorService getPrMetaDataCleanupThreadPool() { return prMetaDataCleanupThreadPool; } - private Executor getPartitionedRegionExcecutor() { + private Executor getPartitionedRegionExecutor() { if (partitionedRegionThread != null) { return partitionedRegionThread; } else { @@ -680,10 +678,10 @@ private static class SerialQueuedExecutorPool { } /* - * Returns an id of the thread in serialQueuedExecutorMap, thats mapped to the given seder. + * Returns an id of the thread in serialQueuedExecutorMap, that's mapped to the given seder. * * - * @param createNew boolean flag to indicate whether to create a new id, if id doesnot exists. + * @param createNew boolean flag to indicate whether to create a new id, if id does not exists. */ private Integer getQueueId(InternalDistributedMember sender, boolean createNew) { // Create a new Id. diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/DMStats.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/DMStats.java index 0f880b2ef079..6fabae1a1ba3 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/DMStats.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/DMStats.java @@ -143,17 +143,17 @@ public interface DMStats extends MembershipStatistics { */ void incMessageProcessingScheduleTime(long nanos); - int getOverflowQueueSize(); + long getOverflowQueueSize(); - void incOverflowQueueSize(int messages); + void incOverflowQueueSize(long messages); - int getNumProcessingThreads(); + long getNumProcessingThreads(); - void incNumProcessingThreads(int threads); + void incNumProcessingThreads(long threads); - int getNumSerialThreads(); + long getNumSerialThreads(); - void incNumSerialThreads(int threads); + void incNumSerialThreads(long threads); void incMessageChannelTime(long val); @@ -169,14 +169,14 @@ public interface DMStats extends MembershipStatistics { long startSocketWrite(boolean sync); - void endSocketWrite(boolean sync, long start, int bytesWritten, int retries); + void endSocketWrite(boolean sync, long start, long bytesWritten, long retries); /** * returns the current value of the mcastWrites statistic */ - int getMcastWrites(); + long getMcastWrites(); - int getMcastReads(); + long getMcastReads(); long startSerialization(); @@ -186,19 +186,19 @@ public interface DMStats extends MembershipStatistics { void endDeserialization(long start, int bytes); - long getUDPMsgEncryptionTiime(); + long getUDPMsgEncryptionTime(); long getUDPMsgDecryptionTime(); - int getNodes(); + long getNodes(); - void setNodes(int val); + void setNodes(long val); - void incNodes(int val); + void incNodes(long val); - int getReplyWaitsInProgress(); + long getReplyWaitsInProgress(); - int getReplyWaitsCompleted(); + long getReplyWaitsCompleted(); long getReplyWaitTime(); @@ -253,7 +253,7 @@ public interface DMStats extends MembershipStatistics { void incReconnectAttempts(); - int getReconnectAttempts(); + long getReconnectAttempts(); /** * @since GemFire 4.1 @@ -273,27 +273,27 @@ public interface DMStats extends MembershipStatistics { /** * @since GemFire 4.1 */ - int getSendersSU(); + long getSendersSU(); /** * returns the current number of multicast retransmission requests processed */ - int getMcastRetransmits(); + long getMcastRetransmits(); /** * @since GemFire 4.2.2 */ - int getAsyncSocketWritesInProgress(); + long getAsyncSocketWritesInProgress(); /** * @since GemFire 4.2.2 */ - int getAsyncSocketWrites(); + long getAsyncSocketWrites(); /** * @since GemFire 4.2.2 */ - int getAsyncSocketWriteRetries(); + long getAsyncSocketWriteRetries(); /** * @since GemFire 4.2.2 @@ -308,22 +308,22 @@ public interface DMStats extends MembershipStatistics { /** * @since GemFire 4.2.2 */ - int getAsyncQueues(); + long getAsyncQueues(); /** * @since GemFire 4.2.2 */ - void incAsyncQueues(int inc); + void incAsyncQueues(long inc); /** * @since GemFire 4.2.2 */ - int getAsyncQueueFlushesInProgress(); + long getAsyncQueueFlushesInProgress(); /** * @since GemFire 4.2.2 */ - int getAsyncQueueFlushesCompleted(); + long getAsyncQueueFlushesCompleted(); /** * @since GemFire 4.2.2 @@ -343,27 +343,27 @@ public interface DMStats extends MembershipStatistics { /** * @since GemFire 4.2.2 */ - int getAsyncQueueTimeouts(); + long getAsyncQueueTimeouts(); /** * @since GemFire 4.2.2 */ - void incAsyncQueueTimeouts(int inc); + void incAsyncQueueTimeouts(long inc); /** * @since GemFire 4.2.2 */ - int getAsyncQueueSizeExceeded(); + long getAsyncQueueSizeExceeded(); /** * @since GemFire 4.2.2 */ - void incAsyncQueueSizeExceeded(int inc); + void incAsyncQueueSizeExceeded(long inc); /** * @since GemFire 4.2.2 */ - int getAsyncDistributionTimeoutExceeded(); + long getAsyncDistributionTimeoutExceeded(); /** * @since GemFire 4.2.2 @@ -413,22 +413,22 @@ public interface DMStats extends MembershipStatistics { /** * @since GemFire 4.2.2 */ - int getAsyncThreads(); + long getAsyncThreads(); /** * @since GemFire 4.2.2 */ - void incAsyncThreads(int inc); + void incAsyncThreads(long inc); /** * @since GemFire 4.2.2 */ - int getAsyncThreadInProgress(); + long getAsyncThreadInProgress(); /** * @since GemFire 4.2.2 */ - int getAsyncThreadCompleted(); + long getAsyncThreadCompleted(); /** * @since GemFire 4.2.2 @@ -468,12 +468,12 @@ public interface DMStats extends MembershipStatistics { /** * @since GemFire 5.0.2.4 */ - void incReceiverBufferSize(int inc, boolean direct); + void incReceiverBufferSize(long inc, boolean direct); /** * @since GemFire 5.0.2.4 */ - void incSenderBufferSize(int inc, boolean direct); + void incSenderBufferSize(long inc, boolean direct); /** * @since GemFire 5.0.2.4 @@ -500,7 +500,7 @@ public interface DMStats extends MembershipStatistics { * * @param dominoCount thread-owned connection chain count */ - void incThreadOwnedReceivers(long value, int dominoCount); + void incThreadOwnedReceivers(long value, long dominoCount); /** * Called when a new message is received. @@ -510,7 +510,7 @@ public interface DMStats extends MembershipStatistics { * @param bytes the number of bytes read, so far, for the message being received. * @since GemFire 5.0.2 */ - void incMessagesBeingReceived(boolean newMsg, int bytes); + void incMessagesBeingReceived(boolean newMsg, long bytes); /** * Called when we finish processing a received message. @@ -518,7 +518,7 @@ public interface DMStats extends MembershipStatistics { * @param bytes the number of bytes read off the wire for the message we have finished with. * @since GemFire 5.0.2 */ - void decMessagesBeingReceived(int bytes); + void decMessagesBeingReceived(long bytes); void incReplyHandOffTime(long start); @@ -527,28 +527,28 @@ public interface DMStats extends MembershipStatistics { * * @return 1 if the system elder is this member, else returns 0 */ - int getElders(); + long getElders(); - void incElders(int val); + void incElders(long val); /** * Returns the number of initial image reply messages sent from this member which have not yet * been acked. */ - int getInitialImageMessagesInFlight(); + long getInitialImageMessagesInFlight(); - void incInitialImageMessagesInFlight(int val); + void incInitialImageMessagesInFlight(long val); /** * Returns the number of initial images this member is currently requesting. */ - int getInitialImageRequestsInProgress(); + long getInitialImageRequestsInProgress(); - void incInitialImageRequestsInProgress(int val); + void incInitialImageRequestsInProgress(long val); - void incPdxSerialization(int bytesWritten); + void incPdxSerialization(long bytesWritten); - void incPdxDeserialization(int i); + void incPdxDeserialization(long i); long startPdxInstanceDeserialization(); diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionStats.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionStats.java index b08a512e82e4..d48458f6da3c 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionStats.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionStats.java @@ -462,115 +462,116 @@ public class DistributionStats implements DMStats { false), f.createLongCounter("messageProcessingScheduleTime", messageProcessingScheduleTimeDesc, "nanoseconds", false), - f.createIntGauge("overflowQueueSize", overflowQueueSizeDesc, "messages"), - f.createIntGauge("waitingQueueSize", waitingQueueSizeDesc, "messages"), - f.createIntGauge("overflowQueueThrottleCount", overflowQueueThrottleCountDesc, "delays"), + f.createLongGauge("overflowQueueSize", overflowQueueSizeDesc, "messages"), + f.createLongGauge("waitingQueueSize", waitingQueueSizeDesc, "messages"), + f.createLongGauge("overflowQueueThrottleCount", overflowQueueThrottleCountDesc, "delays"), f.createLongCounter("overflowQueueThrottleTime", overflowQueueThrottleTimeDesc, "nanoseconds", false), - f.createIntGauge("highPriorityQueueSize", highPriorityQueueSizeDesc, "messages"), - f.createIntGauge("highPriorityQueueThrottleCount", highPriorityQueueThrottleCountDesc, + f.createLongGauge("highPriorityQueueSize", highPriorityQueueSizeDesc, "messages"), + f.createLongGauge("highPriorityQueueThrottleCount", highPriorityQueueThrottleCountDesc, "delays"), f.createLongCounter("highPriorityQueueThrottleTime", highPriorityQueueThrottleTimeDesc, "nanoseconds", false), - f.createIntGauge("partitionedRegionQueueSize", highPriorityQueueSizeDesc, "messages"), - f.createIntGauge("partitionedRegionQueueThrottleCount", highPriorityQueueThrottleCountDesc, + f.createLongGauge("partitionedRegionQueueSize", highPriorityQueueSizeDesc, "messages"), + f.createLongGauge("partitionedRegionQueueThrottleCount", highPriorityQueueThrottleCountDesc, "delays"), f.createLongCounter("partitionedRegionQueueThrottleTime", highPriorityQueueThrottleTimeDesc, "nanoseconds", false), - f.createIntGauge("functionExecutionQueueSize", highPriorityQueueSizeDesc, "messages"), - f.createIntGauge("functionExecutionQueueThrottleCount", highPriorityQueueThrottleCountDesc, + f.createLongGauge("functionExecutionQueueSize", highPriorityQueueSizeDesc, "messages"), + f.createLongGauge("functionExecutionQueueThrottleCount", highPriorityQueueThrottleCountDesc, "delays"), f.createLongCounter("functionExecutionQueueThrottleTime", highPriorityQueueThrottleTimeDesc, "nanoseconds", false), - f.createIntGauge("serialQueueSize", serialQueueSizeDesc, "messages"), - f.createIntGauge("serialQueueBytes", serialQueueBytesDesc, "bytes"), - f.createIntCounter("serialPooledThread", serialPooledThreadDesc, "threads"), - f.createIntGauge("serialQueueThrottleCount", serialQueueThrottleCountDesc, "delays"), + f.createLongGauge("serialQueueSize", serialQueueSizeDesc, "messages"), + f.createLongGauge("serialQueueBytes", serialQueueBytesDesc, "bytes"), + f.createLongCounter("serialPooledThread", serialPooledThreadDesc, "threads"), + f.createLongGauge("serialQueueThrottleCount", serialQueueThrottleCountDesc, "delays"), f.createLongCounter("serialQueueThrottleTime", serialQueueThrottleTimeDesc, "nanoseconds", false), - f.createIntGauge("serialThreads", serialThreadsDesc, "threads"), - f.createIntGauge("processingThreads", processingThreadsDesc, "threads"), - f.createIntGauge("highPriorityThreads", highPriorityThreadsDesc, "threads"), - f.createIntGauge("partitionedRegionThreads", partitionedRegionThreadsDesc, "threads"), - f.createIntGauge("functionExecutionThreads", functionExecutionThreadsDesc, "threads"), - f.createIntGauge("waitingThreads", waitingThreadsDesc, "threads"), + f.createLongGauge("serialThreads", serialThreadsDesc, "threads"), + f.createLongGauge("processingThreads", processingThreadsDesc, "threads"), + f.createLongGauge("highPriorityThreads", highPriorityThreadsDesc, "threads"), + f.createLongGauge("partitionedRegionThreads", partitionedRegionThreadsDesc, "threads"), + f.createLongGauge("functionExecutionThreads", functionExecutionThreadsDesc, "threads"), + f.createLongGauge("waitingThreads", waitingThreadsDesc, "threads"), f.createLongCounter("messageChannelTime", messageChannelTimeDesc, "nanoseconds", false), f.createLongCounter("udpDispatchRequestTime", udpDispatchRequestTimeDesc, "nanoseconds", false), f.createLongCounter("replyMessageTime", replyMessageTimeDesc, "nanoseconds", false), f.createLongCounter("distributeMessageTime", distributeMessageTimeDesc, "nanoseconds", false), - f.createIntGauge("nodes", nodesDesc, "nodes"), - f.createIntGauge("replyWaitsInProgress", replyWaitsInProgressDesc, "operations"), - f.createIntCounter("replyWaitsCompleted", replyWaitsCompletedDesc, "operations"), + f.createLongGauge("nodes", nodesDesc, "nodes"), + f.createLongGauge("replyWaitsInProgress", replyWaitsInProgressDesc, "operations"), + f.createLongCounter("replyWaitsCompleted", replyWaitsCompletedDesc, "operations"), f.createLongCounter("replyWaitTime", replyWaitTimeDesc, "nanoseconds", false), f.createLongGauge("replyWaitMaxTime", replyWaitMaxTimeDesc, "milliseconds", false), f.createLongCounter("replyTimeouts", replyTimeoutsDesc, "timeouts", false), - f.createIntGauge("receivers", receiverConnectionsDesc, "sockets"), - f.createIntGauge("sendersSO", sharedOrderedSenderConnectionsDesc, "sockets"), - f.createIntGauge("sendersSU", sharedUnorderedSenderConnectionsDesc, "sockets"), - f.createIntGauge("sendersTO", threadOrderedSenderConnectionsDesc, "sockets"), - f.createIntGauge("sendersTU", threadUnorderedSenderConnectionsDesc, "sockets"), - f.createIntCounter("failedAccepts", failedAcceptsDesc, "accepts"), - f.createIntCounter("failedConnects", failedConnectsDesc, "connects"), - f.createIntCounter("reconnectAttempts", reconnectAttemptsDesc, "connects"), - f.createIntCounter("senderTimeouts", lostConnectionLeaseDesc, "expirations"), - - f.createIntGauge("syncSocketWritesInProgress", + f.createLongGauge("receivers", receiverConnectionsDesc, "sockets"), + f.createLongGauge("sendersSO", sharedOrderedSenderConnectionsDesc, "sockets"), + f.createLongGauge("sendersSU", sharedUnorderedSenderConnectionsDesc, "sockets"), + f.createLongGauge("sendersTO", threadOrderedSenderConnectionsDesc, "sockets"), + f.createLongGauge("sendersTU", threadUnorderedSenderConnectionsDesc, "sockets"), + f.createLongCounter("failedAccepts", failedAcceptsDesc, "accepts"), + f.createLongCounter("failedConnects", failedConnectsDesc, "connects"), + f.createLongCounter("reconnectAttempts", reconnectAttemptsDesc, "connects"), + f.createLongCounter("senderTimeouts", lostConnectionLeaseDesc, "expirations"), + + f.createLongGauge("syncSocketWritesInProgress", "Current number of synchronous/blocking socket write calls in progress.", "writes"), f.createLongCounter("syncSocketWriteTime", "Total amount of time, in nanoseconds, spent in synchronous/blocking socket write calls.", "nanoseconds"), - f.createIntCounter("syncSocketWrites", + f.createLongCounter("syncSocketWrites", "Total number of completed synchronous/blocking socket write calls.", "writes"), f.createLongCounter("syncSocketWriteBytes", "Total number of bytes sent out in synchronous/blocking mode on sockets.", "bytes"), - f.createIntCounter("ucastReads", "Total number of unicast datagrams received", "datagrams"), + f.createLongCounter("ucastReads", "Total number of unicast datagrams received", + "datagrams"), f.createLongCounter("ucastReadBytes", "Total number of bytes received in unicast datagrams", "bytes"), - f.createIntCounter("ucastWrites", "Total number of unicast datagram socket write calls.", + f.createLongCounter("ucastWrites", "Total number of unicast datagram socket write calls.", "writes"), f.createLongCounter("ucastWriteBytes", "Total number of bytes sent out on unicast datagram sockets.", "bytes"), - f.createIntCounter("ucastRetransmits", + f.createLongCounter("ucastRetransmits", "Total number of unicast datagram socket retransmissions", "writes"), - f.createIntCounter("mcastReads", "Total number of multicast datagrams received", + f.createLongCounter("mcastReads", "Total number of multicast datagrams received", "datagrams"), f.createLongCounter("mcastReadBytes", "Total number of bytes received in multicast datagrams", "bytes"), - f.createIntCounter("mcastWrites", "Total number of multicast datagram socket write calls.", + f.createLongCounter("mcastWrites", "Total number of multicast datagram socket write calls.", "writes"), f.createLongCounter("mcastWriteBytes", "Total number of bytes sent out on multicast datagram sockets.", "bytes"), - f.createIntCounter("mcastRetransmits", + f.createLongCounter("mcastRetransmits", "Total number of multicast datagram socket retransmissions", "writes"), - f.createIntCounter("mcastRetransmitRequests", + f.createLongCounter("mcastRetransmitRequests", "Total number of multicast datagram socket retransmission requests sent to other processes", "requests"), f.createLongCounter("serializationTime", "Total amount of time, in nanoseconds, spent serializing objects. This includes pdx serializations.", "nanoseconds"), - f.createIntCounter("serializations", + f.createLongCounter("serializations", "Total number of object serialization calls. This includes pdx serializations.", "ops"), f.createLongCounter("serializedBytes", "Total number of bytes produced by object serialization. This includes pdx serializations.", "bytes"), - f.createIntCounter("pdxSerializations", "Total number of pdx serializations.", "ops"), + f.createLongCounter("pdxSerializations", "Total number of pdx serializations.", "ops"), f.createLongCounter("pdxSerializedBytes", "Total number of bytes produced by pdx serialization.", "bytes"), f.createLongCounter("deserializationTime", "Total amount of time, in nanoseconds, spent deserializing objects. This includes deserialization that results in a PdxInstance.", "nanoseconds"), - f.createIntCounter("deserializations", + f.createLongCounter("deserializations", "Total number of object deserialization calls. This includes deserialization that results in a PdxInstance.", "ops"), f.createLongCounter("deserializedBytes", "Total number of bytes read by object deserialization. This includes deserialization that results in a PdxInstance.", "bytes"), - f.createIntCounter("pdxDeserializations", "Total number of pdx deserializations.", "ops"), + f.createLongCounter("pdxDeserializations", "Total number of pdx deserializations.", "ops"), f.createLongCounter("pdxDeserializedBytes", "Total number of bytes read by pdx deserialization.", "bytes"), f.createLongCounter("msgSerializationTime", @@ -581,12 +582,12 @@ public class DistributionStats implements DMStats { "Total amount of time, in nanoseconds, spent encrypting udp messages.", "nanoseconds"), f.createLongCounter("udpMsgDecryptionTime", "Total amount of time, in nanoseconds, spent decrypting udp messages.", "nanoseconds"), - f.createIntCounter("pdxInstanceDeserializations", + f.createLongCounter("pdxInstanceDeserializations", "Total number of times getObject has been called on a PdxInstance.", "ops"), f.createLongCounter("pdxInstanceDeserializationTime", "Total amount of time, in nanoseconds, spent deserializing PdxInstances by calling getObject.", "nanoseconds"), - f.createIntCounter("pdxInstanceCreations", + f.createLongCounter("pdxInstanceCreations", "Total number of times a deserialization created a PdxInstance.", "ops"), f.createLongCounter("batchSendTime", @@ -600,11 +601,11 @@ public class DistributionStats implements DMStats { "Total amount of time, in nanoseconds, spent flushing batched messages to the network", "nanoseconds"), - f.createIntGauge("asyncSocketWritesInProgress", + f.createLongGauge("asyncSocketWritesInProgress", "Current number of non-blocking socket write calls in progress.", "writes"), - f.createIntCounter("asyncSocketWrites", + f.createLongCounter("asyncSocketWrites", "Total number of non-blocking socket write calls completed.", "writes"), - f.createIntCounter("asyncSocketWriteRetries", + f.createLongCounter("asyncSocketWriteRetries", "Total number of retries needed to write a single block of data using non-blocking socket write calls.", "writes"), f.createLongCounter("asyncSocketWriteTime", @@ -620,24 +621,25 @@ public class DistributionStats implements DMStats { "Total amount of time, in nanoseconds, spent in removing messages from async queue.", "nanoseconds"), - f.createIntGauge("asyncQueues", asyncQueuesDesc, "queues"), - f.createIntGauge("asyncQueueFlushesInProgress", asyncQueueFlushesInProgressDesc, + f.createLongGauge("asyncQueues", asyncQueuesDesc, "queues"), + f.createLongGauge("asyncQueueFlushesInProgress", asyncQueueFlushesInProgressDesc, "operations"), - f.createIntCounter("asyncQueueFlushesCompleted", asyncQueueFlushesCompletedDesc, + f.createLongCounter("asyncQueueFlushesCompleted", asyncQueueFlushesCompletedDesc, "operations"), f.createLongCounter("asyncQueueFlushTime", asyncQueueFlushTimeDesc, "nanoseconds", false), - f.createIntCounter("asyncQueueTimeoutExceeded", asyncQueueTimeoutExceededDesc, "timeouts"), - f.createIntCounter("asyncQueueSizeExceeded", asyncQueueSizeExceededDesc, "operations"), - f.createIntCounter("asyncDistributionTimeoutExceeded", asyncDistributionTimeoutExceededDesc, + f.createLongCounter("asyncQueueTimeoutExceeded", asyncQueueTimeoutExceededDesc, "timeouts"), + f.createLongCounter("asyncQueueSizeExceeded", asyncQueueSizeExceededDesc, "operations"), + f.createLongCounter("asyncDistributionTimeoutExceeded", + asyncDistributionTimeoutExceededDesc, "operations"), f.createLongGauge("asyncQueueSize", asyncQueueSizeDesc, "bytes"), f.createLongCounter("asyncQueuedMsgs", asyncQueuedMsgsDesc, "msgs"), f.createLongCounter("asyncDequeuedMsgs", asyncDequeuedMsgsDesc, "msgs"), f.createLongCounter("asyncConflatedMsgs", asyncConflatedMsgsDesc, "msgs"), - f.createIntGauge("asyncThreads", asyncThreadsDesc, "threads"), - f.createIntGauge("asyncThreadInProgress", asyncThreadInProgressDesc, "operations"), - f.createIntCounter("asyncThreadCompleted", asyncThreadCompletedDesc, "operations"), + f.createLongGauge("asyncThreads", asyncThreadsDesc, "threads"), + f.createLongGauge("asyncThreadInProgress", asyncThreadInProgressDesc, "operations"), + f.createLongCounter("asyncThreadCompleted", asyncThreadCompletedDesc, "operations"), f.createLongCounter("asyncThreadTime", asyncThreadTimeDesc, "nanoseconds", false), f.createLongGauge("receiversTO", @@ -651,20 +653,20 @@ public class DistributionStats implements DMStats { f.createLongGauge("receiverHeapBufferSize", receiverHeapBufferSizeDesc, "bytes"), f.createLongGauge("senderDirectBufferSize", senderDirectBufferSizeDesc, "bytes"), f.createLongGauge("senderHeapBufferSize", senderHeapBufferSizeDesc, "bytes"), - f.createIntGauge("socketLocksInProgress", + f.createLongGauge("socketLocksInProgress", "Current number of threads waiting to lock a socket", "threads", false), - f.createIntCounter("socketLocks", "Total number of times a socket has been locked.", + f.createLongCounter("socketLocks", "Total number of times a socket has been locked.", "locks"), f.createLongCounter("socketLockTime", "Total amount of time, in nanoseconds, spent locking a socket", "nanoseconds", false), - f.createIntGauge("bufferAcquiresInProgress", + f.createLongGauge("bufferAcquiresInProgress", "Current number of threads waiting to acquire a buffer", "threads", false), - f.createIntCounter("bufferAcquires", "Total number of times a buffer has been acquired.", + f.createLongCounter("bufferAcquires", "Total number of times a buffer has been acquired.", "operations"), f.createLongCounter("bufferAcquireTime", "Total amount of time, in nanoseconds, spent acquiring a socket", "nanoseconds", false), - f.createIntGauge("messagesBeingReceived", + f.createLongGauge("messagesBeingReceived", "Current number of message being received off the network or being processed after reception.", "messages"), f.createLongGauge("messageBytesBeingReceived", @@ -695,20 +697,20 @@ public class DistributionStats implements DMStats { "messages", false), f.createLongCounter("replyHandoffTime", replyHandoffTimeDesc, "nanoseconds"), - f.createIntGauge("partitionedRegionThreadJobs", partitionedRegionThreadJobsDesc, + f.createLongGauge("partitionedRegionThreadJobs", partitionedRegionThreadJobsDesc, "messages"), - f.createIntGauge("functionExecutionThreadJobs", functionExecutionThreadJobsDesc, + f.createLongGauge("functionExecutionThreadJobs", functionExecutionThreadJobsDesc, "messages"), - f.createIntGauge("serialThreadJobs", serialThreadJobsDesc, "messages"), - f.createIntGauge("serialPooledThreadJobs", serialPooledThreadJobsDesc, "messages"), - f.createIntGauge("processingThreadJobs", processingThreadJobsDesc, "messages"), - f.createIntGauge("highPriorityThreadJobs", highPriorityThreadJobsDesc, "messages"), - f.createIntGauge("waitingThreadJobs", waitingThreadJobsDesc, "messages"), - - f.createIntGauge("elders", eldersDesc, "elders"), - f.createIntGauge("initialImageMessagesInFlight", initialImageMessagesInFlightDesc, + f.createLongGauge("serialThreadJobs", serialThreadJobsDesc, "messages"), + f.createLongGauge("serialPooledThreadJobs", serialPooledThreadJobsDesc, "messages"), + f.createLongGauge("processingThreadJobs", processingThreadJobsDesc, "messages"), + f.createLongGauge("highPriorityThreadJobs", highPriorityThreadJobsDesc, "messages"), + f.createLongGauge("waitingThreadJobs", waitingThreadJobsDesc, "messages"), + + f.createLongGauge("elders", eldersDesc, "elders"), + f.createLongGauge("initialImageMessagesInFlight", initialImageMessagesInFlightDesc, "messages"), - f.createIntGauge("initialImageRequestsInProgress", initialImageRequestsInProgressDesc, + f.createLongGauge("initialImageRequestsInProgress", initialImageRequestsInProgressDesc, "requests"), // For GMSHealthMonitor @@ -931,7 +933,7 @@ public class DistributionStats implements DMStats { private final MaxLongGauge maxReplyWaitTime; private final MaxLongGauge maxSentMessagesTime; - private LongAdder serialQueueBytes = new LongAdder(); + private final LongAdder serialQueueBytes = new LongAdder(); //////////////////////// Constructors //////////////////////// @@ -1168,21 +1170,21 @@ public void incMessageProcessingScheduleTime(long elapsed) { } @Override - public int getOverflowQueueSize() { - return this.stats.getInt(overflowQueueSizeId); + public long getOverflowQueueSize() { + return this.stats.getLong(overflowQueueSizeId); } @Override - public void incOverflowQueueSize(int messages) { - this.stats.incInt(overflowQueueSizeId, messages); + public void incOverflowQueueSize(long messages) { + this.stats.incLong(overflowQueueSizeId, messages); } - protected void incWaitingQueueSize(int messages) { - this.stats.incInt(waitingQueueSizeId, messages); + protected void incWaitingQueueSize(long messages) { + this.stats.incLong(waitingQueueSizeId, messages); } - protected void incOverflowQueueThrottleCount(int delays) { - this.stats.incInt(overflowQueueThrottleCountId, delays); + protected void incOverflowQueueThrottleCount(long delays) { + this.stats.incLong(overflowQueueThrottleCountId, delays); } protected void incOverflowQueueThrottleTime(long nanos) { @@ -1191,12 +1193,12 @@ protected void incOverflowQueueThrottleTime(long nanos) { } } - protected void incHighPriorityQueueSize(int messages) { - this.stats.incInt(highPriorityQueueSizeId, messages); + protected void incHighPriorityQueueSize(long messages) { + this.stats.incLong(highPriorityQueueSizeId, messages); } - protected void incHighPriorityQueueThrottleCount(int delays) { - this.stats.incInt(highPriorityQueueThrottleCountId, delays); + protected void incHighPriorityQueueThrottleCount(long delays) { + this.stats.incLong(highPriorityQueueThrottleCountId, delays); } protected void incHighPriorityQueueThrottleTime(long nanos) { @@ -1205,12 +1207,12 @@ protected void incHighPriorityQueueThrottleTime(long nanos) { } } - protected void incPartitionedRegionQueueSize(int messages) { - this.stats.incInt(partitionedRegionQueueSizeId, messages); + protected void incPartitionedRegionQueueSize(long messages) { + this.stats.incLong(partitionedRegionQueueSizeId, messages); } - protected void incPartitionedRegionQueueThrottleCount(int delays) { - this.stats.incInt(partitionedRegionQueueThrottleCountId, delays); + protected void incPartitionedRegionQueueThrottleCount(long delays) { + this.stats.incLong(partitionedRegionQueueThrottleCountId, delays); } protected void incPartitionedRegionQueueThrottleTime(long nanos) { @@ -1219,12 +1221,12 @@ protected void incPartitionedRegionQueueThrottleTime(long nanos) { } } - protected void incFunctionExecutionQueueSize(int messages) { - this.stats.incInt(functionExecutionQueueSizeId, messages); + protected void incFunctionExecutionQueueSize(long messages) { + this.stats.incLong(functionExecutionQueueSizeId, messages); } - protected void incFunctionExecutionQueueThrottleCount(int delays) { - this.stats.incInt(functionExecutionQueueThrottleCountId, delays); + protected void incFunctionExecutionQueueThrottleCount(long delays) { + this.stats.incLong(functionExecutionQueueThrottleCountId, delays); } protected void incFunctionExecutionQueueThrottleTime(long nanos) { @@ -1233,13 +1235,13 @@ protected void incFunctionExecutionQueueThrottleTime(long nanos) { } } - protected void incSerialQueueSize(int messages) { - this.stats.incInt(serialQueueSizeId, messages); + protected void incSerialQueueSize(long messages) { + this.stats.incLong(serialQueueSizeId, messages); } - protected void incSerialQueueBytes(int amount) { + protected void incSerialQueueBytes(long amount) { serialQueueBytes.add(amount); - this.stats.incInt(serialQueueBytesId, amount); + this.stats.incLong(serialQueueBytesId, amount); } public long getInternalSerialQueueBytes() { @@ -1247,11 +1249,11 @@ public long getInternalSerialQueueBytes() { } protected void incSerialPooledThread() { - this.stats.incInt(serialPooledThreadId, 1); + this.stats.incLong(serialPooledThreadId, 1); } - protected void incSerialQueueThrottleCount(int delays) { - this.stats.incInt(serialQueueThrottleCountId, delays); + protected void incSerialQueueThrottleCount(long delays) { + this.stats.incLong(serialQueueThrottleCountId, delays); } protected void incSerialQueueThrottleTime(long nanos) { @@ -1261,39 +1263,39 @@ protected void incSerialQueueThrottleTime(long nanos) { } @Override - public int getNumProcessingThreads() { - return this.stats.getInt(processingThreadsId); + public long getNumProcessingThreads() { + return this.stats.getLong(processingThreadsId); } @Override - public void incNumProcessingThreads(int threads) { - this.stats.incInt(processingThreadsId, threads); + public void incNumProcessingThreads(long threads) { + this.stats.incLong(processingThreadsId, threads); } @Override - public int getNumSerialThreads() { - return this.stats.getInt(serialThreadsId); + public long getNumSerialThreads() { + return this.stats.getLong(serialThreadsId); } @Override - public void incNumSerialThreads(int threads) { - this.stats.incInt(serialThreadsId, threads); + public void incNumSerialThreads(long threads) { + this.stats.incLong(serialThreadsId, threads); } - protected void incWaitingThreads(int threads) { - this.stats.incInt(waitingThreadsId, threads); + protected void incWaitingThreads(long threads) { + this.stats.incLong(waitingThreadsId, threads); } - protected void incHighPriorityThreads(int threads) { - this.stats.incInt(highPriorityThreadsId, threads); + protected void incHighPriorityThreads(long threads) { + this.stats.incLong(highPriorityThreadsId, threads); } - protected void incPartitionedRegionThreads(int threads) { - this.stats.incInt(partitionedRegionThreadsId, threads); + protected void incPartitionedRegionThreads(long threads) { + this.stats.incLong(partitionedRegionThreadsId, threads); } - protected void incFunctionExecutionThreads(int threads) { - this.stats.incInt(functionExecutionThreadsId, threads); + protected void incFunctionExecutionThreads(long threads) { + this.stats.incLong(functionExecutionThreadsId, threads); } @Override @@ -1345,28 +1347,28 @@ public void incDistributeMessageTime(long val) { } @Override - public int getNodes() { - return this.stats.getInt(nodesId); + public long getNodes() { + return this.stats.getLong(nodesId); } @Override - public void setNodes(int val) { - this.stats.setInt(nodesId, val); + public void setNodes(long val) { + this.stats.setLong(nodesId, val); } @Override - public void incNodes(int val) { - this.stats.incInt(nodesId, val); + public void incNodes(long val) { + this.stats.incLong(nodesId, val); } @Override - public int getReplyWaitsInProgress() { - return stats.getInt(replyWaitsInProgressId); + public long getReplyWaitsInProgress() { + return stats.getLong(replyWaitsInProgressId); } @Override - public int getReplyWaitsCompleted() { - return stats.getInt(replyWaitsCompletedId); + public long getReplyWaitsCompleted() { + return stats.getLong(replyWaitsCompletedId); } @Override @@ -1377,28 +1379,28 @@ public long getReplyWaitTime() { @Override public long startSocketWrite(boolean sync) { if (sync) { - stats.incInt(syncSocketWritesInProgressId, 1); + stats.incLong(syncSocketWritesInProgressId, 1); } else { - stats.incInt(asyncSocketWritesInProgressId, 1); + stats.incLong(asyncSocketWritesInProgressId, 1); } return getTime(); } @Override - public void endSocketWrite(boolean sync, long start, int bytesWritten, int retries) { + public void endSocketWrite(boolean sync, long start, long bytesWritten, long retries) { final long now = getTime(); if (sync) { - stats.incInt(syncSocketWritesInProgressId, -1); - stats.incInt(syncSocketWritesId, 1); + stats.incLong(syncSocketWritesInProgressId, -1); + stats.incLong(syncSocketWritesId, 1); stats.incLong(syncSocketWriteBytesId, bytesWritten); if (enableClockStats) { stats.incLong(syncSocketWriteTimeId, now - start); } } else { - stats.incInt(asyncSocketWritesInProgressId, -1); - stats.incInt(asyncSocketWritesId, 1); + stats.incLong(asyncSocketWritesInProgressId, -1); + stats.incLong(asyncSocketWritesId, 1); if (retries != 0) { - stats.incInt(asyncSocketWriteRetriesId, retries); + stats.incLong(asyncSocketWriteRetriesId, retries); } stats.incLong(asyncSocketWriteBytesId, bytesWritten); if (enableClockStats) { @@ -1409,52 +1411,52 @@ public void endSocketWrite(boolean sync, long start, int bytesWritten, int retri @Override public long startSocketLock() { - stats.incInt(socketLocksInProgressId, 1); + stats.incLong(socketLocksInProgressId, 1); return getTime(); } @Override public void endSocketLock(long start) { long ts = getTime(); - stats.incInt(socketLocksInProgressId, -1); - stats.incInt(socketLocksId, 1); + stats.incLong(socketLocksInProgressId, -1); + stats.incLong(socketLocksId, 1); stats.incLong(socketLockTimeId, ts - start); } @Override public long startBufferAcquire() { - stats.incInt(bufferAcquiresInProgressId, 1); + stats.incLong(bufferAcquiresInProgressId, 1); return getTime(); } @Override public void endBufferAcquire(long start) { long ts = getTime(); - stats.incInt(bufferAcquiresInProgressId, -1); - stats.incInt(bufferAcquiresId, 1); + stats.incLong(bufferAcquiresInProgressId, -1); + stats.incLong(bufferAcquiresId, 1); stats.incLong(bufferAcquireTimeId, ts - start); } @Override - public void incUcastWriteBytes(int bytesWritten) { - stats.incInt(ucastWritesId, 1); + public void incUcastWriteBytes(long bytesWritten) { + stats.incLong(ucastWritesId, 1); stats.incLong(ucastWriteBytesId, bytesWritten); } @Override - public void incMcastWriteBytes(int bytesWritten) { - stats.incInt(mcastWritesId, 1); + public void incMcastWriteBytes(long bytesWritten) { + stats.incLong(mcastWritesId, 1); stats.incLong(mcastWriteBytesId, bytesWritten); } @Override - public int getMcastWrites() { - return stats.getInt(mcastWritesId); + public long getMcastWrites() { + return stats.getLong(mcastWritesId); } @Override - public int getMcastReads() { - return stats.getInt(mcastReadsId); + public long getMcastReads() { + return stats.getLong(mcastReadsId); } @Override @@ -1463,19 +1465,19 @@ public long getUDPMsgDecryptionTime() { } @Override - public long getUDPMsgEncryptionTiime() { + public long getUDPMsgEncryptionTime() { return stats.getLong(udpMsgEncryptionTimeId); } @Override - public void incMcastReadBytes(int amount) { - stats.incInt(mcastReadsId, 1); + public void incMcastReadBytes(long amount) { + stats.incLong(mcastReadsId, 1); stats.incLong(mcastReadBytesId, amount); } @Override - public void incUcastReadBytes(int amount) { - stats.incInt(ucastReadsId, 1); + public void incUcastReadBytes(long amount) { + stats.incLong(ucastReadsId, 1); stats.incLong(ucastReadBytesId, amount); } @@ -1489,7 +1491,7 @@ public void endSerialization(long start, int bytes) { if (enableClockStats) { stats.incLong(serializationTimeId, getTime() - start); } - stats.incInt(serializationsId, 1); + stats.incLong(serializationsId, 1); stats.incLong(serializedBytesId, bytes); } @@ -1503,24 +1505,24 @@ public void endPdxInstanceDeserialization(long start) { if (enableClockStats) { stats.incLong(pdxInstanceDeserializationTimeId, getTime() - start); } - stats.incInt(pdxInstanceDeserializationsId, 1); + stats.incLong(pdxInstanceDeserializationsId, 1); } @Override - public void incPdxSerialization(int bytes) { - stats.incInt(pdxSerializationsId, 1); + public void incPdxSerialization(long bytes) { + stats.incLong(pdxSerializationsId, 1); stats.incLong(pdxSerializedBytesId, bytes); } @Override - public void incPdxDeserialization(int bytes) { - stats.incInt(pdxDeserializationsId, 1); + public void incPdxDeserialization(long bytes) { + stats.incLong(pdxDeserializationsId, 1); stats.incLong(pdxDeserializedBytesId, bytes); } @Override public void incPdxInstanceCreations() { - stats.incInt(pdxInstanceCreationsId, 1); + stats.incLong(pdxInstanceCreationsId, 1); } @Override @@ -1533,7 +1535,7 @@ public void endDeserialization(long start, int bytes) { if (enableClockStats) { stats.incLong(deserializationTimeId, getTime() - start); } - stats.incInt(deserializationsId, 1); + stats.incLong(deserializationsId, 1); stats.incLong(deserializedBytesId, bytes); } @@ -1590,7 +1592,7 @@ public void endUDPMsgDecryption(long start) { */ @Override public long startReplyWait() { - stats.incInt(replyWaitsInProgressId, 1); + stats.incLong(replyWaitsInProgressId, 1); return getTime(); } @@ -1605,8 +1607,8 @@ public void endReplyWait(long startNanos, long initTime) { long waitTime = System.currentTimeMillis() - initTime; maxReplyWaitTime.recordMax(waitTime); } - stats.incInt(replyWaitsInProgressId, -1); - stats.incInt(replyWaitsCompletedId, 1); + stats.incLong(replyWaitsInProgressId, -1); + stats.incLong(replyWaitsCompletedId, 1); Breadcrumbs.setSendSide(null); // clear any recipient breadcrumbs set by the message Breadcrumbs.setProblem(null); // clear out reply-wait errors @@ -1624,91 +1626,91 @@ public long getReplyTimeouts() { @Override public void incReceivers() { - stats.incInt(receiverConnectionsId, 1); + stats.incLong(receiverConnectionsId, 1); } @Override public void decReceivers() { - stats.incInt(receiverConnectionsId, -1); + stats.incLong(receiverConnectionsId, -1); } @Override public void incFailedAccept() { - stats.incInt(failedAcceptsId, 1); + stats.incLong(failedAcceptsId, 1); } @Override public void incFailedConnect() { - stats.incInt(failedConnectsId, 1); + stats.incLong(failedConnectsId, 1); } @Override public void incReconnectAttempts() { - stats.incInt(reconnectAttemptsId, 1); + stats.incLong(reconnectAttemptsId, 1); } @Override - public int getReconnectAttempts() { - return stats.getInt(reconnectAttemptsId); + public long getReconnectAttempts() { + return stats.getLong(reconnectAttemptsId); } @Override public void incLostLease() { - stats.incInt(lostConnectionLeaseId, 1); + stats.incLong(lostConnectionLeaseId, 1); } @Override public void incSenders(boolean shared, boolean preserveOrder) { if (shared) { if (preserveOrder) { - stats.incInt(sharedOrderedSenderConnectionsId, 1); + stats.incLong(sharedOrderedSenderConnectionsId, 1); } else { - stats.incInt(sharedUnorderedSenderConnectionsId, 1); + stats.incLong(sharedUnorderedSenderConnectionsId, 1); } } else { if (preserveOrder) { - stats.incInt(threadOrderedSenderConnectionsId, 1); + stats.incLong(threadOrderedSenderConnectionsId, 1); } else { - stats.incInt(threadUnorderedSenderConnectionsId, 1); + stats.incLong(threadUnorderedSenderConnectionsId, 1); } } } @Override - public int getSendersSU() { - return stats.getInt(sharedUnorderedSenderConnectionsId); + public long getSendersSU() { + return stats.getLong(sharedUnorderedSenderConnectionsId); } @Override public void decSenders(boolean shared, boolean preserveOrder) { if (shared) { if (preserveOrder) { - stats.incInt(sharedOrderedSenderConnectionsId, -1); + stats.incLong(sharedOrderedSenderConnectionsId, -1); } else { - stats.incInt(sharedUnorderedSenderConnectionsId, -1); + stats.incLong(sharedUnorderedSenderConnectionsId, -1); } } else { if (preserveOrder) { - stats.incInt(threadOrderedSenderConnectionsId, -1); + stats.incLong(threadOrderedSenderConnectionsId, -1); } else { - stats.incInt(threadUnorderedSenderConnectionsId, -1); + stats.incLong(threadUnorderedSenderConnectionsId, -1); } } } @Override - public int getAsyncSocketWritesInProgress() { - return stats.getInt(asyncSocketWritesInProgressId); + public long getAsyncSocketWritesInProgress() { + return stats.getLong(asyncSocketWritesInProgressId); } @Override - public int getAsyncSocketWrites() { - return stats.getInt(asyncSocketWritesId); + public long getAsyncSocketWrites() { + return stats.getLong(asyncSocketWritesId); } @Override - public int getAsyncSocketWriteRetries() { - return stats.getInt(asyncSocketWriteRetriesId); + public long getAsyncSocketWriteRetries() { + return stats.getLong(asyncSocketWriteRetriesId); } @Override @@ -1746,23 +1748,23 @@ public void incAsyncQueueRemoveTime(long inc) { } @Override - public int getAsyncQueues() { - return stats.getInt(asyncQueuesId); + public long getAsyncQueues() { + return stats.getLong(asyncQueuesId); } @Override - public void incAsyncQueues(int inc) { - stats.incInt(asyncQueuesId, inc); + public void incAsyncQueues(long inc) { + stats.incLong(asyncQueuesId, inc); } @Override - public int getAsyncQueueFlushesInProgress() { - return stats.getInt(asyncQueueFlushesInProgressId); + public long getAsyncQueueFlushesInProgress() { + return stats.getLong(asyncQueueFlushesInProgressId); } @Override - public int getAsyncQueueFlushesCompleted() { - return stats.getInt(asyncQueueFlushesCompletedId); + public long getAsyncQueueFlushesCompleted() { + return stats.getLong(asyncQueueFlushesCompletedId); } @Override @@ -1772,47 +1774,47 @@ public long getAsyncQueueFlushTime() { @Override public long startAsyncQueueFlush() { - stats.incInt(asyncQueueFlushesInProgressId, 1); + stats.incLong(asyncQueueFlushesInProgressId, 1); return getTime(); } @Override public void endAsyncQueueFlush(long start) { - stats.incInt(asyncQueueFlushesInProgressId, -1); - stats.incInt(asyncQueueFlushesCompletedId, 1); + stats.incLong(asyncQueueFlushesInProgressId, -1); + stats.incLong(asyncQueueFlushesCompletedId, 1); if (enableClockStats) { stats.incLong(asyncQueueFlushTimeId, getTime() - start); } } @Override - public int getAsyncQueueTimeouts() { - return stats.getInt(asyncQueueTimeoutExceededId); + public long getAsyncQueueTimeouts() { + return stats.getLong(asyncQueueTimeoutExceededId); } @Override - public void incAsyncQueueTimeouts(int inc) { - stats.incInt(asyncQueueTimeoutExceededId, inc); + public void incAsyncQueueTimeouts(long inc) { + stats.incLong(asyncQueueTimeoutExceededId, inc); } @Override - public int getAsyncQueueSizeExceeded() { - return stats.getInt(asyncQueueSizeExceededId); + public long getAsyncQueueSizeExceeded() { + return stats.getLong(asyncQueueSizeExceededId); } @Override - public void incAsyncQueueSizeExceeded(int inc) { - stats.incInt(asyncQueueSizeExceededId, inc); + public void incAsyncQueueSizeExceeded(long inc) { + stats.incLong(asyncQueueSizeExceededId, inc); } @Override - public int getAsyncDistributionTimeoutExceeded() { - return stats.getInt(asyncDistributionTimeoutExceededId); + public long getAsyncDistributionTimeoutExceeded() { + return stats.getLong(asyncDistributionTimeoutExceededId); } @Override public void incAsyncDistributionTimeoutExceeded() { - stats.incInt(asyncDistributionTimeoutExceededId, 1); + stats.incLong(asyncDistributionTimeoutExceededId, 1); } @Override @@ -1856,23 +1858,23 @@ public void incAsyncConflatedMsgs() { } @Override - public int getAsyncThreads() { - return stats.getInt(asyncThreadsId); + public long getAsyncThreads() { + return stats.getLong(asyncThreadsId); } @Override - public void incAsyncThreads(int inc) { - stats.incInt(asyncThreadsId, inc); + public void incAsyncThreads(long inc) { + stats.incLong(asyncThreadsId, inc); } @Override - public int getAsyncThreadInProgress() { - return stats.getInt(asyncThreadInProgressId); + public long getAsyncThreadInProgress() { + return stats.getLong(asyncThreadInProgressId); } @Override - public int getAsyncThreadCompleted() { - return stats.getInt(asyncThreadCompletedId); + public long getAsyncThreadCompleted() { + return stats.getLong(asyncThreadCompletedId); } @Override @@ -1882,14 +1884,14 @@ public long getAsyncThreadTime() { @Override public long startAsyncThread() { - stats.incInt(asyncThreadInProgressId, 1); + stats.incLong(asyncThreadInProgressId, 1); return getTime(); } @Override public void endAsyncThread(long start) { - stats.incInt(asyncThreadInProgressId, -1); - stats.incInt(asyncThreadCompletedId, 1); + stats.incLong(asyncThreadInProgressId, -1); + stats.incLong(asyncThreadCompletedId, 1); if (enableClockStats) { stats.incLong(asyncThreadTimeId, getTime() - start); } @@ -1924,7 +1926,7 @@ public void remove() { } @Override - public void remove(int count) { + public void remove(long count) { incOverflowQueueSize(-count); } }; @@ -1949,7 +1951,7 @@ public void remove() { } @Override - public void remove(int count) { + public void remove(long count) { incWaitingQueueSize(-count); } }; @@ -1984,7 +1986,7 @@ public void remove() { } @Override - public void remove(int count) { + public void remove(long count) { incHighPriorityQueueSize(-count); } }; @@ -2019,7 +2021,7 @@ public void remove() { } @Override - public void remove(int count) { + public void remove(long count) { incPartitionedRegionQueueSize(-count); } }; @@ -2074,7 +2076,7 @@ public void remove() { } @Override - public void remove(int count) { + public void remove(long count) { incFunctionExecutionQueueSize(-count); } }; @@ -2129,7 +2131,7 @@ public void remove() { } @Override - public void remove(int count) { + public void remove(long count) { incSerialQueueSize(-count); } @@ -2235,26 +2237,26 @@ public void incBatchFlushTime(long start) { @Override public void incUcastRetransmits() { - stats.incInt(ucastRetransmitsId, 1); + stats.incLong(ucastRetransmitsId, 1); } @Override public void incMcastRetransmits() { - stats.incInt(mcastRetransmitsId, 1); + stats.incLong(mcastRetransmitsId, 1); } @Override public void incMcastRetransmitRequests() { - stats.incInt(mcastRetransmitRequestsId, 1); + stats.incLong(mcastRetransmitRequestsId, 1); } @Override - public int getMcastRetransmits() { - return stats.getInt(mcastRetransmitsId); + public long getMcastRetransmits() { + return stats.getLong(mcastRetransmitsId); } @Override - public void incThreadOwnedReceivers(long value, int dominoCount) { + public void incThreadOwnedReceivers(long value, long dominoCount) { if (dominoCount < 2) { stats.incLong(threadOwnedReceiversId, value); } else { @@ -2266,7 +2268,7 @@ public void incThreadOwnedReceivers(long value, int dominoCount) { * @since GemFire 5.0.2.4 */ @Override - public void incReceiverBufferSize(int inc, boolean direct) { + public void incReceiverBufferSize(long inc, boolean direct) { if (direct) { stats.incLong(receiverDirectBufferSizeId, inc); } else { @@ -2278,7 +2280,7 @@ public void incReceiverBufferSize(int inc, boolean direct) { * @since GemFire 5.0.2.4 */ @Override - public void incSenderBufferSize(int inc, boolean direct) { + public void incSenderBufferSize(long inc, boolean direct) { if (direct) { stats.incLong(senderDirectBufferSizeId, inc); } else { @@ -2287,16 +2289,16 @@ public void incSenderBufferSize(int inc, boolean direct) { } @Override - public void incMessagesBeingReceived(boolean newMsg, int bytes) { + public void incMessagesBeingReceived(boolean newMsg, long bytes) { if (newMsg) { - stats.incInt(messagesBeingReceivedId, 1); + stats.incLong(messagesBeingReceivedId, 1L); } stats.incLong(messageBytesBeingReceivedId, bytes); } @Override - public void decMessagesBeingReceived(int bytes) { - stats.incInt(messagesBeingReceivedId, -1); + public void decMessagesBeingReceived(long bytes) { + stats.incLong(messagesBeingReceivedId, -1); stats.incLong(messageBytesBeingReceivedId, -bytes); } @@ -2337,12 +2339,12 @@ public void incReplyHandOffTime(long start) { } } - protected void incPartitionedRegionThreadJobs(int i) { - this.stats.incInt(partitionedRegionThreadJobsId, i); + protected void incPartitionedRegionThreadJobs(long i) { + this.stats.incLong(partitionedRegionThreadJobsId, i); } - protected void incFunctionExecutionThreadJobs(int i) { - this.stats.incInt(functionExecutionThreadJobsId, i); + protected void incFunctionExecutionThreadJobs(long i) { + this.stats.incLong(functionExecutionThreadJobsId, i); } public PoolStatHelper getSerialProcessorHelper() { @@ -2363,8 +2365,8 @@ public void endJob() { }; } - protected void incNumSerialThreadJobs(int jobs) { - this.stats.incInt(serialThreadJobsId, jobs); + protected void incNumSerialThreadJobs(long jobs) { + this.stats.incLong(serialThreadJobsId, jobs); } public PoolStatHelper getSerialPooledProcessorHelper() { @@ -2381,50 +2383,50 @@ public void endJob() { }; } - protected void incSerialPooledProcessorThreadJobs(int jobs) { - this.stats.incInt(serialPooledThreadJobsId, jobs); + protected void incSerialPooledProcessorThreadJobs(long jobs) { + this.stats.incLong(serialPooledThreadJobsId, jobs); } - protected void incNormalPoolThreadJobs(int jobs) { - this.stats.incInt(pooledMessageThreadJobsId, jobs); + protected void incNormalPoolThreadJobs(long jobs) { + this.stats.incLong(pooledMessageThreadJobsId, jobs); } - protected void incHighPriorityThreadJobs(int jobs) { - this.stats.incInt(highPriorityThreadJobsId, jobs); + protected void incHighPriorityThreadJobs(long jobs) { + this.stats.incLong(highPriorityThreadJobsId, jobs); } - protected void incWaitingPoolThreadJobs(int jobs) { - this.stats.incInt(waitingPoolThreadJobsId, jobs); + protected void incWaitingPoolThreadJobs(long jobs) { + this.stats.incLong(waitingPoolThreadJobsId, jobs); } @Override - public int getElders() { - return this.stats.getInt(eldersId); + public long getElders() { + return this.stats.getLong(eldersId); } @Override - public void incElders(int val) { - this.stats.incInt(eldersId, val); + public void incElders(long val) { + this.stats.incLong(eldersId, val); } @Override - public int getInitialImageMessagesInFlight() { - return this.stats.getInt(initialImageMessagesInFlightId); + public long getInitialImageMessagesInFlight() { + return this.stats.getLong(initialImageMessagesInFlightId); } @Override - public void incInitialImageMessagesInFlight(int val) { - this.stats.incInt(initialImageMessagesInFlightId, val); + public void incInitialImageMessagesInFlight(long val) { + this.stats.incLong(initialImageMessagesInFlightId, val); } @Override - public int getInitialImageRequestsInProgress() { - return this.stats.getInt(initialImageRequestsInProgressId); + public long getInitialImageRequestsInProgress() { + return this.stats.getLong(initialImageRequestsInProgressId); } @Override - public void incInitialImageRequestsInProgress(int val) { - this.stats.incInt(initialImageRequestsInProgressId, val); + public void incInitialImageRequestsInProgress(long val) { + this.stats.incLong(initialImageRequestsInProgressId, val); } public Statistics getStats() { diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/LonerDistributionManager.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/LonerDistributionManager.java index 08dab4125943..1da8fc14be33 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/LonerDistributionManager.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/LonerDistributionManager.java @@ -18,7 +18,6 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; -import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Objects; @@ -114,7 +113,7 @@ protected void shutdown() { private final Set allIds; private final List viewMembers; - private ConcurrentMap canonicalIds = + private final ConcurrentMap canonicalIds = new ConcurrentHashMap<>(); @Immutable private static final DummyDMStats stats = new DummyDMStats(); @@ -184,23 +183,13 @@ public Set getAllOtherMembers() { @Override // DM method public void retainMembersWithSameOrNewerVersion(Collection members, KnownVersion version) { - for (Iterator it = members.iterator(); it.hasNext();) { - InternalDistributedMember id = it.next(); - if (id.getVersion().compareTo(version) < 0) { - it.remove(); - } - } + members.removeIf(id -> id.getVersion().compareTo(version) < 0); } @Override // DM method public void removeMembersWithSameOrNewerVersion(Collection members, KnownVersion version) { - for (Iterator it = members.iterator(); it.hasNext();) { - InternalDistributedMember id = it.next(); - if (id.getVersion().compareTo(version) >= 0) { - it.remove(); - } - } + members.removeIf(id -> id.getVersion().compareTo(version) >= 0); } @@ -317,7 +306,7 @@ public Set getAdminMemberSet() { public static class DummyDMStats implements DMStats { @Override public long getSentMessages() { - return 0; + return 0L; } @Override @@ -328,7 +317,7 @@ public void incTOSentMsg() {} @Override public long getSentCommitMessages() { - return 0; + return 0L; } @Override @@ -336,7 +325,7 @@ public void incSentCommitMessages(long messages) {} @Override public long getCommitWaits() { - return 0; + return 0L; } @Override @@ -344,7 +333,7 @@ public void incCommitWaits() {} @Override public long getSentMessagesTime() { - return 0; + return 0L; } @Override @@ -352,7 +341,7 @@ public void incSentMessagesTime(long nanos) {} @Override public long getBroadcastMessages() { - return 0; + return 0L; } @Override @@ -360,7 +349,7 @@ public void incBroadcastMessages(long messages) {} @Override public long getBroadcastMessagesTime() { - return 0; + return 0L; } @Override @@ -368,7 +357,7 @@ public void incBroadcastMessagesTime(long nanos) {} @Override public long getReceivedMessages() { - return 0; + return 0L; } @Override @@ -376,7 +365,7 @@ public void incReceivedMessages(long messages) {} @Override public long getReceivedBytes() { - return 0; + return 0L; } @Override @@ -387,7 +376,7 @@ public void incSentBytes(long bytes) {} @Override public long startUDPDispatchRequest() { - return 0; + return 0L; } @Override @@ -397,7 +386,7 @@ public void endUDPDispatchRequest(long start) { @Override public long getProcessedMessages() { - return 0; + return 0L; } @Override @@ -405,7 +394,7 @@ public void incProcessedMessages(long messages) {} @Override public long getProcessedMessagesTime() { - return 0; + return 0L; } @Override @@ -413,47 +402,47 @@ public void incProcessedMessagesTime(long nanos) {} @Override public long getMessageProcessingScheduleTime() { - return 0; + return 0L; } @Override public void incMessageProcessingScheduleTime(long nanos) {} @Override - public int getOverflowQueueSize() { - return 0; + public long getOverflowQueueSize() { + return 0L; } @Override - public void incOverflowQueueSize(int messages) {} + public void incOverflowQueueSize(long messages) {} @Override - public int getNumProcessingThreads() { - return 0; + public long getNumProcessingThreads() { + return 0L; } @Override - public void incNumProcessingThreads(int threads) {} + public void incNumProcessingThreads(long threads) {} @Override - public int getNumSerialThreads() { - return 0; + public long getNumSerialThreads() { + return 0L; } @Override - public void incNumSerialThreads(int threads) {} + public void incNumSerialThreads(long threads) {} @Override public void incMessageChannelTime(long val) {} @Override public long getUDPDispatchRequestTime() { - return 0; - }; + return 0L; + } @Override public long getReplyMessageTime() { - return 0; + return 0L; } @Override @@ -461,41 +450,41 @@ public void incReplyMessageTime(long val) {} @Override public long getDistributeMessageTime() { - return 0; + return 0L; } @Override public void incDistributeMessageTime(long val) {} @Override - public int getNodes() { - return 0; + public long getNodes() { + return 0L; } @Override - public void setNodes(int val) {} + public void setNodes(long val) {} @Override - public void incNodes(int val) {} + public void incNodes(long val) {} @Override - public int getReplyWaitsInProgress() { - return 0; + public long getReplyWaitsInProgress() { + return 0L; } @Override - public int getReplyWaitsCompleted() { - return 0; + public long getReplyWaitsCompleted() { + return 0L; } @Override public long getReplyWaitTime() { - return 0; + return 0L; } @Override public long startReplyWait() { - return 0; + return 0L; } @Override @@ -506,7 +495,7 @@ public void incReplyTimeouts() {} @Override public long getReplyTimeouts() { - return 0; + return 0L; } @Override @@ -525,8 +514,8 @@ public void incFailedConnect() {} public void incReconnectAttempts() {} @Override - public int getReconnectAttempts() { - return 0; + public long getReconnectAttempts() { + return 0L; } @Override @@ -539,21 +528,21 @@ public void incSenders(boolean shared, boolean preserveOrder) {} public void decSenders(boolean shared, boolean preserveOrder) {} @Override - public int getSendersSU() { - return 0; + public long getSendersSU() { + return 0L; } @Override public long startSocketWrite(boolean sync) { - return 0; + return 0L; } @Override - public void endSocketWrite(boolean sync, long start, int bytesWritten, int retries) {} + public void endSocketWrite(boolean sync, long start, long bytesWritten, long retries) {} @Override public long startSerialization() { - return 0; + return 0L; } @Override @@ -561,7 +550,7 @@ public void endSerialization(long start, int bytes) {} @Override public long startDeserialization() { - return 0; + return 0L; } @Override @@ -569,7 +558,7 @@ public void endDeserialization(long start, int bytes) {} @Override public long startMsgSerialization() { - return 0; + return 0L; } @Override @@ -577,7 +566,7 @@ public void endMsgSerialization(long start) {} @Override public long startMsgDeserialization() { - return 0; + return 0L; } @Override @@ -596,10 +585,10 @@ public void incBatchWaitTime(long start) {} public void incBatchFlushTime(long start) {} @Override - public void incUcastWriteBytes(int bytesWritten) {} + public void incUcastWriteBytes(long bytesWritten) {} @Override - public void incMcastWriteBytes(int bytesWritten) {} + public void incMcastWriteBytes(long bytesWritten) {} @Override public void incUcastRetransmits() {} @@ -611,101 +600,101 @@ public void incMcastRetransmits() {} public void incMcastRetransmitRequests() {} @Override - public int getMcastRetransmits() { - return 0; + public long getMcastRetransmits() { + return 0L; } @Override - public int getMcastWrites() { - return 0; + public long getMcastWrites() { + return 0L; } @Override - public int getMcastReads() { - return 0; + public long getMcastReads() { + return 0L; } @Override - public void incUcastReadBytes(int amount) {} + public void incUcastReadBytes(long amount) {} @Override - public void incMcastReadBytes(int amount) {} + public void incMcastReadBytes(long amount) {} @Override - public int getAsyncSocketWritesInProgress() { - return 0; + public long getAsyncSocketWritesInProgress() { + return 0L; } @Override - public int getAsyncSocketWrites() { - return 0; + public long getAsyncSocketWrites() { + return 0L; } @Override - public int getAsyncSocketWriteRetries() { - return 0; + public long getAsyncSocketWriteRetries() { + return 0L; } @Override public long getAsyncSocketWriteBytes() { - return 0; + return 0L; } @Override public long getAsyncSocketWriteTime() { - return 0; + return 0L; } @Override - public int getAsyncQueues() { - return 0; + public long getAsyncQueues() { + return 0L; } @Override - public void incAsyncQueues(int inc) {} + public void incAsyncQueues(long inc) {} @Override - public int getAsyncQueueFlushesInProgress() { - return 0; + public long getAsyncQueueFlushesInProgress() { + return 0L; } @Override - public int getAsyncQueueFlushesCompleted() { - return 0; + public long getAsyncQueueFlushesCompleted() { + return 0L; } @Override public long getAsyncQueueFlushTime() { - return 0; + return 0L; } @Override public long startAsyncQueueFlush() { - return 0; + return 0L; } @Override public void endAsyncQueueFlush(long start) {} @Override - public int getAsyncQueueTimeouts() { - return 0; + public long getAsyncQueueTimeouts() { + return 0L; } @Override - public void incAsyncQueueTimeouts(int inc) {} + public void incAsyncQueueTimeouts(long inc) {} @Override - public int getAsyncQueueSizeExceeded() { - return 0; + public long getAsyncQueueSizeExceeded() { + return 0L; } @Override - public void incAsyncQueueSizeExceeded(int inc) {} + public void incAsyncQueueSizeExceeded(long inc) {} @Override - public int getAsyncDistributionTimeoutExceeded() { - return 0; + public long getAsyncDistributionTimeoutExceeded() { + return 0L; } @Override @@ -713,7 +702,7 @@ public void incAsyncDistributionTimeoutExceeded() {} @Override public long getAsyncQueueSize() { - return 0; + return 0L; } @Override @@ -721,7 +710,7 @@ public void incAsyncQueueSize(long inc) {} @Override public long getAsyncQueuedMsgs() { - return 0; + return 0L; } @Override @@ -729,7 +718,7 @@ public void incAsyncQueuedMsgs() {} @Override public long getAsyncDequeuedMsgs() { - return 0; + return 0L; } @Override @@ -737,38 +726,38 @@ public void incAsyncDequeuedMsgs() {} @Override public long getAsyncConflatedMsgs() { - return 0; + return 0L; } @Override public void incAsyncConflatedMsgs() {} @Override - public int getAsyncThreads() { - return 0; + public long getAsyncThreads() { + return 0L; } @Override - public void incAsyncThreads(int inc) {} + public void incAsyncThreads(long inc) {} @Override - public int getAsyncThreadInProgress() { - return 0; + public long getAsyncThreadInProgress() { + return 0L; } @Override - public int getAsyncThreadCompleted() { - return 0; + public long getAsyncThreadCompleted() { + return 0L; } @Override public long getAsyncThreadTime() { - return 0; + return 0L; } @Override public long startAsyncThread() { - return 0; + return 0L; } @Override @@ -776,7 +765,7 @@ public void endAsyncThread(long start) {} @Override public long getAsyncQueueAddTime() { - return 0; + return 0L; } @Override @@ -784,21 +773,21 @@ public void incAsyncQueueAddTime(long inc) {} @Override public long getAsyncQueueRemoveTime() { - return 0; + return 0L; } @Override public void incAsyncQueueRemoveTime(long inc) {} @Override - public void incReceiverBufferSize(int inc, boolean direct) {} + public void incReceiverBufferSize(long inc, boolean direct) {} @Override - public void incSenderBufferSize(int inc, boolean direct) {} + public void incSenderBufferSize(long inc, boolean direct) {} @Override public long startSocketLock() { - return 0; + return 0L; } @Override @@ -806,54 +795,54 @@ public void endSocketLock(long start) {} @Override public long startBufferAcquire() { - return 0; + return 0L; } @Override public void endBufferAcquire(long start) {} @Override - public void incMessagesBeingReceived(boolean newMsg, int bytes) {} + public void incMessagesBeingReceived(boolean newMsg, long bytes) {} @Override - public void decMessagesBeingReceived(int bytes) {} + public void decMessagesBeingReceived(long bytes) {} @Override public void incReplyHandOffTime(long start) {} @Override - public int getElders() { - return 0; + public long getElders() { + return 0L; } @Override - public void incElders(int val) {} + public void incElders(long val) {} @Override - public int getInitialImageMessagesInFlight() { - return 0; + public long getInitialImageMessagesInFlight() { + return 0L; } @Override - public void incInitialImageMessagesInFlight(int val) {} + public void incInitialImageMessagesInFlight(long val) {} @Override - public int getInitialImageRequestsInProgress() { - return 0; + public long getInitialImageRequestsInProgress() { + return 0L; } @Override - public void incInitialImageRequestsInProgress(int val) {} + public void incInitialImageRequestsInProgress(long val) {} @Override - public void incPdxSerialization(int bytesWritten) {} + public void incPdxSerialization(long bytesWritten) {} @Override - public void incPdxDeserialization(int i) {} + public void incPdxDeserialization(long i) {} @Override public long startPdxInstanceDeserialization() { - return 0; + return 0L; } @Override @@ -863,11 +852,11 @@ public void endPdxInstanceDeserialization(long start) {} public void incPdxInstanceCreations() {} @Override - public void incThreadOwnedReceivers(long value, int dominoCount) {} + public void incThreadOwnedReceivers(long value, long dominoCount) {} @Override public long getHeartbeatRequestsSent() { - return 0; + return 0L; } @Override @@ -875,7 +864,7 @@ public void incHeartbeatRequestsSent() {} @Override public long getHeartbeatRequestsReceived() { - return 0; + return 0L; } @Override @@ -883,7 +872,7 @@ public void incHeartbeatRequestsReceived() {} @Override public long getHeartbeatsSent() { - return 0; + return 0L; } @Override @@ -891,7 +880,7 @@ public void incHeartbeatsSent() {} @Override public long getHeartbeatsReceived() { - return 0; + return 0L; } @Override @@ -899,7 +888,7 @@ public void incHeartbeatsReceived() {} @Override public long getSuspectsSent() { - return 0; + return 0L; } @Override @@ -907,7 +896,7 @@ public void incSuspectsSent() {} @Override public long getSuspectsReceived() { - return 0; + return 0L; } @Override @@ -915,7 +904,7 @@ public void incSuspectsReceived() {} @Override public long getFinalCheckRequestsSent() { - return 0; + return 0L; } @Override @@ -923,7 +912,7 @@ public void incFinalCheckRequestsSent() {} @Override public long getFinalCheckRequestsReceived() { - return 0; + return 0L; } @Override @@ -931,7 +920,7 @@ public void incFinalCheckRequestsReceived() {} @Override public long getFinalCheckResponsesSent() { - return 0; + return 0L; } @Override @@ -939,7 +928,7 @@ public void incFinalCheckResponsesSent() {} @Override public long getFinalCheckResponsesReceived() { - return 0; + return 0L; } @Override @@ -947,7 +936,7 @@ public void incFinalCheckResponsesReceived() {} @Override public long getTcpFinalCheckRequestsSent() { - return 0; + return 0L; } @Override @@ -955,7 +944,7 @@ public void incTcpFinalCheckRequestsSent() {} @Override public long getTcpFinalCheckRequestsReceived() { - return 0; + return 0L; } @Override @@ -963,7 +952,7 @@ public void incTcpFinalCheckRequestsReceived() {} @Override public long getTcpFinalCheckResponsesSent() { - return 0; + return 0L; } @Override @@ -971,7 +960,7 @@ public void incTcpFinalCheckResponsesSent() {} @Override public long getTcpFinalCheckResponsesReceived() { - return 0; + return 0L; } @Override @@ -979,7 +968,7 @@ public void incTcpFinalCheckResponsesReceived() {} @Override public long getUdpFinalCheckRequestsSent() { - return 0; + return 0L; } @Override @@ -987,7 +976,7 @@ public void incUdpFinalCheckRequestsSent() {} @Override public long getUdpFinalCheckResponsesReceived() { - return 0; + return 0L; } @Override @@ -995,7 +984,7 @@ public void incUdpFinalCheckResponsesReceived() {} @Override public long startUDPMsgEncryption() { - return 0; + return 0L; } @Override @@ -1003,20 +992,20 @@ public void endUDPMsgEncryption(long start) {} @Override public long startUDPMsgDecryption() { - return 0; + return 0L; } @Override public void endUDPMsgDecryption(long start) {} @Override - public long getUDPMsgEncryptionTiime() { - return 0; + public long getUDPMsgEncryptionTime() { + return 0L; } @Override public long getUDPMsgDecryptionTime() { - return 0; + return 0L; } } @@ -1045,16 +1034,16 @@ public Set getAllRoles() { private int lonerPort = 0; - // private static final int CHARS_32KB = 16384; + // private static final long CHARS_32KB = 16384; private InternalDistributedMember generateMemberId() { - InternalDistributedMember result = null; + InternalDistributedMember result; String host; try { // create string of the current millisecond clock time - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); // use low four bytes for backward compatibility long time = System.currentTimeMillis() & 0xffffffffL; - for (int i = 0; i < 4; i++) { + for (long i = 0; i < 4; i++) { String hex = Integer.toHexString((int) (time & 0xff)); if (hex.length() < 2) { sb.append('0'); @@ -1094,7 +1083,7 @@ private InternalDistributedMember generateMemberId() { public void updateLonerPort(int newPort) { this.logger.config( String.format("Updating membership port. Port changed from %s to %s. ID is now %s", - new Object[] {this.lonerPort, newPort, getId()})); + this.lonerPort, newPort, getId())); this.lonerPort = newPort; this.getId().setPort(this.lonerPort); } @@ -1240,12 +1229,12 @@ public void addHostedLocators(InternalDistributedMember member, Collection getHostedLocators(InternalDistributedMember member) { - return Collections.emptyList(); + return Collections.emptyList(); } @Override public Map> getAllHostedLocators() { - return Collections.>emptyMap(); + return Collections.emptyMap(); } @Override @@ -1254,12 +1243,12 @@ public Set getNormalDistributionManagerIds() { } public Set getLocatorDistributionManagerIds() { - return Collections.emptySet(); + return Collections.emptySet(); } @Override public Map> getAllHostedLocatorsWithSharedConfiguration() { - return Collections.>emptyMap(); + return Collections.emptyMap(); } @Override diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/QueueStatHelper.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/QueueStatHelper.java index a7dd04ac1b54..97a40fd11899 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/QueueStatHelper.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/QueueStatHelper.java @@ -37,5 +37,5 @@ public interface QueueStatHelper { /** * Called when count items are removed from the queue. */ - void remove(int count); + void remove(long count); } diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/locks/DLockStats.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/locks/DLockStats.java index 4138a286c998..5028d172c60f 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/locks/DLockStats.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/locks/DLockStats.java @@ -433,18 +433,18 @@ public void close() { // time for call to lock() to complete @Override - public int getLockWaitsInProgress() { - return stats.getInt(lockWaitsInProgressId); + public long getLockWaitsInProgress() { + return stats.getLong(lockWaitsInProgressId); } @Override - public int getLockWaitsCompleted() { - return stats.getInt(lockWaitsCompletedId); + public long getLockWaitsCompleted() { + return stats.getLong(lockWaitsCompletedId); } @Override - public int getLockWaitsFailed() { - return stats.getInt(lockWaitsFailedId); + public long getLockWaitsFailed() { + return stats.getLong(lockWaitsFailedId); } @Override @@ -459,21 +459,21 @@ public long getLockWaitFailedTime() { @Override public long startLockWait() { - stats.incInt(lockWaitsInProgressId, 1); + stats.incLong(lockWaitsInProgressId, 1); return getTime(); } @Override public void endLockWait(long start, boolean success) { long ts = getTime(); - stats.incInt(lockWaitsInProgressId, -1); + stats.incLong(lockWaitsInProgressId, -1); if (success) { - stats.incInt(lockWaitsCompletedId, 1); + stats.incLong(lockWaitsCompletedId, 1); if (DistributionStats.enableClockStats) { stats.incLong(lockWaitTimeId, ts - start); } } else { - stats.incInt(lockWaitsFailedId, 1); + stats.incLong(lockWaitsFailedId, 1); if (DistributionStats.enableClockStats) { stats.incLong(lockWaitFailedTimeId, ts - start); } @@ -482,125 +482,125 @@ public void endLockWait(long start, boolean success) { // incSerialQueueSize everytime getWaitingQueueHelper add/remove called @Override - public int getWaitingQueueSize() { - return this.stats.getInt(waitingQueueSizeId); + public long getWaitingQueueSize() { + return this.stats.getLong(waitingQueueSizeId); } @Override - public void incWaitingQueueSize(int messages) { // TODO: prolly no callers - this.stats.incInt(waitingQueueSizeId, messages); + public void incWaitingQueueSize(long messages) { // TODO: prolly no callers + this.stats.incLong(waitingQueueSizeId, messages); } // incSerialQueueSize everytime getSerialQueueHelper add/remove called @Override - public int getSerialQueueSize() { - return this.stats.getInt(serialQueueSizeId); + public long getSerialQueueSize() { + return this.stats.getLong(serialQueueSizeId); } @Override - public void incSerialQueueSize(int messages) { // TODO: prolly no callers - this.stats.incInt(serialQueueSizeId, messages); + public void incSerialQueueSize(long messages) { // TODO: prolly no callers + this.stats.incLong(serialQueueSizeId, messages); } // incNumSerialThreads everytime we execute with dlock getSerialExecutor() @Override - public int getNumSerialThreads() { - return this.stats.getInt(serialThreadsId); + public long getNumSerialThreads() { + return this.stats.getLong(serialThreadsId); } @Override - public void incNumSerialThreads(int threads) { // TODO: no callers! - this.stats.incInt(serialThreadsId, threads); + public void incNumSerialThreads(long threads) { // TODO: no callers! + this.stats.incLong(serialThreadsId, threads); } // incWaitingThreads for every invoke of getWaitingPoolHelper startJob/endJob @Override - public int getWaitingThreads() { - return this.stats.getInt(waitingThreadsId); + public long getWaitingThreads() { + return this.stats.getLong(waitingThreadsId); } @Override - public void incWaitingThreads(int threads) { // TODO: prolly no callers - this.stats.incInt(waitingThreadsId, threads); + public void incWaitingThreads(long threads) { // TODO: prolly no callers + this.stats.incLong(waitingThreadsId, threads); } // current number of lock services used by this system member @Override - public int getServices() { - return this.stats.getInt(servicesId); + public long getServices() { + return this.stats.getLong(servicesId); } @Override - public void incServices(int val) { - this.stats.incInt(servicesId, val); + public void incServices(long val) { + this.stats.incLong(servicesId, val); } // current number of lock grantors hosted by this system member @Override - public int getGrantors() { - return this.stats.getInt(grantorsId); + public long getGrantors() { + return this.stats.getLong(grantorsId); } @Override - public void incGrantors(int val) { - this.stats.incInt(grantorsId, val); + public void incGrantors(long val) { + this.stats.incLong(grantorsId, val); } // current number of lock tokens used by this system member @Override - public int getTokens() { - return this.stats.getInt(tokensId); + public long getTokens() { + return this.stats.getLong(tokensId); } @Override - public void incTokens(int val) { - this.stats.incInt(tokensId, val); + public void incTokens(long val) { + this.stats.incLong(tokensId, val); } // current number of grant tokens used by local grantors @Override - public int getGrantTokens() { - return this.stats.getInt(grantTokensId); + public long getGrantTokens() { + return this.stats.getLong(grantTokensId); } @Override - public void incGrantTokens(int val) { - this.stats.incInt(grantTokensId, val); + public void incGrantTokens(long val) { + this.stats.incLong(grantTokensId, val); } // current number of lock request queues used by this system member @Override - public int getRequestQueues() { - return this.stats.getInt(requestQueuesId); + public long getRequestQueues() { + return this.stats.getLong(requestQueuesId); } @Override - public void incRequestQueues(int val) { - this.stats.incInt(requestQueuesId, val); + public void incRequestQueues(long val) { + this.stats.incLong(requestQueuesId, val); } // time for granting of lock requests to complete @Override - public int getGrantWaitsInProgress() { - return stats.getInt(grantWaitsInProgressId); + public long getGrantWaitsInProgress() { + return stats.getLong(grantWaitsInProgressId); } @Override - public int getGrantWaitsCompleted() { - return stats.getInt(grantWaitsCompletedId); + public long getGrantWaitsCompleted() { + return stats.getLong(grantWaitsCompletedId); } @Override - public int getGrantWaitsFailed() { - return stats.getInt(grantWaitsFailedId); + public long getGrantWaitsFailed() { + return stats.getLong(grantWaitsFailedId); } - public int getGrantWaitsSuspended() { - return stats.getInt(grantWaitsSuspendedId); + public long getGrantWaitsSuspended() { + return stats.getLong(grantWaitsSuspendedId); } - public int getGrantWaitsDestroyed() { - return stats.getInt(grantWaitsDestroyedId); + public long getGrantWaitsDestroyed() { + return stats.getLong(grantWaitsDestroyedId); } @Override @@ -615,15 +615,15 @@ public long getGrantWaitFailedTime() { @Override public long startGrantWait() { - stats.incInt(grantWaitsInProgressId, 1); + stats.incLong(grantWaitsInProgressId, 1); return getTime(); } @Override public void endGrantWait(long start) { long ts = getTime(); - stats.incInt(grantWaitsInProgressId, -1); - stats.incInt(grantWaitsCompletedId, 1); + stats.incLong(grantWaitsInProgressId, -1); + stats.incLong(grantWaitsCompletedId, 1); if (DistributionStats.enableClockStats) { stats.incLong(grantWaitTimeId, ts - start); } @@ -632,8 +632,8 @@ public void endGrantWait(long start) { @Override public void endGrantWaitNotGrantor(long start) { long ts = getTime(); - stats.incInt(grantWaitsInProgressId, -1); - stats.incInt(grantWaitsNotGrantorId, 1); + stats.incLong(grantWaitsInProgressId, -1); + stats.incLong(grantWaitsNotGrantorId, 1); if (DistributionStats.enableClockStats) { stats.incLong(grantWaitNotGrantorTimeId, ts - start); } @@ -642,8 +642,8 @@ public void endGrantWaitNotGrantor(long start) { @Override public void endGrantWaitTimeout(long start) { long ts = getTime(); - stats.incInt(grantWaitsInProgressId, -1); - stats.incInt(grantWaitsTimeoutId, 1); + stats.incLong(grantWaitsInProgressId, -1); + stats.incLong(grantWaitsTimeoutId, 1); if (DistributionStats.enableClockStats) { stats.incLong(grantWaitTimeoutTimeId, ts - start); } @@ -652,8 +652,8 @@ public void endGrantWaitTimeout(long start) { @Override public void endGrantWaitNotHolder(long start) { long ts = getTime(); - stats.incInt(grantWaitsInProgressId, -1); - stats.incInt(grantWaitsNotHolderId, 1); + stats.incLong(grantWaitsInProgressId, -1); + stats.incLong(grantWaitsNotHolderId, 1); if (DistributionStats.enableClockStats) { stats.incLong(grantWaitNotHolderTimeId, ts - start); } @@ -662,8 +662,8 @@ public void endGrantWaitNotHolder(long start) { @Override public void endGrantWaitFailed(long start) { long ts = getTime(); - stats.incInt(grantWaitsInProgressId, -1); - stats.incInt(grantWaitsFailedId, 1); + stats.incLong(grantWaitsInProgressId, -1); + stats.incLong(grantWaitsFailedId, 1); if (DistributionStats.enableClockStats) { stats.incLong(grantWaitFailedTimeId, ts - start); } @@ -672,8 +672,8 @@ public void endGrantWaitFailed(long start) { @Override public void endGrantWaitSuspended(long start) { long ts = getTime(); - stats.incInt(grantWaitsInProgressId, -1); - stats.incInt(grantWaitsSuspendedId, 1); + stats.incLong(grantWaitsInProgressId, -1); + stats.incLong(grantWaitsSuspendedId, 1); if (DistributionStats.enableClockStats) { stats.incLong(grantWaitSuspendedTimeId, ts - start); } @@ -682,8 +682,8 @@ public void endGrantWaitSuspended(long start) { @Override public void endGrantWaitDestroyed(long start) { long ts = getTime(); - stats.incInt(grantWaitsInProgressId, -1); - stats.incInt(grantWaitsDestroyedId, 1); + stats.incLong(grantWaitsInProgressId, -1); + stats.incLong(grantWaitsDestroyedId, 1); if (DistributionStats.enableClockStats) { stats.incLong(grantWaitDestroyedTimeId, ts - start); } @@ -691,13 +691,13 @@ public void endGrantWaitDestroyed(long start) { // time for creating initial grantor for lock service @Override - public int getCreateGrantorsInProgress() { - return stats.getInt(createGrantorsInProgressId); + public long getCreateGrantorsInProgress() { + return stats.getLong(createGrantorsInProgressId); } @Override - public int getCreateGrantorsCompleted() { - return stats.getInt(createGrantorsCompletedId); + public long getCreateGrantorsCompleted() { + return stats.getLong(createGrantorsCompletedId); } @Override @@ -707,15 +707,15 @@ public long getCreateGrantorTime() { @Override public long startCreateGrantor() { // TODO: no callers! - stats.incInt(createGrantorsInProgressId, 1); + stats.incLong(createGrantorsInProgressId, 1); return getTime(); } @Override public void endCreateGrantor(long start) { long ts = getTime(); - stats.incInt(createGrantorsInProgressId, -1); - stats.incInt(createGrantorsCompletedId, 1); + stats.incLong(createGrantorsInProgressId, -1); + stats.incLong(createGrantorsCompletedId, 1); if (DistributionStats.enableClockStats) { stats.incLong(createGrantorTimeId, ts - start); } @@ -723,18 +723,18 @@ public void endCreateGrantor(long start) { // time for creating each lock service @Override - public int getServiceCreatesInProgress() { - return stats.getInt(serviceCreatesInProgressId); + public long getServiceCreatesInProgress() { + return stats.getLong(serviceCreatesInProgressId); } @Override - public int getServiceCreatesCompleted() { - return stats.getInt(serviceCreatesCompletedId); + public long getServiceCreatesCompleted() { + return stats.getLong(serviceCreatesCompletedId); } @Override public long startServiceCreate() { // TODO: no callers! - stats.incInt(serviceCreatesInProgressId, 1); + stats.incLong(serviceCreatesInProgressId, 1); return getTime(); } @@ -749,8 +749,8 @@ public void serviceCreateLatchReleased(long start) { @Override public void serviceInitLatchReleased(long start) { long ts = getTime(); - stats.incInt(serviceCreatesInProgressId, -1); - stats.incInt(serviceCreatesCompletedId, 1); + stats.incLong(serviceCreatesInProgressId, -1); + stats.incLong(serviceCreatesCompletedId, 1); if (DistributionStats.enableClockStats) { stats.incLong(serviceInitLatchTimeId, ts - start); } @@ -768,18 +768,18 @@ public long getServiceInitLatchTime() { // time spent waiting grantor latches @Override - public int getGrantorWaitsInProgress() { - return stats.getInt(grantorWaitsInProgressId); + public long getGrantorWaitsInProgress() { + return stats.getLong(grantorWaitsInProgressId); } @Override - public int getGrantorWaitsCompleted() { - return stats.getInt(grantorWaitsCompletedId); + public long getGrantorWaitsCompleted() { + return stats.getLong(grantorWaitsCompletedId); } @Override - public int getGrantorWaitsFailed() { - return stats.getInt(grantorWaitsFailedId); + public long getGrantorWaitsFailed() { + return stats.getLong(grantorWaitsFailedId); } @Override @@ -794,21 +794,21 @@ public long getGrantorWaitFailedTime() { @Override public long startGrantorWait() { - stats.incInt(grantorWaitsInProgressId, 1); + stats.incLong(grantorWaitsInProgressId, 1); return getTime(); } @Override public void endGrantorWait(long start, boolean success) { long ts = getTime(); - stats.incInt(grantorWaitsInProgressId, -1); + stats.incLong(grantorWaitsInProgressId, -1); if (success) { - stats.incInt(grantorWaitsCompletedId, 1); + stats.incLong(grantorWaitsCompletedId, 1); if (DistributionStats.enableClockStats) { stats.incLong(grantorWaitTimeId, ts - start); } } else { - stats.incInt(grantorWaitsFailedId, 1); + stats.incLong(grantorWaitsFailedId, 1); if (DistributionStats.enableClockStats) { stats.incLong(grantorWaitFailedTimeId, ts - start); } @@ -817,13 +817,13 @@ public void endGrantorWait(long start, boolean success) { // time spent by grantor threads @Override - public int getGrantorThreadsInProgress() { - return stats.getInt(grantorThreadsInProgressId); + public long getGrantorThreadsInProgress() { + return stats.getLong(grantorThreadsInProgressId); } @Override - public int getGrantorThreadsCompleted() { - return stats.getInt(grantorThreadsCompletedId); + public long getGrantorThreadsCompleted() { + return stats.getLong(grantorThreadsCompletedId); } @Override @@ -848,7 +848,7 @@ public long getGrantorThreadRemoveUnusedTokensTime() { @Override public long startGrantorThread() { - stats.incInt(grantorThreadsInProgressId, 1); + stats.incLong(grantorThreadsInProgressId, 1); return getTime(); } @@ -875,8 +875,8 @@ public void endGrantorThreadRemoveUnusedTokens(long timing) { @Override public void endGrantorThread(long start) { long ts = getTime(); - stats.incInt(grantorThreadsInProgressId, -1); - stats.incInt(grantorThreadsCompletedId, 1); + stats.incLong(grantorThreadsInProgressId, -1); + stats.incLong(grantorThreadsCompletedId, 1); if (DistributionStats.enableClockStats) { stats.incLong(grantorThreadTimeId, ts - start); } @@ -884,29 +884,29 @@ public void endGrantorThread(long start) { // current number of requests waiting in lock grantor queues @Override - public int getPendingRequests() { - return this.stats.getInt(pendingRequestsId); + public long getPendingRequests() { + return this.stats.getLong(pendingRequestsId); } @Override - public void incPendingRequests(int val) { - this.stats.incInt(pendingRequestsId, val); + public void incPendingRequests(long val) { + this.stats.incLong(pendingRequestsId, val); } // acquisition of destroyReadLock in DLockService @Override - public int getDestroyReadWaitsInProgress() { - return stats.getInt(destroyReadWaitsInProgressId); + public long getDestroyReadWaitsInProgress() { + return stats.getLong(destroyReadWaitsInProgressId); } @Override - public int getDestroyReadWaitsCompleted() { - return stats.getInt(destroyReadWaitsCompletedId); + public long getDestroyReadWaitsCompleted() { + return stats.getLong(destroyReadWaitsCompletedId); } @Override - public int getDestroyReadWaitsFailed() { - return stats.getInt(destroyReadWaitsFailedId); + public long getDestroyReadWaitsFailed() { + return stats.getLong(destroyReadWaitsFailedId); } @Override @@ -921,21 +921,21 @@ public long getDestroyReadWaitFailedTime() { @Override public long startDestroyReadWait() { // TODO: no callers! - stats.incInt(destroyReadWaitsInProgressId, 1); + stats.incLong(destroyReadWaitsInProgressId, 1); return getTime(); } @Override public void endDestroyReadWait(long start, boolean success) { long ts = getTime(); - stats.incInt(destroyReadWaitsInProgressId, -1); + stats.incLong(destroyReadWaitsInProgressId, -1); if (success) { - stats.incInt(destroyReadWaitsCompletedId, 1); + stats.incLong(destroyReadWaitsCompletedId, 1); if (DistributionStats.enableClockStats) { stats.incLong(destroyReadWaitTimeId, ts - start); } } else { - stats.incInt(destroyReadWaitsFailedId, 1); + stats.incLong(destroyReadWaitsFailedId, 1); if (DistributionStats.enableClockStats) { stats.incLong(destroyReadWaitFailedTimeId, ts - start); } @@ -944,18 +944,18 @@ public void endDestroyReadWait(long start, boolean success) { // acquisition of destroyWriteLock in DLockService @Override - public int getDestroyWriteWaitsInProgress() { - return stats.getInt(destroyWriteWaitsInProgressId); + public long getDestroyWriteWaitsInProgress() { + return stats.getLong(destroyWriteWaitsInProgressId); } @Override - public int getDestroyWriteWaitsCompleted() { - return stats.getInt(destroyWriteWaitsCompletedId); + public long getDestroyWriteWaitsCompleted() { + return stats.getLong(destroyWriteWaitsCompletedId); } @Override - public int getDestroyWriteWaitsFailed() { - return stats.getInt(destroyWriteWaitsFailedId); + public long getDestroyWriteWaitsFailed() { + return stats.getLong(destroyWriteWaitsFailedId); } @Override @@ -970,21 +970,21 @@ public long getDestroyWriteWaitFailedTime() { @Override public long startDestroyWriteWait() { // TODO: no callers! - stats.incInt(destroyWriteWaitsInProgressId, 1); + stats.incLong(destroyWriteWaitsInProgressId, 1); return getTime(); } @Override public void endDestroyWriteWait(long start, boolean success) { long ts = getTime(); - stats.incInt(destroyWriteWaitsInProgressId, -1); + stats.incLong(destroyWriteWaitsInProgressId, -1); if (success) { - stats.incInt(destroyWriteWaitsCompletedId, 1); + stats.incLong(destroyWriteWaitsCompletedId, 1); if (DistributionStats.enableClockStats) { stats.incLong(destroyWriteWaitTimeId, ts - start); } } else { - stats.incInt(destroyWriteWaitsFailedId, 1); + stats.incLong(destroyWriteWaitsFailedId, 1); if (DistributionStats.enableClockStats) { stats.incLong(destroyWriteWaitFailedTimeId, ts - start); } @@ -993,35 +993,35 @@ public void endDestroyWriteWait(long start, boolean success) { // current number of DLockService destroy read locks held by this process @Override - public int getDestroyReads() { - return this.stats.getInt(destroyReadsId); + public long getDestroyReads() { + return this.stats.getLong(destroyReadsId); } @Override - public void incDestroyReads(int val) { // TODO: no callers! - this.stats.incInt(destroyReadsId, val); + public void incDestroyReads(long val) { // TODO: no callers! + this.stats.incLong(destroyReadsId, val); } // current number of DLockService destroy write locks held by this process @Override - public int getDestroyWrites() { - return this.stats.getInt(destroyWritesId); + public long getDestroyWrites() { + return this.stats.getLong(destroyWritesId); } @Override - public void incDestroyWrites(int val) { // TODO: no callers! - this.stats.incInt(destroyWritesId, val); + public void incDestroyWrites(long val) { // TODO: no callers! + this.stats.incLong(destroyWritesId, val); } // time for call to unlock() to complete @Override - public int getLockReleasesInProgress() { - return stats.getInt(lockReleasesInProgressId); + public long getLockReleasesInProgress() { + return stats.getLong(lockReleasesInProgressId); } @Override - public int getLockReleasesCompleted() { - return stats.getInt(lockReleasesCompletedId); + public long getLockReleasesCompleted() { + return stats.getLong(lockReleasesCompletedId); } @Override @@ -1031,15 +1031,15 @@ public long getLockReleaseTime() { @Override public long startLockRelease() { - stats.incInt(lockReleasesInProgressId, 1); + stats.incLong(lockReleasesInProgressId, 1); return getTime(); } @Override public void endLockRelease(long start) { long ts = getTime(); - stats.incInt(lockReleasesInProgressId, -1); - stats.incInt(lockReleasesCompletedId, 1); + stats.incLong(lockReleasesInProgressId, -1); + stats.incLong(lockReleasesCompletedId, 1); if (DistributionStats.enableClockStats) { stats.incLong(lockReleaseTimeId, ts - start); } @@ -1047,33 +1047,33 @@ public void endLockRelease(long start) { // total number of times this member has requested to become grantor @Override - public int getBecomeGrantorRequests() { - return this.stats.getInt(becomeGrantorRequestsId); + public long getBecomeGrantorRequests() { + return this.stats.getLong(becomeGrantorRequestsId); } @Override public void incBecomeGrantorRequests() { - this.stats.incInt(becomeGrantorRequestsId, 1); + this.stats.incLong(becomeGrantorRequestsId, 1); } @Override - public int getFreeResourcesCompleted() { - return this.stats.getInt(freeResourcesCompletedId); + public long getFreeResourcesCompleted() { + return this.stats.getLong(freeResourcesCompletedId); } @Override public void incFreeResourcesCompleted() { - this.stats.incInt(freeResourcesCompletedId, 1); + this.stats.incLong(freeResourcesCompletedId, 1); } @Override - public int getFreeResourcesFailed() { - return this.stats.getInt(freeResourcesFailedId); + public long getFreeResourcesFailed() { + return this.stats.getLong(freeResourcesFailedId); } @Override public void incFreeResourcesFailed() { - this.stats.incInt(freeResourcesFailedId, 1); + this.stats.incLong(freeResourcesFailedId, 1); } // ------------------------------------------------------------------------- @@ -1100,7 +1100,7 @@ public void remove() { } @Override - public void remove(int count) { + public void remove(long count) { incSerialQueueSize(-count); } }; @@ -1147,7 +1147,7 @@ public void remove() { } @Override - public void remove(int count) { + public void remove(long count) { incWaitingQueueSize(-count); } }; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/locks/DistributedLockStats.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/locks/DistributedLockStats.java index 7344bf883e29..9109a50770c0 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/locks/DistributedLockStats.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/locks/DistributedLockStats.java @@ -30,14 +30,14 @@ public interface DistributedLockStats { /** * Returns the number of threads currently waiting for a distributed lock */ - int getLockWaitsInProgress(); + long getLockWaitsInProgress(); /** * Returns the total number of waits for a distributed lock */ - int getLockWaitsCompleted(); + long getLockWaitsCompleted(); - int getLockWaitsFailed(); + long getLockWaitsFailed(); /** * Returns the total number of nanoseconds spent waiting for a distributed lock. @@ -57,41 +57,41 @@ public interface DistributedLockStats { void endLockWait(long start, boolean success); // incSerialQueueSize everytime getWaitingQueueHelper add/remove called - int getWaitingQueueSize(); + long getWaitingQueueSize(); - void incWaitingQueueSize(int messages); + void incWaitingQueueSize(long messages); // incSerialQueueSize everytime getSerialQueueHelper add/remove called - int getSerialQueueSize(); + long getSerialQueueSize(); - void incSerialQueueSize(int messages); + void incSerialQueueSize(long messages); // incNumSerialThreads everytime we execute with dlock getSerialExecutor() - int getNumSerialThreads(); + long getNumSerialThreads(); - void incNumSerialThreads(int threads); + void incNumSerialThreads(long threads); // incWaitingThreads for every invoke of getWaitingPoolHelper startJob/endJob - int getWaitingThreads(); + long getWaitingThreads(); - void incWaitingThreads(int threads); + void incWaitingThreads(long threads); // current number of lock services used by this system member - int getServices(); + long getServices(); - void incServices(int val); + void incServices(long val); // current number of lock grantors hosted by this system member - int getGrantors(); + long getGrantors(); - void incGrantors(int val); + void incGrantors(long val); // time spent granting of lock requests to completion - int getGrantWaitsInProgress(); + long getGrantWaitsInProgress(); - int getGrantWaitsCompleted(); + long getGrantWaitsCompleted(); - int getGrantWaitsFailed(); + long getGrantWaitsFailed(); long getGrantWaitTime(); @@ -114,9 +114,9 @@ public interface DistributedLockStats { void endGrantWaitSuspended(long start); // time spent creating initial grantor for lock service - int getCreateGrantorsInProgress(); + long getCreateGrantorsInProgress(); - int getCreateGrantorsCompleted(); + long getCreateGrantorsCompleted(); long getCreateGrantorTime(); @@ -125,9 +125,9 @@ public interface DistributedLockStats { void endCreateGrantor(long start); // time spent creating each lock service - int getServiceCreatesInProgress(); + long getServiceCreatesInProgress(); - int getServiceCreatesCompleted(); + long getServiceCreatesCompleted(); long startServiceCreate(); @@ -140,11 +140,11 @@ public interface DistributedLockStats { long getServiceInitLatchTime(); // time spent waiting for grantor latches to open - int getGrantorWaitsInProgress(); + long getGrantorWaitsInProgress(); - int getGrantorWaitsCompleted(); + long getGrantorWaitsCompleted(); - int getGrantorWaitsFailed(); + long getGrantorWaitsFailed(); long getGrantorWaitTime(); @@ -162,9 +162,9 @@ public interface DistributedLockStats { QueueStatHelper getWaitingQueueHelper(); // time spent by grantor threads - int getGrantorThreadsInProgress(); + long getGrantorThreadsInProgress(); - int getGrantorThreadsCompleted(); + long getGrantorThreadsCompleted(); long getGrantorThreadTime(); @@ -185,16 +185,16 @@ public interface DistributedLockStats { void endGrantorThread(long start); // current number of lock grantors hosted by this system member - int getPendingRequests(); + long getPendingRequests(); - void incPendingRequests(int val); + void incPendingRequests(long val); // acquisition of destroyReadLock in DLockService - int getDestroyReadWaitsInProgress(); + long getDestroyReadWaitsInProgress(); - int getDestroyReadWaitsCompleted(); + long getDestroyReadWaitsCompleted(); - int getDestroyReadWaitsFailed(); + long getDestroyReadWaitsFailed(); long getDestroyReadWaitTime(); @@ -205,11 +205,11 @@ public interface DistributedLockStats { void endDestroyReadWait(long start, boolean success); // acquisition of destroyWriteLock in DLockService - int getDestroyWriteWaitsInProgress(); + long getDestroyWriteWaitsInProgress(); - int getDestroyWriteWaitsCompleted(); + long getDestroyWriteWaitsCompleted(); - int getDestroyWriteWaitsFailed(); + long getDestroyWriteWaitsFailed(); long getDestroyWriteWaitTime(); @@ -220,19 +220,19 @@ public interface DistributedLockStats { void endDestroyWriteWait(long start, boolean success); // current number of DLockService destroy read locks held by this process - int getDestroyReads(); + long getDestroyReads(); - void incDestroyReads(int val); + void incDestroyReads(long val); // current number of DLockService destroy write locks held by this process - int getDestroyWrites(); + long getDestroyWrites(); - void incDestroyWrites(int val); + void incDestroyWrites(long val); // time for call to unlock() to complete - int getLockReleasesInProgress(); + long getLockReleasesInProgress(); - int getLockReleasesCompleted(); + long getLockReleasesCompleted(); long getLockReleaseTime(); @@ -241,30 +241,30 @@ public interface DistributedLockStats { void endLockRelease(long start); // total number of times this member has requested to become grantor - int getBecomeGrantorRequests(); + long getBecomeGrantorRequests(); void incBecomeGrantorRequests(); // current number of lock tokens used by this system member - int getTokens(); + long getTokens(); - void incTokens(int val); + void incTokens(long val); // current number of grant tokens used by local grantors - int getGrantTokens(); + long getGrantTokens(); - void incGrantTokens(int val); + void incGrantTokens(long val); // current number of lock request queues used by this system member - int getRequestQueues(); + long getRequestQueues(); - void incRequestQueues(int val); + void incRequestQueues(long val); - int getFreeResourcesCompleted(); + long getFreeResourcesCompleted(); void incFreeResourcesCompleted(); - int getFreeResourcesFailed(); + long getFreeResourcesFailed(); void incFreeResourcesFailed(); } diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/locks/DummyDLockStats.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/locks/DummyDLockStats.java index 013020d36541..26c108f4f509 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/locks/DummyDLockStats.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/locks/DummyDLockStats.java @@ -28,17 +28,17 @@ public class DummyDLockStats implements DistributedLockStats { @Override - public int getLockWaitsInProgress() { + public long getLockWaitsInProgress() { return -1; } @Override - public int getLockWaitsCompleted() { + public long getLockWaitsCompleted() { return -1; } @Override - public int getLockWaitsFailed() { + public long getLockWaitsFailed() { return -1; } @@ -61,65 +61,65 @@ public long startLockWait() { public void endLockWait(long start, boolean success) {} @Override - public int getWaitingQueueSize() { + public long getWaitingQueueSize() { return -1; } @Override - public void incWaitingQueueSize(int messages) {} + public void incWaitingQueueSize(long messages) {} @Override - public int getSerialQueueSize() { + public long getSerialQueueSize() { return -1; } @Override - public void incSerialQueueSize(int messages) {} + public void incSerialQueueSize(long messages) {} @Override - public int getNumSerialThreads() { + public long getNumSerialThreads() { return -1; } @Override - public void incNumSerialThreads(int threads) {} + public void incNumSerialThreads(long threads) {} @Override - public int getWaitingThreads() { + public long getWaitingThreads() { return -1; } @Override - public void incWaitingThreads(int threads) {} + public void incWaitingThreads(long threads) {} @Override - public int getServices() { + public long getServices() { return -1; } @Override - public void incServices(int val) {} + public void incServices(long val) {} @Override - public int getGrantors() { + public long getGrantors() { return -1; } @Override - public void incGrantors(int val) {} + public void incGrantors(long val) {} @Override - public int getGrantWaitsInProgress() { + public long getGrantWaitsInProgress() { return -1; } @Override - public int getGrantWaitsCompleted() { + public long getGrantWaitsCompleted() { return -1; } @Override - public int getGrantWaitsFailed() { + public long getGrantWaitsFailed() { return -1; } @@ -160,12 +160,12 @@ public void endGrantWaitSuspended(long start) {} public void endGrantWaitDestroyed(long start) {} @Override - public int getCreateGrantorsInProgress() { + public long getCreateGrantorsInProgress() { return -1; } @Override - public int getCreateGrantorsCompleted() { + public long getCreateGrantorsCompleted() { return -1; } @@ -183,12 +183,12 @@ public long startCreateGrantor() { public void endCreateGrantor(long start) {} @Override - public int getServiceCreatesInProgress() { + public long getServiceCreatesInProgress() { return -1; } @Override - public int getServiceCreatesCompleted() { + public long getServiceCreatesCompleted() { return -1; } @@ -214,17 +214,17 @@ public long getServiceInitLatchTime() { } @Override - public int getGrantorWaitsInProgress() { + public long getGrantorWaitsInProgress() { return -1; } @Override - public int getGrantorWaitsCompleted() { + public long getGrantorWaitsCompleted() { return -1; } @Override - public int getGrantorWaitsFailed() { + public long getGrantorWaitsFailed() { return -1; } @@ -262,12 +262,12 @@ public QueueStatHelper getWaitingQueueHelper() { } @Override - public int getGrantorThreadsInProgress() { + public long getGrantorThreadsInProgress() { return -1; } @Override - public int getGrantorThreadsCompleted() { + public long getGrantorThreadsCompleted() { return -1; } @@ -313,25 +313,25 @@ public void endGrantorThreadRemoveUnusedTokens(long timing) {} public void endGrantorThread(long start) {} @Override - public int getPendingRequests() { + public long getPendingRequests() { return -1; } @Override - public void incPendingRequests(int val) {} + public void incPendingRequests(long val) {} @Override - public int getDestroyReadWaitsInProgress() { + public long getDestroyReadWaitsInProgress() { return -1; } @Override - public int getDestroyReadWaitsCompleted() { + public long getDestroyReadWaitsCompleted() { return -1; } @Override - public int getDestroyReadWaitsFailed() { + public long getDestroyReadWaitsFailed() { return -1; } @@ -354,17 +354,17 @@ public long startDestroyReadWait() { public void endDestroyReadWait(long start, boolean success) {} @Override - public int getDestroyWriteWaitsInProgress() { + public long getDestroyWriteWaitsInProgress() { return -1; } @Override - public int getDestroyWriteWaitsCompleted() { + public long getDestroyWriteWaitsCompleted() { return -1; } @Override - public int getDestroyWriteWaitsFailed() { + public long getDestroyWriteWaitsFailed() { return -1; } @@ -387,28 +387,28 @@ public long startDestroyWriteWait() { public void endDestroyWriteWait(long start, boolean success) {} @Override - public int getDestroyReads() { + public long getDestroyReads() { return -1; } @Override - public void incDestroyReads(int val) {} + public void incDestroyReads(long val) {} @Override - public int getDestroyWrites() { + public long getDestroyWrites() { return -1; } @Override - public void incDestroyWrites(int val) {} + public void incDestroyWrites(long val) {} @Override - public int getLockReleasesInProgress() { + public long getLockReleasesInProgress() { return -1; } @Override - public int getLockReleasesCompleted() { + public long getLockReleasesCompleted() { return -1; } @@ -426,7 +426,7 @@ public long startLockRelease() { public void endLockRelease(long start) {} @Override - public int getBecomeGrantorRequests() { + public long getBecomeGrantorRequests() { return -1; } @@ -434,31 +434,31 @@ public int getBecomeGrantorRequests() { public void incBecomeGrantorRequests() {} @Override - public int getTokens() { + public long getTokens() { return -1; } @Override - public void incTokens(int val) {} + public void incTokens(long val) {} @Override - public int getGrantTokens() { + public long getGrantTokens() { return -1; } @Override - public void incGrantTokens(int val) {} + public void incGrantTokens(long val) {} @Override - public int getRequestQueues() { + public long getRequestQueues() { return -1; } @Override - public void incRequestQueues(int val) {} + public void incRequestQueues(long val) {} @Override - public int getFreeResourcesCompleted() { + public long getFreeResourcesCompleted() { return -1; } @@ -466,7 +466,7 @@ public int getFreeResourcesCompleted() { public void incFreeResourcesCompleted() {} @Override - public int getFreeResourcesFailed() { + public long getFreeResourcesFailed() { return -1; } @@ -489,7 +489,7 @@ public void add() {} public void remove() {} @Override - public void remove(int count) {} + public void remove(long count) {} } } 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 5bbca522a96e..2927fd0cb671 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 @@ -286,6 +286,11 @@ public class CachePerfStats { "Current number of regions configured for reliablity that are missing required roles with Limited access"; final String reliableRegionsMissingNoAccessDesc = "Current number of regions configured for reliablity that are missing required roles with No access"; + final String regionClearsDesc = + "The total number of times a clear has been done on this cache."; + final String bucketClearsDesc = + "The total number of times a clear has been done on this region and it's bucket regions"; + final String clearsDesc = "The total number of times a clear has been done on this cache."; final String metaDataRefreshCountDesc = "Total number of times the meta data is refreshed due to hopping observed."; @@ -357,49 +362,50 @@ 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.createLongGauge("loadsInProgress", loadsInProgressDesc, "operations"), + f.createLongCounter("loadsCompleted", loadsCompletedDesc, "operations"), f.createLongCounter("loadTime", loadTimeDesc, "nanoseconds", false), - f.createIntGauge("netloadsInProgress", netloadsInProgressDesc, "operations"), - f.createIntCounter("netloadsCompleted", netloadsCompletedDesc, "operations"), + f.createLongGauge("netloadsInProgress", netloadsInProgressDesc, "operations"), + f.createLongCounter("netloadsCompleted", netloadsCompletedDesc, "operations"), f.createLongCounter("netloadTime", netloadTimeDesc, "nanoseconds", false), - f.createIntGauge("netsearchesInProgress", netsearchesInProgressDesc, "operations"), - f.createIntCounter("netsearchesCompleted", netsearchesCompletedDesc, "operations"), + f.createLongGauge("netsearchesInProgress", netsearchesInProgressDesc, "operations"), + f.createLongCounter("netsearchesCompleted", netsearchesCompletedDesc, "operations"), f.createLongCounter("netsearchTime", netsearchTimeDesc, "nanoseconds"), - f.createIntGauge("cacheWriterCallsInProgress", cacheWriterCallsInProgressDesc, + f.createLongGauge("cacheWriterCallsInProgress", cacheWriterCallsInProgressDesc, "operations"), - f.createIntCounter("cacheWriterCallsCompleted", cacheWriterCallsCompletedDesc, + f.createLongCounter("cacheWriterCallsCompleted", cacheWriterCallsCompletedDesc, "operations"), f.createLongCounter("cacheWriterCallTime", cacheWriterCallTimeDesc, "nanoseconds"), - f.createIntGauge("cacheListenerCallsInProgress", cacheListenerCallsInProgressDesc, + f.createLongGauge("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", + f.createLongGauge("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"), - f.createIntGauge("indexInitializationInProgress", + f.createLongGauge("indexInitializationInProgress", "Current number of index initializations in progress", "operations"), - f.createIntCounter("indexInitializationCompleted", + f.createLongCounter("indexInitializationCompleted", "Total number of index initializations that have completed", "operations"), f.createLongCounter("indexInitializationTime", "Total amount of time spent initializing indexes", "nanoseconds"), - f.createIntGauge("getInitialImagesInProgress", getInitialImagesInProgressDesc, + f.createLongGauge("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, + f.createLongCounter("getInitialImageKeysReceived", getInitialImageKeysReceivedDesc, "keys"), - f.createIntGauge("regions", regionsDesc, "regions"), - f.createIntGauge("partitionedRegions", partitionedRegionsDesc, "partitionedRegions"), + f.createLongGauge("regions", regionsDesc, "regions"), + f.createLongGauge("partitionedRegions", partitionedRegionsDesc, "partitionedRegions"), f.createLongCounter("destroys", destroysDesc, "operations"), f.createLongCounter("updates", updatesDesc, "operations"), f.createLongCounter("updateTime", updateTimeDesc, "nanoseconds"), @@ -409,88 +415,87 @@ public class CachePerfStats { 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"), - f.createIntGauge("eventQueueThrottleCount", eventQueueThrottleCountDesc, "delays"), + f.createLongGauge("eventQueueSize", eventQueueSizeDesc, "messages"), + f.createLongGauge("eventQueueThrottleCount", eventQueueThrottleCountDesc, "delays"), f.createLongCounter("eventQueueThrottleTime", eventQueueThrottleTimeDesc, "nanoseconds", false), - f.createIntGauge("eventThreads", eventThreadsDesc, "threads"), - f.createIntCounter("queryExecutions", queryExecutionsDesc, "operations"), + f.createLongGauge("eventThreads", eventThreadsDesc, "threads"), + f.createLongCounter("queryExecutions", queryExecutionsDesc, "operations"), f.createLongCounter("queryExecutionTime", queryExecutionTimeDesc, "nanoseconds"), - f.createIntCounter("queryResultsHashCollisions", queryResultsHashCollisionsDesc, + f.createLongCounter("queryResultsHashCollisions", queryResultsHashCollisionsDesc, "operations"), f.createLongCounter("queryResultsHashCollisionProbeTime", queryResultsHashCollisionProbeTimeDesc, "nanoseconds"), 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", false), - f.createIntGauge("reliableQueuedOps", reliableQueuedOpsDesc, "operations"), - f.createIntGauge("reliableQueueSize", reliableQueueSizeDesc, "megabytes"), - f.createIntGauge("reliableQueueMax", reliableQueueMaxDesc, "megabytes"), - f.createIntGauge("reliableRegions", reliableRegionsDesc, "regions"), - f.createIntGauge("reliableRegionsMissing", reliableRegionsMissingDesc, "regions"), - f.createIntGauge("reliableRegionsQueuing", reliableRegionsQueuingDesc, "regions"), - f.createIntGauge("reliableRegionsMissingFullAccess", + f.createLongGauge("reliableQueuedOps", reliableQueuedOpsDesc, "operations"), + f.createLongGauge("reliableQueueSize", reliableQueueSizeDesc, "megabytes"), + f.createLongGauge("reliableQueueMax", reliableQueueMaxDesc, "megabytes"), + f.createLongGauge("reliableRegions", reliableRegionsDesc, "regions"), + f.createLongGauge("reliableRegionsMissing", reliableRegionsMissingDesc, "regions"), + f.createLongGauge("reliableRegionsQueuing", reliableRegionsQueuingDesc, "regions"), + f.createLongGauge("reliableRegionsMissingFullAccess", reliableRegionsMissingFullAccessDesc, "regions"), - f.createIntGauge("reliableRegionsMissingLimitedAccess", + f.createLongGauge("reliableRegionsMissingLimitedAccess", reliableRegionsMissingLimitedAccessDesc, "regions"), - f.createIntGauge("reliableRegionsMissingNoAccess", reliableRegionsMissingNoAccessDesc, + f.createLongGauge("reliableRegionsMissingNoAccess", reliableRegionsMissingNoAccessDesc, "regions"), f.createLongGauge("entries", "Current number of entries in the cache. This does not include any entries that are tombstones. See tombstoneCount.", "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.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", + f.createLongGauge("diskTasksWaiting", "Current number of disk tasks (oplog compactions, asynchronous recoveries, etc) that are waiting for a thread to run the operation", "operations"), f.createLongCounter("conflatedEvents", conflatedEventsDesc, "operations"), - f.createIntGauge("tombstones", tombstoneCountDesc, "entries"), - f.createIntCounter("tombstoneGCs", tombstoneGCCountDesc, "operations"), + f.createLongGauge("tombstones", tombstoneCountDesc, "entries"), + f.createLongCounter("tombstoneGCs", tombstoneGCCountDesc, "operations"), 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.createIntGauge("evictorQueueSize", + f.createLongCounter("clearTimeouts", clearTimeoutsDesc, "timeouts"), + f.createLongGauge("evictorJobsStarted", "Number of evictor jobs started", "jobs"), + f.createLongGauge("evictorJobsCompleted", "Number of evictor jobs completed", "jobs"), + f.createLongGauge("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"), @@ -686,40 +691,40 @@ public long getTime() { 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() { - return stats.getInt(getInitialImageKeysReceivedId); + public long getGetInitialImageKeysReceived() { + return stats.getLong(getInitialImageKeysReceivedId); } - public int getRegions() { - return stats.getInt(regionsId); + public long getRegions() { + return stats.getLong(regionsId); } public long getDestroys() { @@ -738,12 +743,12 @@ 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 long getUpdates() { @@ -766,96 +771,96 @@ public long getMisses() { return stats.getLong(missesId); } - public int getReliableQueuedOps() { - return stats.getInt(reliableQueuedOpsId); + public long getReliableQueuedOps() { + return stats.getLong(reliableQueuedOpsId); } - public void incReliableQueuedOps(int inc) { - stats.incInt(reliableQueuedOpsId, inc); + public void incReliableQueuedOps(long inc) { + stats.incLong(reliableQueuedOpsId, inc); } - public void incReliableQueueSize(int inc) { - stats.incInt(reliableQueueSizeId, inc); + public void incReliableQueueSize(long inc) { + stats.incLong(reliableQueueSizeId, inc); } - public void incReliableQueueMax(int inc) { - stats.incInt(reliableQueueMaxId, inc); + public void incReliableQueueMax(long inc) { + stats.incLong(reliableQueueMaxId, inc); } - public void incReliableRegions(int inc) { - stats.incInt(reliableRegionsId, inc); + public void incReliableRegions(long inc) { + stats.incLong(reliableRegionsId, inc); } - public int getReliableRegionsMissing() { - return stats.getInt(reliableRegionsMissingId); + public long getReliableRegionsMissing() { + return stats.getLong(reliableRegionsMissingId); } - public void incReliableRegionsMissing(int inc) { - stats.incInt(reliableRegionsMissingId, inc); + public void incReliableRegionsMissing(long inc) { + stats.incLong(reliableRegionsMissingId, inc); } - public void incReliableRegionsQueuing(int inc) { - stats.incInt(reliableRegionsQueuingId, inc); + public void incReliableRegionsQueuing(long inc) { + stats.incLong(reliableRegionsQueuingId, inc); } - public int getReliableRegionsMissingFullAccess() { - return stats.getInt(reliableRegionsMissingFullAccessId); + public long getReliableRegionsMissingFullAccess() { + return stats.getLong(reliableRegionsMissingFullAccessId); } - public void incReliableRegionsMissingFullAccess(int inc) { - stats.incInt(reliableRegionsMissingFullAccessId, inc); + public void incReliableRegionsMissingFullAccess(long inc) { + stats.incLong(reliableRegionsMissingFullAccessId, inc); } - public int getReliableRegionsMissingLimitedAccess() { - return stats.getInt(reliableRegionsMissingLimitedAccessId); + public long getReliableRegionsMissingLimitedAccess() { + return stats.getLong(reliableRegionsMissingLimitedAccessId); } - public void incReliableRegionsMissingLimitedAccess(int inc) { - stats.incInt(reliableRegionsMissingLimitedAccessId, inc); + public void incReliableRegionsMissingLimitedAccess(long inc) { + stats.incLong(reliableRegionsMissingLimitedAccessId, inc); } - public int getReliableRegionsMissingNoAccess() { - return stats.getInt(reliableRegionsMissingNoAccessId); + public long getReliableRegionsMissingNoAccess() { + return stats.getLong(reliableRegionsMissingNoAccessId); } - public void incReliableRegionsMissingNoAccess(int inc) { - stats.incInt(reliableRegionsMissingNoAccessId, inc); + public void incReliableRegionsMissingNoAccess(long inc) { + stats.incLong(reliableRegionsMissingNoAccessId, inc); } - public void incQueuedEvents(int inc) { + public void incQueuedEvents(long 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() { @@ -910,7 +915,7 @@ public void endDecompression(long startTime) { * @return the timestamp that marks the start of the operation */ public long startLoad() { - stats.incInt(loadsInProgressId, 1); + stats.incLong(loadsInProgressId, 1); return NanoTimer.getTime(); // don't use getStatTime so always enabled } @@ -922,15 +927,15 @@ public void endLoad(long start) { // should not be disabled by enableClockStats==false 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(loadsInProgressId, -1); + stats.incLong(loadsCompletedId, 1); } /** * @return the timestamp that marks the start of the operation */ public long startNetload() { - stats.incInt(netloadsInProgressId, 1); + stats.incLong(netloadsInProgressId, 1); return getTime(); } @@ -941,15 +946,15 @@ public void endNetload(long start) { if (clock.isEnabled()) { stats.incLong(netloadTimeId, getTime() - start); } - stats.incInt(netloadsInProgressId, -1); - stats.incInt(netloadsCompletedId, 1); + stats.incLong(netloadsInProgressId, -1); + stats.incLong(netloadsCompletedId, 1); } /** * @return the timestamp that marks the start of the operation */ public long startNetsearch() { - stats.incInt(netsearchesInProgressId, 1); + stats.incLong(netsearchesInProgressId, 1); return NanoTimer.getTime(); // don't use getStatTime so always enabled } @@ -961,15 +966,15 @@ public void endNetsearch(long start) { // not be disabled by enableClockStats==false 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(netsearchesInProgressId, -1); + stats.incLong(netsearchesCompletedId, 1); } /** * @return the timestamp that marks the start of the operation */ public long startCacheWriterCall() { - stats.incInt(cacheWriterCallsInProgressId, 1); + stats.incLong(cacheWriterCallsInProgressId, 1); return getTime(); } @@ -980,12 +985,12 @@ public void endCacheWriterCall(long start) { if (clock.isEnabled()) { stats.incLong(cacheWriterCallTimeId, getTime() - start); } - stats.incInt(cacheWriterCallsInProgressId, -1); - stats.incInt(cacheWriterCallsCompletedId, 1); + stats.incLong(cacheWriterCallsInProgressId, -1); + stats.incLong(cacheWriterCallsCompletedId, 1); } - int getCacheWriterCallsCompleted() { - return stats.getInt(cacheWriterCallsCompletedId); + long getCacheWriterCallsCompleted() { + return stats.getLong(cacheWriterCallsCompletedId); } /** @@ -993,7 +998,7 @@ int getCacheWriterCallsCompleted() { * @since GemFire 3.5 */ public long startCacheListenerCall() { - stats.incInt(cacheListenerCallsInProgressId, 1); + stats.incLong(cacheListenerCallsInProgressId, 1); return getTime(); } @@ -1005,19 +1010,19 @@ public void endCacheListenerCall(long start) { if (clock.isEnabled()) { stats.incLong(cacheListenerCallTimeId, getTime() - start); } - stats.incInt(cacheListenerCallsInProgressId, -1); - stats.incInt(cacheListenerCallsCompletedId, 1); + stats.incLong(cacheListenerCallsInProgressId, -1); + stats.incLong(cacheListenerCallsCompletedId, 1); } - int getCacheListenerCallsCompleted() { - return stats.getInt(cacheListenerCallsCompletedId); + long getCacheListenerCallsCompleted() { + return stats.getLong(cacheListenerCallsCompletedId); } /** * @return the timestamp that marks the start of the operation */ public long startGetInitialImage() { - stats.incInt(getInitialImagesInProgressId, 1); + stats.incLong(getInitialImagesInProgressId, 1); return getTime(); } @@ -1028,8 +1033,8 @@ public void endGetInitialImage(long start) { if (clock.isEnabled()) { stats.incLong(getInitialImageTimeId, getTime() - start); } - stats.incInt(getInitialImagesInProgressId, -1); - stats.incInt(getInitialImagesCompletedId, 1); + stats.incLong(getInitialImagesInProgressId, -1); + stats.incLong(getInitialImagesCompletedId, 1); } /** @@ -1039,55 +1044,55 @@ public void endNoGIIDone(long start) { if (clock.isEnabled()) { stats.incLong(getInitialImageTimeId, getTime() - start); } - stats.incInt(getInitialImagesInProgressId, -1); + stats.incLong(getInitialImagesInProgressId, -1); } void incDeltaGIICompleted() { - stats.incInt(deltaGetInitialImagesCompletedId, 1); + stats.incLong(deltaGetInitialImagesCompletedId, 1); } public void incGetInitialImageKeysReceived() { - stats.incInt(getInitialImageKeysReceivedId, 1); + stats.incLong(getInitialImageKeysReceivedId, 1); } public long startIndexUpdate() { - stats.incInt(indexUpdateInProgressId, 1); + stats.incLong(indexUpdateInProgressId, 1); return getTime(); } public void endIndexUpdate(long start) { long ts = getTime(); stats.incLong(indexUpdateTimeId, ts - start); - stats.incInt(indexUpdateInProgressId, -1); - stats.incInt(indexUpdateCompletedId, 1); + stats.incLong(indexUpdateInProgressId, -1); + stats.incLong(indexUpdateCompletedId, 1); } - int getIndexUpdateCompleted() { - return stats.getInt(indexUpdateCompletedId); + long getIndexUpdateCompleted() { + return stats.getLong(indexUpdateCompletedId); } long startIndexInitialization() { - stats.incInt(indexInitializationInProgressId, 1); + stats.incLong(indexInitializationInProgressId, 1); return getTime(); } void endIndexInitialization(long start) { long ts = getTime(); stats.incLong(indexInitializationTimeId, ts - start); - stats.incInt(indexInitializationInProgressId, -1); - stats.incInt(indexInitializationCompletedId, 1); + stats.incLong(indexInitializationInProgressId, -1); + stats.incLong(indexInitializationCompletedId, 1); } public long getIndexInitializationTime() { return stats.getLong(indexInitializationTimeId); } - public void incRegions(int inc) { - stats.incInt(regionsId, inc); + public void incRegions(long inc) { + stats.incLong(regionsId, inc); } - public void incPartitionedRegions(int inc) { - stats.incInt(partitionedRegionsId, inc); + public void incPartitionedRegions(long inc) { + stats.incLong(partitionedRegionsId, inc); } public void incDestroys() { @@ -1148,26 +1153,26 @@ public long endPut(long start, boolean isUpdate) { } public void endPutAll(long start) { - stats.incInt(putAllsId, 1); + stats.incLong(putAllsId, 1); if (clock.isEnabled()) stats.incLong(putAllTimeId, getTime() - start); } public void endRemoveAll(long start) { - stats.incInt(removeAllsId, 1); + stats.incLong(removeAllsId, 1); if (clock.isEnabled()) stats.incLong(removeAllTimeId, getTime() - start); } public void endQueryExecution(long executionTime) { - stats.incInt(queryExecutionsId, 1); + stats.incLong(queryExecutionsId, 1); if (clock.isEnabled()) { stats.incLong(queryExecutionTimeId, executionTime); } } - public int getQueryExecutions() { - return stats.getInt(queryExecutionsId); + public long getQueryExecutions() { + return stats.getLong(queryExecutionsId); } public void endQueryResultsHashCollisionProbe(long start) { @@ -1177,15 +1182,15 @@ public void endQueryResultsHashCollisionProbe(long start) { } public void incQueryResultsHashCollisions() { - stats.incInt(queryResultsHashCollisionsId, 1); + stats.incLong(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() { @@ -1196,12 +1201,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() { @@ -1212,12 +1217,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() { @@ -1232,55 +1237,55 @@ public void incTxConflictCheckTime(long delta) { stats.incLong(txConflictCheckTimeId, delta); } - public void txSuccess(long opTime, long txLifeTime, int txChanges) { - stats.incInt(txCommitsId, 1); - stats.incInt(txCommitChangesId, txChanges); + public void txSuccess(long opTime, long txLifeTime, long 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); + public void txFailure(long opTime, long txLifeTime, long 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); + public void txRollback(long opTime, long txLifeTime, long 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 (clock.isEnabled()) { stats.incLong(deltaUpdatesTimeId, getTime() - 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 (clock.isEnabled()) { stats.incLong(deltasPreparedTimeId, getTime() - 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); } /** @@ -1302,72 +1307,72 @@ public boolean isClosed() { return stats.isClosed(); } - public int getEventQueueSize() { - return stats.getInt(eventQueueSizeId); + public long getEventQueueSize() { + return stats.getLong(eventQueueSizeId); } - public void incEventQueueSize(int items) { - stats.incInt(eventQueueSizeId, items); + public void incEventQueueSize(long items) { + stats.incLong(eventQueueSizeId, items); } - public void incEventQueueThrottleCount(int items) { - stats.incInt(eventQueueThrottleCountId, items); + public void incEventQueueThrottleCount(long items) { + stats.incLong(eventQueueThrottleCountId, items); } protected void incEventQueueThrottleTime(long nanos) { stats.incLong(eventQueueThrottleTimeId, nanos); } - protected void incEventThreads(int items) { - stats.incInt(eventThreadsId, items); + protected void incEventThreads(long items) { + stats.incLong(eventThreadsId, items); } - public void incEntryCount(int delta) { + public void incEntryCount(long delta) { stats.incLong(entryCountId, delta); } 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() { - stats.incInt(diskTasksWaitingId, 1); + stats.incLong(diskTasksWaitingId, 1); } public void decDiskTasksWaiting() { - stats.incInt(diskTasksWaitingId, -1); + stats.incLong(diskTasksWaitingId, -1); } - int getDiskTasksWaiting() { - return stats.getInt(diskTasksWaitingId); + long getDiskTasksWaiting() { + return stats.getLong(diskTasksWaitingId); } - public void decDiskTasksWaiting(int count) { - stats.incInt(diskTasksWaitingId, -count); + public void decDiskTasksWaiting(long count) { + stats.incLong(diskTasksWaitingId, -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) { - stats.incInt(evictorQueueSizeId, delta); + public void incEvictorQueueSize(long delta) { + stats.incLong(evictorQueueSizeId, delta); } public void incEvictWorkTime(long delta) { @@ -1410,20 +1415,20 @@ public void incConflatedEventsCount() { stats.incLong(conflatedEventsId, 1); } - public int getTombstoneCount() { - return stats.getInt(tombstoneCountId); + public long getTombstoneCount() { + return stats.getLong(tombstoneCountId); } - public void incTombstoneCount(int amount) { - stats.incInt(tombstoneCountId, amount); + public void incTombstoneCount(long amount) { + stats.incLong(tombstoneCountId, amount); } - public int getTombstoneGCCount() { - return stats.getInt(tombstoneGCCountId); + public long getTombstoneGCCount() { + return stats.getLong(tombstoneGCCountId); } public void incTombstoneGCCount() { - stats.incInt(tombstoneGCCountId, 1); + stats.incLong(tombstoneGCCountId, 1); } void setReplicatedTombstonesSize(long size) { @@ -1434,12 +1439,12 @@ void setNonReplicatedTombstonesSize(long size) { stats.setLong(tombstoneOverhead2Id, size); } - public int getClearTimeouts() { - return stats.getInt(clearTimeoutsId); + public long getClearTimeouts() { + return stats.getLong(clearTimeoutsId); } public void incClearTimeouts() { - stats.incInt(clearTimeoutsId, 1); + stats.incLong(clearTimeoutsId, 1); } public void incPRQueryRetries() { @@ -1463,7 +1468,7 @@ public void remove() { } @Override - public void remove(int count) { + public void remove(long count) { incEvictorQueueSize(count * -1); } }; 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 3e2439eea83d..1e3d30b15042 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 @@ -29,43 +29,43 @@ public class DummyCachePerfStats extends CachePerfStats { } @Override - public int getLoadsCompleted() { - return 0; + public long getLoadsCompleted() { + return 0L; } @Override public long getLoadTime() { - return 0; + return 0L; } @Override - public int getNetloadsCompleted() { - return 0; + public long getNetloadsCompleted() { + return 0L; } @Override - public int getNetsearchesCompleted() { - return 0; + public long getNetsearchesCompleted() { + return 0L; } @Override public long getNetsearchTime() { - return 0; + return 0L; } @Override - public int getGetInitialImagesCompleted() { - return 0; + public long getGetInitialImagesCompleted() { + return 0L; } @Override - public int getGetInitialImageKeysReceived() { - return 0; + public long getGetInitialImageKeysReceived() { + return 0L; } @Override - public int getRegions() { - return 0; + public long getRegions() { + return 0L; } @Override @@ -75,7 +75,7 @@ public long getDestroys() { @Override public long getCreates() { - return 0; + return 0L; } @Override @@ -84,18 +84,18 @@ public long getPuts() { } @Override - public int getPutAlls() { - return 0; + public long getPutAlls() { + return 0L; } @Override public long getUpdates() { - return 0; + return 0L; } @Override public long getInvalidates() { - return 0l; + return 0L; } @Override @@ -109,65 +109,65 @@ public long getMisses() { } @Override - public int getReliableQueuedOps() { - return 0; + public long getReliableQueuedOps() { + return 0L; } @Override - public void incReliableQueuedOps(int inc) {} + public void incReliableQueuedOps(long inc) {} @Override - public void incReliableQueueSize(int inc) {} + public void incReliableQueueSize(long inc) {} @Override - public void incReliableQueueMax(int inc) {} + public void incReliableQueueMax(long inc) {} @Override - public void incReliableRegions(int inc) {} + public void incReliableRegions(long inc) {} @Override - public int getReliableRegionsMissing() { - return 0; + public long getReliableRegionsMissing() { + return 0L; } @Override - public void incReliableRegionsMissing(int inc) {} + public void incReliableRegionsMissing(long inc) {} @Override - public void incReliableRegionsQueuing(int inc) {} + public void incReliableRegionsQueuing(long inc) {} @Override - public int getReliableRegionsMissingFullAccess() { - return 0; + public long getReliableRegionsMissingFullAccess() { + return 0L; } @Override - public void incReliableRegionsMissingFullAccess(int inc) {} + public void incReliableRegionsMissingFullAccess(long inc) {} @Override - public int getReliableRegionsMissingLimitedAccess() { - return 0; + public long getReliableRegionsMissingLimitedAccess() { + return 0L; } @Override - public void incReliableRegionsMissingLimitedAccess(int inc) {} + public void incReliableRegionsMissingLimitedAccess(long inc) {} @Override - public int getReliableRegionsMissingNoAccess() { - return 0; + public long getReliableRegionsMissingNoAccess() { + return 0L; } @Override - public void incReliableRegionsMissingNoAccess(int inc) {} + public void incReliableRegionsMissingNoAccess(long inc) {} @Override - public void incQueuedEvents(int inc) {} + public void incQueuedEvents(long inc) {} // //////////////////// Updating Stats ////////////////////// @Override public long startLoad() { - return 0; + return 0L; } @Override @@ -175,7 +175,7 @@ public void endLoad(long start) {} @Override public long startNetload() { - return 0; + return 0L; } @Override @@ -183,7 +183,7 @@ public void endNetload(long start) {} @Override public long startNetsearch() { - return 0; + return 0L; } @Override @@ -191,7 +191,7 @@ public void endNetsearch(long start) {} @Override public long startCacheWriterCall() { - return 0; + return 0L; } @Override @@ -199,7 +199,7 @@ public void endCacheWriterCall(long start) {} @Override public long startCacheListenerCall() { - return 0; + return 0L; } @Override @@ -207,7 +207,7 @@ public void endCacheListenerCall(long start) {} @Override public long startGetInitialImage() { - return 0; + return 0L; } @Override @@ -220,10 +220,10 @@ public void endNoGIIDone(long start) {} public void incGetInitialImageKeysReceived() {} @Override - public void incRegions(int inc) {} + public void incRegions(long inc) {} @Override - public void incPartitionedRegions(int inc) {} + public void incPartitionedRegions(long inc) {} @Override public void incDestroys() {} @@ -236,7 +236,7 @@ public void incInvalidates() {} @Override public long startGet() { - return 0; + return 0L; } @Override @@ -244,7 +244,7 @@ public void endGet(long start, boolean miss) {} @Override public long endPut(long start, boolean isUpdate) { - return 0; + return 0L; } @Override @@ -254,76 +254,76 @@ public void endPutAll(long start) {} public void endQueryExecution(long executionTime) {} @Override - public int getTxCommits() { - return 0; + public long getTxCommits() { + return 0L; } @Override - public int getTxCommitChanges() { - return 0; + public long getTxCommitChanges() { + return 0L; } @Override public long getTxCommitTime() { - return 0; + return 0L; } @Override public long getTxSuccessLifeTime() { - return 0; + return 0L; } @Override - public int getTxFailures() { - return 0; + public long getTxFailures() { + return 0L; } @Override - public int getTxFailureChanges() { - return 0; + public long getTxFailureChanges() { + return 0L; } @Override public long getTxFailureTime() { - return 0; + return 0L; } @Override public long getTxFailedLifeTime() { - return 0; + return 0L; } @Override - public int getTxRollbacks() { - return 0; + public long getTxRollbacks() { + return 0L; } @Override - public int getTxRollbackChanges() { - return 0; + public long getTxRollbackChanges() { + return 0L; } @Override public long getTxRollbackTime() { - return 0; + return 0L; } @Override public long getTxRollbackLifeTime() { - return 0; + return 0L; } @Override public void incTxConflictCheckTime(long delta) {} @Override - public void txSuccess(long opTime, long txLifeTime, int txChanges) {} + public void txSuccess(long opTime, long txLifeTime, long txChanges) {} @Override - public void txFailure(long opTime, long txLifeTime, int txChanges) {} + public void txFailure(long opTime, long txLifeTime, long txChanges) {} @Override - public void txRollback(long opTime, long txLifeTime, int txChanges) {} + public void txRollback(long opTime, long txLifeTime, long txChanges) {} @Override protected void close() { @@ -336,24 +336,24 @@ public boolean isClosed() { } @Override - public int getEventQueueSize() { - return 0; + public long getEventQueueSize() { + return 0L; } @Override - public void incEventQueueSize(int items) {} + public void incEventQueueSize(long items) {} @Override - public void incEventQueueThrottleCount(int items) {} + public void incEventQueueThrottleCount(long items) {} @Override protected void incEventQueueThrottleTime(long nanos) {} @Override - protected void incEventThreads(int items) {} + protected void incEventThreads(long items) {} @Override - public void incEntryCount(int delta) {} + public void incEntryCount(long delta) {} @Override public void incRetries() {} diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionStats.java b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionStats.java index db930e6bc9d1..11f881448063 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionStats.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionStats.java @@ -176,9 +176,13 @@ public class PartitionedRegionStats { private static final int prMetaDataSentCountId; private static final int localMaxMemoryId; + static final int regionClearLocalDurationId; + static final int regionClearTotalDurationId; + + static { - final boolean largerIsBetter = true; + StatisticsTypeFactory f = StatisticsTypeFactoryImpl.singleton(); type = f.createType("PartitionedRegionStats", "Statistics for operations and connections in the Partitioned Region", @@ -186,23 +190,23 @@ public class PartitionedRegionStats { f.createLongGauge("bucketCount", "Number of buckets in this node.", "buckets"), f.createLongCounter("putsCompleted", "Number of puts completed.", "operations", - largerIsBetter), + true), f.createLongCounter("putOpsRetried", "Number of put operations which had to be retried due to failures.", "operations", false), f.createLongCounter("putRetries", "Total number of times put operations had to be retried.", "retry attempts", false), f.createLongCounter("createsCompleted", "Number of creates completed.", "operations", - largerIsBetter), + true), f.createLongCounter("createOpsRetried", "Number of create operations which had to be retried due to failures.", "operations", false), f.createLongCounter("createRetries", "Total number of times put operations had to be retried.", "retry attempts", false), f.createLongCounter("preferredReadLocal", "Number of reads satisfied from local store", - "operations", largerIsBetter), + "operations", true), f.createLongCounter(PUTALLS_COMPLETED, "Number of putAlls completed.", "operations", - largerIsBetter), + true), f.createLongCounter(PUTALL_MSGS_RETRIED, "Number of putAll messages which had to be retried due to failures.", "operations", false), @@ -210,9 +214,9 @@ public class PartitionedRegionStats { "Total number of times putAll messages had to be retried.", "retry attempts", false), f.createLongCounter(PUTALL_TIME, "Total time spent doing putAlls.", "nanoseconds", - !largerIsBetter), + false), f.createLongCounter(REMOVE_ALLS_COMPLETED, "Number of removeAlls completed.", - "operations", largerIsBetter), + "operations", true), f.createLongCounter(REMOVE_ALL_MSGS_RETRIED, "Number of removeAll messages which had to be retried due to failures.", "operations", false), @@ -220,19 +224,19 @@ public class PartitionedRegionStats { "Total number of times removeAll messages had to be retried.", "retry attempts", false), f.createLongCounter(REMOVE_ALL_TIME, "Total time spent doing removeAlls.", - "nanoseconds", !largerIsBetter), + "nanoseconds", false), f.createLongCounter("preferredReadRemote", "Number of reads satisfied from remote store", "operations", false), f.createLongCounter("getsCompleted", "Number of gets completed.", "operations", - largerIsBetter), + true), f.createLongCounter("getOpsRetried", "Number of get operations which had to be retried due to failures.", "operations", false), f.createLongCounter("getRetries", "Total number of times get operations had to be retried.", "retry attempts", false), f.createLongCounter("destroysCompleted", "Number of destroys completed.", "operations", - largerIsBetter), + true), f.createLongCounter("destroyOpsRetried", "Number of destroy operations which had to be retried due to failures.", "operations", false), @@ -240,7 +244,7 @@ public class PartitionedRegionStats { "Total number of times destroy operations had to be retried.", "retry attempts", false), f.createLongCounter("invalidatesCompleted", "Number of invalidates completed.", - "operations", largerIsBetter), + "operations", true), f.createLongCounter("invalidateOpsRetried", "Number of invalidate operations which had to be retried due to failures.", @@ -249,7 +253,7 @@ public class PartitionedRegionStats { "Total number of times invalidate operations had to be retried.", "retry attempts", false), f.createLongCounter("containsKeyCompleted", "Number of containsKeys completed.", - "operations", largerIsBetter), + "operations", true), f.createLongCounter("containsKeyOpsRetried", "Number of containsKey or containsValueForKey operations which had to be retried due to failures.", @@ -258,14 +262,14 @@ public class PartitionedRegionStats { "Total number of times containsKey or containsValueForKey operations had to be retried.", "operations", false), f.createLongCounter("containsValueForKeyCompleted", - "Number of containsValueForKeys completed.", "operations", largerIsBetter), + "Number of containsValueForKeys completed.", "operations", true), f.createLongCounter("PartitionMessagesSent", "Number of PartitionMessages Sent.", - "operations", largerIsBetter), + "operations", true), f.createLongCounter("PartitionMessagesReceived", "Number of PartitionMessages Received.", - "operations", largerIsBetter), + "operations", true), f.createLongCounter("PartitionMessagesProcessed", - "Number of PartitionMessages Processed.", "operations", largerIsBetter), + "Number of PartitionMessages Processed.", "operations", true), f.createLongCounter("putTime", "Total time spent doing puts.", "nanoseconds", false), f.createLongCounter("createTime", "Total time spent doing create operations.", "nanoseconds", false), @@ -322,7 +326,7 @@ public class PartitionedRegionStats { f.createLongGauge("actualRedundantCopies", "Actual number of redundant copies for this partitioned region.", "copies"), f.createLongCounter("getEntryCompleted", "Number of getEntry operations completed.", - "operations", largerIsBetter), + "operations", true), f.createLongCounter("getEntryTime", "Total time spent performing getEntry operations.", "nanoseconds", false), @@ -361,40 +365,40 @@ public class PartitionedRegionStats { f.createLongCounter("applyReplicationCompleted", "Total number of replicated values sent from a primary to this redundant data store.", - "operations", largerIsBetter), + "operations", true), f.createLongGauge("applyReplicationInProgress", "Current number of replication operations in progress on this redundant data store.", - "operations", !largerIsBetter), + "operations", false), f.createLongCounter("applyReplicationTime", "Total time spent storing replicated values on this redundant data store.", - "nanoseconds", !largerIsBetter), + "nanoseconds", false), f.createLongCounter("sendReplicationCompleted", "Total number of replicated values sent from this primary to a redundant data store.", - "operations", largerIsBetter), + "operations", true), f.createLongGauge("sendReplicationInProgress", "Current number of replication operations in progress from this primary.", - "operations", !largerIsBetter), + "operations", false), f.createLongCounter("sendReplicationTime", "Total time spent replicating values from this primary to a redundant data store.", - "nanoseconds", !largerIsBetter), + "nanoseconds", false), f.createLongCounter("putRemoteCompleted", "Total number of completed puts that did not originate in the primary. These puts require an extra network hop to the primary.", - "operations", largerIsBetter), + "operations", true), f.createLongGauge("putRemoteInProgress", "Current number of puts in progress that did not originate in the primary.", - "operations", !largerIsBetter), + "operations", false), f.createLongCounter("putRemoteTime", "Total time spent doing puts that did not originate in the primary.", "nanoseconds", - !largerIsBetter), + false), f.createLongCounter("putLocalCompleted", "Total number of completed puts that did originate in the primary. These puts are optimal.", - "operations", largerIsBetter), + "operations", true), f.createLongGauge("putLocalInProgress", "Current number of puts in progress that did originate in the primary.", - "operations", !largerIsBetter), + "operations", false), f.createLongCounter("putLocalTime", "Total time spent doing puts that did originate in the primary.", "nanoseconds", - !largerIsBetter), + false), f.createLongGauge("rebalanceBucketCreatesInProgress", "Current number of bucket create operations being performed for rebalancing.", @@ -425,7 +429,13 @@ public class PartitionedRegionStats { false), f.createLongGauge("localMaxMemory", - "local max memory in bytes for this region on this member", "bytes") + "local max memory in bytes for this region on this member", "bytes"), + f.createLongCounter("partitionedRegionClearLocalDuration", + "The time in nanoseconds partitioned region clear has been running for the region on this member", + "nanoseconds"), + f.createLongCounter("partitionedRegionClearTotalDuration", + "The time in nanoseconds partitioned region clear has been running for the region with this member as coordinator.", + "nanoseconds"), }); @@ -531,6 +541,10 @@ public class PartitionedRegionStats { prMetaDataSentCountId = type.nameToId("prMetaDataSentCount"); localMaxMemoryId = type.nameToId("localMaxMemory"); + + regionClearLocalDurationId = type.nameToId("partitionedRegionClearLocalDuration"); + regionClearTotalDurationId = type.nameToId("partitionedRegionClearTotalDuration"); + } private final Statistics stats; @@ -546,13 +560,13 @@ public class PartitionedRegionStats { * lot of unused longs. Volunteering is a rare event and thus the performance implications of a * HashMap lookup is small and preferrable to so many longs. Key: BucketAdvisor, Value: Long */ - private final Map startTimeMap; + private final Map startTimeMap; public PartitionedRegionStats(StatisticsFactory factory, String name, StatisticsClock clock) { stats = factory.createAtomicStatistics(type, name); if (clock.isEnabled()) { - startTimeMap = new ConcurrentHashMap(); + startTimeMap = new ConcurrentHashMap<>(); } else { startTimeMap = Collections.emptyMap(); } @@ -945,14 +959,14 @@ public void setActualRedundantCopies(int val) { /** Put stat start time in holding map for later removal and use by caller */ public void putStartTime(Object key, long startTime) { if (clock.isEnabled()) { - this.startTimeMap.put(key, Long.valueOf(startTime)); + this.startTimeMap.put(key, startTime); } } /** Remove stat start time from holding map to complete a clock stat */ public long removeStartTime(Object key) { Long startTime = (Long) this.startTimeMap.remove(key); - return startTime == null ? 0 : startTime.longValue(); + return startTime == null ? 0 : startTime; } /** @@ -1195,4 +1209,20 @@ public void incPRMetaDataSentCount() { public long getPRMetaDataSentCount() { return this.stats.getLong(prMetaDataSentCountId); } + + public void incPartitionedRegionClearLocalDuration(long durationNanos) { + stats.incLong(regionClearLocalDurationId, durationNanos); + } + + public void incPartitionedRegionClearTotalDuration(long durationNanos) { + stats.incLong(regionClearTotalDurationId, durationNanos); + } + + public long getRegionClearLocalDuration() { + return stats.getLong(regionClearLocalDurationId); + } + + public long getRegionClearTotalDuration() { + return stats.getLong(regionClearTotalDurationId); + } } diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/RegionPerfStats.java b/geode-core/src/main/java/org/apache/geode/internal/cache/RegionPerfStats.java index d3c9891bb345..6e92ce91d038 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/RegionPerfStats.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/RegionPerfStats.java @@ -81,68 +81,68 @@ protected void close() { } @Override - public void incReliableQueuedOps(int inc) { - stats.incInt(reliableQueuedOpsId, inc); + public void incReliableQueuedOps(long inc) { + stats.incLong(reliableQueuedOpsId, inc); cachePerfStats.incReliableQueuedOps(inc); } @Override - public void incReliableQueueSize(int inc) { - stats.incInt(reliableQueueSizeId, inc); + public void incReliableQueueSize(long inc) { + stats.incLong(reliableQueueSizeId, inc); cachePerfStats.incReliableQueueSize(inc); } @Override - public void incReliableQueueMax(int inc) { - stats.incInt(reliableQueueMaxId, inc); + public void incReliableQueueMax(long inc) { + stats.incLong(reliableQueueMaxId, inc); cachePerfStats.incReliableQueueMax(inc); } @Override - public void incReliableRegions(int inc) { - stats.incInt(reliableRegionsId, inc); + public void incReliableRegions(long inc) { + stats.incLong(reliableRegionsId, inc); cachePerfStats.incReliableRegions(inc); } @Override - public void incReliableRegionsMissing(int inc) { - stats.incInt(reliableRegionsMissingId, inc); + public void incReliableRegionsMissing(long inc) { + stats.incLong(reliableRegionsMissingId, inc); cachePerfStats.incReliableRegionsMissing(inc); } @Override - public void incReliableRegionsQueuing(int inc) { - stats.incInt(reliableRegionsQueuingId, inc); + public void incReliableRegionsQueuing(long inc) { + stats.incLong(reliableRegionsQueuingId, inc); cachePerfStats.incReliableRegionsQueuing(inc); } @Override - public void incReliableRegionsMissingFullAccess(int inc) { - stats.incInt(reliableRegionsMissingFullAccessId, inc); + public void incReliableRegionsMissingFullAccess(long inc) { + stats.incLong(reliableRegionsMissingFullAccessId, inc); cachePerfStats.incReliableRegionsMissingFullAccess(inc); } @Override - public void incReliableRegionsMissingLimitedAccess(int inc) { - stats.incInt(reliableRegionsMissingLimitedAccessId, inc); + public void incReliableRegionsMissingLimitedAccess(long inc) { + stats.incLong(reliableRegionsMissingLimitedAccessId, inc); cachePerfStats.incReliableRegionsMissingLimitedAccess(inc); } @Override - public void incReliableRegionsMissingNoAccess(int inc) { - stats.incInt(reliableRegionsMissingNoAccessId, inc); + public void incReliableRegionsMissingNoAccess(long inc) { + stats.incLong(reliableRegionsMissingNoAccessId, inc); cachePerfStats.incReliableRegionsMissingNoAccess(inc); } @Override - public void incQueuedEvents(int inc) { + public void incQueuedEvents(long inc) { stats.incLong(eventsQueuedId, inc); cachePerfStats.incQueuedEvents(inc); } @Override public long startLoad() { - stats.incInt(loadsInProgressId, 1); + stats.incLong(loadsInProgressId, 1); return cachePerfStats.startLoad(); } @@ -154,8 +154,8 @@ public void endLoad(long start) { // don't use getStatTime so always enabled long ts = getTime(); stats.incLong(loadTimeId, ts - start); - stats.incInt(loadsInProgressId, -1); - stats.incInt(loadsCompletedId, 1); + stats.incLong(loadsInProgressId, -1); + stats.incLong(loadsCompletedId, 1); // need to think about timings cachePerfStats.endLoad(start); @@ -163,7 +163,7 @@ public void endLoad(long start) { @Override public long startNetload() { - stats.incInt(netloadsInProgressId, 1); + stats.incLong(netloadsInProgressId, 1); cachePerfStats.startNetload(); return getTime(); } @@ -173,14 +173,14 @@ public void endNetload(long start) { if (clock.isEnabled()) { stats.incLong(netloadTimeId, getTime() - start); } - stats.incInt(netloadsInProgressId, -1); - stats.incInt(netloadsCompletedId, 1); + stats.incLong(netloadsInProgressId, -1); + stats.incLong(netloadsCompletedId, 1); cachePerfStats.endNetload(start); } @Override public long startNetsearch() { - stats.incInt(netsearchesInProgressId, 1); + stats.incLong(netsearchesInProgressId, 1); return cachePerfStats.startNetsearch(); } @@ -192,14 +192,14 @@ public void endNetsearch(long start) { // don't use getStatTime so always enabled long ts = getTime(); stats.incLong(netsearchTimeId, ts - start); - stats.incInt(netsearchesInProgressId, -1); - stats.incInt(netsearchesCompletedId, 1); + stats.incLong(netsearchesInProgressId, -1); + stats.incLong(netsearchesCompletedId, 1); cachePerfStats.endNetsearch(start); } @Override public long startCacheWriterCall() { - stats.incInt(cacheWriterCallsInProgressId, 1); + stats.incLong(cacheWriterCallsInProgressId, 1); cachePerfStats.startCacheWriterCall(); return getTime(); } @@ -209,14 +209,14 @@ public void endCacheWriterCall(long start) { if (clock.isEnabled()) { stats.incLong(cacheWriterCallTimeId, getTime() - start); } - stats.incInt(cacheWriterCallsInProgressId, -1); - stats.incInt(cacheWriterCallsCompletedId, 1); + stats.incLong(cacheWriterCallsInProgressId, -1); + stats.incLong(cacheWriterCallsCompletedId, 1); cachePerfStats.endCacheWriterCall(start); } @Override public long startCacheListenerCall() { - stats.incInt(cacheListenerCallsInProgressId, 1); + stats.incLong(cacheListenerCallsInProgressId, 1); cachePerfStats.startCacheListenerCall(); return getTime(); } @@ -226,14 +226,14 @@ public void endCacheListenerCall(long start) { if (clock.isEnabled()) { stats.incLong(cacheListenerCallTimeId, getTime() - start); } - stats.incInt(cacheListenerCallsInProgressId, -1); - stats.incInt(cacheListenerCallsCompletedId, 1); + stats.incLong(cacheListenerCallsInProgressId, -1); + stats.incLong(cacheListenerCallsCompletedId, 1); cachePerfStats.endCacheListenerCall(start); } @Override public long startGetInitialImage() { - stats.incInt(getInitialImagesInProgressId, 1); + stats.incLong(getInitialImagesInProgressId, 1); cachePerfStats.startGetInitialImage(); return getTime(); } @@ -243,8 +243,8 @@ public void endGetInitialImage(long start) { if (clock.isEnabled()) { stats.incLong(getInitialImageTimeId, getTime() - start); } - stats.incInt(getInitialImagesInProgressId, -1); - stats.incInt(getInitialImagesCompletedId, 1); + stats.incLong(getInitialImagesInProgressId, -1); + stats.incLong(getInitialImagesCompletedId, 1); cachePerfStats.endGetInitialImage(start); } @@ -253,19 +253,19 @@ public void endNoGIIDone(long start) { if (clock.isEnabled()) { stats.incLong(getInitialImageTimeId, getTime() - start); } - stats.incInt(getInitialImagesInProgressId, -1); + stats.incLong(getInitialImagesInProgressId, -1); cachePerfStats.endNoGIIDone(start); } @Override public void incGetInitialImageKeysReceived() { - stats.incInt(getInitialImageKeysReceivedId, 1); + stats.incLong(getInitialImageKeysReceivedId, 1); cachePerfStats.incGetInitialImageKeysReceived(); } @Override public long startIndexUpdate() { - stats.incInt(indexUpdateInProgressId, 1); + stats.incLong(indexUpdateInProgressId, 1); cachePerfStats.startIndexUpdate(); return getTime(); } @@ -274,21 +274,21 @@ public long startIndexUpdate() { public void endIndexUpdate(long start) { long ts = getTime(); stats.incLong(indexUpdateTimeId, ts - start); - stats.incInt(indexUpdateInProgressId, -1); - stats.incInt(indexUpdateCompletedId, 1); + stats.incLong(indexUpdateInProgressId, -1); + stats.incLong(indexUpdateCompletedId, 1); cachePerfStats.endIndexUpdate(start); } @Override - public void incRegions(int inc) { - stats.incInt(regionsId, inc); + public void incRegions(long inc) { + stats.incLong(regionsId, inc); cachePerfStats.incRegions(inc); } @Override - public void incPartitionedRegions(int inc) { - stats.incInt(partitionedRegionsId, inc); + public void incPartitionedRegions(long inc) { + stats.incLong(partitionedRegionsId, inc); cachePerfStats.incPartitionedRegions(inc); } @@ -311,20 +311,20 @@ public void incInvalidates() { } @Override - public void incTombstoneCount(int amount) { - stats.incInt(tombstoneCountId, amount); + public void incTombstoneCount(long amount) { + stats.incLong(tombstoneCountId, amount); cachePerfStats.incTombstoneCount(amount); } @Override public void incTombstoneGCCount() { - stats.incInt(tombstoneGCCountId, 1); + stats.incLong(tombstoneGCCountId, 1); cachePerfStats.incTombstoneGCCount(); } @Override public void incClearTimeouts() { - stats.incInt(clearTimeoutsId, 1); + stats.incLong(clearTimeoutsId, 1); cachePerfStats.incClearTimeouts(); } @@ -379,7 +379,7 @@ public long endPut(long start, boolean isUpdate) { @Override public void endPutAll(long start) { - stats.incInt(putAllsId, 1); + stats.incLong(putAllsId, 1); if (clock.isEnabled()) { stats.incLong(putAllTimeId, getTime() - start); } @@ -388,7 +388,7 @@ public void endPutAll(long start) { @Override public void endQueryExecution(long executionTime) { - stats.incInt(queryExecutionsId, 1); + stats.incLong(queryExecutionsId, 1); if (clock.isEnabled()) { stats.incLong(queryExecutionTimeId, executionTime); } @@ -405,7 +405,7 @@ public void endQueryResultsHashCollisionProbe(long start) { @Override public void incQueryResultsHashCollisions() { - stats.incInt(queryResultsHashCollisionsId, 1); + stats.incLong(queryResultsHashCollisionsId, 1); cachePerfStats.incQueryResultsHashCollisions(); } @@ -416,41 +416,41 @@ public void incTxConflictCheckTime(long delta) { } @Override - public void txSuccess(long opTime, long txLifeTime, int txChanges) { - stats.incInt(txCommitsId, 1); - stats.incInt(txCommitChangesId, txChanges); + public void txSuccess(long opTime, long txLifeTime, long txChanges) { + stats.incLong(txCommitsId, 1); + stats.incLong(txCommitChangesId, txChanges); stats.incLong(txCommitTimeId, opTime); stats.incLong(txSuccessLifeTimeId, txLifeTime); cachePerfStats.txSuccess(opTime, txLifeTime, txChanges); } @Override - public void txFailure(long opTime, long txLifeTime, int txChanges) { - stats.incInt(txFailuresId, 1); - stats.incInt(txFailureChangesId, txChanges); + public void txFailure(long opTime, long txLifeTime, long txChanges) { + stats.incLong(txFailuresId, 1); + stats.incLong(txFailureChangesId, txChanges); stats.incLong(txFailureTimeId, opTime); stats.incLong(txFailedLifeTimeId, txLifeTime); cachePerfStats.txFailure(opTime, txLifeTime, txChanges); } @Override - public void txRollback(long opTime, long txLifeTime, int txChanges) { - stats.incInt(txRollbacksId, 1); - stats.incInt(txRollbackChangesId, txChanges); + public void txRollback(long opTime, long txLifeTime, long txChanges) { + stats.incLong(txRollbacksId, 1); + stats.incLong(txRollbackChangesId, txChanges); stats.incLong(txRollbackTimeId, opTime); stats.incLong(txRollbackLifeTimeId, txLifeTime); cachePerfStats.txRollback(opTime, txLifeTime, txChanges); } @Override - public void incEventQueueSize(int items) { - stats.incInt(eventQueueSizeId, items); + public void incEventQueueSize(long items) { + stats.incLong(eventQueueSizeId, items); cachePerfStats.incEventQueueSize(items); } @Override - public void incEventQueueThrottleCount(int items) { - stats.incInt(eventQueueThrottleCountId, items); + public void incEventQueueThrottleCount(long items) { + stats.incLong(eventQueueThrottleCountId, items); cachePerfStats.incEventQueueThrottleCount(items); } @@ -461,55 +461,55 @@ public void incEventQueueThrottleTime(long nanos) { } @Override - public void incEventThreads(int items) { - stats.incInt(eventThreadsId, items); + public void incEventThreads(long items) { + stats.incLong(eventThreadsId, items); cachePerfStats.incEventThreads(items); } @Override - public void incEntryCount(int delta) { + public void incEntryCount(long delta) { cachePerfStats.incEntryCount(delta); } @Override public void incRetries() { - stats.incInt(retriesId, 1); + stats.incLong(retriesId, 1); cachePerfStats.incRetries(); } @Override public void incDiskTasksWaiting() { - stats.incInt(diskTasksWaitingId, 1); + stats.incLong(diskTasksWaitingId, 1); cachePerfStats.incDiskTasksWaiting(); } @Override public void decDiskTasksWaiting() { - stats.incInt(diskTasksWaitingId, -1); + stats.incLong(diskTasksWaitingId, -1); cachePerfStats.decDiskTasksWaiting(); } @Override - public void decDiskTasksWaiting(int count) { - stats.incInt(diskTasksWaitingId, -count); + public void decDiskTasksWaiting(long count) { + stats.incLong(diskTasksWaitingId, -count); cachePerfStats.decDiskTasksWaiting(count); } @Override public void incEvictorJobsStarted() { - stats.incInt(evictorJobsStartedId, 1); + stats.incLong(evictorJobsStartedId, 1); cachePerfStats.incEvictorJobsStarted(); } @Override public void incEvictorJobsCompleted() { - stats.incInt(evictorJobsCompletedId, 1); + stats.incLong(evictorJobsCompletedId, 1); cachePerfStats.incEvictorJobsCompleted(); } @Override - public void incEvictorQueueSize(int delta) { - stats.incInt(evictorQueueSizeId, delta); + public void incEvictorQueueSize(long delta) { + stats.incLong(evictorQueueSizeId, delta); cachePerfStats.incEvictorQueueSize(delta); } diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/RegionStats.java b/geode-core/src/main/java/org/apache/geode/internal/cache/RegionStats.java index 2fe6cc14b81a..e5e76ad53ad7 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/RegionStats.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/RegionStats.java @@ -17,25 +17,25 @@ public interface RegionStats { - void incReliableQueuedOps(int inc); + void incReliableQueuedOps(long inc); - void incReliableQueueSize(int inc); + void incReliableQueueSize(long inc); - void incReliableQueueMax(int inc); + void incReliableQueueMax(long inc); - void incReliableRegions(int inc); + void incReliableRegions(long inc); - void incReliableRegionsMissing(int inc); + void incReliableRegionsMissing(long inc); - void incReliableRegionsQueuing(int inc); + void incReliableRegionsQueuing(long inc); - void incReliableRegionsMissingFullAccess(int inc); + void incReliableRegionsMissingFullAccess(long inc); - void incReliableRegionsMissingLimitedAccess(int inc); + void incReliableRegionsMissingLimitedAccess(long inc); - void incReliableRegionsMissingNoAccess(int inc); + void incReliableRegionsMissingNoAccess(long inc); - void incQueuedEvents(int inc); + void incQueuedEvents(long inc); long startLoad(); @@ -69,9 +69,9 @@ public interface RegionStats { void endIndexUpdate(long start); - void incRegions(int inc); + void incRegions(long inc); - void incPartitionedRegions(int inc); + void incPartitionedRegions(long inc); void incDestroys(); @@ -79,7 +79,7 @@ public interface RegionStats { void incInvalidates(); - void incTombstoneCount(int amount); + void incTombstoneCount(long amount); void incTombstoneGCCount(); @@ -103,21 +103,21 @@ public interface RegionStats { void incTxConflictCheckTime(long delta); - void txSuccess(long opTime, long txLifeTime, int txChanges); + void txSuccess(long opTime, long txLifeTime, long txChanges); - void txFailure(long opTime, long txLifeTime, int txChanges); + void txFailure(long opTime, long txLifeTime, long txChanges); - void txRollback(long opTime, long txLifeTime, int txChanges); + void txRollback(long opTime, long txLifeTime, long txChanges); - void incEventQueueSize(int items); + void incEventQueueSize(long items); - void incEventQueueThrottleCount(int items); + void incEventQueueThrottleCount(long items); void incEventQueueThrottleTime(long nanos); - void incEventThreads(int items); + void incEventThreads(long items); - void incEntryCount(int delta); + void incEntryCount(long delta); void incRetries(); @@ -125,13 +125,13 @@ public interface RegionStats { void decDiskTasksWaiting(); - void decDiskTasksWaiting(int count); + void decDiskTasksWaiting(long count); void incEvictorJobsStarted(); void incEvictorJobsCompleted(); - void incEvictorQueueSize(int delta); + void incEvictorQueueSize(long delta); void incEvictWorkTime(long delta); diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/control/ResourceManagerStats.java b/geode-core/src/main/java/org/apache/geode/internal/cache/control/ResourceManagerStats.java index 161a6ee09b32..3fcb17aac104 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/control/ResourceManagerStats.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/control/ResourceManagerStats.java @@ -84,13 +84,13 @@ public class ResourceManagerStats { StatisticsTypeFactory f = StatisticsTypeFactoryImpl.singleton(); type = f.createType("ResourceManagerStats", "Statistics about resource management", new StatisticDescriptor[] { - f.createIntGauge("rebalancesInProgress", + f.createLongGauge("rebalancesInProgress", "Current number of cache rebalance operations being directed by this process.", "operations"), - f.createIntCounter("rebalancesCompleted", + f.createLongCounter("rebalancesCompleted", "Total number of cache rebalance operations directed by this process.", "operations"), - f.createIntCounter("autoRebalanceAttempts", + f.createLongCounter("autoRebalanceAttempts", "Total number of cache auto-rebalance attempts.", "operations"), f.createLongCounter("rebalanceTime", "Total time spent directing cache rebalance operations.", "nanoseconds", false), @@ -105,12 +105,12 @@ public class ResourceManagerStats { "Total time spent directing cache restore redundancy operations.", "nanoseconds", false), - f.createIntGauge("rebalanceBucketCreatesInProgress", + f.createLongGauge("rebalanceBucketCreatesInProgress", "Current number of bucket create operations being directed for rebalancing.", "operations"), - f.createIntCounter("rebalanceBucketCreatesCompleted", + f.createLongCounter("rebalanceBucketCreatesCompleted", "Total number of bucket create operations directed for rebalancing.", "operations"), - f.createIntCounter("rebalanceBucketCreatesFailed", + f.createLongCounter("rebalanceBucketCreatesFailed", "Total number of bucket create operations directed for rebalancing that failed.", "operations"), f.createLongCounter("rebalanceBucketCreateTime", @@ -120,12 +120,12 @@ public class ResourceManagerStats { "Total bytes created while directing bucket create operations for rebalancing.", "bytes", false), - f.createIntGauge("rebalanceBucketRemovesInProgress", + f.createLongGauge("rebalanceBucketRemovesInProgress", "Current number of bucket remove operations being directed for rebalancing.", "operations"), - f.createIntCounter("rebalanceBucketRemovesCompleted", + f.createLongCounter("rebalanceBucketRemovesCompleted", "Total number of bucket remove operations directed for rebalancing.", "operations"), - f.createIntCounter("rebalanceBucketRemovesFailed", + f.createLongCounter("rebalanceBucketRemovesFailed", "Total number of bucket remove operations directed for rebalancing that failed.", "operations"), f.createLongCounter("rebalanceBucketRemovesTime", @@ -136,13 +136,13 @@ public class ResourceManagerStats { "bytes", false), - f.createIntGauge("rebalanceBucketTransfersInProgress", + f.createLongGauge("rebalanceBucketTransfersInProgress", "Current number of bucket transfer operations being directed for rebalancing.", "operations"), - f.createIntCounter("rebalanceBucketTransfersCompleted", + f.createLongCounter("rebalanceBucketTransfersCompleted", "Total number of bucket transfer operations directed for rebalancing.", "operations"), - f.createIntCounter("rebalanceBucketTransfersFailed", + f.createLongCounter("rebalanceBucketTransfersFailed", "Total number of bucket transfer operations directed for rebalancing that failed.", "operations"), f.createLongCounter("rebalanceBucketTransfersTime", @@ -152,36 +152,36 @@ public class ResourceManagerStats { "Total bytes transfered while directing bucket transfer operations for rebalancing.", "bytes", false), - f.createIntGauge("rebalancePrimaryTransfersInProgress", + f.createLongGauge("rebalancePrimaryTransfersInProgress", "Current number of primary transfer operations being directed for rebalancing.", "operations"), - f.createIntCounter("rebalancePrimaryTransfersCompleted", + f.createLongCounter("rebalancePrimaryTransfersCompleted", "Total number of primary transfer operations directed for rebalancing.", "operations"), - f.createIntCounter("rebalancePrimaryTransfersFailed", + f.createLongCounter("rebalancePrimaryTransfersFailed", "Total number of primary transfer operations directed for rebalancing that failed.", "operations"), f.createLongCounter("rebalancePrimaryTransferTime", "Total time spent directing primary transfer operations for rebalancing.", "nanoseconds", false), - f.createIntCounter("rebalanceMembershipChanges", + f.createLongCounter("rebalanceMembershipChanges", "The number of times that membership has changed during a rebalance", "events"), - f.createIntGauge("heapCriticalEvents", + f.createLongGauge("heapCriticalEvents", "Total number of times the heap usage went over critical threshold.", "events"), - f.createIntGauge("offHeapCriticalEvents", + f.createLongGauge("offHeapCriticalEvents", "Total number of times off-heap usage went over critical threshold.", "events"), - f.createIntGauge("heapSafeEvents", + f.createLongGauge("heapSafeEvents", "Total number of times the heap usage fell below critical threshold.", "events"), - f.createIntGauge("offHeapSafeEvents", + f.createLongGauge("offHeapSafeEvents", "Total number of times off-heap usage fell below critical threshold.", "events"), - f.createIntGauge("evictionStartEvents", + f.createLongGauge("evictionStartEvents", "Total number of times heap usage went over eviction threshold.", "events"), - f.createIntGauge("offHeapEvictionStartEvents", + f.createLongGauge("offHeapEvictionStartEvents", "Total number of times off-heap usage went over eviction threshold.", "events"), - f.createIntGauge("evictionStopEvents", + f.createLongGauge("evictionStopEvents", "Total number of times heap usage fell below eviction threshold.", "events"), - f.createIntGauge("offHeapEvictionStopEvents", + f.createLongGauge("offHeapEvictionStopEvents", "Total number of times off-heap usage fell below eviction threshold.", "events"), f.createLongGauge("criticalThreshold", "The currently set heap critical threshold value in bytes", "bytes"), @@ -193,14 +193,14 @@ public class ResourceManagerStats { "The currently set off-heap eviction threshold value in bytes", "bytes"), f.createLongGauge("tenuredHeapUsed", "Total memory used in the tenured/old space", "bytes"), - f.createIntCounter("resourceEventsDelivered", + f.createLongCounter("resourceEventsDelivered", "Total number of resource events delivered to listeners", "events"), - f.createIntGauge("resourceEventQueueSize", + f.createLongGauge("resourceEventQueueSize", "Pending events for thresholdEventProcessor thread", "events"), - f.createIntGauge("thresholdEventProcessorThreadJobs", + f.createLongGauge("thresholdEventProcessorThreadJobs", "Number of jobs currently being processed by the thresholdEventProcessorThread", "jobs"), - f.createIntGauge("numThreadsStuck", + f.createLongGauge("numThreadsStuck", "Number of running threads that have not changed state within the thread-monitor-time-limit-ms interval.", "stuck Threads")}); @@ -261,110 +261,110 @@ public void close() { } public long startRebalance() { - this.stats.incInt(rebalancesInProgressId, 1); + this.stats.incLong(rebalancesInProgressId, 1L); return System.nanoTime(); } public void incAutoRebalanceAttempts() { - this.stats.incInt(autoRebalanceAttemptsId, 1); + this.stats.incLong(autoRebalanceAttemptsId, 1L); } public void endRebalance(long start) { long elapsed = System.nanoTime() - start; - this.stats.incInt(rebalancesInProgressId, -1); - this.stats.incInt(rebalancesCompletedId, 1); + this.stats.incLong(rebalancesInProgressId, -1L); + this.stats.incLong(rebalancesCompletedId, 1L); this.stats.incLong(rebalanceTimeId, elapsed); } public long startRestoreRedundancy() { - this.stats.incLong(restoreRedundanciesInProgressId, 1); + this.stats.incLong(restoreRedundanciesInProgressId, 1L); return System.nanoTime(); } public void endRestoreRedundancy(long start) { long elapsed = System.nanoTime() - start; - this.stats.incLong(restoreRedundanciesInProgressId, -1); - this.stats.incLong(restoreRedundanciesCompletedId, 1); + this.stats.incLong(restoreRedundanciesInProgressId, -1L); + this.stats.incLong(restoreRedundanciesCompletedId, 1L); this.stats.incLong(restoreRedundancyTimeId, elapsed); } public void startBucketCreate(int regions) { - this.stats.incInt(rebalanceBucketCreatesInProgressId, regions); + this.stats.incLong(rebalanceBucketCreatesInProgressId, regions); } public void endBucketCreate(int regions, boolean success, long bytes, long elapsed) { - this.stats.incInt(rebalanceBucketCreatesInProgressId, -regions); + this.stats.incLong(rebalanceBucketCreatesInProgressId, -regions); this.stats.incLong(rebalanceBucketCreateTimeId, elapsed); if (success) { - this.stats.incInt(rebalanceBucketCreatesCompletedId, regions); + this.stats.incLong(rebalanceBucketCreatesCompletedId, regions); this.stats.incLong(rebalanceBucketCreateBytesId, bytes); } else { - this.stats.incInt(rebalanceBucketCreatesFailedId, regions); + this.stats.incLong(rebalanceBucketCreatesFailedId, regions); } } public void startBucketRemove(int regions) { - this.stats.incInt(rebalanceBucketRemovesInProgressId, regions); + this.stats.incLong(rebalanceBucketRemovesInProgressId, regions); } public void endBucketRemove(int regions, boolean success, long bytes, long elapsed) { - this.stats.incInt(rebalanceBucketRemovesInProgressId, -regions); + this.stats.incLong(rebalanceBucketRemovesInProgressId, -regions); this.stats.incLong(rebalanceBucketRemovesTimeId, elapsed); if (success) { - this.stats.incInt(rebalanceBucketRemovesCompletedId, regions); + this.stats.incLong(rebalanceBucketRemovesCompletedId, regions); this.stats.incLong(rebalanceBucketRemovesBytesId, bytes); } else { - this.stats.incInt(rebalanceBucketRemovesFailedId, regions); + this.stats.incLong(rebalanceBucketRemovesFailedId, regions); } } public void startBucketTransfer(int regions) { - this.stats.incInt(rebalanceBucketTransfersInProgressId, regions); + this.stats.incLong(rebalanceBucketTransfersInProgressId, regions); } public void endBucketTransfer(int regions, boolean success, long bytes, long elapsed) { - this.stats.incInt(rebalanceBucketTransfersInProgressId, -regions); + this.stats.incLong(rebalanceBucketTransfersInProgressId, -regions); this.stats.incLong(rebalanceBucketTransfersTimeId, elapsed); if (success) { - this.stats.incInt(rebalanceBucketTransfersCompletedId, regions); + this.stats.incLong(rebalanceBucketTransfersCompletedId, regions); this.stats.incLong(rebalanceBucketTransfersBytesId, bytes); } else { - this.stats.incInt(rebalanceBucketTransfersFailedId, regions); + this.stats.incLong(rebalanceBucketTransfersFailedId, regions); } } public void startPrimaryTransfer(int regions) { - this.stats.incInt(rebalancePrimaryTransfersInProgressId, regions); + this.stats.incLong(rebalancePrimaryTransfersInProgressId, regions); } public void endPrimaryTransfer(int regions, boolean success, long elapsed) { - this.stats.incInt(rebalancePrimaryTransfersInProgressId, -regions); + this.stats.incLong(rebalancePrimaryTransfersInProgressId, -regions); this.stats.incLong(rebalancePrimaryTransferTimeId, elapsed); if (success) { - this.stats.incInt(rebalancePrimaryTransfersCompletedId, regions); + this.stats.incLong(rebalancePrimaryTransfersCompletedId, regions); } else { - this.stats.incInt(rebalancePrimaryTransfersFailedId, regions); + this.stats.incLong(rebalancePrimaryTransfersFailedId, regions); } } - public void incRebalanceMembershipChanges(int delta) { - this.stats.incInt(rebalanceMembershipChanges, 1); + public void incRebalanceMembershipChanges(long delta) { + this.stats.incLong(rebalanceMembershipChanges, 1L); } - public int getRebalanceMembershipChanges() { - return this.stats.getInt(rebalanceMembershipChanges); + public long getRebalanceMembershipChanges() { + return this.stats.getLong(rebalanceMembershipChanges); } - public int getRebalancesInProgress() { - return this.stats.getInt(rebalancesInProgressId); + public long getRebalancesInProgress() { + return this.stats.getLong(rebalancesInProgressId); } - public int getRebalancesCompleted() { - return this.stats.getInt(rebalancesCompletedId); + public long getRebalancesCompleted() { + return this.stats.getLong(rebalancesCompletedId); } - public int getAutoRebalanceAttempts() { - return this.stats.getInt(autoRebalanceAttemptsId); + public long getAutoRebalanceAttempts() { + return this.stats.getLong(autoRebalanceAttemptsId); } public long getRebalanceTime() { @@ -383,16 +383,16 @@ public long getRestoreRedundancyTime() { return this.stats.getLong(restoreRedundancyTimeId); } - public int getRebalanceBucketCreatesInProgress() { - return this.stats.getInt(rebalanceBucketCreatesInProgressId); + public long getRebalanceBucketCreatesInProgress() { + return this.stats.getLong(rebalanceBucketCreatesInProgressId); } - public int getRebalanceBucketCreatesCompleted() { - return this.stats.getInt(rebalanceBucketCreatesCompletedId); + public long getRebalanceBucketCreatesCompleted() { + return this.stats.getLong(rebalanceBucketCreatesCompletedId); } - public int getRebalanceBucketCreatesFailed() { - return this.stats.getInt(rebalanceBucketCreatesFailedId); + public long getRebalanceBucketCreatesFailed() { + return this.stats.getLong(rebalanceBucketCreatesFailedId); } public long getRebalanceBucketCreateTime() { @@ -403,16 +403,16 @@ public long getRebalanceBucketCreateBytes() { return this.stats.getLong(rebalanceBucketCreateBytesId); } - public int getRebalanceBucketTransfersInProgress() { - return this.stats.getInt(rebalanceBucketTransfersInProgressId); + public long getRebalanceBucketTransfersInProgress() { + return this.stats.getLong(rebalanceBucketTransfersInProgressId); } - public int getRebalanceBucketTransfersCompleted() { - return this.stats.getInt(rebalanceBucketTransfersCompletedId); + public long getRebalanceBucketTransfersCompleted() { + return this.stats.getLong(rebalanceBucketTransfersCompletedId); } - public int getRebalanceBucketTransfersFailed() { - return this.stats.getInt(rebalanceBucketTransfersFailedId); + public long getRebalanceBucketTransfersFailed() { + return this.stats.getLong(rebalanceBucketTransfersFailedId); } public long getRebalanceBucketTransfersTime() { @@ -423,16 +423,16 @@ public long getRebalanceBucketTransfersBytes() { return this.stats.getLong(rebalanceBucketTransfersBytesId); } - public int getRebalancePrimaryTransfersInProgress() { - return this.stats.getInt(rebalancePrimaryTransfersInProgressId); + public long getRebalancePrimaryTransfersInProgress() { + return this.stats.getLong(rebalancePrimaryTransfersInProgressId); } - public int getRebalancePrimaryTransfersCompleted() { - return this.stats.getInt(rebalancePrimaryTransfersCompletedId); + public long getRebalancePrimaryTransfersCompleted() { + return this.stats.getLong(rebalancePrimaryTransfersCompletedId); } - public int getRebalancePrimaryTransfersFailed() { - return this.stats.getInt(rebalancePrimaryTransfersFailedId); + public long getRebalancePrimaryTransfersFailed() { + return this.stats.getLong(rebalancePrimaryTransfersFailedId); } public long getRebalancePrimaryTransferTime() { @@ -440,75 +440,75 @@ public long getRebalancePrimaryTransferTime() { } public void incResourceEventsDelivered() { - this.stats.incInt(resourceEventsDeliveredId, 1); + this.stats.incLong(resourceEventsDeliveredId, 1L); } - public int getResourceEventsDelivered() { - return this.stats.getInt(resourceEventsDeliveredId); + public long getResourceEventsDelivered() { + return this.stats.getLong(resourceEventsDeliveredId); } public void incHeapCriticalEvents() { - this.stats.incInt(heapCriticalEventsId, 1); + this.stats.incLong(heapCriticalEventsId, 1L); } - public int getHeapCriticalEvents() { - return this.stats.getInt(heapCriticalEventsId); + public long getHeapCriticalEvents() { + return this.stats.getLong(heapCriticalEventsId); } public void incOffHeapCriticalEvents() { - this.stats.incInt(offHeapCriticalEventsId, 1); + this.stats.incLong(offHeapCriticalEventsId, 1L); } - public int getOffHeapCriticalEvents() { - return this.stats.getInt(offHeapCriticalEventsId); + public long getOffHeapCriticalEvents() { + return this.stats.getLong(offHeapCriticalEventsId); } public void incHeapSafeEvents() { - this.stats.incInt(heapSafeEventsId, 1); + this.stats.incLong(heapSafeEventsId, 1L); } - public int getHeapSafeEvents() { - return this.stats.getInt(heapSafeEventsId); + public long getHeapSafeEvents() { + return this.stats.getLong(heapSafeEventsId); } public void incOffHeapSafeEvents() { - this.stats.incInt(offHeapSafeEventsId, 1); + this.stats.incLong(offHeapSafeEventsId, 1L); } - public int getOffHeapSafeEvents() { - return this.stats.getInt(offHeapSafeEventsId); + public long getOffHeapSafeEvents() { + return this.stats.getLong(offHeapSafeEventsId); } public void incEvictionStartEvents() { - this.stats.incInt(evictionStartEventsId, 1); + this.stats.incLong(evictionStartEventsId, 1L); } - public int getEvictionStartEvents() { - return this.stats.getInt(evictionStartEventsId); + public long getEvictionStartEvents() { + return this.stats.getLong(evictionStartEventsId); } public void incOffHeapEvictionStartEvents() { - this.stats.incInt(offHeapEvictionStartEventsId, 1); + this.stats.incLong(offHeapEvictionStartEventsId, 1L); } - public int getOffHeapEvictionStartEvents() { - return this.stats.getInt(offHeapEvictionStartEventsId); + public long getOffHeapEvictionStartEvents() { + return this.stats.getLong(offHeapEvictionStartEventsId); } public void incEvictionStopEvents() { - this.stats.incInt(evictionStopEventsId, 1); + this.stats.incLong(evictionStopEventsId, 1L); } - public int getEvictionStopEvents() { - return this.stats.getInt(evictionStopEventsId); + public long getEvictionStopEvents() { + return this.stats.getLong(evictionStopEventsId); } public void incOffHeapEvictionStopEvents() { - this.stats.incInt(offHeapEvictionStopEventsId, 1); + this.stats.incLong(offHeapEvictionStopEventsId, 1L); } - public int getOffHeapEvictionStopEvents() { - return this.stats.getInt(offHeapEvictionStopEventsId); + public long getOffHeapEvictionStopEvents() { + return this.stats.getLong(offHeapEvictionStopEventsId); } public void changeCriticalThreshold(long newValue) { @@ -551,20 +551,20 @@ public long getTenuredHeapUsed() { return this.stats.getLong(tenuredHeapUsageId); } - public void incResourceEventQueueSize(int delta) { - this.stats.incInt(resourceEventQueueSizeId, delta); + public void incResourceEventQueueSize(long delta) { + this.stats.incLong(resourceEventQueueSizeId, delta); } - public int getResourceEventQueueSize() { - return this.stats.getInt(resourceEventQueueSizeId); + public long getResourceEventQueueSize() { + return this.stats.getLong(resourceEventQueueSizeId); } - public void incThresholdEventProcessorThreadJobs(int delta) { - this.stats.incInt(thresholdEventProcessorThreadJobsId, delta); + public void incThresholdEventProcessorThreadJobs(long delta) { + this.stats.incLong(thresholdEventProcessorThreadJobsId, delta); } - public int getThresholdEventProcessorThreadJobs() { - return this.stats.getInt(thresholdEventProcessorThreadJobsId); + public long getThresholdEventProcessorThreadJobs() { + return this.stats.getLong(thresholdEventProcessorThreadJobsId); } /** @@ -575,16 +575,16 @@ public QueueStatHelper getResourceEventQueueStatHelper() { return new QueueStatHelper() { @Override public void add() { - incResourceEventQueueSize(1); + incResourceEventQueueSize(1L); } @Override public void remove() { - incResourceEventQueueSize(-1); + incResourceEventQueueSize(-1L); } @Override - public void remove(int count) { + public void remove(long count) { incResourceEventQueueSize(-1 * count); } }; @@ -594,12 +594,12 @@ public PoolStatHelper getResourceEventPoolStatHelper() { return new PoolStatHelper() { @Override public void endJob() { - incThresholdEventProcessorThreadJobs(-1); + incThresholdEventProcessorThreadJobs(-1L); } @Override public void startJob() { - incThresholdEventProcessorThreadJobs(1); + incThresholdEventProcessorThreadJobs(1L); } }; } @@ -607,14 +607,14 @@ public void startJob() { /** * Returns the value of ThreadStuck (how many (if at all) stuck threads are in the system) */ - public int getNumThreadStuck() { - return this.stats.getInt(numThreadsStuckId); + public long getNumThreadStuck() { + return this.stats.getLong(numThreadsStuckId); } /** * Sets the value of Thread Stuck */ - public void setNumThreadStuck(int value) { - this.stats.setInt(numThreadsStuckId, value); + public void setNumThreadStuck(long value) { + this.stats.setLong(numThreadsStuckId, value); } } diff --git a/geode-core/src/main/java/org/apache/geode/internal/statistics/StatisticsImpl.java b/geode-core/src/main/java/org/apache/geode/internal/statistics/StatisticsImpl.java index 99bf5b4ba8a7..a524ca33b856 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/statistics/StatisticsImpl.java +++ b/geode-core/src/main/java/org/apache/geode/internal/statistics/StatisticsImpl.java @@ -110,7 +110,7 @@ static Statistics createAtomicNoOS(StatisticsType type, String textId, long nume StatisticsImpl(StatisticsType type, String textId, long numericId, long uniqueId, int osStatFlags, StatisticsManager statisticsManager) { this(type, textId, numericId, uniqueId, osStatFlags, statisticsManager, - (message, textId1, statId, throwable) -> logger.warn(message, textId1, statId, throwable)); + logger::warn); } /** @@ -444,15 +444,13 @@ public boolean equals(Object obj) { @Override public String toString() { - final StringBuilder sb = new StringBuilder(getClass().getName()); - sb.append("@").append(System.identityHashCode(this)).append("{"); - sb.append("uniqueId=").append(uniqueId); - sb.append(", numericId=").append(numericId); - sb.append(", textId=").append(textId); - sb.append(", type=").append(type.getName()); - sb.append(", closed=").append(closed); - sb.append("}"); - return sb.toString(); + return getClass().getName() + "@" + System.identityHashCode(this) + "{" + + "uniqueId=" + uniqueId + + ", numericId=" + numericId + + ", textId=" + textId + + ", type=" + type.getName() + + ", closed=" + closed + + "}"; } @Override diff --git a/geode-core/src/main/java/org/apache/geode/internal/tcp/ConnectionTable.java b/geode-core/src/main/java/org/apache/geode/internal/tcp/ConnectionTable.java index 614b50263a0f..f0c0792e2ce0 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/tcp/ConnectionTable.java +++ b/geode-core/src/main/java/org/apache/geode/internal/tcp/ConnectionTable.java @@ -926,7 +926,7 @@ void removeSharedConnection(String reason, DistributedMember stub, boolean order } @VisibleForTesting - public static int getNumSenderSharedConnections() { + public static long getNumSenderSharedConnections() { ConnectionTable ct = (ConnectionTable) lastInstance.get(); if (ct == null) { return 0; 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 fe03c3e209db..993c617f7ec8 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 @@ -1392,7 +1392,7 @@ public String getRedundancyZone() { } int getRebalancesInProgress() { - return resourceManagerStats.getRebalancesInProgress(); + return (int) resourceManagerStats.getRebalancesInProgress(); } public int getReplyWaitsInProgress() { diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/DistributionStatsTest.java b/geode-core/src/test/java/org/apache/geode/distributed/internal/DistributionStatsTest.java index e47516dae1bb..0a5e9ef9d4ad 100644 --- a/geode-core/src/test/java/org/apache/geode/distributed/internal/DistributionStatsTest.java +++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/DistributionStatsTest.java @@ -64,7 +64,7 @@ public void incSerialQueueBytes() { distributionStats.incSerialQueueBytes(50000000); distributionStats.incSerialQueueBytes(20000000); assertThat(distributionStats.getInternalSerialQueueBytes()).isEqualTo(70000000); - verify(mockStats).incInt(DistributionStats.serialQueueBytesId, 50000000); - verify(mockStats).incInt(DistributionStats.serialQueueBytesId, 20000000); + verify(mockStats).incLong(DistributionStats.serialQueueBytesId, 50000000); + verify(mockStats).incLong(DistributionStats.serialQueueBytesId, 20000000); } } 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 7a81fdd5598f..673e7fe97071 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 @@ -256,9 +256,9 @@ public void createsWrapsFromMaxLongToNegativeValue() { @Test public void getPutAllsDelegatesToStatistics() { - statistics.incInt(putAllsId, Integer.MAX_VALUE); + statistics.incLong(putAllsId, Long.MAX_VALUE); - assertThat(cachePerfStats.getPutAlls()).isEqualTo(Integer.MAX_VALUE); + assertThat(cachePerfStats.getPutAlls()).isEqualTo(Long.MAX_VALUE); } /** @@ -269,7 +269,7 @@ public void getPutAllsDelegatesToStatistics() { public void endPutAllIncrementsPutAlls() { cachePerfStats.endPutAll(0); - assertThat(statistics.getInt(putAllsId)).isEqualTo(1); + assertThat(statistics.getLong(putAllsId)).isEqualTo(1); } /** @@ -277,7 +277,7 @@ public void endPutAllIncrementsPutAlls() { */ @Test public void putAllsWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(putAllsId, Integer.MAX_VALUE); + statistics.incLong(putAllsId, Long.MAX_VALUE); cachePerfStats.endPutAll(0); @@ -286,9 +286,9 @@ public void putAllsWrapsFromMaxIntegerToNegativeValue() { @Test public void getRemoveAllsDelegatesToStatistics() { - statistics.incInt(removeAllsId, Integer.MAX_VALUE); + statistics.incLong(removeAllsId, Long.MAX_VALUE); - assertThat(cachePerfStats.getRemoveAlls()).isEqualTo(Integer.MAX_VALUE); + assertThat(cachePerfStats.getRemoveAlls()).isEqualTo(Long.MAX_VALUE); } /** @@ -299,7 +299,7 @@ public void getRemoveAllsDelegatesToStatistics() { public void endRemoveAllIncrementsRemoveAll() { cachePerfStats.endRemoveAll(0); - assertThat(statistics.getInt(removeAllsId)).isEqualTo(1); + assertThat(statistics.getLong(removeAllsId)).isEqualTo(1); } /** @@ -307,7 +307,7 @@ public void endRemoveAllIncrementsRemoveAll() { */ @Test public void removeAllsWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(removeAllsId, Integer.MAX_VALUE); + statistics.incLong(removeAllsId, Long.MAX_VALUE); cachePerfStats.endRemoveAll(0); @@ -402,16 +402,16 @@ public void missesWrapsFromMaxLongToNegativeValue() { @Test public void getRetriesDelegatesToStatistics() { - statistics.incInt(retriesId, Integer.MAX_VALUE); + statistics.incLong(retriesId, Long.MAX_VALUE); - assertThat(cachePerfStats.getRetries()).isEqualTo(Integer.MAX_VALUE); + assertThat(cachePerfStats.getRetries()).isEqualTo(Long.MAX_VALUE); } @Test public void incRetriesIncrementsRetries() { cachePerfStats.incRetries(); - assertThat(statistics.getInt(retriesId)).isEqualTo(1); + assertThat(statistics.getLong(retriesId)).isEqualTo(1); } /** @@ -419,7 +419,7 @@ public void incRetriesIncrementsRetries() { */ @Test public void retriesWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(retriesId, Integer.MAX_VALUE); + statistics.incLong(retriesId, Long.MAX_VALUE); cachePerfStats.incRetries(); @@ -433,6 +433,8 @@ public void getClearsDelegatesToStatistics() { assertThat(cachePerfStats.getClearCount()).isEqualTo(Long.MAX_VALUE); } + + @Test public void incClearCountIncrementsClears() { cachePerfStats.incClearCount(); @@ -454,9 +456,9 @@ public void clearsWrapsFromMaxLongToNegativeValue() { @Test public void getLoadsCompletedDelegatesToStatistics() { - statistics.incInt(loadsCompletedId, Integer.MAX_VALUE); + statistics.incLong(loadsCompletedId, Long.MAX_VALUE); - assertThat(cachePerfStats.getLoadsCompleted()).isEqualTo(Integer.MAX_VALUE); + assertThat(cachePerfStats.getLoadsCompleted()).isEqualTo(Long.MAX_VALUE); } /** @@ -467,7 +469,7 @@ public void getLoadsCompletedDelegatesToStatistics() { public void endLoadIncrementsMisses() { cachePerfStats.endLoad(0); - assertThat(statistics.getInt(loadsCompletedId)).isEqualTo(1); + assertThat(statistics.getLong(loadsCompletedId)).isEqualTo(1); } /** @@ -475,7 +477,7 @@ public void endLoadIncrementsMisses() { */ @Test public void loadsCompletedWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(loadsCompletedId, Integer.MAX_VALUE); + statistics.incLong(loadsCompletedId, Long.MAX_VALUE); cachePerfStats.endLoad(0); @@ -484,9 +486,9 @@ public void loadsCompletedWrapsFromMaxIntegerToNegativeValue() { @Test public void getNetloadsCompletedDelegatesToStatistics() { - statistics.incInt(netloadsCompletedId, Integer.MAX_VALUE); + statistics.incLong(netloadsCompletedId, Long.MAX_VALUE); - assertThat(cachePerfStats.getNetloadsCompleted()).isEqualTo(Integer.MAX_VALUE); + assertThat(cachePerfStats.getNetloadsCompleted()).isEqualTo(Long.MAX_VALUE); } /** @@ -497,7 +499,7 @@ public void getNetloadsCompletedDelegatesToStatistics() { public void endNetloadIncrementsNetloadsCompleted() { cachePerfStats.endNetload(0); - assertThat(statistics.getInt(netloadsCompletedId)).isEqualTo(1); + assertThat(statistics.getLong(netloadsCompletedId)).isEqualTo(1); } /** @@ -506,7 +508,7 @@ public void endNetloadIncrementsNetloadsCompleted() { */ @Test public void netloadsCompletedWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(netloadsCompletedId, Integer.MAX_VALUE); + statistics.incLong(netloadsCompletedId, Long.MAX_VALUE); cachePerfStats.endNetload(0); @@ -515,9 +517,9 @@ public void netloadsCompletedWrapsFromMaxIntegerToNegativeValue() { @Test public void getNetsearchesCompletedDelegatesToStatistics() { - statistics.incInt(netsearchesCompletedId, Integer.MAX_VALUE); + statistics.incLong(netsearchesCompletedId, Long.MAX_VALUE); - assertThat(cachePerfStats.getNetsearchesCompleted()).isEqualTo(Integer.MAX_VALUE); + assertThat(cachePerfStats.getNetsearchesCompleted()).isEqualTo(Long.MAX_VALUE); } /** @@ -528,7 +530,7 @@ public void getNetsearchesCompletedDelegatesToStatistics() { public void endLoadIncrementsNetsearchesCompleted() { cachePerfStats.endNetsearch(0); - assertThat(statistics.getInt(netsearchesCompletedId)).isEqualTo(1); + assertThat(statistics.getLong(netsearchesCompletedId)).isEqualTo(1); } /** @@ -537,7 +539,7 @@ public void endLoadIncrementsNetsearchesCompleted() { */ @Test public void netsearchesCompletedWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(netsearchesCompletedId, Integer.MAX_VALUE); + statistics.incLong(netsearchesCompletedId, Long.MAX_VALUE); cachePerfStats.endNetsearch(0); @@ -546,9 +548,9 @@ public void netsearchesCompletedWrapsFromMaxIntegerToNegativeValue() { @Test public void getCacheWriterCallsCompletedDelegatesToStatistics() { - statistics.incInt(cacheWriterCallsCompletedId, Integer.MAX_VALUE); + statistics.incLong(cacheWriterCallsCompletedId, Long.MAX_VALUE); - assertThat(cachePerfStats.getCacheWriterCallsCompleted()).isEqualTo(Integer.MAX_VALUE); + assertThat(cachePerfStats.getCacheWriterCallsCompleted()).isEqualTo(Long.MAX_VALUE); } /** @@ -559,7 +561,7 @@ public void getCacheWriterCallsCompletedDelegatesToStatistics() { public void endCacheWriterCallIncrementsCacheWriterCallsCompleted() { cachePerfStats.endCacheWriterCall(0); - assertThat(statistics.getInt(cacheWriterCallsCompletedId)).isEqualTo(1); + assertThat(statistics.getLong(cacheWriterCallsCompletedId)).isEqualTo(1); } /** @@ -568,7 +570,7 @@ public void endCacheWriterCallIncrementsCacheWriterCallsCompleted() { */ @Test public void cacheWriterCallsCompletedWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(cacheWriterCallsCompletedId, Integer.MAX_VALUE); + statistics.incLong(cacheWriterCallsCompletedId, Long.MAX_VALUE); cachePerfStats.endCacheWriterCall(0); @@ -577,9 +579,9 @@ public void cacheWriterCallsCompletedWrapsFromMaxIntegerToNegativeValue() { @Test public void getCacheListenerCallsCompletedDelegatesToStatistics() { - statistics.incInt(cacheListenerCallsCompletedId, Integer.MAX_VALUE); + statistics.incLong(cacheListenerCallsCompletedId, Long.MAX_VALUE); - assertThat(cachePerfStats.getCacheListenerCallsCompleted()).isEqualTo(Integer.MAX_VALUE); + assertThat(cachePerfStats.getCacheListenerCallsCompleted()).isEqualTo(Long.MAX_VALUE); } /** @@ -590,7 +592,7 @@ public void getCacheListenerCallsCompletedDelegatesToStatistics() { public void endCacheWriterCallIncrementsCacheListenerCallsCompleted() { cachePerfStats.endCacheListenerCall(0); - assertThat(statistics.getInt(cacheListenerCallsCompletedId)).isEqualTo(1); + assertThat(statistics.getLong(cacheListenerCallsCompletedId)).isEqualTo(1); } /** @@ -599,7 +601,7 @@ public void endCacheWriterCallIncrementsCacheListenerCallsCompleted() { */ @Test public void cacheListenerCallsCompletedWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(cacheListenerCallsCompletedId, Integer.MAX_VALUE); + statistics.incLong(cacheListenerCallsCompletedId, Long.MAX_VALUE); cachePerfStats.endCacheListenerCall(0); @@ -608,9 +610,9 @@ public void cacheListenerCallsCompletedWrapsFromMaxIntegerToNegativeValue() { @Test public void getGetInitialImagesCompletedDelegatesToStatistics() { - statistics.incInt(getInitialImagesCompletedId, Integer.MAX_VALUE); + statistics.incLong(getInitialImagesCompletedId, Long.MAX_VALUE); - assertThat(cachePerfStats.getGetInitialImagesCompleted()).isEqualTo(Integer.MAX_VALUE); + assertThat(cachePerfStats.getGetInitialImagesCompleted()).isEqualTo(Long.MAX_VALUE); } /** @@ -621,7 +623,7 @@ public void getGetInitialImagesCompletedDelegatesToStatistics() { public void endCacheWriterCallIncrementsGetInitialImagesCompleted() { cachePerfStats.endGetInitialImage(0); - assertThat(statistics.getInt(getInitialImagesCompletedId)).isEqualTo(1); + assertThat(statistics.getLong(getInitialImagesCompletedId)).isEqualTo(1); } /** @@ -630,7 +632,7 @@ public void endCacheWriterCallIncrementsGetInitialImagesCompleted() { */ @Test public void getInitialImagesCompletedCallsCompletedWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(getInitialImagesCompletedId, Integer.MAX_VALUE); + statistics.incLong(getInitialImagesCompletedId, Long.MAX_VALUE); cachePerfStats.endGetInitialImage(0); @@ -639,16 +641,16 @@ public void getInitialImagesCompletedCallsCompletedWrapsFromMaxIntegerToNegative @Test public void getDeltaGetInitialImagesCompletedDelegatesToStatistics() { - statistics.incInt(deltaGetInitialImagesCompletedId, Integer.MAX_VALUE); + statistics.incLong(deltaGetInitialImagesCompletedId, Long.MAX_VALUE); - assertThat(cachePerfStats.getDeltaGetInitialImagesCompleted()).isEqualTo(Integer.MAX_VALUE); + assertThat(cachePerfStats.getDeltaGetInitialImagesCompleted()).isEqualTo(Long.MAX_VALUE); } @Test public void incDeltaGIICompletedIncrementsDeltaGetInitialImagesCompleted() { cachePerfStats.incDeltaGIICompleted(); - assertThat(statistics.getInt(deltaGetInitialImagesCompletedId)).isEqualTo(1); + assertThat(statistics.getLong(deltaGetInitialImagesCompletedId)).isEqualTo(1); } /** @@ -657,7 +659,7 @@ public void incDeltaGIICompletedIncrementsDeltaGetInitialImagesCompleted() { */ @Test public void deltaGetInitialImagesCompletedWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(deltaGetInitialImagesCompletedId, Integer.MAX_VALUE); + statistics.incLong(deltaGetInitialImagesCompletedId, Long.MAX_VALUE); cachePerfStats.incDeltaGIICompleted(); @@ -666,9 +668,9 @@ public void deltaGetInitialImagesCompletedWrapsFromMaxIntegerToNegativeValue() { @Test public void getQueryExecutionsDelegatesToStatistics() { - statistics.incInt(queryExecutionsId, Integer.MAX_VALUE); + statistics.incLong(queryExecutionsId, Long.MAX_VALUE); - assertThat(cachePerfStats.getQueryExecutions()).isEqualTo(Integer.MAX_VALUE); + assertThat(cachePerfStats.getQueryExecutions()).isEqualTo(Long.MAX_VALUE); } /** @@ -679,7 +681,7 @@ public void getQueryExecutionsDelegatesToStatistics() { public void endQueryExecutionIncrementsQueryExecutions() { cachePerfStats.endQueryExecution(1); - assertThat(statistics.getInt(queryExecutionsId)).isEqualTo(1); + assertThat(statistics.getLong(queryExecutionsId)).isEqualTo(1); } /** @@ -688,7 +690,7 @@ public void endQueryExecutionIncrementsQueryExecutions() { */ @Test public void queryExecutionsWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(queryExecutionsId, Integer.MAX_VALUE); + statistics.incLong(queryExecutionsId, Long.MAX_VALUE); cachePerfStats.endQueryExecution(1); @@ -697,9 +699,9 @@ public void queryExecutionsWrapsFromMaxIntegerToNegativeValue() { @Test public void getTxCommitsDelegatesToStatistics() { - statistics.incInt(txCommitsId, Integer.MAX_VALUE); + statistics.incLong(txCommitsId, Long.MAX_VALUE); - assertThat(cachePerfStats.getTxCommits()).isEqualTo(Integer.MAX_VALUE); + assertThat(cachePerfStats.getTxCommits()).isEqualTo(Long.MAX_VALUE); } /** @@ -710,7 +712,7 @@ public void getTxCommitsDelegatesToStatistics() { public void txSuccessIncrementsTxCommits() { cachePerfStats.txSuccess(1, 1, 1); - assertThat(statistics.getInt(txCommitsId)).isEqualTo(1); + assertThat(statistics.getLong(txCommitsId)).isEqualTo(1); } /** @@ -718,7 +720,7 @@ public void txSuccessIncrementsTxCommits() { */ @Test public void txCommitsWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(txCommitsId, Integer.MAX_VALUE); + statistics.incLong(txCommitsId, Long.MAX_VALUE); cachePerfStats.txSuccess(1, 1, 1); @@ -727,9 +729,9 @@ public void txCommitsWrapsFromMaxIntegerToNegativeValue() { @Test public void getTxFailuresDelegatesToStatistics() { - statistics.incInt(txFailuresId, Integer.MAX_VALUE); + statistics.incLong(txFailuresId, Long.MAX_VALUE); - assertThat(cachePerfStats.getTxFailures()).isEqualTo(Integer.MAX_VALUE); + assertThat(cachePerfStats.getTxFailures()).isEqualTo(Long.MAX_VALUE); } /** @@ -740,7 +742,7 @@ public void getTxFailuresDelegatesToStatistics() { public void txFailureIncrementsTxFailures() { cachePerfStats.txFailure(1, 1, 1); - assertThat(statistics.getInt(txFailuresId)).isEqualTo(1); + assertThat(statistics.getLong(txFailuresId)).isEqualTo(1); } /** @@ -748,7 +750,7 @@ public void txFailureIncrementsTxFailures() { */ @Test public void txFailuresWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(txFailuresId, Integer.MAX_VALUE); + statistics.incLong(txFailuresId, Long.MAX_VALUE); cachePerfStats.txFailure(1, 1, 1); @@ -757,9 +759,9 @@ public void txFailuresWrapsFromMaxIntegerToNegativeValue() { @Test public void getTxRollbacksDelegatesToStatistics() { - statistics.incInt(txRollbacksId, Integer.MAX_VALUE); + statistics.incLong(txRollbacksId, Long.MAX_VALUE); - assertThat(cachePerfStats.getTxRollbacks()).isEqualTo(Integer.MAX_VALUE); + assertThat(cachePerfStats.getTxRollbacks()).isEqualTo(Long.MAX_VALUE); } /** @@ -770,7 +772,7 @@ public void getTxRollbacksDelegatesToStatistics() { public void txRollbackIncrementsTxRollbacks() { cachePerfStats.txRollback(1, 1, 1); - assertThat(statistics.getInt(txRollbacksId)).isEqualTo(1); + assertThat(statistics.getLong(txRollbacksId)).isEqualTo(1); } /** @@ -778,7 +780,7 @@ public void txRollbackIncrementsTxRollbacks() { */ @Test public void txRollbacksWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(txRollbacksId, Integer.MAX_VALUE); + statistics.incLong(txRollbacksId, Long.MAX_VALUE); cachePerfStats.txRollback(1, 1, 1); @@ -787,9 +789,9 @@ public void txRollbacksWrapsFromMaxIntegerToNegativeValue() { @Test public void getTxCommitChangesDelegatesToStatistics() { - statistics.incInt(txCommitChangesId, Integer.MAX_VALUE); + statistics.incLong(txCommitChangesId, Long.MAX_VALUE); - assertThat(cachePerfStats.getTxCommitChanges()).isEqualTo(Integer.MAX_VALUE); + assertThat(cachePerfStats.getTxCommitChanges()).isEqualTo(Long.MAX_VALUE); } /** @@ -800,7 +802,7 @@ public void getTxCommitChangesDelegatesToStatistics() { public void txSuccessIncrementsTxCommitChanges() { cachePerfStats.txSuccess(1, 1, 1); - assertThat(statistics.getInt(txCommitChangesId)).isEqualTo(1); + assertThat(statistics.getLong(txCommitChangesId)).isEqualTo(1); } /** @@ -809,7 +811,7 @@ public void txSuccessIncrementsTxCommitChanges() { */ @Test public void txCommitChangesWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(txCommitChangesId, Integer.MAX_VALUE); + statistics.incLong(txCommitChangesId, Long.MAX_VALUE); cachePerfStats.txSuccess(1, 1, 1); @@ -818,9 +820,9 @@ public void txCommitChangesWrapsFromMaxIntegerToNegativeValue() { @Test public void getTxFailureChangesDelegatesToStatistics() { - statistics.incInt(txFailureChangesId, Integer.MAX_VALUE); + statistics.incLong(txFailureChangesId, Long.MAX_VALUE); - assertThat(cachePerfStats.getTxFailureChanges()).isEqualTo(Integer.MAX_VALUE); + assertThat(cachePerfStats.getTxFailureChanges()).isEqualTo(Long.MAX_VALUE); } /** @@ -831,7 +833,7 @@ public void getTxFailureChangesDelegatesToStatistics() { public void txFailureIncrementsTxFailureChanges() { cachePerfStats.txFailure(1, 1, 1); - assertThat(statistics.getInt(txFailureChangesId)).isEqualTo(1); + assertThat(statistics.getLong(txFailureChangesId)).isEqualTo(1); } /** @@ -840,7 +842,7 @@ public void txFailureIncrementsTxFailureChanges() { */ @Test public void txFailureChangesWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(txFailureChangesId, Integer.MAX_VALUE); + statistics.incLong(txFailureChangesId, Long.MAX_VALUE); cachePerfStats.txFailure(1, 1, 1); @@ -849,9 +851,9 @@ public void txFailureChangesWrapsFromMaxIntegerToNegativeValue() { @Test public void getTxRollbackChangesDelegatesToStatistics() { - statistics.incInt(txRollbackChangesId, Integer.MAX_VALUE); + statistics.incLong(txRollbackChangesId, Long.MAX_VALUE); - assertThat(cachePerfStats.getTxRollbackChanges()).isEqualTo(Integer.MAX_VALUE); + assertThat(cachePerfStats.getTxRollbackChanges()).isEqualTo(Long.MAX_VALUE); } /** @@ -862,7 +864,7 @@ public void getTxRollbackChangesDelegatesToStatistics() { public void txRollbackIncrementsTxRollbackChanges() { cachePerfStats.txRollback(1, 1, 1); - assertThat(statistics.getInt(txRollbackChangesId)).isEqualTo(1); + assertThat(statistics.getLong(txRollbackChangesId)).isEqualTo(1); } /** @@ -871,7 +873,7 @@ public void txRollbackIncrementsTxRollbackChanges() { */ @Test public void txRollbackChangesWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(txRollbackChangesId, Integer.MAX_VALUE); + statistics.incLong(txRollbackChangesId, Long.MAX_VALUE); cachePerfStats.txRollback(1, 1, 1); @@ -880,16 +882,16 @@ public void txRollbackChangesWrapsFromMaxIntegerToNegativeValue() { @Test public void getEvictorJobsStartedChangesDelegatesToStatistics() { - statistics.incInt(evictorJobsStartedId, Integer.MAX_VALUE); + statistics.incLong(evictorJobsStartedId, Long.MAX_VALUE); - assertThat(cachePerfStats.getEvictorJobsStarted()).isEqualTo(Integer.MAX_VALUE); + assertThat(cachePerfStats.getEvictorJobsStarted()).isEqualTo(Long.MAX_VALUE); } @Test public void incEvictorJobsStartedIncrementsEvictorJobsStarted() { cachePerfStats.incEvictorJobsStarted(); - assertThat(statistics.getInt(evictorJobsStartedId)).isEqualTo(1); + assertThat(statistics.getLong(evictorJobsStartedId)).isEqualTo(1); } /** @@ -898,7 +900,7 @@ public void incEvictorJobsStartedIncrementsEvictorJobsStarted() { */ @Test public void evictorJobsStartedWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(evictorJobsStartedId, Integer.MAX_VALUE); + statistics.incLong(evictorJobsStartedId, Long.MAX_VALUE); cachePerfStats.incEvictorJobsStarted(); @@ -907,16 +909,16 @@ public void evictorJobsStartedWrapsFromMaxIntegerToNegativeValue() { @Test public void getEvictorJobsCompletedChangesDelegatesToStatistics() { - statistics.incInt(evictorJobsCompletedId, Integer.MAX_VALUE); + statistics.incLong(evictorJobsCompletedId, Long.MAX_VALUE); - assertThat(cachePerfStats.getEvictorJobsCompleted()).isEqualTo(Integer.MAX_VALUE); + assertThat(cachePerfStats.getEvictorJobsCompleted()).isEqualTo(Long.MAX_VALUE); } @Test public void incEvictorJobsCompletedIncrementsEvictorJobsCompleted() { cachePerfStats.incEvictorJobsCompleted(); - assertThat(statistics.getInt(evictorJobsCompletedId)).isEqualTo(1); + assertThat(statistics.getLong(evictorJobsCompletedId)).isEqualTo(1); } /** @@ -925,7 +927,7 @@ public void incEvictorJobsCompletedIncrementsEvictorJobsCompleted() { */ @Test public void evictorJobsCompletedWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(evictorJobsCompletedId, Integer.MAX_VALUE); + statistics.incLong(evictorJobsCompletedId, Long.MAX_VALUE); cachePerfStats.incEvictorJobsCompleted(); @@ -934,9 +936,9 @@ public void evictorJobsCompletedWrapsFromMaxIntegerToNegativeValue() { @Test public void getIndexUpdateCompletedChangesDelegatesToStatistics() { - statistics.incInt(indexUpdateCompletedId, Integer.MAX_VALUE); + statistics.incLong(indexUpdateCompletedId, Long.MAX_VALUE); - assertThat(cachePerfStats.getIndexUpdateCompleted()).isEqualTo(Integer.MAX_VALUE); + assertThat(cachePerfStats.getIndexUpdateCompleted()).isEqualTo(Long.MAX_VALUE); } /** @@ -947,7 +949,7 @@ public void getIndexUpdateCompletedChangesDelegatesToStatistics() { public void endIndexUpdateIncrementsEvictorJobsCompleted() { cachePerfStats.endIndexUpdate(1); - assertThat(statistics.getInt(indexUpdateCompletedId)).isEqualTo(1); + assertThat(statistics.getLong(indexUpdateCompletedId)).isEqualTo(1); } /** @@ -956,7 +958,7 @@ public void endIndexUpdateIncrementsEvictorJobsCompleted() { */ @Test public void indexUpdateCompletedWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(indexUpdateCompletedId, Integer.MAX_VALUE); + statistics.incLong(indexUpdateCompletedId, Long.MAX_VALUE); cachePerfStats.endIndexUpdate(1); @@ -965,9 +967,9 @@ public void indexUpdateCompletedWrapsFromMaxIntegerToNegativeValue() { @Test public void getDeltaUpdatesDelegatesToStatistics() { - statistics.incInt(deltaUpdatesId, Integer.MAX_VALUE); + statistics.incLong(deltaUpdatesId, Long.MAX_VALUE); - assertThat(cachePerfStats.getDeltaUpdates()).isEqualTo(Integer.MAX_VALUE); + assertThat(cachePerfStats.getDeltaUpdates()).isEqualTo(Long.MAX_VALUE); } /** @@ -978,7 +980,7 @@ public void getDeltaUpdatesDelegatesToStatistics() { public void endDeltaUpdateIncrementsDeltaUpdates() { cachePerfStats.endDeltaUpdate(1); - assertThat(statistics.getInt(deltaUpdatesId)).isEqualTo(1); + assertThat(statistics.getLong(deltaUpdatesId)).isEqualTo(1); } /** @@ -987,7 +989,7 @@ public void endDeltaUpdateIncrementsDeltaUpdates() { */ @Test public void deltaUpdatesWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(deltaUpdatesId, Integer.MAX_VALUE); + statistics.incLong(deltaUpdatesId, Long.MAX_VALUE); cachePerfStats.endDeltaUpdate(1); @@ -996,16 +998,16 @@ public void deltaUpdatesWrapsFromMaxIntegerToNegativeValue() { @Test public void getDeltaFailedUpdatesDelegatesToStatistics() { - statistics.incInt(deltaFailedUpdatesId, Integer.MAX_VALUE); + statistics.incLong(deltaFailedUpdatesId, Long.MAX_VALUE); - assertThat(cachePerfStats.getDeltaFailedUpdates()).isEqualTo(Integer.MAX_VALUE); + assertThat(cachePerfStats.getDeltaFailedUpdates()).isEqualTo(Long.MAX_VALUE); } @Test public void incDeltaFailedUpdatesIncrementsDeltaFailedUpdates() { cachePerfStats.incDeltaFailedUpdates(); - assertThat(statistics.getInt(deltaFailedUpdatesId)).isEqualTo(1); + assertThat(statistics.getLong(deltaFailedUpdatesId)).isEqualTo(1); } /** @@ -1014,7 +1016,7 @@ public void incDeltaFailedUpdatesIncrementsDeltaFailedUpdates() { */ @Test public void deltaFailedUpdatesWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(deltaFailedUpdatesId, Integer.MAX_VALUE); + statistics.incLong(deltaFailedUpdatesId, Long.MAX_VALUE); cachePerfStats.incDeltaFailedUpdates(); @@ -1023,9 +1025,9 @@ public void deltaFailedUpdatesWrapsFromMaxIntegerToNegativeValue() { @Test public void getDeltasPreparedUpdatesDelegatesToStatistics() { - statistics.incInt(deltasPreparedId, Integer.MAX_VALUE); + statistics.incLong(deltasPreparedId, Long.MAX_VALUE); - assertThat(cachePerfStats.getDeltasPrepared()).isEqualTo(Integer.MAX_VALUE); + assertThat(cachePerfStats.getDeltasPrepared()).isEqualTo(Long.MAX_VALUE); } /** @@ -1036,7 +1038,7 @@ public void getDeltasPreparedUpdatesDelegatesToStatistics() { public void endDeltaPreparedIncrementsDeltasPrepared() { cachePerfStats.endDeltaPrepared(1); - assertThat(statistics.getInt(deltasPreparedId)).isEqualTo(1); + assertThat(statistics.getLong(deltasPreparedId)).isEqualTo(1); } /** @@ -1045,7 +1047,7 @@ public void endDeltaPreparedIncrementsDeltasPrepared() { */ @Test public void deltasPreparedWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(deltasPreparedId, Integer.MAX_VALUE); + statistics.incLong(deltasPreparedId, Long.MAX_VALUE); cachePerfStats.endDeltaPrepared(1); @@ -1054,16 +1056,16 @@ public void deltasPreparedWrapsFromMaxIntegerToNegativeValue() { @Test public void getDeltasSentDelegatesToStatistics() { - statistics.incInt(deltasSentId, Integer.MAX_VALUE); + statistics.incLong(deltasSentId, Long.MAX_VALUE); - assertThat(cachePerfStats.getDeltasSent()).isEqualTo(Integer.MAX_VALUE); + assertThat(cachePerfStats.getDeltasSent()).isEqualTo(Long.MAX_VALUE); } @Test public void incDeltasSentPreparedIncrementsDeltasSent() { cachePerfStats.incDeltasSent(); - assertThat(statistics.getInt(deltasSentId)).isEqualTo(1); + assertThat(statistics.getLong(deltasSentId)).isEqualTo(1); } /** @@ -1071,7 +1073,7 @@ public void incDeltasSentPreparedIncrementsDeltasSent() { */ @Test public void deltasSentWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(deltasSentId, Integer.MAX_VALUE); + statistics.incLong(deltasSentId, Long.MAX_VALUE); cachePerfStats.incDeltasSent(); @@ -1080,16 +1082,16 @@ public void deltasSentWrapsFromMaxIntegerToNegativeValue() { @Test public void getDeltaFullValuesSentDelegatesToStatistics() { - statistics.incInt(deltaFullValuesSentId, Integer.MAX_VALUE); + statistics.incLong(deltaFullValuesSentId, Long.MAX_VALUE); - assertThat(cachePerfStats.getDeltaFullValuesSent()).isEqualTo(Integer.MAX_VALUE); + assertThat(cachePerfStats.getDeltaFullValuesSent()).isEqualTo(Long.MAX_VALUE); } @Test public void incDeltaFullValuesSentIncrementsDeltaFullValuesSent() { cachePerfStats.incDeltaFullValuesSent(); - assertThat(statistics.getInt(deltaFullValuesSentId)).isEqualTo(1); + assertThat(statistics.getLong(deltaFullValuesSentId)).isEqualTo(1); } /** @@ -1098,7 +1100,7 @@ public void incDeltaFullValuesSentIncrementsDeltaFullValuesSent() { */ @Test public void deltaFullValuesSentWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(deltaFullValuesSentId, Integer.MAX_VALUE); + statistics.incLong(deltaFullValuesSentId, Long.MAX_VALUE); cachePerfStats.incDeltaFullValuesSent(); @@ -1107,16 +1109,16 @@ public void deltaFullValuesSentWrapsFromMaxIntegerToNegativeValue() { @Test public void getDeltaFullValuesRequestedDelegatesToStatistics() { - statistics.incInt(deltaFullValuesRequestedId, Integer.MAX_VALUE); + statistics.incLong(deltaFullValuesRequestedId, Long.MAX_VALUE); - assertThat(cachePerfStats.getDeltaFullValuesRequested()).isEqualTo(Integer.MAX_VALUE); + assertThat(cachePerfStats.getDeltaFullValuesRequested()).isEqualTo(Long.MAX_VALUE); } @Test public void incDeltaFullValuesRequestedIncrementsDeltaFullValuesRequested() { cachePerfStats.incDeltaFullValuesRequested(); - assertThat(statistics.getInt(deltaFullValuesRequestedId)).isEqualTo(1); + assertThat(statistics.getLong(deltaFullValuesRequestedId)).isEqualTo(1); } /** @@ -1125,7 +1127,7 @@ public void incDeltaFullValuesRequestedIncrementsDeltaFullValuesRequested() { */ @Test public void deltaFullValuesRequestedWrapsFromMaxIntegerToNegativeValue() { - statistics.incInt(deltaFullValuesRequestedId, Integer.MAX_VALUE); + statistics.incLong(deltaFullValuesRequestedId, Long.MAX_VALUE); cachePerfStats.incDeltaFullValuesRequested(); diff --git a/geode-core/src/test/java/org/apache/geode/internal/net/NioPlainEngineTest.java b/geode-core/src/test/java/org/apache/geode/internal/net/NioPlainEngineTest.java index 7ab838cb8ac5..67292942456d 100644 --- a/geode-core/src/test/java/org/apache/geode/internal/net/NioPlainEngineTest.java +++ b/geode-core/src/test/java/org/apache/geode/internal/net/NioPlainEngineTest.java @@ -63,7 +63,7 @@ public void ensureWrappedCapacity() { int requestedCapacity = 210; ByteBuffer result = nioEngine.ensureWrappedCapacity(requestedCapacity, wrappedBuffer, BufferPool.BufferType.TRACKED_RECEIVER); - verify(mockStats, times(2)).incReceiverBufferSize(any(Integer.class), any(Boolean.class)); + verify(mockStats, times(2)).incReceiverBufferSize(any(Long.class), any(Boolean.class)); assertThat(result.capacity()).isGreaterThanOrEqualTo(requestedCapacity); assertThat(result).isGreaterThanOrEqualTo(wrappedBuffer); // make sure that data was transferred to the new buffer diff --git a/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/api/MembershipStatistics.java b/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/api/MembershipStatistics.java index f9c8b0fb8e86..54f2c5262f2d 100644 --- a/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/api/MembershipStatistics.java +++ b/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/api/MembershipStatistics.java @@ -49,24 +49,24 @@ public interface MembershipStatistics { * * @since GemFire 5.0 */ - void incUcastWriteBytes(int bytesWritten); + void incUcastWriteBytes(long bytesWritten); /** * increment the number of unicast datagram payload bytes received and the number of unicast reads * performed */ - void incUcastReadBytes(int amount); + void incUcastReadBytes(long amount); /** * increment the number of multicast datagrams sent and the number of multicast bytes transmitted */ - void incMcastWriteBytes(int bytesWritten); + void incMcastWriteBytes(long bytesWritten); /** * increment the number of multicast datagram payload bytes received, and the number of mcast * messages read */ - void incMcastReadBytes(int amount); + void incMcastReadBytes(long amount); /** * increment the number of unicast UDP retransmission requests received from other processes diff --git a/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/DefaultMembershipStatistics.java b/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/DefaultMembershipStatistics.java index ef4ae72f77e2..9f7cee3111ac 100644 --- a/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/DefaultMembershipStatistics.java +++ b/geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/DefaultMembershipStatistics.java @@ -102,22 +102,22 @@ public void endUDPDispatchRequest(final long start) { } @Override - public void incUcastWriteBytes(final int bytesWritten) { + public void incUcastWriteBytes(final long bytesWritten) { ucastWriteBytes++; } @Override - public void incUcastReadBytes(final int amount) { + public void incUcastReadBytes(final long amount) { ucastReadBytes++; } @Override - public void incMcastWriteBytes(final int bytesWritten) { + public void incMcastWriteBytes(final long bytesWritten) { mcastWriteBytes++; } @Override - public void incMcastReadBytes(final int amount) { + public void incMcastReadBytes(final long amount) { mcastReadBytes++; } From e0848556e964d8970d43d0c3b1fa4da315873327 Mon Sep 17 00:00:00 2001 From: Mark Hanson Date: Mon, 19 Apr 2021 14:48:54 -0700 Subject: [PATCH 2/8] spotless --- .../java/org/apache/geode/internal/cache/CachePerfStats.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 2927fd0cb671..093b89683437 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 @@ -472,7 +472,8 @@ public class CachePerfStats { "Number of times a concurrent destroy followed by a create has caused an entry operation to need to retry.", "operations"), f.createLongCounter("clears", clearsDesc, "operations"), - f.createLongGauge("diskTasksWaiting", "Current number of disk tasks (oplog compactions, asynchronous recoveries, etc) that are waiting for a thread to run the operation", + f.createLongGauge("diskTasksWaiting", + "Current number of disk tasks (oplog compactions, asynchronous recoveries, etc) that are waiting for a thread to run the operation", "operations"), f.createLongCounter("conflatedEvents", conflatedEventsDesc, "operations"), f.createLongGauge("tombstones", tombstoneCountDesc, "entries"), From 463a5a19b764052aeb211797b1ce91eef688a5f6 Mon Sep 17 00:00:00 2001 From: Mark Hanson Date: Mon, 19 Apr 2021 14:53:56 -0700 Subject: [PATCH 3/8] unused strings --- .../java/org/apache/geode/internal/cache/CachePerfStats.java | 5 ----- 1 file changed, 5 deletions(-) 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 093b89683437..7400442e495e 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 @@ -286,11 +286,6 @@ public class CachePerfStats { "Current number of regions configured for reliablity that are missing required roles with Limited access"; final String reliableRegionsMissingNoAccessDesc = "Current number of regions configured for reliablity that are missing required roles with No access"; - final String regionClearsDesc = - "The total number of times a clear has been done on this cache."; - final String bucketClearsDesc = - "The total number of times a clear has been done on this region and it's bucket regions"; - final String clearsDesc = "The total number of times a clear has been done on this cache."; final String metaDataRefreshCountDesc = "Total number of times the meta data is refreshed due to hopping observed."; From 67966474ac888ffad2834d466b8557d08d046c09 Mon Sep 17 00:00:00 2001 From: Mark Hanson Date: Mon, 19 Apr 2021 16:42:57 -0700 Subject: [PATCH 4/8] minor cleanup from LGTM warning --- .../apache/geode/distributed/internal/DistributionStats.java | 4 ++-- .../distributed/internal/ThrottledMemQueueStatHelper.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionStats.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionStats.java index d48458f6da3c..e653a4c7b94e 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionStats.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionStats.java @@ -2136,12 +2136,12 @@ public void remove(long count) { } @Override - public void addMem(int amount) { + public void addMem(long amount) { incSerialQueueBytes(amount); } @Override - public void removeMem(int amount) { + public void removeMem(long amount) { incSerialQueueBytes(amount * (-1)); } }; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/ThrottledMemQueueStatHelper.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/ThrottledMemQueueStatHelper.java index c745159748f1..b628572f28cb 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/ThrottledMemQueueStatHelper.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/ThrottledMemQueueStatHelper.java @@ -41,12 +41,12 @@ public interface ThrottledMemQueueStatHelper extends QueueStatHelper { * * @param amount number of bytes added to the queue */ - void addMem(int amount); + void addMem(long amount); /** * Decrements the amount of memory consumed by queue contents. * * @param amount number of bytes removed from the queue */ - void removeMem(int amount); + void removeMem(long amount); } From 6b26161454c053c35e55d3d3568cbbcfdfd6991b Mon Sep 17 00:00:00 2001 From: Mark Hanson Date: Mon, 19 Apr 2021 16:59:40 -0700 Subject: [PATCH 5/8] more cleanup --- .../internal/DistributionStats.java | 30 +++++++++---------- .../ThrottlingMemLinkedQueueWithDMStats.java | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionStats.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionStats.java index e653a4c7b94e..11156caaffbf 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionStats.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionStats.java @@ -1183,8 +1183,8 @@ protected void incWaitingQueueSize(long messages) { this.stats.incLong(waitingQueueSizeId, messages); } - protected void incOverflowQueueThrottleCount(long delays) { - this.stats.incLong(overflowQueueThrottleCountId, delays); + protected void incOverflowQueueThrottleCount() { + this.stats.incLong(overflowQueueThrottleCountId, 1); } protected void incOverflowQueueThrottleTime(long nanos) { @@ -1197,8 +1197,8 @@ protected void incHighPriorityQueueSize(long messages) { this.stats.incLong(highPriorityQueueSizeId, messages); } - protected void incHighPriorityQueueThrottleCount(long delays) { - this.stats.incLong(highPriorityQueueThrottleCountId, delays); + protected void incHighPriorityQueueThrottleCount() { + this.stats.incLong(highPriorityQueueThrottleCountId, 1); } protected void incHighPriorityQueueThrottleTime(long nanos) { @@ -1211,8 +1211,8 @@ protected void incPartitionedRegionQueueSize(long messages) { this.stats.incLong(partitionedRegionQueueSizeId, messages); } - protected void incPartitionedRegionQueueThrottleCount(long delays) { - this.stats.incLong(partitionedRegionQueueThrottleCountId, delays); + protected void incPartitionedRegionQueueThrottleCount() { + this.stats.incLong(partitionedRegionQueueThrottleCountId, 1); } protected void incPartitionedRegionQueueThrottleTime(long nanos) { @@ -1225,8 +1225,8 @@ protected void incFunctionExecutionQueueSize(long messages) { this.stats.incLong(functionExecutionQueueSizeId, messages); } - protected void incFunctionExecutionQueueThrottleCount(long delays) { - this.stats.incLong(functionExecutionQueueThrottleCountId, delays); + protected void incFunctionExecutionQueueThrottleCount() { + this.stats.incLong(functionExecutionQueueThrottleCountId, 1); } protected void incFunctionExecutionQueueThrottleTime(long nanos) { @@ -1252,8 +1252,8 @@ protected void incSerialPooledThread() { this.stats.incLong(serialPooledThreadId, 1); } - protected void incSerialQueueThrottleCount(long delays) { - this.stats.incLong(serialQueueThrottleCountId, delays); + protected void incSerialQueueThrottleCount() { + this.stats.incLong(serialQueueThrottleCountId, 1); } protected void incSerialQueueThrottleTime(long nanos) { @@ -1907,7 +1907,7 @@ public ThrottledQueueStatHelper getOverflowQueueHelper() { return new ThrottledQueueStatHelper() { @Override public void incThrottleCount() { - incOverflowQueueThrottleCount(1); + incOverflowQueueThrottleCount(); } @Override @@ -1967,7 +1967,7 @@ public ThrottledQueueStatHelper getHighPriorityQueueHelper() { return new ThrottledQueueStatHelper() { @Override public void incThrottleCount() { - incHighPriorityQueueThrottleCount(1); + incHighPriorityQueueThrottleCount(); } @Override @@ -2002,7 +2002,7 @@ public ThrottledQueueStatHelper getPartitionedRegionQueueHelper() { return new ThrottledQueueStatHelper() { @Override public void incThrottleCount() { - incPartitionedRegionQueueThrottleCount(1); + incPartitionedRegionQueueThrottleCount(); } @Override @@ -2057,7 +2057,7 @@ public ThrottledQueueStatHelper getFunctionExecutionQueueHelper() { return new ThrottledQueueStatHelper() { @Override public void incThrottleCount() { - incFunctionExecutionQueueThrottleCount(1); + incFunctionExecutionQueueThrottleCount(); } @Override @@ -2112,7 +2112,7 @@ public ThrottledMemQueueStatHelper getSerialQueueHelper() { return new ThrottledMemQueueStatHelper() { @Override public void incThrottleCount() { - incSerialQueueThrottleCount(1); + incSerialQueueThrottleCount(); } @Override diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/ThrottlingMemLinkedQueueWithDMStats.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/ThrottlingMemLinkedQueueWithDMStats.java index 2432cd9ea8f7..4603a0ce630e 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/ThrottlingMemLinkedQueueWithDMStats.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/ThrottlingMemLinkedQueueWithDMStats.java @@ -142,7 +142,7 @@ protected void postRemove(Object o) { } @Override - protected void postDrain(Collection c) { + protected void postDrain(Collection c) { for (Object aC : c) { postRemove(aC); } From af56cfc30782711ff337d15e347e9367db3516a5 Mon Sep 17 00:00:00 2001 From: Mark Hanson Date: Mon, 19 Apr 2021 22:51:12 -0700 Subject: [PATCH 6/8] Backing out GEODE-7665 changes --- .../PartitionedRegionStatsTest.java | 1 - .../PartitionedRegionStatsJUnitTest.java | 26 ------------------- .../cache/PartitionedRegionStats.java | 24 ----------------- 3 files changed, 51 deletions(-) diff --git a/geode-core/src/distributedTest/java/org/apache/geode/management/PartitionedRegionStatsTest.java b/geode-core/src/distributedTest/java/org/apache/geode/management/PartitionedRegionStatsTest.java index b394f4678728..578cd783a3b3 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/management/PartitionedRegionStatsTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/management/PartitionedRegionStatsTest.java @@ -73,5 +73,4 @@ public void testGetsRate() throws Exception { assertThat(cacheStats.getMisses()).isEqualTo(1); } - } diff --git a/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/PartitionedRegionStatsJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/PartitionedRegionStatsJUnitTest.java index a3f6bab69ea7..d0d59b8da94f 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/PartitionedRegionStatsJUnitTest.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/PartitionedRegionStatsJUnitTest.java @@ -19,9 +19,6 @@ */ package org.apache.geode.internal.cache; -import static org.apache.geode.internal.cache.PartitionedRegionStats.regionClearLocalDurationId; -import static org.apache.geode.internal.cache.PartitionedRegionStats.regionClearTotalDurationId; -import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -480,27 +477,4 @@ private long getMemBytes(PartitionedRegion pr) { return bytes; } - - @Test - public void incPartitionedRegionClearLocalDurationIncrementsPartitionedRegionClearLocalDuration() { - String regionname = "testStats"; - int localMaxMemory = 100; - PartitionedRegion pr = createPR(regionname + 1, localMaxMemory, 0); - PartitionedRegionStats partitionedRegionStats = pr.getPrStats(); - partitionedRegionStats.incPartitionedRegionClearLocalDuration(100L); - assertThat(partitionedRegionStats.getStats().getLong(regionClearLocalDurationId)) - .isEqualTo(100L); - } - - @Test - public void incPartitionedRegionClearTotalDurationIncrementsPartitionedRegionClearTotalDuration() { - String regionname = "testStats"; - int localMaxMemory = 100; - PartitionedRegion pr = createPR(regionname + 1, localMaxMemory, 0); - PartitionedRegionStats partitionedRegionStats = pr.getPrStats(); - partitionedRegionStats.incPartitionedRegionClearTotalDuration(100L); - - assertThat(partitionedRegionStats.getStats().getLong(regionClearTotalDurationId)) - .isEqualTo(100L); - } } diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionStats.java b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionStats.java index 11f881448063..1c8f35daaaf9 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionStats.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionStats.java @@ -176,10 +176,6 @@ public class PartitionedRegionStats { private static final int prMetaDataSentCountId; private static final int localMaxMemoryId; - static final int regionClearLocalDurationId; - static final int regionClearTotalDurationId; - - static { @@ -541,10 +537,6 @@ public class PartitionedRegionStats { prMetaDataSentCountId = type.nameToId("prMetaDataSentCount"); localMaxMemoryId = type.nameToId("localMaxMemory"); - - regionClearLocalDurationId = type.nameToId("partitionedRegionClearLocalDuration"); - regionClearTotalDurationId = type.nameToId("partitionedRegionClearTotalDuration"); - } private final Statistics stats; @@ -1209,20 +1201,4 @@ public void incPRMetaDataSentCount() { public long getPRMetaDataSentCount() { return this.stats.getLong(prMetaDataSentCountId); } - - public void incPartitionedRegionClearLocalDuration(long durationNanos) { - stats.incLong(regionClearLocalDurationId, durationNanos); - } - - public void incPartitionedRegionClearTotalDuration(long durationNanos) { - stats.incLong(regionClearTotalDurationId, durationNanos); - } - - public long getRegionClearLocalDuration() { - return stats.getLong(regionClearLocalDurationId); - } - - public long getRegionClearTotalDuration() { - return stats.getLong(regionClearTotalDurationId); - } } From d5d3719f9d4ee90b4aabb597e490f96d677982b3 Mon Sep 17 00:00:00 2001 From: Mark Hanson Date: Tue, 20 Apr 2021 14:14:11 -0700 Subject: [PATCH 7/8] PR cleanup suggestions. --- .../distributed/internal/ClusterOperationExecutors.java | 6 +++--- .../distributed/internal/LonerDistributionManager.java | 1 - .../geode/internal/cache/PartitionedRegionStats.java | 7 ------- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/ClusterOperationExecutors.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/ClusterOperationExecutors.java index 50025d6cc7d5..655a9278393d 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/ClusterOperationExecutors.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/ClusterOperationExecutors.java @@ -678,10 +678,10 @@ private static class SerialQueuedExecutorPool { } /* - * Returns an id of the thread in serialQueuedExecutorMap, that's mapped to the given seder. + * Returns an id of the thread in serialQueuedExecutorMap, that's mapped to the given sender. * * - * @param createNew boolean flag to indicate whether to create a new id, if id does not exists. + * @param createNew boolean flag to indicate whether to create a new id, if id does not exist. */ private Integer getQueueId(InternalDistributedMember sender, boolean createNew) { // Create a new Id. @@ -696,7 +696,7 @@ private Integer getQueueId(InternalDistributedMember sender, boolean createNew) } // Create new. - // Check if any threads are availabe that is marked for Use. + // Check if any threads are available that is marked for Use. if (!threadMarkedForUse.isEmpty()) { queueId = threadMarkedForUse.remove(0); } diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/LonerDistributionManager.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/LonerDistributionManager.java index 1da8fc14be33..74417431d199 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/LonerDistributionManager.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/LonerDistributionManager.java @@ -1034,7 +1034,6 @@ public Set getAllRoles() { private int lonerPort = 0; - // private static final long CHARS_32KB = 16384; private InternalDistributedMember generateMemberId() { InternalDistributedMember result; String host; diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionStats.java b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionStats.java index 1c8f35daaaf9..71960197e712 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionStats.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionStats.java @@ -426,13 +426,6 @@ public class PartitionedRegionStats { f.createLongGauge("localMaxMemory", "local max memory in bytes for this region on this member", "bytes"), - f.createLongCounter("partitionedRegionClearLocalDuration", - "The time in nanoseconds partitioned region clear has been running for the region on this member", - "nanoseconds"), - f.createLongCounter("partitionedRegionClearTotalDuration", - "The time in nanoseconds partitioned region clear has been running for the region with this member as coordinator.", - "nanoseconds"), - }); bucketCountId = type.nameToId("bucketCount"); From d4e93b7583423cc99b91602624e2e591f354845c Mon Sep 17 00:00:00 2001 From: Mark Hanson Date: Tue, 20 Apr 2021 15:04:46 -0700 Subject: [PATCH 8/8] A little cleanup of warnings. --- .../PartitionedRegionStatsJUnitTest.java | 176 +++++++++--------- 1 file changed, 92 insertions(+), 84 deletions(-) diff --git a/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/PartitionedRegionStatsJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/PartitionedRegionStatsJUnitTest.java index d0d59b8da94f..46b7d64e1a94 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/PartitionedRegionStatsJUnitTest.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/PartitionedRegionStatsJUnitTest.java @@ -12,30 +12,25 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. */ -/** - * This test verifies that stats are collected properly for the SingleNode and Single - * PartitionedRegion - * - */ + package org.apache.geode.internal.cache; +import static org.assertj.core.api.AssertionsForClassTypes.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.io.File; import java.io.IOException; -import java.util.Iterator; import java.util.Random; import java.util.Set; import org.apache.commons.io.FileUtils; +import org.apache.logging.log4j.Logger; import org.junit.After; import org.junit.Before; import org.junit.Test; -import org.apache.geode.LogWriter; import org.apache.geode.Statistics; -import org.apache.geode.cache.AttributesFactory; import org.apache.geode.cache.Cache; import org.apache.geode.cache.DataPolicy; import org.apache.geode.cache.EvictionAction; @@ -43,14 +38,21 @@ import org.apache.geode.cache.PartitionAttributesFactory; import org.apache.geode.cache.PartitionedRegionStorageException; import org.apache.geode.cache.RegionExistsException; +import org.apache.geode.cache.RegionFactory; +import org.apache.geode.logging.internal.log4j.api.LogService; +/** + * This test verifies that stats are collected properly for the SingleNode and Single + * PartitionedRegion + * + */ public class PartitionedRegionStatsJUnitTest { private static final File DISK_DIR = new File("PRStatsTest"); - LogWriter logger = null; + Logger logger = null; @Before public void setUp() { - logger = PartitionedRegionTestHelper.getLogger(); + logger = LogService.getLogger(); } @After @@ -59,44 +61,49 @@ public void tearDown() throws IOException { FileUtils.deleteDirectory(DISK_DIR); } - private PartitionedRegion createPR(String name, int lmax, int redundancy) { - PartitionAttributesFactory paf = new PartitionAttributesFactory(); - paf.setLocalMaxMemory(lmax).setRedundantCopies(redundancy).setTotalNumBuckets(13); // set low to - // reduce - // logging - AttributesFactory af = new AttributesFactory(); - af.setPartitionAttributes(paf.create()); + private PartitionedRegion createPR(String name, int lmax) { + PartitionAttributesFactory paf = new PartitionAttributesFactory<>(); + paf.setLocalMaxMemory(lmax).setRedundantCopies(0).setTotalNumBuckets(13); // set low to + // reduce + // logging Cache cache = PartitionedRegionTestHelper.createCache(); - PartitionedRegion pr = null; + PartitionedRegion pr; try { - pr = (PartitionedRegion) cache.createRegion(name, af.create()); + RegionFactory regionFactory = cache.createRegionFactory(); + regionFactory.setPartitionAttributes(paf.create()); + pr = (PartitionedRegion) regionFactory.create(name); } catch (RegionExistsException rex) { pr = (PartitionedRegion) cache.getRegion(name); } return pr; } - private PartitionedRegion createPRWithEviction(String name, int lmax, int redundancy, - int evictionCount, boolean diskSync, boolean persistent) { - PartitionAttributesFactory paf = new PartitionAttributesFactory(); - paf.setLocalMaxMemory(lmax).setRedundantCopies(redundancy).setTotalNumBuckets(13); // set low to - // reduce - // logging - AttributesFactory af = new AttributesFactory(); - af.setPartitionAttributes(paf.create()); + private PartitionedRegion createPRWithEviction(String name, int lmax, + boolean diskSync, + boolean persistent) { + PartitionAttributesFactory paf = new PartitionAttributesFactory<>(); + paf.setLocalMaxMemory(lmax).setRedundantCopies(0).setTotalNumBuckets(13); // set low to + // reduce + // logging + Cache cache = PartitionedRegionTestHelper.createCache(); + RegionFactory regionFactory = cache.createRegionFactory(); + regionFactory.setPartitionAttributes(paf.create()); if (persistent) { - af.setDataPolicy(DataPolicy.PERSISTENT_PARTITION); + regionFactory.setDataPolicy(DataPolicy.PERSISTENT_PARTITION); } - af.setEvictionAttributes( + regionFactory.setEvictionAttributes( EvictionAttributes.createLRUEntryAttributes(1, EvictionAction.OVERFLOW_TO_DISK)); - af.setDiskStoreName("diskstore"); - af.setDiskSynchronous(diskSync); - Cache cache = PartitionedRegionTestHelper.createCache(); - DISK_DIR.mkdir(); + regionFactory.setDiskStoreName("diskstore"); + regionFactory.setDiskSynchronous(diskSync); + regionFactory.setPartitionAttributes(paf.create()); + PartitionedRegion pr; + + assertThat(DISK_DIR.mkdir()).isTrue(); cache.createDiskStoreFactory().setDiskDirs(new File[] {DISK_DIR}).create("diskstore"); - PartitionedRegion pr = null; + try { - pr = (PartitionedRegion) cache.createRegion(name, af.create()); + pr = (PartitionedRegion) regionFactory.create(name); + } catch (RegionExistsException rex) { pr = (PartitionedRegion) cache.getRegion(name); } @@ -109,16 +116,16 @@ private PartitionedRegion createPRWithEviction(String name, int lmax, int redund * */ @Test - public void testStats() throws Exception { - String regionname = "testStats"; + public void testStats() { + String regionName = "testStats"; int localMaxMemory = 100; - PartitionedRegion pr = createPR(regionname + 1, localMaxMemory, 0); + PartitionedRegion pr = createPR(regionName + 1, localMaxMemory); validateStats(pr); - pr = createPR(regionname + 2, localMaxMemory, 0); + pr = createPR(regionName + 2, localMaxMemory); validateStats(pr); - if (logger.fineEnabled()) { - logger.fine("PartitionedRegionStatsJUnitTest - testStats() Completed successfully ... "); + if (logger.isDebugEnabled()) { + logger.debug("PartitionedRegionStatsJUnitTest - testStats() Completed successfully ... "); } } @@ -128,7 +135,7 @@ public void testStats() throws Exception { * containsValueForKeyCompleted, invalidatesCompleted, totalBucketSize and temporarily commented * avgRedundantCopies, maxRedundantCopies, minRedundantCopies are validated in this method. */ - private void validateStats(PartitionedRegion pr) throws Exception { + private void validateStats(PartitionedRegion pr) { Statistics stats = pr.getPrStats().getStats(); int bucketCount = stats.get("bucketCount").intValue(); int putsCompleted = stats.get("putsCompleted").intValue(); @@ -141,20 +148,20 @@ private void validateStats(PartitionedRegion pr) throws Exception { final int bucketMax = pr.getTotalNumberOfBuckets(); for (int i = 0; i < bucketMax + 1; i++) { - Long val = new Long(i); + Long val = (long) i; try { pr.put(val, val); } catch (PartitionedRegionStorageException ex) { - this.logger.warning(ex); + this.logger.warn(ex); } } for (int i = 0; i < bucketMax + 1; i++) { - Long val = new Long(i); + Long val = (long) i; try { pr.get(val); totalGets++; } catch (PartitionedRegionStorageException ex) { - this.logger.warning(ex); + this.logger.warn(ex); } } @@ -167,7 +174,7 @@ private void validateStats(PartitionedRegion pr) throws Exception { assertEquals(bucketMax + 1, putsCompleted); assertEquals(bucketMax + 1, totalBucketSize); - pr.destroy(new Long(bucketMax)); + pr.destroy((long) bucketMax); putsCompleted = stats.get("putsCompleted").intValue(); totalBucketSize = stats.get("dataStoreEntryCount").intValue(); @@ -177,49 +184,50 @@ private void validateStats(PartitionedRegion pr) throws Exception { assertEquals(bucketMax, totalBucketSize); for (int i = 200; i < 210; i++) { - Long key = new Long(i); + Long key = (long) i; String val = "" + i; try { pr.create(key, val); } catch (PartitionedRegionStorageException ex) { - this.logger.warning(ex); + this.logger.warn(ex); } } for (int i = 200; i < 210; i++) { - Long key = new Long(i); + Long key = (long) i; try { pr.get(key); totalGets++; } catch (PartitionedRegionStorageException ex) { - this.logger.warning(ex); + this.logger.warn(ex); } } for (int i = 200; i < 210; i++) { - Long key = new Long(i); + Long key = (long) i; try { + // noinspection ResultOfMethodCallIgnored pr.containsKey(key); } catch (PartitionedRegionStorageException ex) { - this.logger.warning(ex); + this.logger.warn(ex); } } for (int i = 200; i < 210; i++) { - Long key = new Long(i); + Long key = (long) i; try { pr.containsValueForKey(key); } catch (PartitionedRegionStorageException ex) { - this.logger.warning(ex); + this.logger.warn(ex); } } for (int i = 200; i < 210; i++) { - Long key = new Long(i); + Long key = (long) i; try { pr.invalidate(key); } catch (PartitionedRegionStorageException ex) { - this.logger.warning(ex); + this.logger.warn(ex); } } int getsCompleted = stats.get("getsCompleted").intValue(); @@ -248,10 +256,10 @@ private void validateStats(PartitionedRegion pr) throws Exception { } @Test - public void testOverflowStatsAsync() throws Exception { - String regionname = "testStats"; + public void testOverflowStatsAsync() { + String regionName = "testStats"; int localMaxMemory = 100; - PartitionedRegion pr = createPRWithEviction(regionname + 1, localMaxMemory, 0, 1, false, false); + PartitionedRegion pr = createPRWithEviction(regionName + 1, localMaxMemory, false, false); validateOverflowStats(pr); } @@ -261,18 +269,18 @@ public void testOverflowStatsAsync() throws Exception { * */ @Test - public void testOverflowStats() throws Exception { - String regionname = "testStats"; + public void testOverflowStats() { + String regionName = "testStats"; int localMaxMemory = 100; - PartitionedRegion pr = createPRWithEviction(regionname + 1, localMaxMemory, 0, 1, true, false); + PartitionedRegion pr = createPRWithEviction(regionName + 1, localMaxMemory, true, false); validateOverflowStats(pr); } @Test - public void testPersistOverflowStatsAsync() throws Exception { - String regionname = "testStats"; + public void testPersistOverflowStatsAsync() { + String regionName = "testStats"; int localMaxMemory = 100; - PartitionedRegion pr = createPRWithEviction(regionname + 1, localMaxMemory, 0, 1, false, true); + PartitionedRegion pr = createPRWithEviction(regionName + 1, localMaxMemory, false, true); validateOverflowStats(pr); } @@ -282,19 +290,19 @@ public void testPersistOverflowStatsAsync() throws Exception { * */ @Test - public void testPersistOverflowStats() throws Exception { - String regionname = "testStats"; + public void testPersistOverflowStats() { + String regionName = "testStats"; int localMaxMemory = 100; - PartitionedRegion pr = createPRWithEviction(regionname + 1, localMaxMemory, 0, 1, true, true); + PartitionedRegion pr = createPRWithEviction(regionName + 1, localMaxMemory, true, true); validateOverflowStats(pr); } - private void validateOverflowStats(PartitionedRegion pr) throws Exception { + private void validateOverflowStats(PartitionedRegion pr) { Statistics stats = pr.getPrStats().getStats(); DiskRegionStats diskStats = pr.getDiskRegionStats(); assertEquals(0, stats.getLong("dataStoreBytesInUse")); - assertEquals(0, stats.getInt("dataStoreEntryCount")); + assertEquals(0, stats.getLong("dataStoreEntryCount")); assertEquals(0, diskStats.getNumOverflowBytesOnDisk()); assertEquals(0, diskStats.getNumEntriesInVM()); assertEquals(0, diskStats.getNumOverflowOnDisk()); @@ -309,7 +317,7 @@ private void validateOverflowStats(PartitionedRegion pr) throws Exception { pr.getDiskStore().flush(); long singleEntryMemSize = stats.getLong("dataStoreBytesInUse"); - assertEquals(1, stats.getInt("dataStoreEntryCount")); + assertEquals(1, stats.getLong("dataStoreEntryCount")); assertEquals(0, diskStats.getNumOverflowBytesOnDisk()); assertEquals(1, diskStats.getNumEntriesInVM()); assertEquals(0, diskStats.getNumOverflowOnDisk()); @@ -321,7 +329,7 @@ private void validateOverflowStats(PartitionedRegion pr) throws Exception { pr.getDiskStore().flush(); assertEquals(singleEntryMemSize, stats.getLong("dataStoreBytesInUse")); - assertEquals(2, stats.getInt("dataStoreEntryCount")); + assertEquals(2, stats.getLong("dataStoreEntryCount")); long entryOverflowSize = diskStats.getNumOverflowBytesOnDisk(); assertEquals(1, diskStats.getNumEntriesInVM()); assertEquals(1, diskStats.getNumOverflowOnDisk()); @@ -336,7 +344,7 @@ private void validateOverflowStats(PartitionedRegion pr) throws Exception { pr.getDiskStore().flush(); assertEquals(singleEntryMemSize, stats.getLong("dataStoreBytesInUse")); - assertEquals(numEntries, stats.getInt("dataStoreEntryCount")); + assertEquals(numEntries, stats.getLong("dataStoreEntryCount")); assertEquals((numEntries - 1) * entryOverflowSize, diskStats.getNumOverflowBytesOnDisk()); assertEquals(1, diskStats.getNumEntriesInVM()); assertEquals((numEntries - 1), diskStats.getNumOverflowOnDisk()); @@ -351,7 +359,7 @@ private void validateOverflowStats(PartitionedRegion pr) throws Exception { pr.getDiskStore().flush(); assertEquals(singleEntryMemSize, stats.getLong("dataStoreBytesInUse")); - assertEquals(numEntries, stats.getInt("dataStoreEntryCount")); + assertEquals(numEntries, stats.getLong("dataStoreEntryCount")); assertEquals((numEntries - 1) * entryOverflowSize, diskStats.getNumOverflowBytesOnDisk()); assertEquals(1, diskStats.getNumEntriesInVM()); assertEquals((numEntries - 1), diskStats.getNumOverflowOnDisk()); @@ -365,7 +373,7 @@ private void validateOverflowStats(PartitionedRegion pr) throws Exception { pr.getDiskStore().flush(); assertEquals(singleEntryMemSize, stats.getLong("dataStoreBytesInUse")); - assertEquals(numEntries, stats.getInt("dataStoreEntryCount")); + assertEquals(numEntries, stats.getLong("dataStoreEntryCount")); assertEquals((numEntries - 1) * entryOverflowSize, diskStats.getNumOverflowBytesOnDisk()); assertEquals(1, diskStats.getNumEntriesInVM()); assertEquals((numEntries - 1), diskStats.getNumOverflowOnDisk()); @@ -380,7 +388,7 @@ private void validateOverflowStats(PartitionedRegion pr) throws Exception { pr.getDiskStore().flush(); assertEquals(singleEntryMemSize, stats.getLong("dataStoreBytesInUse")); - assertEquals(numEntries, stats.getInt("dataStoreEntryCount")); + assertEquals(numEntries, stats.getLong("dataStoreEntryCount")); assertEquals((numEntries - 1) * entryOverflowSize, diskStats.getNumOverflowBytesOnDisk()); assertEquals(1, diskStats.getNumEntriesInVM()); assertEquals((numEntries - 1), diskStats.getNumOverflowOnDisk()); @@ -388,12 +396,14 @@ private void validateOverflowStats(PartitionedRegion pr) throws Exception { assertEquals(diskStats.getNumOverflowBytesOnDisk(), getDiskBytes(pr)); // Update the same entry twice + // noinspection OverwrittenKey pr.put(5, 5); + // noinspection OverwrittenKey pr.put(5, 6); pr.getDiskStore().flush(); assertEquals(singleEntryMemSize, stats.getLong("dataStoreBytesInUse")); - assertEquals(numEntries, stats.getInt("dataStoreEntryCount")); + assertEquals(numEntries, stats.getLong("dataStoreEntryCount")); assertEquals((numEntries - 1) * entryOverflowSize, diskStats.getNumOverflowBytesOnDisk()); assertEquals(1, diskStats.getNumEntriesInVM()); assertEquals((numEntries - 1), diskStats.getNumOverflowOnDisk()); @@ -410,7 +420,7 @@ private void validateOverflowStats(PartitionedRegion pr) throws Exception { int entriesInMem = 1; assertEquals(singleEntryMemSize * entriesInMem, stats.getLong("dataStoreBytesInUse")); - assertEquals(numEntries, stats.getInt("dataStoreEntryCount")); + assertEquals(numEntries, stats.getLong("dataStoreEntryCount")); assertEquals((numEntries - entriesInMem) * entryOverflowSize, diskStats.getNumOverflowBytesOnDisk()); assertEquals(entriesInMem, diskStats.getNumEntriesInVM()); @@ -445,7 +455,7 @@ private void validateOverflowStats(PartitionedRegion pr) throws Exception { numEntries = pr.entryCount(); assertEquals(singleEntryMemSize * entriesInMem, stats.getLong("dataStoreBytesInUse")); - assertEquals(numEntries, stats.getInt("dataStoreEntryCount")); + assertEquals(numEntries, stats.getLong("dataStoreEntryCount")); assertEquals((numEntries - entriesInMem) * entryOverflowSize, diskStats.getNumOverflowBytesOnDisk()); assertEquals(entriesInMem, diskStats.getNumEntriesInVM()); @@ -458,8 +468,7 @@ private Object getDiskBytes(PartitionedRegion pr) { Set brs = pr.getDataStore().getAllLocalBucketRegions(); long bytes = 0; - for (Iterator itr = brs.iterator(); itr.hasNext();) { - BucketRegion br = itr.next(); + for (BucketRegion br : brs) { bytes += br.getNumOverflowBytesOnDisk(); } @@ -470,8 +479,7 @@ private long getMemBytes(PartitionedRegion pr) { Set brs = pr.getDataStore().getAllLocalBucketRegions(); long bytes = 0; - for (Iterator itr = brs.iterator(); itr.hasNext();) { - BucketRegion br = itr.next(); + for (BucketRegion br : brs) { bytes += br.getBytesInMemory(); }